From: dkozinski via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: dkozinski <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avcodec/apv_decode: Update metadata decoding to use byte order conversion functions (PR #20988)
Date: Fri, 21 Nov 2025 09:04:32 -0000
Message-ID: <176371587316.59.6362062889667991681@2cb04c0e5124> (raw)
PR #20988 opened by dkozinski
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20988
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20988.patch
- Replaced direct assignments with 'av_be2ne16' and 'av_be2ne32' for byte order conversion in 'apv_decode_metadata'
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
>From 8c3c83104ddb94649df144bc7c37cb6167482134 Mon Sep 17 00:00:00 2001
From: Dawid Kozinski <d.kozinski@samsung.com>
Date: Fri, 21 Nov 2025 09:52:46 +0100
Subject: [PATCH] avcodec/apv_decode: Update metadata decoding to use byte
order conversion functions
- Replaced direct assignments with 'av_be2ne16' and 'av_be2ne32' for byte order conversion in 'apv_decode_metadata'
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
---
libavcodec/apv_decode.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/libavcodec/apv_decode.c b/libavcodec/apv_decode.c
index dbe354a793..ca3fc5896e 100644
--- a/libavcodec/apv_decode.c
+++ b/libavcodec/apv_decode.c
@@ -408,7 +408,7 @@ static int apv_decode_metadata(AVCodecContext *avctx, AVFrame *frame,
const APVRawMetadataPayload *pl = &md->payloads[i];
switch (pl->payload_type) {
- case APV_METADATA_MDCV:
+ case APV_METADATA_MDCV:
{
const APVRawMetadataMDCV *mdcv = &pl->mdcv;
AVMasteringDisplayMetadata *mdm;
@@ -420,20 +420,20 @@ static int apv_decode_metadata(AVCodecContext *avctx, AVFrame *frame,
if (mdm) {
for (int j = 0; j < 3; j++) {
mdm->display_primaries[j][0] =
- av_make_q(mdcv->primary_chromaticity_x[j], 1 << 16);
+ av_make_q(av_be2ne16(mdcv->primary_chromaticity_x[j]), 1 << 16);
mdm->display_primaries[j][1] =
- av_make_q(mdcv->primary_chromaticity_y[j], 1 << 16);
+ av_make_q(av_be2ne16(mdcv->primary_chromaticity_y[j]), 1 << 16);
}
mdm->white_point[0] =
- av_make_q(mdcv->white_point_chromaticity_x, 1 << 16);
+ av_make_q(av_be2ne16(mdcv->white_point_chromaticity_x), 1 << 16);
mdm->white_point[1] =
- av_make_q(mdcv->white_point_chromaticity_y, 1 << 16);
+ av_make_q(av_be2ne16(mdcv->white_point_chromaticity_y), 1 << 16);
mdm->max_luminance =
- av_make_q(mdcv->max_mastering_luminance, 1 << 8);
+ av_make_q(av_be2ne32(mdcv->max_mastering_luminance), 1 << 8);
mdm->min_luminance =
- av_make_q(mdcv->min_mastering_luminance, 1 << 14);
+ av_make_q(av_be2ne32(mdcv->min_mastering_luminance), 1 << 14);
mdm->has_primaries = 1;
mdm->has_luminance = 1;
@@ -450,8 +450,8 @@ static int apv_decode_metadata(AVCodecContext *avctx, AVFrame *frame,
return err;
if (clm) {
- clm->MaxCLL = cll->max_cll;
- clm->MaxFALL = cll->max_fall;
+ clm->MaxCLL = av_be2ne16(cll->max_cll);
+ clm->MaxFALL = av_be2ne16(cll->max_fall);
}
}
break;
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2025-11-21 9:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176371587316.59.6362062889667991681@2cb04c0e5124 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git