mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
Compare commits
2 Commits
c1ff2c24b5
...
2c1af16872
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c1af16872 | |||
| e1797cdd51 |
@@ -9,6 +9,7 @@ version <next>:
|
||||
- HE-AAC 960 decoding (DAB+)
|
||||
- transpose_cuda filter
|
||||
- Add AMF Frame Rate Converter (vf_frc_amf) filter
|
||||
- SMPTE 2094-50 metadata support and passthrough
|
||||
|
||||
|
||||
version 8.1:
|
||||
|
||||
+22
-1
@@ -74,6 +74,7 @@ typedef struct FrameData {
|
||||
AVBufferRef *frame_opaque_ref;
|
||||
|
||||
AVBufferRef *hdr10_plus;
|
||||
AVBufferRef *hdr_smpte2094_app5;
|
||||
} FrameData;
|
||||
|
||||
typedef struct VPxEncoderContext {
|
||||
@@ -341,6 +342,7 @@ static void frame_data_uninit(FrameData *fd)
|
||||
{
|
||||
av_buffer_unref(&fd->frame_opaque_ref);
|
||||
av_buffer_unref(&fd->hdr10_plus);
|
||||
av_buffer_unref(&fd->hdr_smpte2094_app5);
|
||||
}
|
||||
|
||||
static av_cold void fifo_free(AVFifo **fifo)
|
||||
@@ -366,12 +368,13 @@ static int frame_data_submit(AVCodecContext *avctx, AVFifo *fifo,
|
||||
|
||||
FrameData fd = { .pts = frame->pts };
|
||||
int ret;
|
||||
const AVFrameSideData *sd;
|
||||
|
||||
if (IS_VP9(avctx) &&
|
||||
// Keep HDR10+ if it has bit depth higher than 8 and
|
||||
// it has PQ trc (SMPTE2084).
|
||||
enccfg->g_bit_depth > 8 && avctx->color_trc == AVCOL_TRC_SMPTE2084) {
|
||||
const AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DYNAMIC_HDR_PLUS);
|
||||
sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DYNAMIC_HDR_PLUS);
|
||||
|
||||
if (sd) {
|
||||
fd.hdr10_plus = av_buffer_ref(sd->buf);
|
||||
@@ -380,6 +383,14 @@ static int frame_data_submit(AVCodecContext *avctx, AVFifo *fifo,
|
||||
}
|
||||
}
|
||||
|
||||
// Keep SMPTE2094_APP5 metadata.
|
||||
sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DYNAMIC_HDR_SMPTE_2094_APP5);
|
||||
if (sd) {
|
||||
fd.hdr_smpte2094_app5 = av_buffer_ref(sd->buf);
|
||||
if (!fd.hdr_smpte2094_app5)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
fd.duration = frame->duration;
|
||||
fd.frame_opaque = frame->opaque;
|
||||
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE && frame->opaque_ref) {
|
||||
@@ -454,6 +465,16 @@ static int frame_data_apply(AVCodecContext *avctx, AVFifo *fifo, AVPacket *pkt)
|
||||
memcpy(data, fd.hdr10_plus->data, fd.hdr10_plus->size);
|
||||
}
|
||||
|
||||
if (fd.hdr_smpte2094_app5) {
|
||||
data = av_packet_new_side_data(pkt, AV_PKT_DATA_DYNAMIC_HDR_SMPTE_2094_APP5, fd.hdr_smpte2094_app5->size);
|
||||
if (!data) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto skip;
|
||||
}
|
||||
|
||||
memcpy(data, fd.hdr_smpte2094_app5->data, fd.hdr_smpte2094_app5->size);
|
||||
}
|
||||
|
||||
skip:
|
||||
av_fifo_drain2(fifo, 1);
|
||||
frame_data_uninit(&fd);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVCODEC_VERSION_MINOR 30
|
||||
#define LIBAVCODEC_VERSION_MINOR 31
|
||||
#define LIBAVCODEC_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
|
||||
@@ -2960,7 +2960,7 @@ static int mkv_write_block(void *logctx, MatroskaMuxContext *mkv,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
mkv_write_blockadditional(&writer, t35_buf, payload_size + 5,
|
||||
mkv_write_blockadditional(&writer, smpte_2094_app5_buf, payload_size + 5,
|
||||
MATROSKA_BLOCK_ADD_ID_ITU_T_T35);
|
||||
track->max_blockaddid = FFMAX(track->max_blockaddid,
|
||||
MATROSKA_BLOCK_ADD_ID_ITU_T_T35);
|
||||
|
||||
Reference in New Issue
Block a user