From b797f7352055cec199bb087323f20edaa1101369 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Tue, 20 Dec 2011 10:53:18 +0200 Subject: vc1dec: Use the right pointer type for the tmp pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes warnings about assignment from incompatible pointer type. Signed-off-by: Martin Storsjö --- libavcodec/vc1dec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 701a3da956..3cb7661397 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5426,13 +5426,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, AVFrame *pict = data; uint8_t *buf2 = NULL; const uint8_t *buf_start = buf; - uint8_t *tmp; int mb_height, n_slices1; struct { uint8_t *buf; GetBitContext gb; int mby_start; - } *slices = NULL; + } *slices = NULL, *tmp; /* no supplementary picture */ if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == VC1_CODE_ENDOFSEQ)) { -- cgit v1.2.3 From d9b89b23df4f63d67694507f3d1caee62424a9d8 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Mon, 19 Dec 2011 10:41:22 -0800 Subject: mpegts: Fix typo in handling sections in the PMT. This was an error rebasing 4682a1dc3aa2554ad7077f5db32d0f2d598d018e for commit. The "pes" variable guaranteed to be NULL in that block. --- libavformat/mpegts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index ca01003d80..2356fa8935 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1460,7 +1460,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (idx >= 0) { st = ts->stream->streams[idx]; } else { - st = avformat_new_stream(pes->stream, NULL); + st = avformat_new_stream(ts->stream, NULL); st->id = pid; st->codec->codec_type = AVMEDIA_TYPE_DATA; } -- cgit v1.2.3 From 41bdd4adc4ab90a5ef7d63050a4046fcba711365 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Mon, 19 Dec 2011 10:48:57 -0800 Subject: mpegts: Suppress invalid timebase warnings on DMB streams. timestamp_len and timestamp_res intialize to zero. --- libavformat/mpegts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 2356fa8935..15688a9747 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -732,7 +732,8 @@ static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf if (cts != AV_NOPTS_VALUE) pes->pts = cts; - avpriv_set_pts_info(pes->st, sl->timestamp_len, 1, sl->timestamp_res); + if (sl->timestamp_len && sl->timestamp_res) + avpriv_set_pts_info(pes->st, sl->timestamp_len, 1, sl->timestamp_res); return (get_bits_count(&gb) + 7) >> 3; } -- cgit v1.2.3 From fd22616c593156a35b4fe6acbd3668b0802f5f84 Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Tue, 20 Dec 2011 03:54:50 +0530 Subject: bytestream: add a new set of bytestream functions with overread checking Signed-off-by: Justin Ruggles --- libavcodec/bytestream.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index 98f00879be..ba3e4e8802 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -26,6 +26,10 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" +typedef struct { + const uint8_t *buffer, *buffer_end; +} GetByteContext; + #define DEF_T(type, name, bytes, read, write) \ static av_always_inline type bytestream_get_ ## name(const uint8_t **b){\ (*b) += bytes;\ @@ -34,6 +38,18 @@ static av_always_inline type bytestream_get_ ## name(const uint8_t **b){\ static av_always_inline void bytestream_put_ ##name(uint8_t **b, const type value){\ write(*b, value);\ (*b) += bytes;\ +}\ +static av_always_inline type bytestream2_get_ ## name(GetByteContext *g)\ +{\ + if (g->buffer_end - g->buffer < bytes)\ + return 0;\ + return bytestream_get_ ## name(&g->buffer);\ +}\ +static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g)\ +{\ + if (g->buffer_end - g->buffer < bytes)\ + return 0;\ + return read(g->buffer);\ } #define DEF(name, bytes, read, write) \ @@ -55,6 +71,34 @@ DEF (byte, 1, AV_RB8 , AV_WB8 ) #undef DEF64 #undef DEF_T +static av_always_inline void bytestream2_init(GetByteContext *g, + const uint8_t *buf, int buf_size) +{ + g->buffer = buf; + g->buffer_end = buf + buf_size; +} + +static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g) +{ + return g->buffer_end - g->buffer; +} + +static av_always_inline void bytestream2_skip(GetByteContext *g, + unsigned int size) +{ + g->buffer += FFMIN(g->buffer_end - g->buffer, size); +} + +static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, + uint8_t *dst, + unsigned int size) +{ + int size2 = FFMIN(g->buffer_end - g->buffer, size); + memcpy(dst, g->buffer, size2); + g->buffer += size2; + return size2; +} + static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, uint8_t *dst, unsigned int size) { memcpy(dst, *b, size); -- cgit v1.2.3 From 1443ea93d935784370f41d85e224718484b0e32c Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Tue, 20 Dec 2011 03:54:50 +0530 Subject: 4xm: Use bytestream2 functions to prevent overreads Fixes Bug 110. Signed-off-by: Justin Ruggles --- libavcodec/4xm.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 0ae10d5905..ba8bb4a652 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -132,8 +132,8 @@ typedef struct FourXContext{ AVFrame current_picture, last_picture; GetBitContext pre_gb; ///< ac/dc prefix GetBitContext gb; - const uint8_t *bytestream; - const uint16_t *wordstream; + GetByteContext g; + GetByteContext g2; int mv[256]; VLC pre_vlc; int last_dc; @@ -328,7 +328,7 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo assert(code>=0 && code<=6); if(code == 0){ - src += f->mv[ *f->bytestream++ ]; + src += f->mv[bytestream2_get_byte(&f->g)]; if(start > src || src > end){ av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n"); return; @@ -345,21 +345,21 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo }else if(code == 3 && f->version<2){ mcdc(dst, src, log2w, h, stride, 1, 0); }else if(code == 4){ - src += f->mv[ *f->bytestream++ ]; + src += f->mv[bytestream2_get_byte(&f->g)]; if(start > src || src > end){ av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n"); return; } - mcdc(dst, src, log2w, h, stride, 1, av_le2ne16(*f->wordstream++)); + mcdc(dst, src, log2w, h, stride, 1, bytestream2_get_le16(&f->g2)); }else if(code == 5){ - mcdc(dst, src, log2w, h, stride, 0, av_le2ne16(*f->wordstream++)); + mcdc(dst, src, log2w, h, stride, 0, bytestream2_get_le16(&f->g2)); }else if(code == 6){ if(log2w){ - dst[0] = av_le2ne16(*f->wordstream++); - dst[1] = av_le2ne16(*f->wordstream++); + dst[0] = bytestream2_get_le16(&f->g2); + dst[1] = bytestream2_get_le16(&f->g2); }else{ - dst[0 ] = av_le2ne16(*f->wordstream++); - dst[stride] = av_le2ne16(*f->wordstream++); + dst[0 ] = bytestream2_get_le16(&f->g2); + dst[stride] = bytestream2_get_le16(&f->g2); } } } @@ -371,7 +371,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){ uint16_t *src= (uint16_t*)f->last_picture.data[0]; uint16_t *dst= (uint16_t*)f->current_picture.data[0]; const int stride= f->current_picture.linesize[0]>>1; - unsigned int bitstream_size, bytestream_size, wordstream_size, extra; + unsigned int bitstream_size, bytestream_size, wordstream_size, extra, bytestream_offset, wordstream_offset; if(f->version>1){ extra=20; @@ -402,8 +402,10 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){ memset((uint8_t*)f->bitstream_buffer + bitstream_size, 0, FF_INPUT_BUFFER_PADDING_SIZE); init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size); - f->wordstream= (const uint16_t*)(buf + extra + bitstream_size); - f->bytestream= buf + extra + bitstream_size + wordstream_size; + wordstream_offset = extra + bitstream_size; + bytestream_offset = extra + bitstream_size + wordstream_size; + bytestream2_init(&f->g2, buf + wordstream_offset, length - wordstream_offset); + bytestream2_init(&f->g, buf + bytestream_offset, length - bytestream_offset); init_mv(f); -- cgit v1.2.3 From 606c9297b92ba47753b50c36e0775ad8f2180f70 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 20 Dec 2011 11:34:05 +0100 Subject: build: fix standalone compilation of mpc7/mpc8 decoders These decoders depend on the mpegaudio DSP code. --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 22542afbe7..180578db7e 100755 --- a/configure +++ b/configure @@ -1324,6 +1324,8 @@ mp3adufloat_decoder_select="mpegaudiodsp" mp3float_decoder_select="mpegaudiodsp" mp3on4_decoder_select="mpegaudiodsp" mp3on4float_decoder_select="mpegaudiodsp" +mpc7_decoder_select="mpegaudiodsp" +mpc8_decoder_select="mpegaudiodsp" mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder" mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" mpeg_xvmc_decoder_select="mpegvideo_decoder" -- cgit v1.2.3 From 18725fcdc2aaf40fc25f09886e0e508c5dafd385 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 20 Dec 2011 11:37:56 +0100 Subject: build: fix standalone compilation of ADPCM decoders The generic ADPCM codes depends on the ADPCM data tables. --- libavcodec/Makefile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index be9cd3610c..7553456d4d 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -495,12 +495,12 @@ OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o adx.o OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o adpcm_data.o -OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o -OBJS-$(CONFIG_ADPCM_EA_MAXIS_XA_DECODER) += adpcm.o -OBJS-$(CONFIG_ADPCM_EA_R1_DECODER) += adpcm.o -OBJS-$(CONFIG_ADPCM_EA_R2_DECODER) += adpcm.o -OBJS-$(CONFIG_ADPCM_EA_R3_DECODER) += adpcm.o -OBJS-$(CONFIG_ADPCM_EA_XAS_DECODER) += adpcm.o +OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_EA_MAXIS_XA_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_EA_R1_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_EA_R2_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_EA_R3_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_EA_XAS_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_G722_DECODER) += g722.o g722dec.o OBJS-$(CONFIG_ADPCM_G722_ENCODER) += g722.o g722enc.o OBJS-$(CONFIG_ADPCM_G726_DECODER) += g726.o @@ -519,13 +519,13 @@ OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcmenc.o adpcm_data.o OBJS-$(CONFIG_ADPCM_IMA_WS_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_MS_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_MS_ENCODER) += adpcmenc.o adpcm_data.o -OBJS-$(CONFIG_ADPCM_SBPRO_2_DECODER) += adpcm.o -OBJS-$(CONFIG_ADPCM_SBPRO_3_DECODER) += adpcm.o -OBJS-$(CONFIG_ADPCM_SBPRO_4_DECODER) += adpcm.o +OBJS-$(CONFIG_ADPCM_SBPRO_2_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_SBPRO_3_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_SBPRO_4_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_SWF_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_SWF_ENCODER) += adpcmenc.o adpcm_data.o -OBJS-$(CONFIG_ADPCM_THP_DECODER) += adpcm.o -OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o +OBJS-$(CONFIG_ADPCM_THP_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o -- cgit v1.2.3 From 19277d933574a8c702db51ea5dbb1d450d6a967c Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 20 Dec 2011 18:26:54 +0100 Subject: build: fix standalone compilation of ADX encoder The encoder depends on the common code, so link against it. --- libavcodec/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 7553456d4d..b426129af3 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -493,7 +493,7 @@ OBJS-$(CONFIG_PCM_ZORK_DECODER) += pcm.o OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o adx.o -OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o +OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o adx.o OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_EA_MAXIS_XA_DECODER) += adpcm.o adpcm_data.o -- cgit v1.2.3 From bc4d156140c42185433126d838ed454266a4567b Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 20 Dec 2011 14:42:54 +0100 Subject: vp3: Reorder some functions to fix VP3 build with Theora disabled. --- libavcodec/vp3.c | 151 +++++++++++++++++++++++++++---------------------------- 1 file changed, 74 insertions(+), 77 deletions(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 6e04b7b01b..51ab048ac0 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -45,9 +45,6 @@ #define FRAGMENT_PIXELS 8 -static av_cold int vp3_decode_end(AVCodecContext *avctx); -static void vp3_decode_flush(AVCodecContext *avctx); - //FIXME split things out into their own arrays typedef struct Vp3Fragment { int16_t dc; @@ -256,6 +253,63 @@ typedef struct Vp3DecodeContext { * VP3 specific functions ************************************************************************/ +static void vp3_decode_flush(AVCodecContext *avctx) +{ + Vp3DecodeContext *s = avctx->priv_data; + + if (s->golden_frame.data[0]) { + if (s->golden_frame.data[0] == s->last_frame.data[0]) + memset(&s->last_frame, 0, sizeof(AVFrame)); + if (s->current_frame.data[0] == s->golden_frame.data[0]) + memset(&s->current_frame, 0, sizeof(AVFrame)); + ff_thread_release_buffer(avctx, &s->golden_frame); + } + if (s->last_frame.data[0]) { + if (s->current_frame.data[0] == s->last_frame.data[0]) + memset(&s->current_frame, 0, sizeof(AVFrame)); + ff_thread_release_buffer(avctx, &s->last_frame); + } + if (s->current_frame.data[0]) + ff_thread_release_buffer(avctx, &s->current_frame); +} + +static av_cold int vp3_decode_end(AVCodecContext *avctx) +{ + Vp3DecodeContext *s = avctx->priv_data; + int i; + + av_free(s->superblock_coding); + av_free(s->all_fragments); + av_free(s->coded_fragment_list[0]); + av_free(s->dct_tokens_base); + av_free(s->superblock_fragments); + av_free(s->macroblock_coding); + av_free(s->motion_val[0]); + av_free(s->motion_val[1]); + av_free(s->edge_emu_buffer); + + if (avctx->internal->is_copy) + return 0; + + for (i = 0; i < 16; i++) { + free_vlc(&s->dc_vlc[i]); + free_vlc(&s->ac_vlc_1[i]); + free_vlc(&s->ac_vlc_2[i]); + free_vlc(&s->ac_vlc_3[i]); + free_vlc(&s->ac_vlc_4[i]); + } + + free_vlc(&s->superblock_run_length_vlc); + free_vlc(&s->fragment_run_length_vlc); + free_vlc(&s->mode_code_vlc); + free_vlc(&s->motion_vector_vlc); + + /* release all frames */ + vp3_decode_flush(avctx); + + return 0; +} + /* * This function sets up all of the various blocks mappings: * superblocks <-> fragments, macroblocks <-> fragments, @@ -1995,43 +2049,6 @@ error: return -1; } -static av_cold int vp3_decode_end(AVCodecContext *avctx) -{ - Vp3DecodeContext *s = avctx->priv_data; - int i; - - av_free(s->superblock_coding); - av_free(s->all_fragments); - av_free(s->coded_fragment_list[0]); - av_free(s->dct_tokens_base); - av_free(s->superblock_fragments); - av_free(s->macroblock_coding); - av_free(s->motion_val[0]); - av_free(s->motion_val[1]); - av_free(s->edge_emu_buffer); - - if (avctx->internal->is_copy) - return 0; - - for (i = 0; i < 16; i++) { - free_vlc(&s->dc_vlc[i]); - free_vlc(&s->ac_vlc_1[i]); - free_vlc(&s->ac_vlc_2[i]); - free_vlc(&s->ac_vlc_3[i]); - free_vlc(&s->ac_vlc_4[i]); - } - - free_vlc(&s->superblock_run_length_vlc); - free_vlc(&s->fragment_run_length_vlc); - free_vlc(&s->mode_code_vlc); - free_vlc(&s->motion_vector_vlc); - - /* release all frames */ - vp3_decode_flush(avctx); - - return 0; -} - static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb) { Vp3DecodeContext *s = avctx->priv_data; @@ -2066,6 +2083,23 @@ static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb) return 0; } +static int vp3_init_thread_copy(AVCodecContext *avctx) +{ + Vp3DecodeContext *s = avctx->priv_data; + + s->superblock_coding = NULL; + s->all_fragments = NULL; + s->coded_fragment_list[0] = NULL; + s->dct_tokens_base = NULL; + s->superblock_fragments = NULL; + s->macroblock_coding = NULL; + s->motion_val[0] = NULL; + s->motion_val[1] = NULL; + s->edge_emu_buffer = NULL; + + return 0; +} + #if CONFIG_THEORA_DECODER static const enum PixelFormat theora_pix_fmts[4] = { PIX_FMT_YUV420P, PIX_FMT_NONE, PIX_FMT_YUV422P, PIX_FMT_YUV444P @@ -2327,43 +2361,6 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) return vp3_decode_init(avctx); } -static void vp3_decode_flush(AVCodecContext *avctx) -{ - Vp3DecodeContext *s = avctx->priv_data; - - if (s->golden_frame.data[0]) { - if (s->golden_frame.data[0] == s->last_frame.data[0]) - memset(&s->last_frame, 0, sizeof(AVFrame)); - if (s->current_frame.data[0] == s->golden_frame.data[0]) - memset(&s->current_frame, 0, sizeof(AVFrame)); - ff_thread_release_buffer(avctx, &s->golden_frame); - } - if (s->last_frame.data[0]) { - if (s->current_frame.data[0] == s->last_frame.data[0]) - memset(&s->current_frame, 0, sizeof(AVFrame)); - ff_thread_release_buffer(avctx, &s->last_frame); - } - if (s->current_frame.data[0]) - ff_thread_release_buffer(avctx, &s->current_frame); -} - -static int vp3_init_thread_copy(AVCodecContext *avctx) -{ - Vp3DecodeContext *s = avctx->priv_data; - - s->superblock_coding = NULL; - s->all_fragments = NULL; - s->coded_fragment_list[0] = NULL; - s->dct_tokens_base = NULL; - s->superblock_fragments = NULL; - s->macroblock_coding = NULL; - s->motion_val[0] = NULL; - s->motion_val[1] = NULL; - s->edge_emu_buffer = NULL; - - return 0; -} - AVCodec ff_theora_decoder = { .name = "theora", .type = AVMEDIA_TYPE_VIDEO, -- cgit v1.2.3 From a55eb1586c3a0361d1ced1ba9d32e11b68441c29 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 20 Dec 2011 15:38:18 +0100 Subject: oma: make header compile standalone --- libavformat/oma.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/oma.h b/libavformat/oma.h index 2830b34673..bac8bcb736 100644 --- a/libavformat/oma.h +++ b/libavformat/oma.h @@ -21,6 +21,10 @@ #ifndef AVFORMAT_OMA_H #define AVFORMAT_OMA_H +#include + +#include "internal.h" + #define EA3_HEADER_SIZE 96 #define ID3v2_EA3_MAGIC "ea3" #define OMA_ENC_HEADER_SIZE 16 @@ -36,4 +40,5 @@ enum { extern const uint16_t ff_oma_srate_tab[6]; extern const AVCodecTag ff_oma_codec_tags[]; -#endif + +#endif /* AVFORMAT_OMA_H */ -- cgit v1.2.3 From 1ce1578e4e6e4c79eff87b997668779e50e4be33 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 20 Dec 2011 10:06:49 +0100 Subject: mpegvideo_enc: separate declarations and statements libavcodec/mpegvideo_enc.c:1209: warning: ISO C90 forbids mixed declarations and code --- libavcodec/mpegvideo_enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 14f5447d07..798eb5c1c1 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1203,10 +1203,11 @@ no_output_pic: if (s->reordered_input_picture[0]->f.type == FF_BUFFER_TYPE_SHARED || s->avctx->rc_buffer_size) { // input is a shared pix, so we can't modifiy it -> alloc a new one & ensure that the shared one is reuseable + Picture *pic; int i= ff_find_unused_picture(s, 0); if (i < 0) return i; - Picture *pic= &s->picture[i]; + pic = &s->picture[i]; pic->f.reference = s->reordered_input_picture[0]->f.reference; if(ff_alloc_picture(s, pic, 0) < 0){ -- cgit v1.2.3 From 432f0e5b7d2329976ef7aee05d990c7462efd0ee Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sun, 4 Dec 2011 15:56:39 +0100 Subject: nut: support 10bit YUV Signed-off-by: Luca Barbato --- libavformat/nut.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/nut.c b/libavformat/nut.c index 1ce048d645..ac62d4ff4c 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -70,6 +70,12 @@ const AVCodecTag ff_nut_video_tags[] = { { CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 48 ) }, { CODEC_ID_RAWVIDEO, MKTAG(48 , 'B', 'G', 'R') }, { CODEC_ID_RAWVIDEO, MKTAG(48 , 'R', 'G', 'B') }, + { CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 10 ) }, + { CODEC_ID_RAWVIDEO, MKTAG(10 , 11 , '3', 'Y') }, + { CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 10 ) }, + { CODEC_ID_RAWVIDEO, MKTAG(10 , 10 , '3', 'Y') }, + { CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 10 ) }, + { CODEC_ID_RAWVIDEO, MKTAG(10 , 0 , '3', 'Y') }, { CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0 , 16 ) }, { CODEC_ID_RAWVIDEO, MKTAG(16 , 0 , '1', 'Y') }, { CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 16 ) }, -- cgit v1.2.3 From 91b1e6f0c678e5d096185c2011f4ca56a3290a20 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sun, 4 Dec 2011 15:56:40 +0100 Subject: raw: add 10bit YUV definitions Signed-off-by: Luca Barbato --- libavcodec/raw.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/raw.c b/libavcodec/raw.c index cdd217536e..c41f756572 100644 --- a/libavcodec/raw.c +++ b/libavcodec/raw.c @@ -108,6 +108,12 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = { { PIX_FMT_BGR48BE, MKTAG( 48, 'B', 'G', 'R') }, { PIX_FMT_GRAY16LE, MKTAG('Y', '1', 0 , 16 ) }, { PIX_FMT_GRAY16BE, MKTAG(16 , 0 , '1', 'Y') }, + { PIX_FMT_YUV420P10LE, MKTAG('Y', '3', 11 , 10 ) }, + { PIX_FMT_YUV420P10BE, MKTAG(10 , 11 , '3', 'Y') }, + { PIX_FMT_YUV422P10LE, MKTAG('Y', '3', 10 , 10 ) }, + { PIX_FMT_YUV422P10BE, MKTAG(10 , 10 , '3', 'Y') }, + { PIX_FMT_YUV444P10LE, MKTAG('Y', '3', 0 , 10 ) }, + { PIX_FMT_YUV444P10BE, MKTAG(10 , 0 , '3', 'Y') }, { PIX_FMT_YUV420P16LE, MKTAG('Y', '3', 11 , 16 ) }, { PIX_FMT_YUV420P16BE, MKTAG(16 , 11 , '3', 'Y') }, { PIX_FMT_YUV422P16LE, MKTAG('Y', '3', 10 , 16 ) }, -- cgit v1.2.3 From 37c0dc626d2f8254ef623d987eb5077f9120755f Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Tue, 13 Dec 2011 15:32:34 +0100 Subject: lavc: always align height by 32 pixel Interlaced content for most codec requires it. This patch is a stop-gap pending a serious rework to support codecs with non 16 pixel macroblocks. Signed-off-by: Luca Barbato --- libavcodec/utils.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 9d17ee4edb..20b01f5df4 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -166,10 +166,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, case PIX_FMT_GBRP9BE: case PIX_FMT_GBRP10LE: case PIX_FMT_GBRP10BE: - w_align= 16; //FIXME check for non mpeg style codecs and use less alignment - h_align= 16; - if(s->codec_id == CODEC_ID_MPEG2VIDEO || s->codec_id == CODEC_ID_MJPEG || s->codec_id == CODEC_ID_AMV || s->codec_id == CODEC_ID_THP || s->codec_id == CODEC_ID_H264) - h_align= 32; // interlaced is rounded up to 2 MBs + w_align = 16; //FIXME assume 16 pixel per macroblock + h_align = 16 * 2; // interlaced needs 2 macroblocks height break; case PIX_FMT_YUV411P: case PIX_FMT_UYYVYY411: -- cgit v1.2.3