From e831b3b852a23cd24f2941e68bd65299ce306880 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 23 Oct 2012 19:22:52 +0200 Subject: [PATCH 1/7] av_memcpy_backptr: Drop no longer necessary malloc padding Signed-off-by: Mans Rullgard --- libavcodec/dfa.c | 2 +- libavcodec/eatgv.c | 3 +-- libavcodec/lcldec.c | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 39f0f6465d..46051e041d 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -43,7 +43,7 @@ static av_cold int dfa_decode_init(AVCodecContext *avctx) if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0) return ret; - s->frame_buf = av_mallocz(avctx->width * avctx->height + AV_LZO_OUTPUT_PADDING); + s->frame_buf = av_mallocz(avctx->width * avctx->height); if (!s->frame_buf) return AVERROR(ENOMEM); diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index b29c99418c..404238b6ef 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -294,8 +294,7 @@ static int tgv_decode_frame(AVCodecContext *avctx, s->frame.buffer_hints = FF_BUFFER_HINTS_VALID; s->frame.linesize[0] = s->width; - /* allocate additional 12 bytes to accommodate av_memcpy_backptr() OUTBUF_PADDED optimisation */ - s->frame.data[0] = av_malloc(s->width*s->height + 12); + s->frame.data[0] = av_malloc(s->width * s->height); if (!s->frame.data[0]) return AVERROR(ENOMEM); s->frame.data[1] = av_malloc(AVPALETTE_SIZE); diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 0de7410355..6b101ae6d1 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -476,7 +476,8 @@ static av_cold int decode_init(AVCodecContext *avctx) { LclDecContext * const c = avctx->priv_data; unsigned int basesize = avctx->width * avctx->height; - unsigned int max_basesize = FFALIGN(avctx->width, 4) * FFALIGN(avctx->height, 4) + AV_LZO_OUTPUT_PADDING; + unsigned int max_basesize = FFALIGN(avctx->width, 4) * + FFALIGN(avctx->height, 4); unsigned int max_decomp_size; if (avctx->extradata_size < 8) { From a153e45b953dee5b065939300d3a591772f43b19 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Tue, 23 Oct 2012 18:17:46 +0100 Subject: [PATCH 2/7] dfa: use av_memcpy_backptr() where previously impossible Since the requirement for output padding has been lifted, we can use av_memcpy_backptr() here as well. Signed-off-by: Mans Rullgard --- libavcodec/dfa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 46051e041d..ae184d7b5f 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -122,9 +122,7 @@ static int decode_dsw1(GetByteContext *gb, uint8_t *frame, int width, int height count = ((v >> 13) + 2) << 1; if (frame - frame_start < offset || frame_end - frame < count) return AVERROR_INVALIDDATA; - // can't use av_memcpy_backptr() since it can overwrite following pixels - for (v = 0; v < count; v++) - frame[v] = frame[v - offset]; + av_memcpy_backptr(frame, offset, count); frame += count; } else if (bitbuf & (mask << 1)) { frame += bytestream2_get_le16(gb); From d7a39b33407927005f65755b8a3a608394aaeccd Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 22 Oct 2012 16:01:18 +0200 Subject: [PATCH 3/7] doxygen: Build Doxygen documentation in the doc/ subdirectory --- .gitignore | 2 +- Doxyfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8589127fb9..3ed55b3487 100644 --- a/.gitignore +++ b/.gitignore @@ -28,8 +28,8 @@ /doc/*.pod /doc/avoptions_codec.texi /doc/avoptions_format.texi +/doc/doxy/html/ /doc/print_options -/doxy/ /libavcodec/*_tablegen /libavcodec/*_tables.c /libavcodec/*_tables.h diff --git a/Doxyfile b/Doxyfile index 8e0dcf39f9..1b4e7d528b 100644 --- a/Doxyfile +++ b/Doxyfile @@ -44,7 +44,7 @@ PROJECT_LOGO = # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = doxy +OUTPUT_DIRECTORY = doc/doxy # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output From 5e28e974339e90c2cee866bedbd913fe42917b15 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 22 Oct 2012 16:03:39 +0200 Subject: [PATCH 4/7] Move Doxyfile into the doc/ subdirectory --- Doxyfile => doc/Doxyfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Doxyfile => doc/Doxyfile (100%) diff --git a/Doxyfile b/doc/Doxyfile similarity index 100% rename from Doxyfile rename to doc/Doxyfile From a5ef830b1226273c35d4baa1c2e4e7e1c9de7c7d Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 23 Oct 2012 13:25:53 -0400 Subject: [PATCH 5/7] lavc: use the correct API version guard macro for avcodec_encode_audio() --- libavcodec/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 5e22b9f6cf..10230cad47 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1073,7 +1073,7 @@ end: return ret; } -#if FF_API_OLD_DECODE_AUDIO +#if FF_API_OLD_ENCODE_AUDIO int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples) From 44d854a518f97cb65090420b0b9f55611a0ea932 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Mon, 22 Oct 2012 10:44:55 -0400 Subject: [PATCH 6/7] atrac3: return an error if extradata_size is not a specific known size Also fixes 3 compiler warnings about using uninitialized variables. --- libavcodec/atrac3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index 9cf989246b..5bf992f395 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -912,6 +912,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) } else { av_log(NULL, AV_LOG_ERROR, "Unknown extradata size %d.\n", avctx->extradata_size); + return AVERROR(EINVAL); } /* Check the extradata */ From c68317ebbe4915035df0b08c23eea7a0b80ab881 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 2 Oct 2012 11:38:34 -0400 Subject: [PATCH 7/7] lavc: fix documentation for AVCodecContext.delay --- libavcodec/avcodec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 64d45db349..c505a922e3 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1442,7 +1442,7 @@ typedef struct AVCodecContext { int ticks_per_frame; /** - * Encoder delay. + * Codec delay. * * Video: * Number of frames the decoded output will be delayed relative to the