diff options
author | Mickaƫl Raulet <mraulet@insa-rennes.fr> | 2013-10-18 20:01:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-20 00:31:33 +0200 |
commit | b5d197a38b64548bcc2658cc58565fd41906bc54 (patch) | |
tree | 0af72d23c80f4211e83afa6decff704afba63c3c /libavcodec/hevc_cabac.c | |
parent | 92a97d1168cceb6ca66f8483cd319f9a22a31b6d (diff) | |
download | ffmpeg-b5d197a38b64548bcc2658cc58565fd41906bc54.tar.gz |
hevc: inline cabac in hls_mvd_coding(cherry picked from commit ad387195ad04e8a005a1bfd509e9e4f827e68fa9)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc_cabac.c')
-rw-r--r-- | libavcodec/hevc_cabac.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c index f6f74bc118..a1edf58c41 100644 --- a/libavcodec/hevc_cabac.c +++ b/libavcodec/hevc_cabac.c @@ -844,17 +844,17 @@ int ff_hevc_no_residual_syntax_flag_decode(HEVCContext *s) return GET_CABAC(elem_offset[NO_RESIDUAL_DATA_FLAG]); } -int ff_hevc_abs_mvd_greater0_flag_decode(HEVCContext *s) +static av_always_inline int abs_mvd_greater0_flag_decode(HEVCContext *s) { return GET_CABAC(elem_offset[ABS_MVD_GREATER0_FLAG]); } -int ff_hevc_abs_mvd_greater1_flag_decode(HEVCContext *s) +static av_always_inline int abs_mvd_greater1_flag_decode(HEVCContext *s) { return GET_CABAC(elem_offset[ABS_MVD_GREATER1_FLAG] + 1); } -int ff_hevc_mvd_decode(HEVCContext *s) +static av_always_inline int mvd_decode(HEVCContext *s) { int ret = 2; int k = 1; @@ -870,7 +870,7 @@ int ff_hevc_mvd_decode(HEVCContext *s) return get_cabac_bypass_sign(&s->HEVClc.cc, -ret); } -int ff_hevc_mvd_sign_flag_decode(HEVCContext *s) +static av_always_inline int mvd_sign_flag_decode(HEVCContext *s) { return get_cabac_bypass_sign(&s->HEVClc.cc, -1); } @@ -1392,3 +1392,27 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, } } +void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size) +{ + HEVCLocalContext *lc = &s->HEVClc; + int x = abs_mvd_greater0_flag_decode(s); + int y = abs_mvd_greater0_flag_decode(s); + + if (x) + x += abs_mvd_greater1_flag_decode(s); + if (y) + y += abs_mvd_greater1_flag_decode(s); + + switch (x) { + case 2: lc->pu.mvd.x = mvd_decode(s); break; + case 1: lc->pu.mvd.x = mvd_sign_flag_decode(s); break; + case 0: lc->pu.mvd.x = 0; break; + } + + switch (y) { + case 2: lc->pu.mvd.y = mvd_decode(s); break; + case 1: lc->pu.mvd.y = mvd_sign_flag_decode(s); break; + case 0: lc->pu.mvd.y = 0; break; + } +} + |