[FFmpeg-devel] [PATCH 24/24] avcodec/mpegvideo: Don't use ScanTable where unnecessary

Michael Niedermayer michael at niedermayer.cc
Fri Oct 21 21:46:08 EEST 2022


On Thu, Oct 20, 2022 at 07:24:36PM +0200, Andreas Rheinhardt wrote:
> For the intra_[hv]_scantables, only ScanTable.permutated
> is used, so one only needs to keep that.
[...]
> diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
> index 8e6e35b927..bf499a2206 100644
> --- a/libavcodec/mpeg4videoenc.c
> +++ b/libavcodec/mpeg4videoenc.c
> @@ -175,7 +175,7 @@ static inline int decide_ac_pred(MpegEncContext *s, int16_t block[6][64],
>                      ac_val1[i + 8] = level;
>                  }
>              }
> -            st[n] = s->intra_h_scantable.permutated;
> +            st[n] = s->intra_h_scantable;
>          } else {
>              const int xy = s->mb_x - 1 + s->mb_y * s->mb_stride;
>              /* left prediction */
> @@ -197,7 +197,7 @@ static inline int decide_ac_pred(MpegEncContext *s, int16_t block[6][64],
>                      ac_val1[i + 8] = block[n][s->idsp.idct_permutation[i]];
>                  }
>              }
> -            st[n] = s->intra_v_scantable.permutated;
> +            st[n] = s->intra_v_scantable;

Iam thinking that replacing 
s->intra_v_scantable.permutated
by
intra_v_scantable
is semantically feeling inferrior to calling it
permutated_intra_v_scantable
or something like that

The same probably applies to te other patches too
iam not happy about the long name but having consistent
naming between scantables (as in the spec) and scantables permutated
for idct optimizations could improve readability of the code

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

If the United States is serious about tackling the national security threats 
related to an insecure 5G network, it needs to rethink the extent to which it
values corporate profits and government espionage over security.-Bruce Schneier
-------------- 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/20221021/0fbc64c1/attachment.sig>


More information about the ffmpeg-devel mailing list