[FFmpeg-devel] [PATCH 3/5] avformat/matroska*: Use av_chroma_location_(pos_to_enum|enum_to_pos)
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Wed Sep 21 04:35:39 EEST 2022
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavformat/matroskadec.c | 5 +++--
libavformat/matroskaenc.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 16a3e93611..aa59f73d00 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -46,6 +46,7 @@
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
#include "libavutil/time_internal.h"
#include "libavutil/spherical.h"
@@ -2184,8 +2185,8 @@ static int mkv_parse_video_color(AVStream *st, const MatroskaTrack *track) {
color->chroma_siting_horz < MATROSKA_COLOUR_CHROMASITINGHORZ_NB &&
color->chroma_siting_vert < MATROSKA_COLOUR_CHROMASITINGVERT_NB) {
st->codecpar->chroma_location =
- avcodec_chroma_pos_to_enum((color->chroma_siting_horz - 1) << 7,
- (color->chroma_siting_vert - 1) << 7);
+ av_chroma_location_pos_to_enum((color->chroma_siting_horz - 1) << 7,
+ (color->chroma_siting_vert - 1) << 7);
}
if (color->max_cll && color->max_fall) {
size_t size = 0;
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index ed1ad5039d..147f29988e 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -51,6 +51,7 @@
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
+#include "libavutil/pixdesc.h"
#include "libavutil/random_seed.h"
#include "libavutil/rational.h"
#include "libavutil/samplefmt.h"
@@ -1322,7 +1323,7 @@ static void mkv_write_video_color(EbmlWriter *writer, const AVStream *st,
par->chroma_location <= AVCHROMA_LOC_TOP) {
int xpos, ypos;
- avcodec_enum_to_chroma_pos(&xpos, &ypos, par->chroma_location);
+ av_chroma_location_enum_to_pos(&xpos, &ypos, par->chroma_location);
ebml_writer_add_uint(writer, MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ,
(xpos >> 7) + 1);
ebml_writer_add_uint(writer, MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT,
--
2.34.1
More information about the ffmpeg-devel
mailing list