1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

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@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-05-22 22:44:56 +02:00
parent 05a5e2b576
commit a5ff6ea32d

View File

@ -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) {