X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Frv34.c;h=7e83a99959ccaaf06a1a92672db8ef97fab89329;hb=73275259978e77f3dc52bfd01712249d96a585fe;hp=12475692c689caf7ee6178d97276d2a954845e13;hpb=272b252c0110225188c7d7f31167941210aac197;p=ffmpeg diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index 12475692c68..7e83a99959c 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -260,20 +260,15 @@ static inline void decode_subblock1(DCTELEM *dst, int code, GetBitContext *gb, V decode_coeff(dst, coeff, 3, gb, vlc, q); } -static inline void decode_subblock3(DCTELEM *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, +static inline void decode_subblock3(DCTELEM *dst, int code, GetBitContext *gb, VLC *vlc, int q_dc, int q_ac1, int q_ac2) { int flags = modulo_three_table[code]; - decode_coeff( dst+0*4+0, (flags >> 6) , 3, gb, vlc, q_dc); - if(is_block2){ - decode_coeff(dst+1*4+0, (flags >> 4) & 3, 2, gb, vlc, q_ac1); - decode_coeff(dst+0*4+1, (flags >> 2) & 3, 2, gb, vlc, q_ac1); - }else{ - decode_coeff(dst+0*4+1, (flags >> 4) & 3, 2, gb, vlc, q_ac1); - decode_coeff(dst+1*4+0, (flags >> 2) & 3, 2, gb, vlc, q_ac1); - } - decode_coeff( dst+1*4+1, (flags >> 0) & 3, 2, gb, vlc, q_ac2); + decode_coeff(dst+0*4+0, (flags >> 6) , 3, gb, vlc, q_dc); + decode_coeff(dst+0*4+1, (flags >> 4) & 3, 2, gb, vlc, q_ac1); + decode_coeff(dst+1*4+0, (flags >> 2) & 3, 2, gb, vlc, q_ac1); + decode_coeff(dst+1*4+1, (flags >> 0) & 3, 2, gb, vlc, q_ac2); } /** @@ -287,7 +282,7 @@ static inline void decode_subblock3(DCTELEM *dst, int code, const int is_block2, * o--o */ -static inline int rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2) +static int rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2) { int code, pattern, has_ac = 1; @@ -298,7 +293,7 @@ static inline int rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *rv code >>= 3; if (modulo_three_table[code] & 0x3F) { - decode_subblock3(dst, code, 0, gb, &rvlc->coefficient, q_dc, q_ac1, q_ac2); + decode_subblock3(dst, code, gb, &rvlc->coefficient, q_dc, q_ac1, q_ac2); } else { decode_subblock1(dst, code, gb, &rvlc->coefficient, q_dc); if (!pattern) @@ -318,7 +313,7 @@ static inline int rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *rv code = get_vlc2(gb, rvlc->third_pattern[sc].table, 9, 2); decode_subblock(dst + 4*2+2, code, 0, gb, &rvlc->coefficient, q_ac2); } - return has_ac || pattern; + return has_ac | pattern; } /** @@ -1491,14 +1486,14 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) if ((ret = ff_MPV_common_init(s)) < 0) return ret; - ff_h264_pred_init(&r->h, CODEC_ID_RV40, 8, 1); + ff_h264_pred_init(&r->h, AV_CODEC_ID_RV40, 8, 1); #if CONFIG_RV30_DECODER - if (avctx->codec_id == CODEC_ID_RV30) + if (avctx->codec_id == AV_CODEC_ID_RV30) ff_rv30dsp_init(&r->rdsp, &r->s.dsp); #endif #if CONFIG_RV40_DECODER - if (avctx->codec_id == CODEC_ID_RV40) + if (avctx->codec_id == AV_CODEC_ID_RV40) ff_rv40dsp_init(&r->rdsp, &r->s.dsp); #endif