mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-12 12:14:38 +00:00
avcodec/itut35: add support for AOM film graim
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -126,7 +126,7 @@ OBJS-$(CONFIG_HUFFYUVENCDSP) += huffyuvencdsp.o
|
||||
OBJS-$(CONFIG_IDCTDSP) += idctdsp.o simple_idct.o jrevdct.o
|
||||
OBJS-$(CONFIG_INFLATE_WRAPPER) += zlib_wrapper.o
|
||||
OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o msmpeg4_vc1_data.o
|
||||
OBJS-$(CONFIG_ITUT_T35) += itut35.o
|
||||
OBJS-$(CONFIG_ITUT_T35) += itut35.o aom_film_grain.o
|
||||
OBJS-$(CONFIG_IVIDSP) += ivi_dsp.o
|
||||
OBJS-$(CONFIG_JNI) += ffjni.o jni.o
|
||||
OBJS-$(CONFIG_JPEGTABLES) += jpegtables.o
|
||||
|
||||
@@ -68,6 +68,14 @@ int ff_itut_t35_parse_buffer(FFITUTT35 *const itut_t35, const uint8_t *buf,
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case ITU_T_T35_PROVIDER_CODE_AOM:
|
||||
if (bytestream2_get_bytes_left(&gb) < 1)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
provider_oriented_code = bytestream2_get_byteu(&gb);
|
||||
if (provider_oriented_code != 0x0001)
|
||||
return 0; // ignore
|
||||
break;
|
||||
case ITU_T_T35_PROVIDER_CODE_SAMSUNG:
|
||||
if (bytestream2_get_bytes_left(&gb) < 3)
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -135,6 +143,12 @@ int ff_itut_t35_parse_payload_to_struct(FFITUTT35 *const itut_t35, FFITUTT35Aux
|
||||
switch (itut_t35->country_code) {
|
||||
case ITU_T_T35_COUNTRY_CODE_US:
|
||||
switch (itut_t35->provider_code) {
|
||||
case ITU_T_T35_PROVIDER_CODE_AOM:
|
||||
ret = ff_aom_parse_film_grain_sets(&metadata->aom_film_grain,
|
||||
itut_t35->payload, itut_t35->payload_size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
break;
|
||||
case ITU_T_T35_PROVIDER_CODE_ATSC:
|
||||
switch (itut_t35->provider_oriented_code) {
|
||||
case MKBETAG('G', 'A', '9', '4'): // closed captions
|
||||
@@ -257,6 +271,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
}
|
||||
|
||||
if (metadata.aom_film_grain.enable) {
|
||||
ret = ff_aom_attach_film_grain_sets(&metadata.aom_film_grain, frame);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (metadata.hdr_plus) {
|
||||
ret = ff_frame_new_side_data_from_buf(avctx, frame, AV_FRAME_DATA_DYNAMIC_HDR_PLUS,
|
||||
&metadata.hdr_plus);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "libavutil/frame.h"
|
||||
#include "avcodec.h"
|
||||
#include "aom_film_grain.h"
|
||||
#include "dovi_rpu.h"
|
||||
|
||||
#define ITU_T_T35_COUNTRY_CODE_CN 0x26
|
||||
@@ -62,6 +63,7 @@ typedef struct FFITUTT35Meta {
|
||||
AVBufferRef *hdr_plus;
|
||||
AVBufferRef *hdr_smpte2094_app5;
|
||||
AVBufferRef *dovi;
|
||||
AVFilmGrainAFGS1Params aom_film_grain;
|
||||
} FFITUTT35Meta;
|
||||
|
||||
typedef struct FFITUTT35Aux {
|
||||
|
||||
Reference in New Issue
Block a user