diff mbox series

[FFmpeg-devel,9/9] avcodec/ylc: Inline constants

Message ID 20201013091017.1899676-9-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/9] avcodec/asvdec: Reduce the size of some VLCs | expand

Checks

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

Commit Message

Andreas Rheinhardt Oct. 13, 2020, 9:10 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/ylc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Michael Niedermayer Oct. 14, 2020, 5:21 p.m. UTC | #1
On Tue, Oct 13, 2020 at 11:10:17AM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/ylc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c
> index 2afe3fc9d5..ecfecc0292 100644
> --- a/libavcodec/ylc.c
> +++ b/libavcodec/ylc.c
> @@ -371,7 +371,7 @@ static int decode_frame(AVCodecContext *avctx,
>                  return AVERROR_INVALIDDATA;
>  
>              if (get_bits1(&gb)) {
> -                int val = get_vlc2(&gb, s->vlc[0].table, s->vlc[0].bits, 3);
> +                int val = get_vlc2(&gb, s->vlc[0].table, 10, 3);
>                  if (val < 0) {
>                      return AVERROR_INVALIDDATA;
>                  } else if (val < 0xE1) {
> @@ -394,10 +394,10 @@ static int decode_frame(AVCodecContext *avctx,
>              } else {
>                  int y1, y2, u, v;
>  
> -                y1 = get_vlc2(&gb, s->vlc[1].table, s->vlc[1].bits, 3);
> -                u  = get_vlc2(&gb, s->vlc[2].table, s->vlc[2].bits, 3);
> -                y2 = get_vlc2(&gb, s->vlc[1].table, s->vlc[1].bits, 3);
> -                v  = get_vlc2(&gb, s->vlc[3].table, s->vlc[3].bits, 3);
> +                y1 = get_vlc2(&gb, s->vlc[1].table, 10, 3);
> +                u  = get_vlc2(&gb, s->vlc[2].table, 10, 3);
> +                y2 = get_vlc2(&gb, s->vlc[1].table, 10, 3);
> +                v  = get_vlc2(&gb, s->vlc[3].table, 10, 3);

Please use a named constant, LGTM otherwise

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c
index 2afe3fc9d5..ecfecc0292 100644
--- a/libavcodec/ylc.c
+++ b/libavcodec/ylc.c
@@ -371,7 +371,7 @@  static int decode_frame(AVCodecContext *avctx,
                 return AVERROR_INVALIDDATA;
 
             if (get_bits1(&gb)) {
-                int val = get_vlc2(&gb, s->vlc[0].table, s->vlc[0].bits, 3);
+                int val = get_vlc2(&gb, s->vlc[0].table, 10, 3);
                 if (val < 0) {
                     return AVERROR_INVALIDDATA;
                 } else if (val < 0xE1) {
@@ -394,10 +394,10 @@  static int decode_frame(AVCodecContext *avctx,
             } else {
                 int y1, y2, u, v;
 
-                y1 = get_vlc2(&gb, s->vlc[1].table, s->vlc[1].bits, 3);
-                u  = get_vlc2(&gb, s->vlc[2].table, s->vlc[2].bits, 3);
-                y2 = get_vlc2(&gb, s->vlc[1].table, s->vlc[1].bits, 3);
-                v  = get_vlc2(&gb, s->vlc[3].table, s->vlc[3].bits, 3);
+                y1 = get_vlc2(&gb, s->vlc[1].table, 10, 3);
+                u  = get_vlc2(&gb, s->vlc[2].table, 10, 3);
+                y2 = get_vlc2(&gb, s->vlc[1].table, 10, 3);
+                v  = get_vlc2(&gb, s->vlc[3].table, 10, 3);
                 if (y1 < 0 || y2 < 0 || u < 0 || v < 0)
                     return AVERROR_INVALIDDATA;
                 dst[x    ] = y1;