[FFmpeg-cvslog] avformat/matroska{dec, enc}: Parse BlockAdditionMapping elements
ffmpeg | branch: master | quietvoid | Sat Jan 1 17:51:50 2022 +0100| [05c07943b04de2514343b1de09dc6dca64502643] | committer: Andreas Rheinhardt avformat/matroska{dec, enc}: Parse BlockAdditionMapping elements Adds handling of dvcC/dvvC block addition mappings. The parsing creates AVDOVIDecoderConfigurationRecord side data. The configuration block is written when muxing into Matroska, if DOVI side data is present for the track. Most of the Matroska element parsing is based on Plex's FFmpeg source code. Signed-off-by: quietvoid Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05c07943b04de2514343b1de09dc6dca64502643 --- libavformat/Makefile | 4 ++-- libavformat/matroska.h| 9 libavformat/matroskadec.c | 58 +-- libavformat/matroskaenc.c | 37 ++ 4 files changed, 104 insertions(+), 4 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index e31b248ac0..4464c2b049 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -316,11 +316,11 @@ OBJS-$(CONFIG_M4V_MUXER) += rawenc.o OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroska.o \ flac_picture.o isom_tags.o rmsipr.o \ oggparsevorbis.o vorbiscomment.o \ -qtpalette.o replaygain.o +qtpalette.o replaygain.o dovi_isom.o OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o matroska.o \ av1.o avc.o hevc.o isom_tags.o \ flacenc_header.o avlanguage.o \ -vorbiscomment.o wv.o +vorbiscomment.o wv.o dovi_isom.o OBJS-$(CONFIG_MCA_DEMUXER) += mca.o OBJS-$(CONFIG_MCC_DEMUXER) += mccdec.o subtitles.o OBJS-$(CONFIG_MD5_MUXER) += hashenc.o diff --git a/libavformat/matroska.h b/libavformat/matroska.h index 2d04a6838b..16491aae22 100644 --- a/libavformat/matroska.h +++ b/libavformat/matroska.h @@ -111,6 +111,7 @@ #define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 #define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F #define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE +#define MATROSKA_ID_TRACKBLKADDMAPPING 0x41E4 /* IDs in the trackvideo master */ #define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 @@ -189,6 +190,12 @@ #define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4 #define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3 +/* IDs in the block addition mapping master */ +#define MATROSKA_ID_BLKADDIDVALUE 0x41F0 +#define MATROSKA_ID_BLKADDIDNAME 0x41A4 +#define MATROSKA_ID_BLKADDIDTYPE 0x41E7 +#define MATROSKA_ID_BLKADDIDEXTRADATA 0x41ED + /* ID in the cues master */ #define MATROSKA_ID_POINTENTRY 0xBB @@ -385,4 +392,6 @@ extern const char * const ff_matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_P int ff_mkv_stereo3d_conv(AVStream *st, MatroskaVideoStereoModeType stereo_mode); +#define DVCC_DVVC_BLOCK_TYPE_NAME "Dolby Vision configuration" + #endif /* AVFORMAT_MATROSKA_H */ diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index a4bbbe954e..6ce553205d 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -53,6 +53,7 @@ #include "avformat.h" #include "avio_internal.h" +#include "dovi_isom.h" #include "internal.h" #include "isom.h" #include "matroska.h" @@ -239,6 +240,13 @@ typedef struct MatroskaTrackOperation { EbmlList combine_planes; } MatroskaTrackOperation; +typedef struct MatroskaBlockAdditionMapping { +uint64_t value; +char *name; +uint64_t type; +EbmlBin extradata; +} MatroskaBlockAdditionMapping; + typedef struct MatroskaTrack { uint64_t num; uint64_t uid; @@ -269,6 +277,7 @@ typedef struct MatroskaTrack { int ms_compat; int needs_decoding; uint64_t max_block_additional_id; +EbmlList block_addition_mappings; uint32_t palette[AVPALETTE_COUNT]; int has_palette; @@ -419,8 +428,8 @@ typedef struct MatroskaDemuxContext { // incomplete type (6.7.2 in C90, 6.9.2 in C99). // Removing the sizes breaks MSVC. static EbmlSyntax ebml_syntax[3], matroska_segment[9], matroska_track_video_color[15], matroska_track_video[19], - matroska_track[32], matroska_track_encoding[6], matroska_track_encodings[2], - matroska_track_combine_planes[2], matroska_track_operation[2], matroska_tracks[2], + matroska_track[33], matroska_track_encoding[6], matroska_track_encodings[2], + matroska_track_combine_planes[2], matroska_track_operation[2], matroska_block_addition_mapping[5], matroska_tracks[2], matroska_attach
[FFmpeg-cvslog] avformat/dovi_isom: Implement Dolby Vision configuration parsing/writing
ffmpeg | branch: master | quietvoid | Sat Jan 1 17:51:49 2022 +0100| [5c16e463745ece2f18777a5424d7779853d63011] | committer: Andreas Rheinhardt avformat/dovi_isom: Implement Dolby Vision configuration parsing/writing Both parse/write implementations are based on mov/movenc. This only adds support for the "Dolby Vision configuration box". Other configuration boxes, such as "Dolby Vision enhancement layer configuration box" are not supported. The new functions will be used to implement parsing/writing the DOVI config for Matroska, as well as to refactor both mov/movenc to use dovi_isom functions. Signed-off-by: quietvoid Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c16e463745ece2f18777a5424d7779853d63011 --- libavformat/dovi_isom.c | 118 libavformat/dovi_isom.h | 35 ++ 2 files changed, 153 insertions(+) diff --git a/libavformat/dovi_isom.c b/libavformat/dovi_isom.c new file mode 100644 index 00..76681b9451 --- /dev/null +++ b/libavformat/dovi_isom.c @@ -0,0 +1,118 @@ +/* + * DOVI ISO Media common code + * + * Copyright (c) 2020 Vacing Fang + * Copyright (c) 2021 quietvoid + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/dovi_meta.h" + +#include "libavcodec/put_bits.h" + +#include "avformat.h" +#include "dovi_isom.h" + +int ff_isom_parse_dvcc_dvvc(AVFormatContext *s, AVStream *st, const uint8_t *buf_ptr, uint64_t size) +{ +uint32_t buf; +AVDOVIDecoderConfigurationRecord *dovi; +size_t dovi_size; +int ret; + +if (size > (1 << 30) || size < 4) +return AVERROR_INVALIDDATA; + +dovi = av_dovi_alloc(&dovi_size); +if (!dovi) +return AVERROR(ENOMEM); + +dovi->dv_version_major = *buf_ptr++;// 8 bits +dovi->dv_version_minor = *buf_ptr++;// 8 bits + +buf = *buf_ptr++ << 8; +buf |= *buf_ptr++; + +dovi->dv_profile= (buf >> 9) & 0x7f;// 7 bits +dovi->dv_level = (buf >> 3) & 0x3f;// 6 bits +dovi->rpu_present_flag = (buf >> 2) & 0x01;// 1 bit +dovi->el_present_flag = (buf >> 1) & 0x01;// 1 bit +dovi->bl_present_flag = buf & 0x01;// 1 bit + +// Has enough remaining data +if (size >= 5) { +dovi->dv_bl_signal_compatibility_id = ((*buf_ptr++) >> 4) & 0x0f; // 4 bits +} else { +// 0 stands for None +// Dolby Vision V1.2.93 profiles and levels +dovi->dv_bl_signal_compatibility_id = 0; +} + +ret = av_stream_add_side_data(st, AV_PKT_DATA_DOVI_CONF, + (uint8_t *)dovi, dovi_size); +if (ret < 0) { +av_free(dovi); +return ret; +} + +av_log(s, AV_LOG_TRACE, "DOVI in dvcC/dvvC/dvwC box, version: %d.%d, profile: %d, level: %d, " + "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", + dovi->dv_version_major, dovi->dv_version_minor, + dovi->dv_profile, dovi->dv_level, + dovi->rpu_present_flag, + dovi->el_present_flag, + dovi->bl_present_flag, + dovi->dv_bl_signal_compatibility_id); + +return 0; +} + +void ff_isom_put_dvcc_dvvc(AVFormatContext *s, uint8_t out[ISOM_DVCC_DVVC_SIZE], + AVDOVIDecoderConfigurationRecord *dovi) +{ +PutBitContext pb; + +init_put_bits(&pb, out, ISOM_DVCC_DVVC_SIZE); + +put_bits(&pb, 8, dovi->dv_version_major); +put_bits(&pb, 8, dovi->dv_version_minor); +put_bits(&pb, 7, dovi->dv_profile & 0x7f); +put_bits(&pb, 6, dovi->dv_level & 0x3f); +put_bits(&pb, 1, !!dovi->rpu_present_flag); +put_bits(&pb, 1, !!dovi->el_present_flag); +put_bits(&pb, 1, !!dovi->bl_present_flag); +put_bits(&pb, 4, dovi->dv_bl_signal_compatibility_id & 0x0f); + +put_bits(&pb, 28, 0); /* reserved */ +put_bits32(&pb, 0); /* reserved */ +put_bits32(&pb, 0); /* reser
[FFmpeg-cvslog] avformat/mov: Refactor mov_read_dvcc_dvvc to use ff_isom_parse_dvcc_dvvc
ffmpeg | branch: master | quietvoid | Sat Jan 1 17:51:51 2022 +0100| [9906f9ae3b678d95b413dd4320e334ea3e2cf70a] | committer: Andreas Rheinhardt avformat/mov: Refactor mov_read_dvcc_dvvc to use ff_isom_parse_dvcc_dvvc To avoid duplicating code. The implementation in dovi_isom is identical. Signed-off-by: quietvoid Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9906f9ae3b678d95b413dd4320e334ea3e2cf70a --- libavformat/Makefile | 2 +- libavformat/mov.c| 50 +++--- 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index 4464c2b049..cd9810ba01 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -339,7 +339,7 @@ OBJS-$(CONFIG_MMF_MUXER) += mmf.o rawenc.o OBJS-$(CONFIG_MODS_DEMUXER) += mods.o OBJS-$(CONFIG_MOFLEX_DEMUXER)+= moflex.o OBJS-$(CONFIG_MOV_DEMUXER) += mov.o mov_chan.o mov_esds.o \ -qtpalette.o replaygain.o +qtpalette.o replaygain.o dovi_isom.o OBJS-$(CONFIG_MOV_MUXER) += movenc.o av1.o avc.o hevc.o vpcc.o \ movenchint.o mov_chan.o rtp.o \ movenccenc.o movenc_ttml.o rawutils.o diff --git a/libavformat/mov.c b/libavformat/mov.c index 351ecde770..ad5ab6b491 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -55,6 +55,7 @@ #include "avformat.h" #include "internal.h" #include "avio_internal.h" +#include "dovi_isom.h" #include "riff.h" #include "isom.h" #include "libavcodec/get_bits.h" @@ -7062,58 +7063,21 @@ static int mov_read_dmlp(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_dvcc_dvvc(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; -uint32_t buf; -AVDOVIDecoderConfigurationRecord *dovi; -size_t dovi_size; +uint8_t buf[ISOM_DVCC_DVVC_SIZE]; int ret; +int64_t read_size = atom.size; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; -if ((uint64_t)atom.size > (1<<30) || atom.size < 4) -return AVERROR_INVALIDDATA; - -dovi = av_dovi_alloc(&dovi_size); -if (!dovi) -return AVERROR(ENOMEM); - -dovi->dv_version_major = avio_r8(pb); -dovi->dv_version_minor = avio_r8(pb); - -buf = avio_rb16(pb); -dovi->dv_profile= (buf >> 9) & 0x7f;// 7 bits -dovi->dv_level = (buf >> 3) & 0x3f;// 6 bits -dovi->rpu_present_flag = (buf >> 2) & 0x01;// 1 bit -dovi->el_present_flag = (buf >> 1) & 0x01;// 1 bit -dovi->bl_present_flag = buf & 0x01;// 1 bit -if (atom.size >= 24) { // 4 + 4 + 4 * 4 -buf = avio_r8(pb); -dovi->dv_bl_signal_compatibility_id = (buf >> 4) & 0x0f; // 4 bits -} else { -// 0 stands for None -// Dolby Vision V1.2.93 profiles and levels -dovi->dv_bl_signal_compatibility_id = 0; -} +// At most 24 bytes +read_size = FFMIN(read_size, ISOM_DVCC_DVVC_SIZE); -ret = av_stream_add_side_data(st, AV_PKT_DATA_DOVI_CONF, - (uint8_t *)dovi, dovi_size); -if (ret < 0) { -av_free(dovi); +if ((ret = ffio_read_size(pb, buf, read_size)) < 0) return ret; -} -av_log(c, AV_LOG_TRACE, "DOVI in dvcC/dvvC/dvwC box, version: %d.%d, profile: %d, level: %d, " - "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", - dovi->dv_version_major, dovi->dv_version_minor, - dovi->dv_profile, dovi->dv_level, - dovi->rpu_present_flag, - dovi->el_present_flag, - dovi->bl_present_flag, - dovi->dv_bl_signal_compatibility_id -); - -return 0; +return ff_isom_parse_dvcc_dvvc(c->fc, st, buf, read_size); } static int mov_read_kind(MOVContext *c, AVIOContext *pb, MOVAtom atom) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/movenc: Refactor mov_write_dvcc_dvvc_tag to use ff_isom_put_dvcc_dvvc
ffmpeg | branch: master | quietvoid | Sat Jan 1 17:51:52 2022 +0100| [f0fb005f59f6febcf2ffc8140bdb7f136ac56add] | committer: Andreas Rheinhardt avformat/movenc: Refactor mov_write_dvcc_dvvc_tag to use ff_isom_put_dvcc_dvvc Improves code legibility by not using bit shifts. Also avoids duplicating the dvcC/dvvC ISOM box writing code. Signed-off-by: quietvoid Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f0fb005f59f6febcf2ffc8140bdb7f136ac56add --- libavformat/Makefile | 3 ++- libavformat/movenc.c | 24 +++- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index cd9810ba01..a9afb9c042 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -342,7 +342,8 @@ OBJS-$(CONFIG_MOV_DEMUXER) += mov.o mov_chan.o mov_esds.o \ qtpalette.o replaygain.o dovi_isom.o OBJS-$(CONFIG_MOV_MUXER) += movenc.o av1.o avc.o hevc.o vpcc.o \ movenchint.o mov_chan.o rtp.o \ -movenccenc.o movenc_ttml.o rawutils.o +movenccenc.o movenc_ttml.o rawutils.o \ +dovi_isom.o OBJS-$(CONFIG_MP2_MUXER) += rawenc.o OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o replaygain.o OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 40ad4f8642..04cf2f777d 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -27,6 +27,7 @@ #include "movenc.h" #include "avformat.h" #include "avio_internal.h" +#include "dovi_isom.h" #include "riff.h" #include "avio.h" #include "isom.h" @@ -1911,6 +1912,8 @@ static int mov_write_sv3d_tag(AVFormatContext *s, AVIOContext *pb, AVSphericalMa static int mov_write_dvcc_dvvc_tag(AVFormatContext *s, AVIOContext *pb, AVDOVIDecoderConfigurationRecord *dovi) { +uint8_t buf[ISOM_DVCC_DVVC_SIZE]; + avio_wb32(pb, 32); /* size = 8 + 24 */ if (dovi->dv_profile > 10) ffio_wfourcc(pb, "dvwC"); @@ -1918,23 +1921,10 @@ static int mov_write_dvcc_dvvc_tag(AVFormatContext *s, AVIOContext *pb, AVDOVIDe ffio_wfourcc(pb, "dvvC"); else ffio_wfourcc(pb, "dvcC"); -avio_w8(pb, dovi->dv_version_major); -avio_w8(pb, dovi->dv_version_minor); -avio_wb16(pb, (dovi->dv_profile << 9) | (dovi->dv_level << 3) | - (dovi->rpu_present_flag << 2) | (dovi->el_present_flag << 1) | - dovi->bl_present_flag); -avio_wb32(pb, (dovi->dv_bl_signal_compatibility_id << 28) | 0); - -ffio_fill(pb, 0, 4 * 4); /* reserved */ -av_log(s, AV_LOG_DEBUG, "DOVI in %s box, version: %d.%d, profile: %d, level: %d, " - "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", - dovi->dv_profile > 10 ? "dvwC" : (dovi->dv_profile > 7 ? "dvvC" : "dvcC"), - dovi->dv_version_major, dovi->dv_version_minor, - dovi->dv_profile, dovi->dv_level, - dovi->rpu_present_flag, - dovi->el_present_flag, - dovi->bl_present_flag, - dovi->dv_bl_signal_compatibility_id); + +ff_isom_put_dvcc_dvvc(s, buf, dovi); +avio_write(pb, buf, sizeof(buf)); + return 32; /* 8 + 24 */ } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/dovi_isom: Implement Dolby Vision configuration parsing/writing
ffmpeg | branch: release/5.0 | quietvoid | Sat Jan 1 17:51:49 2022 +0100| [5c16e463745ece2f18777a5424d7779853d63011] | committer: Andreas Rheinhardt avformat/dovi_isom: Implement Dolby Vision configuration parsing/writing Both parse/write implementations are based on mov/movenc. This only adds support for the "Dolby Vision configuration box". Other configuration boxes, such as "Dolby Vision enhancement layer configuration box" are not supported. The new functions will be used to implement parsing/writing the DOVI config for Matroska, as well as to refactor both mov/movenc to use dovi_isom functions. Signed-off-by: quietvoid Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c16e463745ece2f18777a5424d7779853d63011 --- libavformat/dovi_isom.c | 118 libavformat/dovi_isom.h | 35 ++ 2 files changed, 153 insertions(+) diff --git a/libavformat/dovi_isom.c b/libavformat/dovi_isom.c new file mode 100644 index 00..76681b9451 --- /dev/null +++ b/libavformat/dovi_isom.c @@ -0,0 +1,118 @@ +/* + * DOVI ISO Media common code + * + * Copyright (c) 2020 Vacing Fang + * Copyright (c) 2021 quietvoid + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/dovi_meta.h" + +#include "libavcodec/put_bits.h" + +#include "avformat.h" +#include "dovi_isom.h" + +int ff_isom_parse_dvcc_dvvc(AVFormatContext *s, AVStream *st, const uint8_t *buf_ptr, uint64_t size) +{ +uint32_t buf; +AVDOVIDecoderConfigurationRecord *dovi; +size_t dovi_size; +int ret; + +if (size > (1 << 30) || size < 4) +return AVERROR_INVALIDDATA; + +dovi = av_dovi_alloc(&dovi_size); +if (!dovi) +return AVERROR(ENOMEM); + +dovi->dv_version_major = *buf_ptr++;// 8 bits +dovi->dv_version_minor = *buf_ptr++;// 8 bits + +buf = *buf_ptr++ << 8; +buf |= *buf_ptr++; + +dovi->dv_profile= (buf >> 9) & 0x7f;// 7 bits +dovi->dv_level = (buf >> 3) & 0x3f;// 6 bits +dovi->rpu_present_flag = (buf >> 2) & 0x01;// 1 bit +dovi->el_present_flag = (buf >> 1) & 0x01;// 1 bit +dovi->bl_present_flag = buf & 0x01;// 1 bit + +// Has enough remaining data +if (size >= 5) { +dovi->dv_bl_signal_compatibility_id = ((*buf_ptr++) >> 4) & 0x0f; // 4 bits +} else { +// 0 stands for None +// Dolby Vision V1.2.93 profiles and levels +dovi->dv_bl_signal_compatibility_id = 0; +} + +ret = av_stream_add_side_data(st, AV_PKT_DATA_DOVI_CONF, + (uint8_t *)dovi, dovi_size); +if (ret < 0) { +av_free(dovi); +return ret; +} + +av_log(s, AV_LOG_TRACE, "DOVI in dvcC/dvvC/dvwC box, version: %d.%d, profile: %d, level: %d, " + "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", + dovi->dv_version_major, dovi->dv_version_minor, + dovi->dv_profile, dovi->dv_level, + dovi->rpu_present_flag, + dovi->el_present_flag, + dovi->bl_present_flag, + dovi->dv_bl_signal_compatibility_id); + +return 0; +} + +void ff_isom_put_dvcc_dvvc(AVFormatContext *s, uint8_t out[ISOM_DVCC_DVVC_SIZE], + AVDOVIDecoderConfigurationRecord *dovi) +{ +PutBitContext pb; + +init_put_bits(&pb, out, ISOM_DVCC_DVVC_SIZE); + +put_bits(&pb, 8, dovi->dv_version_major); +put_bits(&pb, 8, dovi->dv_version_minor); +put_bits(&pb, 7, dovi->dv_profile & 0x7f); +put_bits(&pb, 6, dovi->dv_level & 0x3f); +put_bits(&pb, 1, !!dovi->rpu_present_flag); +put_bits(&pb, 1, !!dovi->el_present_flag); +put_bits(&pb, 1, !!dovi->bl_present_flag); +put_bits(&pb, 4, dovi->dv_bl_signal_compatibility_id & 0x0f); + +put_bits(&pb, 28, 0); /* reserved */ +put_bits32(&pb, 0); /* reserved */ +put_bits32(&a
[FFmpeg-cvslog] avformat/matroska{dec, enc}: Parse BlockAdditionMapping elements
ffmpeg | branch: release/5.0 | quietvoid | Sat Jan 1 17:51:50 2022 +0100| [05c07943b04de2514343b1de09dc6dca64502643] | committer: Andreas Rheinhardt avformat/matroska{dec, enc}: Parse BlockAdditionMapping elements Adds handling of dvcC/dvvC block addition mappings. The parsing creates AVDOVIDecoderConfigurationRecord side data. The configuration block is written when muxing into Matroska, if DOVI side data is present for the track. Most of the Matroska element parsing is based on Plex's FFmpeg source code. Signed-off-by: quietvoid Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05c07943b04de2514343b1de09dc6dca64502643 --- libavformat/Makefile | 4 ++-- libavformat/matroska.h| 9 libavformat/matroskadec.c | 58 +-- libavformat/matroskaenc.c | 37 ++ 4 files changed, 104 insertions(+), 4 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index e31b248ac0..4464c2b049 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -316,11 +316,11 @@ OBJS-$(CONFIG_M4V_MUXER) += rawenc.o OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroska.o \ flac_picture.o isom_tags.o rmsipr.o \ oggparsevorbis.o vorbiscomment.o \ -qtpalette.o replaygain.o +qtpalette.o replaygain.o dovi_isom.o OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o matroska.o \ av1.o avc.o hevc.o isom_tags.o \ flacenc_header.o avlanguage.o \ -vorbiscomment.o wv.o +vorbiscomment.o wv.o dovi_isom.o OBJS-$(CONFIG_MCA_DEMUXER) += mca.o OBJS-$(CONFIG_MCC_DEMUXER) += mccdec.o subtitles.o OBJS-$(CONFIG_MD5_MUXER) += hashenc.o diff --git a/libavformat/matroska.h b/libavformat/matroska.h index 2d04a6838b..16491aae22 100644 --- a/libavformat/matroska.h +++ b/libavformat/matroska.h @@ -111,6 +111,7 @@ #define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 #define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F #define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE +#define MATROSKA_ID_TRACKBLKADDMAPPING 0x41E4 /* IDs in the trackvideo master */ #define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 @@ -189,6 +190,12 @@ #define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4 #define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3 +/* IDs in the block addition mapping master */ +#define MATROSKA_ID_BLKADDIDVALUE 0x41F0 +#define MATROSKA_ID_BLKADDIDNAME 0x41A4 +#define MATROSKA_ID_BLKADDIDTYPE 0x41E7 +#define MATROSKA_ID_BLKADDIDEXTRADATA 0x41ED + /* ID in the cues master */ #define MATROSKA_ID_POINTENTRY 0xBB @@ -385,4 +392,6 @@ extern const char * const ff_matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_P int ff_mkv_stereo3d_conv(AVStream *st, MatroskaVideoStereoModeType stereo_mode); +#define DVCC_DVVC_BLOCK_TYPE_NAME "Dolby Vision configuration" + #endif /* AVFORMAT_MATROSKA_H */ diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index a4bbbe954e..6ce553205d 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -53,6 +53,7 @@ #include "avformat.h" #include "avio_internal.h" +#include "dovi_isom.h" #include "internal.h" #include "isom.h" #include "matroska.h" @@ -239,6 +240,13 @@ typedef struct MatroskaTrackOperation { EbmlList combine_planes; } MatroskaTrackOperation; +typedef struct MatroskaBlockAdditionMapping { +uint64_t value; +char *name; +uint64_t type; +EbmlBin extradata; +} MatroskaBlockAdditionMapping; + typedef struct MatroskaTrack { uint64_t num; uint64_t uid; @@ -269,6 +277,7 @@ typedef struct MatroskaTrack { int ms_compat; int needs_decoding; uint64_t max_block_additional_id; +EbmlList block_addition_mappings; uint32_t palette[AVPALETTE_COUNT]; int has_palette; @@ -419,8 +428,8 @@ typedef struct MatroskaDemuxContext { // incomplete type (6.7.2 in C90, 6.9.2 in C99). // Removing the sizes breaks MSVC. static EbmlSyntax ebml_syntax[3], matroska_segment[9], matroska_track_video_color[15], matroska_track_video[19], - matroska_track[32], matroska_track_encoding[6], matroska_track_encodings[2], - matroska_track_combine_planes[2], matroska_track_operation[2], matroska_tracks[2], + matroska_track[33], matroska_track_encoding[6], matroska_track_encodings[2], + matroska_track_combine_planes[2], matroska_track_operation[2], matroska_block_addition_mapping[5], matroska_tracks[2], matroska_attach
[FFmpeg-cvslog] avformat/movenc: Refactor mov_write_dvcc_dvvc_tag to use ff_isom_put_dvcc_dvvc
ffmpeg | branch: release/5.0 | quietvoid | Sat Jan 1 17:51:52 2022 +0100| [f0fb005f59f6febcf2ffc8140bdb7f136ac56add] | committer: Andreas Rheinhardt avformat/movenc: Refactor mov_write_dvcc_dvvc_tag to use ff_isom_put_dvcc_dvvc Improves code legibility by not using bit shifts. Also avoids duplicating the dvcC/dvvC ISOM box writing code. Signed-off-by: quietvoid Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f0fb005f59f6febcf2ffc8140bdb7f136ac56add --- libavformat/Makefile | 3 ++- libavformat/movenc.c | 24 +++- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index cd9810ba01..a9afb9c042 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -342,7 +342,8 @@ OBJS-$(CONFIG_MOV_DEMUXER) += mov.o mov_chan.o mov_esds.o \ qtpalette.o replaygain.o dovi_isom.o OBJS-$(CONFIG_MOV_MUXER) += movenc.o av1.o avc.o hevc.o vpcc.o \ movenchint.o mov_chan.o rtp.o \ -movenccenc.o movenc_ttml.o rawutils.o +movenccenc.o movenc_ttml.o rawutils.o \ +dovi_isom.o OBJS-$(CONFIG_MP2_MUXER) += rawenc.o OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o replaygain.o OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 40ad4f8642..04cf2f777d 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -27,6 +27,7 @@ #include "movenc.h" #include "avformat.h" #include "avio_internal.h" +#include "dovi_isom.h" #include "riff.h" #include "avio.h" #include "isom.h" @@ -1911,6 +1912,8 @@ static int mov_write_sv3d_tag(AVFormatContext *s, AVIOContext *pb, AVSphericalMa static int mov_write_dvcc_dvvc_tag(AVFormatContext *s, AVIOContext *pb, AVDOVIDecoderConfigurationRecord *dovi) { +uint8_t buf[ISOM_DVCC_DVVC_SIZE]; + avio_wb32(pb, 32); /* size = 8 + 24 */ if (dovi->dv_profile > 10) ffio_wfourcc(pb, "dvwC"); @@ -1918,23 +1921,10 @@ static int mov_write_dvcc_dvvc_tag(AVFormatContext *s, AVIOContext *pb, AVDOVIDe ffio_wfourcc(pb, "dvvC"); else ffio_wfourcc(pb, "dvcC"); -avio_w8(pb, dovi->dv_version_major); -avio_w8(pb, dovi->dv_version_minor); -avio_wb16(pb, (dovi->dv_profile << 9) | (dovi->dv_level << 3) | - (dovi->rpu_present_flag << 2) | (dovi->el_present_flag << 1) | - dovi->bl_present_flag); -avio_wb32(pb, (dovi->dv_bl_signal_compatibility_id << 28) | 0); - -ffio_fill(pb, 0, 4 * 4); /* reserved */ -av_log(s, AV_LOG_DEBUG, "DOVI in %s box, version: %d.%d, profile: %d, level: %d, " - "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", - dovi->dv_profile > 10 ? "dvwC" : (dovi->dv_profile > 7 ? "dvvC" : "dvcC"), - dovi->dv_version_major, dovi->dv_version_minor, - dovi->dv_profile, dovi->dv_level, - dovi->rpu_present_flag, - dovi->el_present_flag, - dovi->bl_present_flag, - dovi->dv_bl_signal_compatibility_id); + +ff_isom_put_dvcc_dvvc(s, buf, dovi); +avio_write(pb, buf, sizeof(buf)); + return 32; /* 8 + 24 */ } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/mov: Refactor mov_read_dvcc_dvvc to use ff_isom_parse_dvcc_dvvc
ffmpeg | branch: release/5.0 | quietvoid | Sat Jan 1 17:51:51 2022 +0100| [9906f9ae3b678d95b413dd4320e334ea3e2cf70a] | committer: Andreas Rheinhardt avformat/mov: Refactor mov_read_dvcc_dvvc to use ff_isom_parse_dvcc_dvvc To avoid duplicating code. The implementation in dovi_isom is identical. Signed-off-by: quietvoid Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9906f9ae3b678d95b413dd4320e334ea3e2cf70a --- libavformat/Makefile | 2 +- libavformat/mov.c| 50 +++--- 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index 4464c2b049..cd9810ba01 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -339,7 +339,7 @@ OBJS-$(CONFIG_MMF_MUXER) += mmf.o rawenc.o OBJS-$(CONFIG_MODS_DEMUXER) += mods.o OBJS-$(CONFIG_MOFLEX_DEMUXER)+= moflex.o OBJS-$(CONFIG_MOV_DEMUXER) += mov.o mov_chan.o mov_esds.o \ -qtpalette.o replaygain.o +qtpalette.o replaygain.o dovi_isom.o OBJS-$(CONFIG_MOV_MUXER) += movenc.o av1.o avc.o hevc.o vpcc.o \ movenchint.o mov_chan.o rtp.o \ movenccenc.o movenc_ttml.o rawutils.o diff --git a/libavformat/mov.c b/libavformat/mov.c index 351ecde770..ad5ab6b491 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -55,6 +55,7 @@ #include "avformat.h" #include "internal.h" #include "avio_internal.h" +#include "dovi_isom.h" #include "riff.h" #include "isom.h" #include "libavcodec/get_bits.h" @@ -7062,58 +7063,21 @@ static int mov_read_dmlp(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_dvcc_dvvc(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; -uint32_t buf; -AVDOVIDecoderConfigurationRecord *dovi; -size_t dovi_size; +uint8_t buf[ISOM_DVCC_DVVC_SIZE]; int ret; +int64_t read_size = atom.size; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; -if ((uint64_t)atom.size > (1<<30) || atom.size < 4) -return AVERROR_INVALIDDATA; - -dovi = av_dovi_alloc(&dovi_size); -if (!dovi) -return AVERROR(ENOMEM); - -dovi->dv_version_major = avio_r8(pb); -dovi->dv_version_minor = avio_r8(pb); - -buf = avio_rb16(pb); -dovi->dv_profile= (buf >> 9) & 0x7f;// 7 bits -dovi->dv_level = (buf >> 3) & 0x3f;// 6 bits -dovi->rpu_present_flag = (buf >> 2) & 0x01;// 1 bit -dovi->el_present_flag = (buf >> 1) & 0x01;// 1 bit -dovi->bl_present_flag = buf & 0x01;// 1 bit -if (atom.size >= 24) { // 4 + 4 + 4 * 4 -buf = avio_r8(pb); -dovi->dv_bl_signal_compatibility_id = (buf >> 4) & 0x0f; // 4 bits -} else { -// 0 stands for None -// Dolby Vision V1.2.93 profiles and levels -dovi->dv_bl_signal_compatibility_id = 0; -} +// At most 24 bytes +read_size = FFMIN(read_size, ISOM_DVCC_DVVC_SIZE); -ret = av_stream_add_side_data(st, AV_PKT_DATA_DOVI_CONF, - (uint8_t *)dovi, dovi_size); -if (ret < 0) { -av_free(dovi); +if ((ret = ffio_read_size(pb, buf, read_size)) < 0) return ret; -} -av_log(c, AV_LOG_TRACE, "DOVI in dvcC/dvvC/dvwC box, version: %d.%d, profile: %d, level: %d, " - "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", - dovi->dv_version_major, dovi->dv_version_minor, - dovi->dv_profile, dovi->dv_level, - dovi->rpu_present_flag, - dovi->el_present_flag, - dovi->bl_present_flag, - dovi->dv_bl_signal_compatibility_id -); - -return 0; +return ff_isom_parse_dvcc_dvvc(c->fc, st, buf, read_size); } static int mov_read_kind(MOVContext *c, AVIOContext *pb, MOVAtom atom) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] fate/matroska: Add test for reading/writing BlockAdditionMapping elements
ffmpeg | branch: master | quietvoid | Sat Jan 1 17:51:53 2022 +0100| [0f5fd44dc9b41d6019cab5d2eb92dd370fe565fb] | committer: Andreas Rheinhardt fate/matroska: Add test for reading/writing BlockAdditionMapping elements Tests the parsing and writing of AVDOVIDecoderConfigurationRecord, when it is present as a Dolby Vision configuration block addition mapping. Signed-off-by: quietvoid Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f5fd44dc9b41d6019cab5d2eb92dd370fe565fb --- tests/fate/matroska.mak| 7 tests/ref/fate/matroska-dovi-write-config8 | 60 ++ 2 files changed, 67 insertions(+) diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak index 2fcac34d62..7dd858b07e 100644 --- a/tests/fate/matroska.mak +++ b/tests/fate/matroska.mak @@ -90,6 +90,13 @@ FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL MOV_DEMUXER \ += fate-matroska-dovi-write-config7 fate-matroska-dovi-write-config7: CMD = transcode mov $(TARGET_SAMPLES)/mov/dovi-p7.mp4 matroska "-map 0 -c copy -cues_to_front yes -reserve_index_space 40 -metadata_header_padding 64339" "-map 0 -c copy" "" "-show_entries stream_side_data_list" +FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL PIPE_PROTOCOL \ +MOV_DEMUXER MATROSKA_DEMUXER \ +HEVC_DECODER AAC_DECODER \ +MATROSKA_MUXER FRAMECRC_MUXER) \ + += fate-matroska-dovi-write-config8 +fate-matroska-dovi-write-config8: CMD = transcode mov $(TARGET_SAMPLES)/hevc/dv84.mov matroska "-c copy" "-map 0 -c copy -t 0.4" "" "-show_entries stream_side_data_list -select_streams v" + # This tests writing the MS-compatibility modes V_MS/VFW/FOURCC and A_MS/ACM. # It furthermore tests writing the Cues at the front if the cues_to_front # option is set and more than enough space has been reserved in advance. diff --git a/tests/ref/fate/matroska-dovi-write-config8 b/tests/ref/fate/matroska-dovi-write-config8 new file mode 100644 index 00..84f138cc64 --- /dev/null +++ b/tests/ref/fate/matroska-dovi-write-config8 @@ -0,0 +1,60 @@ +a5f259b0d7590e1ef77e09c3a75d0801 *tests/data/fate/matroska-dovi-write-config8.matroska +3600595 tests/data/fate/matroska-dovi-write-config8.matroska +#extradata 0: 551, 0xa18acf66 +#extradata 1:2, 0x00340022 +#tb 0: 1/1000 +#media_type 0: video +#codec_id 0: hevc +#dimensions 0: 1920x1080 +#sar 0: 0/1 +#tb 1: 1/1000 +#media_type 1: audio +#codec_id 1: aac +#sample_rate 1: 44100 +#channel_layout 1: 3 +#channel_layout_name 1: stereo +0,-67, 0, 33,63375, 0xc76606ab, S=1,8 +0,-34,133, 33,46706, 0x0e08a7e5, F=0x0 +0, 0, 67, 33,29766, 0x753c031a, F=0x0 +1, 0, 0, 23,6, 0x031e0108 +1, 23, 23, 23, 251, 0x6b4a7cbd +0, 33, 33, 33,19409, 0x4b948b6c, F=0x0 +1, 46, 46, 23, 389, 0x6673c205 +0, 67,100, 33,21086, 0x1b9412ce, F=0x0 +1, 70, 70, 23, 356, 0x8c71a316 +1, 93, 93, 23, 339, 0x3018a45a +0,100,267, 33,62043, 0xc2356b56, F=0x0 +1,116,116, 23, 405, 0xc89ebe05 +0,133,200, 33,36175, 0x0a7df38c, F=0x0 +1,139,139, 23, 449, 0x42eadf96 +1,163,163, 23, 416, 0x28a7c9b9 +0,167,167, 33,16028, 0xa57fcbe9, F=0x0 +1,186,186, 23, 426, 0x9a74d4ec +0,200,233, 33,15428, 0x9a91f357, F=0x0 +1,209,209, 23, 419, 0xbe3dc54b +1,232,232, 23, 424, 0x5102d50e +0,233,400, 33,66072, 0xa542b6d7, F=0x0 +1,255,255, 23, 402, 0xb11cc14c +0,267,333, 33,34985, 0xbfd8ff45, F=0x0 +1,279,279, 23, 401, 0x3820b8f9 +0,300,300, 33,16036, 0xfc39c6ea, F=0x0 +1,302,302, 23, 400, 0xe5c4c168 +1,325,325, 23, 435, 0x6dbecc33 +0,333,367, 33,19893, 0x7e746f4e, F=0x0 +1,348,348, 23, 441, 0x0ad3d199 +0,367,533, 33,77576, 0xeba2e5c8, F=0x0 +1,372,372, 23, 479, 0x44dce967 +1,395,395, 23, 439, 0x7d85e4c9 +[STREAM] +[SIDE_DATA] +side_data_type=DOVI configuration record +dv_version_major=1 +dv_version_minor=0 +dv_profile=8 +dv_level=4 +rpu_present_flag=1
[FFmpeg-cvslog] avutil/dovi_meta: add AVDOVIDataMapping.nlq_pivots
ffmpeg | branch: master | quietvoid | Sat Aug 6 09:42:59 2022 -0400| [78076ede2960debdba4e12aca594897ab11e5417] | committer: Niklas Haas avutil/dovi_meta: add AVDOVIDataMapping.nlq_pivots The NLQ pivots are not documented but should be present in the header for profile 7 RPU format. It has been verified using Dolby's verification toolkit. Signed-off-by: quietvoid Signed-off-by: Niklas Haas > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=78076ede2960debdba4e12aca594897ab11e5417 --- doc/APIchanges| 3 +++ libavcodec/dovi_rpu.c | 9 - libavutil/dovi_meta.h | 1 + libavutil/version.h | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index e7677658b1..6ce69fbabc 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 API changes, most recent first: +2024-04-xx - xx - lavu 59.11.100 - dovi_meta.h + Add AVDOVIDataMapping.nlq_pivots. + 2024-03-29 - xx - lavf 61.3.100 - avformat.h Add AVFormatContext.duration_probesize. diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c index ccd5216500..0502f0e7f2 100644 --- a/libavcodec/dovi_rpu.c +++ b/libavcodec/dovi_rpu.c @@ -110,7 +110,7 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame) /* Copy only the parts of these structs known to us at compiler-time. */ #define COPY(t, a, b, last) memcpy(a, b, offsetof(t, last) + sizeof((b)->last)) COPY(AVDOVIRpuDataHeader, av_dovi_get_header(dovi), &s->header, disable_residual_flag); -COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq[2].linear_deadzone_threshold); +COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq_pivots); COPY(AVDOVIColorMetadata, av_dovi_get_color(dovi), s->color, source_diagonal); return 0; } @@ -347,7 +347,14 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size) } if (use_nlq) { +int nlq_pivot = 0; vdr->mapping.nlq_method_idc = get_bits(gb, 3); + +for (int i = 0; i < 2; i++) { +nlq_pivot += get_bits(gb, hdr->bl_bit_depth); +vdr->mapping.nlq_pivots[i] = av_clip_uint16(nlq_pivot); +} + /** * The patent mentions another legal value, NLQ_MU_LAW, but it's * not documented anywhere how to parse or apply that type of NLQ. diff --git a/libavutil/dovi_meta.h b/libavutil/dovi_meta.h index 3d11e02bff..46b13b3399 100644 --- a/libavutil/dovi_meta.h +++ b/libavutil/dovi_meta.h @@ -147,6 +147,7 @@ typedef struct AVDOVIDataMapping { uint32_t num_x_partitions; uint32_t num_y_partitions; AVDOVINLQParams nlq[3]; /* per component */ +uint16_t nlq_pivots[2]; } AVDOVIDataMapping; /** diff --git a/libavutil/version.h b/libavutil/version.h index 8774ed4d1a..d0cc34f43a 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 10 +#define LIBAVUTIL_VERSION_MINOR 11 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".