diff mbox series

[FFmpeg-devel,29/30] avcodec/svq1dec: Increment nb_bits of VLC to read it in one go

Message ID 20201230233157.1055287-29-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,01/30] avcodec/opustab: Make array static | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 30, 2020, 11:31 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/svq1dec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Michael Niedermayer Dec. 31, 2020, 12:14 a.m. UTC | #1
On Thu, Dec 31, 2020 at 12:31:56AM +0100, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/svq1dec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
> index 7aea138060..e9c068de19 100644
> --- a/libavcodec/svq1dec.c
> +++ b/libavcodec/svq1dec.c
> @@ -456,7 +456,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, HpelDSPContext *hdsp,
>      int result = 0;
>  
>      /* get block type */
> -    block_type = get_vlc2(bitbuf, svq1_block_type.table, 2, 2);
> +    block_type = get_vlc2(bitbuf, svq1_block_type.table, 3, 1);
>  
>      /* reset motion vectors */
>      if (block_type == SVQ1_BLOCK_SKIP || block_type == SVQ1_BLOCK_INTRA) {
> @@ -765,9 +765,9 @@ err:
>  
>  static av_cold void svq1_static_init(void)
>  {
> -    INIT_VLC_STATIC(&svq1_block_type, 2, 4,
> +    INIT_VLC_STATIC(&svq1_block_type, 3, 4,
>                      &ff_svq1_block_type_vlc[0][1], 2, 1,
> -                    &ff_svq1_block_type_vlc[0][0], 2, 1, 6);
> +                    &ff_svq1_block_type_vlc[0][0], 2, 1, 8);
>  

please use some named constant (of course can be in a seperate patch)
duplicating these numbers risks havung then get out of sync

patch LGTM

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index 7aea138060..e9c068de19 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -456,7 +456,7 @@  static int svq1_decode_delta_block(AVCodecContext *avctx, HpelDSPContext *hdsp,
     int result = 0;
 
     /* get block type */
-    block_type = get_vlc2(bitbuf, svq1_block_type.table, 2, 2);
+    block_type = get_vlc2(bitbuf, svq1_block_type.table, 3, 1);
 
     /* reset motion vectors */
     if (block_type == SVQ1_BLOCK_SKIP || block_type == SVQ1_BLOCK_INTRA) {
@@ -765,9 +765,9 @@  err:
 
 static av_cold void svq1_static_init(void)
 {
-    INIT_VLC_STATIC(&svq1_block_type, 2, 4,
+    INIT_VLC_STATIC(&svq1_block_type, 3, 4,
                     &ff_svq1_block_type_vlc[0][1], 2, 1,
-                    &ff_svq1_block_type_vlc[0][0], 2, 1, 6);
+                    &ff_svq1_block_type_vlc[0][0], 2, 1, 8);
 
     INIT_VLC_STATIC(&svq1_motion_component, 7, 33,
                     &ff_mvtab[0][1], 2, 1,