Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avcodec/apv_decode: Update metadata decoding to use byte order conversion functions (PR #20988)
@ 2025-11-21  9:04 dkozinski via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: dkozinski via ffmpeg-devel @ 2025-11-21  9:04 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: dkozinski

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-21  9:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-21  9:04 [FFmpeg-devel] [PATCH] avcodec/apv_decode: Update metadata decoding to use byte order conversion functions (PR #20988) dkozinski via ffmpeg-devel

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