diff options
author | Keiji Costantini <lists@strites.net> | 2008-04-21 08:30:54 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2008-04-21 08:30:54 +0000 |
commit | bd7c626ad0d00da0620dd9e5873ffb02b3d4efd1 (patch) | |
tree | 55a8910ea4e4ae63d2bff293ded0202c27c801f1 /libavcodec/mpegvideo.c | |
parent | 4fa6eac5f1c911a28f7b89dcdab0b4217ec8ecff (diff) | |
download | ffmpeg-bd7c626ad0d00da0620dd9e5873ffb02b3d4efd1.tar.gz |
Unroll codepath
Patch by strites: strites gmail com
Original thread: [FFmpeg-devel] [PATCH] Patch cleanup for MPEG 1 & 2 optimizations
Date: 04/06/2008 11:32 PM
Originally committed as revision 12917 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index a555f7a1c6..4faf85f206 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1737,7 +1737,7 @@ void ff_clean_intra_table_entries(MpegEncContext *s) */ static av_always_inline void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], - int lowres_flag) + int lowres_flag, int is_mpeg12) { int mb_x, mb_y; const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; @@ -1764,7 +1764,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], /* update DC predictors for P macroblocks */ if (!s->mb_intra) { - if (s->h263_pred || s->h263_aic) { + if (!is_mpeg12 && (s->h263_pred || s->h263_aic)) { if(s->mbintra_table[mb_xy]) ff_clean_intra_table_entries(s); } else { @@ -1773,7 +1773,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], s->last_dc[2] = 128 << s->intra_dc_precision; } } - else if (s->h263_pred || s->h263_aic) + else if (!is_mpeg12 && (s->h263_pred || s->h263_aic)) s->mbintra_table[mb_xy]=1; if ((s->flags&CODEC_FLAG_PSNR) || !(s->encoding && (s->intra_only || s->pict_type==FF_B_TYPE) && s->avctx->mb_decision != FF_MB_DECISION_RD)) { //FIXME precalc @@ -1888,7 +1888,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], add_dequant_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale); } } - } else if(s->codec_id != CODEC_ID_WMV2){ + } else if(is_mpeg12 || (s->codec_id != CODEC_ID_WMV2)){ add_dct(s, block[0], 0, dest_y , dct_linesize); add_dct(s, block[1], 1, dest_y + block_size, dct_linesize); add_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize); @@ -1979,8 +1979,14 @@ skip_idct: } void MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){ - if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1); - else MPV_decode_mb_internal(s, block, 0); +#ifndef CONFIG_SMALL + if(s->out_format == FMT_MPEG1) { + if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 1); + else MPV_decode_mb_internal(s, block, 0, 1); + } else +#endif + if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 0); + else MPV_decode_mb_internal(s, block, 0, 0); } /** |