[FFmpeg-devel] [PATCH 1/2] mpeg2: Renaming functions around init_uni_ac_vlc

Michael Niedermayer michael at niedermayer.cc
Tue Jul 14 00:49:48 EEST 2020


On Mon, Jul 13, 2020 at 01:16:18PM +0200, Jean-Baptiste Kempf wrote:
> We need to export init_uni_ac_vlc to init_uni_ac_vlc and therefore need
> renaming ff_init_uni_ac_vlc to ff_init_uni_ac_huffman for the following
> patch.
> ---
>  libavcodec/mjpegenc.c        | 4 ++--
>  libavcodec/mjpegenc_common.c | 6 +++---
>  libavcodec/mjpegenc_common.h | 2 +-
>  libavcodec/mpeg12.h          | 2 ++
>  libavcodec/mpeg12enc.c       | 6 +++---
>  libavcodec/speedhq.c         | 2 +-
>  6 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
> index 56ccbc5fb1..eaa739306a 100644
> --- a/libavcodec/mjpegenc.c
> +++ b/libavcodec/mjpegenc.c
> @@ -106,8 +106,8 @@ av_cold int ff_mjpeg_encode_init(MpegEncContext *s)
>                                   avpriv_mjpeg_bits_ac_chrominance,
>                                   avpriv_mjpeg_val_ac_chrominance);
>  
> -    ff_init_uni_ac_vlc(m->huff_size_ac_luminance,   m->uni_ac_vlc_len);
> -    ff_init_uni_ac_vlc(m->huff_size_ac_chrominance, m->uni_chroma_ac_vlc_len);
> +    ff_init_uni_ac_huffman(m->huff_size_ac_luminance,   m->uni_ac_vlc_len);
> +    ff_init_uni_ac_huffman(m->huff_size_ac_chrominance, m->uni_chroma_ac_vlc_len);
>      s->intra_ac_vlc_length      =
>      s->intra_ac_vlc_last_length = m->uni_ac_vlc_len;
>      s->intra_chroma_ac_vlc_length      =
> diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c
> index 3038ebde6e..fed32efc67 100644
> --- a/libavcodec/mjpegenc_common.c
> +++ b/libavcodec/mjpegenc_common.c
> @@ -36,7 +36,7 @@
>  #include "mjpegenc_huffman.h"
>  #include "mjpeg.h"
>  
> -av_cold void ff_init_uni_ac_vlc(const uint8_t huff_size_ac[256], uint8_t *uni_ac_vlc_len)
> +av_cold void ff_init_uni_ac_huffman(const uint8_t huff_size_ac[256], uint8_t *uni_ac_vlc_len)
>  {
>      int i;
>  

Maybe its nitpicking but huffman != vlc
huffman is a specific type of vlc code
and specifically, huffman codes are optimal and have no unused parts while
this here can have unused parts so huffman may be a suboptimal term

also isnt this jpeg specific here ?
if so adding a "jpeg" in the name might work better

thx

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- 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/20200713/4c00d3f0/attachment.sig>


More information about the ffmpeg-devel mailing list