diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-03 00:09:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-03 00:23:10 +0100 |
commit | 268098d8b2a6e3dd84be788a2cd6fda10f7b3e71 (patch) | |
tree | afd9e17a980920b66edb38331e5a608308da711d /libavcodec/mpegvideo.c | |
parent | 689f65126be8a55e8a1e706cb56b19bb975c20ce (diff) | |
parent | 9d87374ec0f382c8394ad511243db6980afa42af (diff) | |
download | ffmpeg-268098d8b2a6e3dd84be788a2cd6fda10f7b3e71.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (29 commits)
amrwb: remove duplicate arguments from extrapolate_isf().
amrwb: error out early if mode is invalid.
h264: change underread for 10bit QPEL to overread.
matroska: check buffer size for RM-style byte reordering.
vp8: disable mmx functions with sse/sse2 counterparts on x86-64.
vp8: change int stride to ptrdiff_t stride.
wma: fix invalid buffer size assumptions causing random overreads.
Windows Media Audio Lossless decoder
rv10/20: Fix slice overflow with checked bitstream reader.
h263dec: Disallow width/height changing with frame threads.
rv10/20: Fix a buffer overread caused by losing track of the remaining buffer size.
rmdec: Honor .RMF tag size rather than assuming 18.
g722: Fix the QMF scaling
r3d: don't set codec timebase.
electronicarts: set timebase for tgv video.
electronicarts: parse the framerate for cmv video.
ogg: don't set codec timebase
electronicarts: don't set codec timebase
avs: don't set codec timebase
wavpack: Fix an integer overflow
...
Conflicts:
libavcodec/arm/vp8dsp_init_arm.c
libavcodec/fraps.c
libavcodec/h264.c
libavcodec/mpeg4videodec.c
libavcodec/mpegvideo.c
libavcodec/msmpeg4.c
libavcodec/pnmdec.c
libavcodec/qpeg.c
libavcodec/rawenc.c
libavcodec/ulti.c
libavcodec/vcr1.c
libavcodec/version.h
libavcodec/wmalosslessdec.c
libavformat/electronicarts.c
libswscale/ppc/yuv2rgb_altivec.c
tests/ref/acodec/g722
tests/ref/fate/ea-cmv
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index efe4cae762..9577c9d38f 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -232,9 +232,9 @@ static void free_frame_buffer(MpegEncContext *s, Picture *pic) * dimensions; ignore user defined callbacks for these */ if (s->codec_id != CODEC_ID_WMV3IMAGE && s->codec_id != CODEC_ID_VC1IMAGE) - ff_thread_release_buffer(s->avctx, (AVFrame *) pic); + ff_thread_release_buffer(s->avctx, &pic->f); else - avcodec_default_release_buffer(s->avctx, (AVFrame *) pic); + avcodec_default_release_buffer(s->avctx, &pic->f); av_freep(&pic->f.hwaccel_picture_private); } @@ -257,9 +257,9 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic) } if (s->codec_id != CODEC_ID_WMV3IMAGE && s->codec_id != CODEC_ID_VC1IMAGE) - r = ff_thread_get_buffer(s->avctx, (AVFrame *) pic); + r = ff_thread_get_buffer(s->avctx, &pic->f); else - r = avcodec_default_get_buffer(s->avctx, (AVFrame *) pic); + r = avcodec_default_get_buffer(s->avctx, &pic->f); if (r < 0 || !pic->f.type || !pic->f.data[0]) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (%d %d %p)\n", @@ -729,7 +729,7 @@ av_cold int ff_MPV_common_init(MpegEncContext *s) s->codec_tag = avpriv_toupper4(s->avctx->codec_tag); s->stream_codec_tag = avpriv_toupper4(s->avctx->stream_codec_tag); - s->avctx->coded_frame = (AVFrame*)&s->current_picture; + s->avctx->coded_frame = &s->current_picture.f; FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int), fail); // error ressilience code looks cleaner with this for (y = 0; y < s->mb_height; y++) @@ -781,7 +781,7 @@ av_cold int ff_MPV_common_init(MpegEncContext *s) FF_ALLOCZ_OR_GOTO(s->avctx, s->picture, s->picture_count * sizeof(Picture), fail); for (i = 0; i < s->picture_count; i++) { - avcodec_get_frame_defaults((AVFrame *) &s->picture[i]); + avcodec_get_frame_defaults(&s->picture[i].f); } FF_ALLOCZ_OR_GOTO(s->avctx, s->error_status_table, mb_array_size*sizeof(uint8_t), fail) @@ -1247,10 +1247,8 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) memset(s->last_picture_ptr->f.data[0] + s->last_picture_ptr->f.linesize[0]*i, 16, avctx->width); } - ff_thread_report_progress((AVFrame *) s->last_picture_ptr, - INT_MAX, 0); - ff_thread_report_progress((AVFrame *) s->last_picture_ptr, - INT_MAX, 1); + ff_thread_report_progress(&s->last_picture_ptr->f, INT_MAX, 0); + ff_thread_report_progress(&s->last_picture_ptr->f, INT_MAX, 1); } if ((s->next_picture_ptr == NULL || s->next_picture_ptr->f.data[0] == NULL) && @@ -1263,10 +1261,8 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) s->next_picture_ptr->f.key_frame = 0; if (ff_alloc_picture(s, s->next_picture_ptr, 0) < 0) return -1; - ff_thread_report_progress((AVFrame *) s->next_picture_ptr, - INT_MAX, 0); - ff_thread_report_progress((AVFrame *) s->next_picture_ptr, - INT_MAX, 1); + ff_thread_report_progress(&s->next_picture_ptr->f, INT_MAX, 0); + ff_thread_report_progress(&s->next_picture_ptr->f, INT_MAX, 1); } } @@ -1391,10 +1387,10 @@ void ff_MPV_frame_end(MpegEncContext *s) memset(&s->next_picture, 0, sizeof(Picture)); memset(&s->current_picture, 0, sizeof(Picture)); #endif - s->avctx->coded_frame = (AVFrame *) s->current_picture_ptr; + s->avctx->coded_frame = &s->current_picture_ptr->f; if (s->codec_id != CODEC_ID_H264 && s->current_picture.f.reference) { - ff_thread_report_progress((AVFrame *) s->current_picture_ptr, + ff_thread_report_progress(&s->current_picture_ptr->f, s->mb_height - 1, 0); } } @@ -2346,10 +2342,14 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], if(HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) { if (s->mv_dir & MV_DIR_FORWARD) { - ff_thread_await_progress((AVFrame*)s->last_picture_ptr, ff_MPV_lowest_referenced_row(s, 0), 0); + ff_thread_await_progress(&s->last_picture_ptr->f, + ff_MPV_lowest_referenced_row(s, 0), + 0); } if (s->mv_dir & MV_DIR_BACKWARD) { - ff_thread_await_progress((AVFrame*)s->next_picture_ptr, ff_MPV_lowest_referenced_row(s, 1), 0); + ff_thread_await_progress(&s->next_picture_ptr->f, + ff_MPV_lowest_referenced_row(s, 1), + 0); } } @@ -2556,9 +2556,9 @@ void ff_draw_horiz_band(MpegEncContext *s, int y, int h){ int i; if(s->pict_type==AV_PICTURE_TYPE_B || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER)) - src= (AVFrame*)s->current_picture_ptr; + src = &s->current_picture_ptr->f; else if(s->last_picture_ptr) - src= (AVFrame*)s->last_picture_ptr; + src = &s->last_picture_ptr->f; else return; @@ -2867,5 +2867,5 @@ void ff_set_qscale(MpegEncContext * s, int qscale) void ff_MPV_report_decode_progress(MpegEncContext *s) { if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->error_occurred) - ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0); + ff_thread_report_progress(&s->current_picture_ptr->f, s->mb_y, 0); } |