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

Michael Niedermayer michael at niedermayer.cc
Wed Oct 14 20:21:48 EEST 2020


On Tue, Oct 13, 2020 at 11:10:17AM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at 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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Any man who breaks a law that conscience tells him is unjust and willingly 
accepts the penalty by staying in jail in order to arouse the conscience of 
the community on the injustice of the law is at that moment expressing the 
very highest respect for law. - Martin Luther King Jr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20201014/696112b8/attachment.sig>


More information about the ffmpeg-devel mailing list