[FFmpeg-cvslog] avcodec/asvenc: Simplify writing extradata
Andreas Rheinhardt
git at videolan.org
Mon May 26 04:52:57 EEST 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu May 22 22:44:56 2025 +0200| [a5ff6ea32d9aafc3a8da9ce40c510a6858794c40] | committer: Andreas Rheinhardt
avcodec/asvenc: Simplify writing extradata
It is confusing, because the AV_RL32("ASUS") already
returns an endian-independent value, so converting
it via av_le2ne32() makes no real sense: one would need
to transform the native value to le and write it as
a natie endian uint32_t for it to make sense (the current
code only works because le2ne32 and ne2le32 are the same
for both endianness that we care about). Or one can just
use AV_RL32 and create the number via MKTAG().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5ff6ea32d9aafc3a8da9ce40c510a6858794c40
---
libavcodec/asvenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index 2f81d6c74b..bcdb5cfbe2 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -379,8 +379,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (!avctx->extradata)
return AVERROR(ENOMEM);
avctx->extradata_size = 8;
- AV_WLA(32, avctx->extradata, inv_qscale);
- ((uint32_t *) avctx->extradata)[1] = av_le2ne32(AV_RL32("ASUS"));
+ AV_WL32A(avctx->extradata, inv_qscale);
+ AV_WL32A(avctx->extradata + 4, MKTAG('A', 'S', 'U', 'S'));
for (i = 0; i < 64; i++) {
if (a->fdsp.fdct == ff_fdct_ifast) {
More information about the ffmpeg-cvslog
mailing list