Compare commits

...

18 Commits

Author SHA1 Message Date
Araz Iusubov d31983dc8e MAINTAINERS: Update the entries for AMF 2025-10-28 21:06:37 +00:00
Andreas Rheinhardt 0941646182 avcodec/fflcms2: Don't access inexistent array elements
This would happen if one of the extended transfer characteristics is in
use (currently only AVCOL_TRC_V_LOG).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-10-28 21:40:50 +01:00
Lynne e85947576c
ffv1enc_vulkan: limit probability caching to RADV only
Nvidia's drivers recently broke this.
2025-10-28 20:46:25 +01:00
Lynne bcfb4b2e3e prores_raw_parser: set color params based on vendor
Panasonic cameras record ProRes RAW in V-Log/V-Gamut internally.

Atomos is a brand of recorders which can record uncompressed
non-debayered RAW over HDMI.
All known cameras output linear RAW over HDMI, so mark the transfer function
as linear in that case.
2025-10-28 20:46:21 +01:00
Lynne 71c7b9156b lavu: bump minor and add APIchanges entry for V-Log/V-Gamut 2025-10-28 20:46:21 +01:00
Lynne 92a688cabd lavu: add support for Panasonic V-Gamut 2025-10-28 20:46:21 +01:00
Lynne aeb9b19ebc lavu: add support for Panasonic V-Log 2025-10-28 20:46:21 +01:00
James Almer 08c94518c9 avfilter/vsrc_testsrc: add support for YUV444P1{0,2}MSB to yuvtestsrc
Signed-off-by: James Almer <jamrial@gmail.com>
2025-10-28 19:16:58 +00:00
Baptiste Coudurier 1025beeef1 lavf/id3v2: allow empty strings without bom, fixes #20597 2025-10-28 10:59:25 -07:00
James Almer c7a2b31f84 avformat/demux: pass new extradata to the parser
The parser API doesn't work with packets, only raw data, so in order for it to
be made aware of new extradata propagated through packet side data we need to
pass it in some other form, namely, replacing the main extradata and ensuring
it will be parsed by restarting the parser.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-10-28 10:10:22 -03:00
James Almer 530ca627a3 avcodec/mlpdec: don't depend on context channel layout when setting substream masks
If avctx->ch_layout is unset (as it's allowed and even expeced by the
AV_CODEC_CAP_CHANNEL_CONF flag), the code setting substream masks will fail for
stereo and mono layouts unless a downmix channel was requested.
Fix this by deriving the mask with coded values only.

Fixes issue #20764.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-10-28 13:08:02 +00:00
xin.guo 0a4bd6cc23 avcodec/h264_vulkan: Fix param error in set_sps
Signed-off-by: xin.guo <xin.guo@sophgo.com>
2025-10-28 06:12:36 +00:00
averne 909d71322a vulkan/prores: output LSB-padded data
For consistency with existing Vulkan-based hwaccels
2025-10-28 06:12:14 +00:00
Lynne 70be2e2ae2
lavc/hwaccels: properly order list 2025-10-28 07:11:26 +01:00
Lynne 51843adfe5
vulkan/rangecoder: ifdef out encode and decode chunks
There's little code sharing between them.
2025-10-28 07:11:26 +01:00
Lynne 3cd678506c
vulkan_decode: align images to the subsampling
Normally, the Vulkan drivers handle this. But Vulkan decided "nah".

This requires API users to crop out odd-numbered images with subsampling.
2025-10-28 07:11:26 +01:00
Lynne 964e9cc63b
hwcontext_vulkan: add support for VK_EXT_zero_initialize_device_memory 2025-10-28 07:11:21 +01:00
caifan3 91512f0856 fftools/cmdutils: Rename file_read to read_file_to_string to avoid symbol collision with NuttX
The function name 'file_read' is too generic and conflicts with a function
of the same name in the NuttX kernel. Since NuttX links kernel and userspace
into a single binary, this causes a symbol collision when building FFmpeg tools.

Signed-off-by: caifan3 <caifan3@xiaomi.com>
2025-10-28 02:48:05 +00:00
77 changed files with 384 additions and 81 deletions

View File

@ -14,7 +14,7 @@ libavcodec/.*aac.* @lynne
libavcodec/.*ac3.* @lynne
libavcodec/.*adpcm.* @zane @pross
libavcodec/anm.* @pross
libavcodec/amf.* @OvchinnikovDmitrii
libavcodec/amf.* @OvchinnikovDmitrii @ArazIusubov
libavcodec/ansi.* @pross
libavcodec/aom_film_grain.* @haasn
libavcodec/.*atrac9.* @lynne
@ -92,7 +92,7 @@ libavcodec/x86/vpx.* @rbultje
# avfilter
# =======
libavfilter/af_whisper.* @vpalmisano
libavfilter/.*_amf* @OvchinnikovDmitrii
libavfilter/.*_amf* @OvchinnikovDmitrii @ArazIusubov
libavfilter/avfiltergraph.* @haasn
libavfilter/colorspace.* @rbultje
libavfilter/formats.* @haasn
@ -156,7 +156,7 @@ libavformat/wtv.* @pross
# avutil
# ======
libavutil/.*_amf* @OvchinnikovDmitrii
libavutil/.*_amf* @OvchinnikovDmitrii @ArazIusubov
libavutil/.*crc.* @lynne @michaelni
libavutil/.*d3d12va.* @jianhuaw @tong1wu
libavutil/csp.* @rbultje @haasn

View File

@ -152,7 +152,7 @@ Codecs:
adpcm.c Zane van Iperen
alacenc.c Jaikrishnan Menon
alsdec.c Thilo Borgmann, Umair Khan
amfdec*,amfenc* [2] Dmitrii Ovchinnikov
amfdec*,amfenc* [2] Dmitrii Ovchinnikov, Araz Iusubov
aptx.c Aurelien Jacobs
ass* Aurelien Jacobs
asv* Michael Niedermayer
@ -278,7 +278,7 @@ Codecs:
xface Stefano Sabatini
Hardware acceleration:
amf* [2] Dmitrii Ovchinnikov
amf* [2] Dmitrii Ovchinnikov, Araz Iusubov
dxva2* Hendrik Leppkes, Laurent Aimar, Steve Lhomme
d3d11va* Steve Lhomme
d3d12va* Wu Jianhua

View File

@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28
API changes, most recent first:
2025-10-xx - xxxxxxxxxx - lavu 60.16.100 - pixfmt.h
Add AVCOL_TRC_EXT_BASE and AVCOL_TRC_L_LOG.
2025-10-xx - xxxxxxxxxx - lavu 60.15.100 - pixfmt.h
Add AV_PIX_FMT_GRAY10MSB, AV_PIX_FMT_GRAY12MSB,
AV_PIX_FMT_YUV420P10MSB, AV_PIX_FMT_YUV420P12MSB,

View File

@ -263,7 +263,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
return AVERROR(EINVAL);
}
arg_allocated = file_read(arg);
arg_allocated = read_file_to_string(arg);
if (!arg_allocated) {
av_log(NULL, AV_LOG_FATAL,
"Error reading the value for option '%s' from file: %s\n",
@ -1498,7 +1498,7 @@ double get_rotation(const int32_t *displaymatrix)
}
/* read file contents into a string */
char *file_read(const char *filename)
char *read_file_to_string(const char *filename)
{
AVIOContext *pb = NULL;
int ret = avio_open(&pb, filename, AVIO_FLAG_READ);

View File

@ -535,7 +535,7 @@ void *allocate_array_elem(void *array, size_t elem_size, int *nb_elems);
double get_rotation(const int32_t *displaymatrix);
/* read file contents into a string */
char *file_read(const char *filename);
char *read_file_to_string(const char *filename);
/* Remove keys in dictionary b from dictionary a */
void remove_avoptions(AVDictionary **a, AVDictionary *b);

View File

@ -507,7 +507,7 @@ static int filter_opt_apply(void *logctx, AVFilterContext *f,
ret = av_opt_set_bin(f, key, data, len, AV_OPT_SEARCH_CHILDREN);
av_freep(&data);
} else {
char *data = file_read(val);
char *data = read_file_to_string(val);
if (!data) {
ret = AVERROR(EIO);
goto err_load;

View File

@ -453,7 +453,7 @@ static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc,
}
if (filters_script)
*dst = file_read(filters_script);
*dst = read_file_to_string(filters_script);
else
#endif
if (filters)
@ -732,7 +732,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o,
AV_OPT_SEARCH_CHILDREN);
} else {
if (video_enc->flags & AV_CODEC_FLAG_PASS2) {
char *logbuffer = file_read(logfilename);
char *logbuffer = read_file_to_string(logfilename);
if (!logbuffer) {
av_log(ost, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",

View File

@ -1189,7 +1189,7 @@ static int opt_filter_complex_script(void *optctx, const char *opt, const char *
char *graph_desc;
int ret;
graph_desc = file_read(arg);
graph_desc = read_file_to_string(arg);
if (!graph_desc)
return AVERROR(EINVAL);

View File

@ -50,10 +50,7 @@ void ff_icc_context_uninit(FFIccContext *s)
static int get_curve(FFIccContext *s, enum AVColorTransferCharacteristic trc,
cmsToneCurve **out_curve)
{
if (trc >= AVCOL_TRC_NB)
return AVERROR_INVALIDDATA;
if (s->curves[trc])
if ((unsigned)trc < AVCOL_TRC_NB && s->curves[trc])
goto done;
switch (trc) {
@ -128,6 +125,7 @@ static int get_curve(FFIccContext *s, enum AVColorTransferCharacteristic trc,
case AVCOL_TRC_BT1361_ECG:
case AVCOL_TRC_SMPTE2084:
case AVCOL_TRC_ARIB_STD_B67:
case AVCOL_TRC_V_LOG:
return AVERROR_PATCHWELCOME;
default:

View File

@ -1289,7 +1289,8 @@ static int init_encode_shader(AVCodecContext *avctx, FFVkSPIRVCompiler *spv)
uint8_t *spv_data;
size_t spv_len;
void *spv_opaque = NULL;
int use_cached_reader = fv->ctx.ac != AC_GOLOMB_RICE;
int use_cached_reader = fv->ctx.ac != AC_GOLOMB_RICE &&
fv->s.driver_props.driverID == VK_DRIVER_ID_MESA_RADV;
RET(ff_vk_shader_init(&fv->s, shd, "ffv1_enc",
VK_SHADER_STAGE_COMPUTE_BIT,

View File

@ -67,8 +67,8 @@ extern const struct FFHWAccel ff_mpeg4_vaapi_hwaccel;
extern const struct FFHWAccel ff_mpeg4_vdpau_hwaccel;
extern const struct FFHWAccel ff_mpeg4_videotoolbox_hwaccel;
extern const struct FFHWAccel ff_prores_videotoolbox_hwaccel;
extern const struct FFHWAccel ff_prores_raw_vulkan_hwaccel;
extern const struct FFHWAccel ff_prores_vulkan_hwaccel;
extern const struct FFHWAccel ff_prores_raw_vulkan_hwaccel;
extern const struct FFHWAccel ff_vc1_d3d11va_hwaccel;
extern const struct FFHWAccel ff_vc1_d3d11va2_hwaccel;
extern const struct FFHWAccel ff_vc1_d3d12va_hwaccel;

View File

@ -319,8 +319,10 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx)
av_channel_layout_uninit(&avctx->ch_layout);
avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1;
}
else
else {
av_log(avctx, AV_LOG_WARNING, "Invalid downmix layout\n");
av_channel_layout_uninit(&m->downmix_layout);
}
}
ff_thread_once(&init_static_once, init_static);
@ -453,26 +455,22 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
}
m->substream[1].mask = mh.channel_layout_thd_stream1;
if (mh.channels_thd_stream1 == 2 &&
mh.channels_thd_stream2 == 2 &&
m->avctx->ch_layout.nb_channels == 2)
mh.channels_thd_stream2 == 2)
m->substream[0].mask = AV_CH_LAYOUT_STEREO;
if ((substr = (mh.num_substreams > 1)))
m->substream[0].mask = AV_CH_LAYOUT_STEREO;
if (mh.num_substreams == 1 &&
mh.channels_thd_stream1 == 1 &&
mh.channels_thd_stream2 == 1 &&
m->avctx->ch_layout.nb_channels == 1)
mh.channels_thd_stream2 == 1)
m->substream[0].mask = AV_CH_LAYOUT_MONO;
if (mh.num_substreams > 2)
if (mh.channel_layout_thd_stream2)
m->substream[2].mask = mh.channel_layout_thd_stream2;
else
m->substream[2].mask = mh.channel_layout_thd_stream1;
if (m->avctx->ch_layout.nb_channels > 2)
if (mh.num_substreams > 2)
m->substream[1].mask = mh.channel_layout_thd_stream1;
else
m->substream[mh.num_substreams > 1].mask = mh.channel_layout_thd_stream2;
if (mh.num_substreams == 2 && (!m->downmix_layout.nb_channels ||
m->downmix_layout.nb_channels > 2))
m->substream[1].mask = mh.channel_layout_thd_stream2;
}
m->needs_reordering = mh.channel_arrangement >= 18 && mh.channel_arrangement <= 20;

View File

@ -61,7 +61,23 @@ static int prores_raw_parse(AVCodecParserContext *s, AVCodecContext *avctx,
}
/* Vendor header (e.g. "peac" for Panasonic or "atm0" for Atmos) */
bytestream2_skip(&gb, 4);
switch (bytestream2_get_be32(&gb)) {
case MKBETAG('p','e','a','c'):
/* Internal recording from a Panasonic camera, V-Log */
avctx->color_primaries = AVCOL_PRI_V_GAMUT;
avctx->color_trc = AVCOL_TRC_V_LOG;
break;
case MKBETAG('a','t','m','0'):
/* External recording from an Atomos recorder. Cameras universally
* record in their own native log curve internally, but linearize it
* when outputting RAW externally */
avctx->color_primaries = AVCOL_PRI_UNSPECIFIED;
avctx->color_trc = AVCOL_TRC_LINEAR;
break;
default:
avctx->color_trc = AVCOL_TRC_UNSPECIFIED;
break;
};
s->width = bytestream2_get_be16(&gb);
s->height = bytestream2_get_be16(&gb);

View File

@ -110,14 +110,14 @@ void main(void)
idct(block, idx, 9);
float fact = 1.0f / (1 << (12 - depth)), off = 1 << (depth - 1);
int maxv = (1 << depth) - 1;
int maxv = (1 << depth) - 1, shift = 16 - depth;
/* 7.5.1 Color Component Samples. Rescale, clamp and write back to global memory */
barrier();
if (act) {
[[unroll]] for (uint i = 0; i < 8; ++i) {
float v = blocks[block][i * 9 + idx] * fact + off;
put_px(comp, ivec2(gid.x, (gid.y << 3) | i), clamp(int(v), 0, maxv));
put_px(comp, ivec2(gid.x, (gid.y << 3) | i), clamp(int(v), 0, maxv) << shift);
}
}
}

View File

@ -31,6 +31,19 @@ struct RangeCoder {
uint8_t outstanding_byte;
};
void rac_init(out RangeCoder r, u8buf data, uint buf_size)
{
r.bytestream_start = uint64_t(data);
r.bytestream = uint64_t(data);
r.bytestream_end = uint64_t(data) + buf_size;
r.low = 0;
r.range = 0xFF00;
r.outstanding_count = uint16_t(0);
r.outstanding_byte = uint8_t(0xFF);
}
#if !defined(DECODE)
#ifdef FULL_RENORM
/* Full renorm version that can handle outstanding_byte == 0xFF */
void renorm_encoder(inout RangeCoder c)
@ -165,16 +178,7 @@ uint32_t rac_terminate(inout RangeCoder c)
return uint32_t(uint64_t(c.bytestream) - uint64_t(c.bytestream_start));
}
void rac_init(out RangeCoder r, u8buf data, uint buf_size)
{
r.bytestream_start = uint64_t(data);
r.bytestream = uint64_t(data);
r.bytestream_end = uint64_t(data) + buf_size;
r.low = 0;
r.range = 0xFF00;
r.outstanding_count = uint16_t(0);
r.outstanding_byte = uint8_t(0xFF);
}
#else
/* Decoder */
uint overread = 0;
@ -239,3 +243,5 @@ bool get_rac_equi(inout RangeCoder c)
{
return get_rac_internal(c, c.range >> 1);
}
#endif

View File

@ -1140,8 +1140,9 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
}
}
frames_ctx->width = avctx->coded_width;
frames_ctx->height = avctx->coded_height;
const AVPixFmtDescriptor *pdesc = av_pix_fmt_desc_get(frames_ctx->sw_format);
frames_ctx->width = FFALIGN(avctx->coded_width, 1 << pdesc->log2_chroma_w);
frames_ctx->height = FFALIGN(avctx->coded_height, 1 << pdesc->log2_chroma_h);
frames_ctx->format = AV_PIX_FMT_VULKAN;
hwfc->format[0] = vkfmt;
@ -1348,8 +1349,8 @@ int ff_vk_decode_init(AVCodecContext *avctx)
dpb_frames = (AVHWFramesContext *)ctx->common.dpb_hwfc_ref->data;
dpb_frames->format = s->frames->format;
dpb_frames->sw_format = s->frames->sw_format;
dpb_frames->width = avctx->coded_width;
dpb_frames->height = avctx->coded_height;
dpb_frames->width = s->frames->width;
dpb_frames->height = s->frames->height;
dpb_hwfc = dpb_frames->hwctx;
dpb_hwfc->create_pnext = (void *)ff_vk_find_struct(ctx->s.hwfc->create_pnext,

View File

@ -195,7 +195,7 @@ static void set_sps(const SPS *sps,
.video_signal_type_present_flag = sps->vui.video_signal_type_present_flag,
.video_full_range_flag = sps->vui.video_full_range_flag,
.color_description_present_flag = sps->vui.colour_description_present_flag,
.chroma_loc_info_present_flag = sps->vui.chroma_location,
.chroma_loc_info_present_flag = sps->vui.chroma_loc_info_present_flag,
.timing_info_present_flag = sps->timing_info_present_flag,
.fixed_frame_rate_flag = sps->fixed_frame_rate_flag,
.bitstream_restriction_flag = sps->bitstream_restriction_flag,

View File

@ -1665,6 +1665,7 @@ static const AVOption libplacebo_options[] = {
{"smpte432", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_SMPTE432}, INT_MIN, INT_MAX, STATIC, .unit = "color_primaries"},
{"jedec-p22", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_JEDEC_P22}, INT_MIN, INT_MAX, STATIC, .unit = "color_primaries"},
{"ebu3213", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_EBU3213}, INT_MIN, INT_MAX, STATIC, .unit = "color_primaries"},
{"vgamut", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_V_GAMUT}, INT_MIN, INT_MAX, STATIC, .unit = "color_primaries"},
{"color_trc", "select color transfer", OFFSET(color_trc), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_TRC_NB-1, DYNAMIC, .unit = "color_trc"},
{"auto", "keep the same color transfer", 0, AV_OPT_TYPE_CONST, {.i64=-1}, INT_MIN, INT_MAX, STATIC, .unit = "color_trc"},
@ -1682,6 +1683,7 @@ static const AVOption libplacebo_options[] = {
{"bt2020-12", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_BT2020_12}, INT_MIN, INT_MAX, STATIC, .unit = "color_trc"},
{"smpte2084", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_SMPTE2084}, INT_MIN, INT_MAX, STATIC, .unit = "color_trc"},
{"arib-std-b67", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_ARIB_STD_B67}, INT_MIN, INT_MAX, STATIC, .unit = "color_trc"},
{"vlog", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_V_LOG}, INT_MIN, INT_MAX, STATIC, .unit = "color_trc"},
{"rotate", "rotate the input clockwise", OFFSET(rotation), AV_OPT_TYPE_INT, {.i64=PL_ROTATION_0}, PL_ROTATION_0, PL_ROTATION_360, DYNAMIC, .unit = "rotation"},
{"0", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PL_ROTATION_0}, .flags = STATIC, .unit = "rotation"},

View File

@ -66,7 +66,7 @@ static const AVOption setparams_options[] = {
{"pc", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_RANGE_JPEG}, 0, 0, FLAGS, .unit = "range"},
{"jpeg", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_RANGE_JPEG}, 0, 0, FLAGS, .unit = "range"},
{"color_primaries", "select color primaries", OFFSET(color_primaries), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_PRI_NB-1, FLAGS, .unit = "color_primaries"},
{"color_primaries", "select color primaries", OFFSET(color_primaries), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_PRI_EXT_NB-1, FLAGS, .unit = "color_primaries"},
{"auto", "keep the same color primaries", 0, AV_OPT_TYPE_CONST, {.i64=-1}, 0, 0, FLAGS, .unit = "color_primaries"},
{"bt709", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_BT709}, 0, 0, FLAGS, .unit = "color_primaries"},
{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_UNSPECIFIED}, 0, 0, FLAGS, .unit = "color_primaries"},
@ -81,8 +81,9 @@ static const AVOption setparams_options[] = {
{"smpte432", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_SMPTE432}, 0, 0, FLAGS, .unit = "color_primaries"},
{"jedec-p22", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_JEDEC_P22}, 0, 0, FLAGS, .unit = "color_primaries"},
{"ebu3213", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_EBU3213}, 0, 0, FLAGS, .unit = "color_primaries"},
{"vgamut", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_V_GAMUT}, 0, 0, FLAGS, .unit = "color_primaries"},
{"color_trc", "select color transfer", OFFSET(color_trc), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_TRC_NB-1, FLAGS, .unit = "color_trc"},
{"color_trc", "select color transfer", OFFSET(color_trc), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_TRC_EXT_NB-1, FLAGS, .unit = "color_trc"},
{"auto", "keep the same color transfer", 0, AV_OPT_TYPE_CONST, {.i64=-1}, 0, 0, FLAGS, .unit = "color_trc"},
{"bt709", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_BT709}, 0, 0, FLAGS, .unit = "color_trc"},
{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_UNSPECIFIED}, 0, 0, FLAGS, .unit = "color_trc"},
@ -101,6 +102,7 @@ static const AVOption setparams_options[] = {
{"smpte2084", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_SMPTE2084}, 0, 0, FLAGS, .unit = "color_trc"},
{"smpte428", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_SMPTE428}, 0, 0, FLAGS, .unit = "color_trc"},
{"arib-std-b67", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_ARIB_STD_B67}, 0, 0, FLAGS, .unit = "color_trc"},
{"vlog", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_V_LOG}, 0, 0, FLAGS, .unit = "color_trc"},
{"colorspace", "select colorspace", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_SPC_NB-1, FLAGS, .unit = "colorspace"},
{"auto", "keep the same colorspace", 0, AV_OPT_TYPE_CONST, {.i64=-1}, 0, 0, FLAGS, .unit = "colorspace"},

View File

@ -1254,6 +1254,12 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
AV_WN16A(&dstp[1][i*2 + j*dst_linesizep[1]], u);
AV_WN16A(&dstp[2][i*2 + j*dst_linesizep[2]], v);
break;
case AV_PIX_FMT_YUV444P10MSB:
case AV_PIX_FMT_YUV444P12MSB:
AV_WN16A(&dstp[0][i*2 + j*dst_linesizep[0]], y << desc->comp[0].shift);
AV_WN16A(&dstp[1][i*2 + j*dst_linesizep[1]], u << desc->comp[1].shift);
AV_WN16A(&dstp[2][i*2 + j*dst_linesizep[2]], v << desc->comp[2].shift);
break;
case AV_PIX_FMT_NV24:
dstp[0][i + j*dst_linesizep[0] + 0] = y;
dstp[1][i*2 + j*dst_linesizep[1] + 0] = u;
@ -1313,6 +1319,7 @@ static const enum AVPixelFormat yuvtest_pix_fmts[] = {
AV_PIX_FMT_YUV444P16, AV_PIX_FMT_VYU444,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA444P9,
AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_YUVA444P16,
AV_PIX_FMT_YUV444P10MSB, AV_PIX_FMT_YUV444P12MSB,
AV_PIX_FMT_AYUV, AV_PIX_FMT_UYVA, AV_PIX_FMT_AYUV64,
AV_PIX_FMT_VUYA, AV_PIX_FMT_VUYX, AV_PIX_FMT_XV48,
AV_PIX_FMT_XV30LE, AV_PIX_FMT_V30XLE, AV_PIX_FMT_XV36,

View File

@ -1167,7 +1167,10 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
AVPacket *out_pkt = si->parse_pkt;
AVStream *st = s->streams[stream_index];
FFStream *const sti = ffstream(st);
const AVPacketSideData *sd = NULL;
const uint8_t *data = pkt->data;
uint8_t *extradata = sti->avctx->extradata;
int extradata_size = sti->avctx->extradata_size;
int size = pkt->size;
int ret = 0, got_output = flush;
@ -1184,6 +1187,16 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
}
}
if (pkt->side_data_elems)
sd = av_packet_side_data_get(pkt->side_data, pkt->side_data_elems,
AV_PKT_DATA_NEW_EXTRADATA);
if (sd) {
av_assert1(size && !flush);
sti->avctx->extradata = sd->data;
sti->avctx->extradata_size = sd->size;
}
while (size > 0 || (flush && got_output)) {
int64_t next_pts = pkt->pts;
int64_t next_dts = pkt->dts;
@ -1277,6 +1290,11 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
}
fail:
if (sd) {
sti->avctx->extradata = extradata;
sti->avctx->extradata_size = extradata_size;
}
if (ret < 0)
av_packet_unref(out_pkt);
av_packet_unref(pkt);
@ -1370,6 +1388,11 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
st->event_flags |= AVSTREAM_EVENT_FLAG_NEW_PACKETS;
int new_extradata = !!av_packet_side_data_get(pkt->side_data, pkt->side_data_elems,
AV_PKT_DATA_NEW_EXTRADATA);
if (new_extradata)
sti->need_context_update = 1;
/* update context if required */
if (sti->need_context_update) {
if (avcodec_is_open(sti->avctx)) {
@ -1380,8 +1403,9 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
return ret;
}
/* close parser, because it depends on the codec */
if (sti->parser && sti->avctx->codec_id != st->codecpar->codec_id) {
/* close parser, because it depends on the codec and extradata */
if (sti->parser &&
(sti->avctx->codec_id != st->codecpar->codec_id || new_extradata)) {
av_parser_close(sti->parser);
sti->parser = NULL;
}

View File

@ -268,7 +268,7 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
case ID3v2_ENCODING_UTF16BOM:
if ((left -= 2) < 0) {
av_log(s, AV_LOG_ERROR, "Cannot read BOM value, input too short\n");
av_log(s, AV_LOG_ERROR, "Cannot read BOM value, input too short %d\n", left);
ffio_free_dyn_buf(&dynbuf);
*dst = NULL;
return AVERROR_INVALIDDATA;
@ -279,6 +279,11 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
get = avio_rl16;
case 0xfeff:
break;
case 0: // empty string without bom
ffio_free_dyn_buf(&dynbuf);
*dst = NULL;
*maxread = left;
return 0;
default:
av_log(s, AV_LOG_ERROR, "Incorrect BOM value: 0x%x\n", bom);
ffio_free_dyn_buf(&dynbuf);

View File

@ -87,16 +87,21 @@ static const AVColorPrimariesDesc color_primaries[AVCOL_PRI_NB] = {
[AVCOL_PRI_JEDEC_P22] = { WP_D65, { { AVR(0.630), AVR(0.340) }, { AVR(0.295), AVR(0.605) }, { AVR(0.155), AVR(0.077) } } },
};
static const AVColorPrimariesDesc color_primaries_ext[AVCOL_PRI_EXT_NB -
AVCOL_PRI_EXT_BASE] = {
[AVCOL_PRI_V_GAMUT - AVCOL_PRI_EXT_BASE] = { WP_D65, { { AVR(0.730), AVR(0.280) }, { AVR(0.165), AVR(0.840) }, { AVR(0.100), AVR(-0.030) } } },
};
const AVColorPrimariesDesc *av_csp_primaries_desc_from_id(enum AVColorPrimaries prm)
{
const AVColorPrimariesDesc *p;
if ((unsigned)prm >= AVCOL_PRI_NB)
return NULL;
p = &color_primaries[prm];
const AVColorPrimariesDesc *p = NULL;
if ((unsigned)prm < AVCOL_PRI_NB)
p = &color_primaries[prm];
else if (((unsigned)prm >= AVCOL_PRI_EXT_BASE) &&
((unsigned)prm < AVCOL_PRI_EXT_NB))
p = &color_primaries_ext[prm - AVCOL_PRI_EXT_BASE];
if (!p->prim.r.x.num)
return NULL;
return p;
}
@ -146,14 +151,17 @@ static const double approximate_gamma[AVCOL_TRC_NB] = {
[AVCOL_TRC_SMPTE428] = 2.6,
};
static const double approximate_gamma_ext[AVCOL_TRC_EXT_NB -
AVCOL_TRC_EXT_BASE] = {
[AVCOL_TRC_V_LOG - AVCOL_TRC_EXT_BASE] = 2.2,
};
double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc)
{
double gamma;
if ((unsigned)trc >= AVCOL_TRC_NB)
return 0.0;
gamma = approximate_gamma[trc];
if (gamma > 0)
return gamma;
if (trc < AVCOL_TRC_NB)
return approximate_gamma[trc];
else if ((trc >= AVCOL_TRC_EXT_BASE) && (trc < AVCOL_TRC_EXT_NB))
return approximate_gamma_ext[trc - AVCOL_TRC_EXT_BASE];
return 0.0;
}
@ -171,11 +179,19 @@ static const double approximate_eotf_gamma[AVCOL_TRC_NB] = {
[AVCOL_TRC_SMPTE428] = 2.6,
};
static const double approximate_eotf_gamma_ext[AVCOL_TRC_EXT_NB -
AVCOL_TRC_EXT_BASE] = {
[AVCOL_TRC_V_LOG - AVCOL_TRC_EXT_BASE] = 2.2,
};
double av_csp_approximate_eotf_gamma(enum AVColorTransferCharacteristic trc)
{
if ((unsigned)trc >= AVCOL_TRC_NB)
return 0.0;
return approximate_eotf_gamma[trc];
if ((unsigned)trc < AVCOL_TRC_NB)
return approximate_eotf_gamma[trc];
else if (((unsigned)trc >= AVCOL_TRC_EXT_BASE) &&
((unsigned)trc < AVCOL_TRC_EXT_NB))
return approximate_eotf_gamma_ext[trc - AVCOL_TRC_EXT_BASE];
return 0.0;
}
#define BT709_alpha 1.099296826809442
@ -399,6 +415,32 @@ static double trc_arib_std_b67_inv(double E)
(E <= 0.5 ? E * E / 3.0 : (exp((E - c) / a) + b) / 12.0);
}
#define VLOG_c1 0.01
#define VLOG_c2 0.181
#define VLOG_b 0.00873
#define VLOG_c 0.241514
#define VLOG_d 0.598206
static double trc_v_log(double E)
{
const double c1 = VLOG_c1;
const double b = VLOG_b;
const double c = VLOG_c;
const double d = VLOG_d;
return (E < c1) ? (5.6 * E + 0.125) :
(c * log10(E + b) + d);
}
static double trc_v_log_inv(double E)
{
const double c2 = VLOG_c2;
const double b = VLOG_b;
const double c = VLOG_c;
const double d = VLOG_d;
return (E < c2) ? (E - 0.125) / 5.6 :
(pow(10.0, ((E - d) / c)) - b);
}
static const av_csp_trc_function trc_funcs[AVCOL_TRC_NB] = {
[AVCOL_TRC_BT709] = trc_bt709,
[AVCOL_TRC_GAMMA22] = trc_gamma22,
@ -418,11 +460,19 @@ static const av_csp_trc_function trc_funcs[AVCOL_TRC_NB] = {
[AVCOL_TRC_ARIB_STD_B67] = trc_arib_std_b67,
};
static const av_csp_trc_function trc_funcs_ext[AVCOL_TRC_EXT_NB -
AVCOL_TRC_EXT_BASE] = {
[AVCOL_TRC_V_LOG - AVCOL_TRC_EXT_BASE] = trc_v_log,
};
av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic trc)
{
if ((unsigned)trc >= AVCOL_TRC_NB)
return NULL;
return trc_funcs[trc];
if ((unsigned)trc < AVCOL_TRC_NB)
return trc_funcs[trc];
else if (((unsigned)trc >= AVCOL_TRC_EXT_BASE) &&
((unsigned)trc < AVCOL_TRC_EXT_NB))
return trc_funcs_ext[trc - AVCOL_TRC_EXT_BASE];
return NULL;
}
static const av_csp_trc_function trc_inv_funcs[AVCOL_TRC_NB] = {
@ -444,11 +494,19 @@ static const av_csp_trc_function trc_inv_funcs[AVCOL_TRC_NB] = {
[AVCOL_TRC_ARIB_STD_B67] = trc_arib_std_b67_inv,
};
static const av_csp_trc_function trc_inv_funcs_ext[AVCOL_TRC_EXT_NB -
AVCOL_TRC_EXT_BASE] = {
[AVCOL_TRC_V_LOG - AVCOL_TRC_EXT_BASE] = trc_v_log_inv,
};
av_csp_trc_function av_csp_trc_func_inv_from_id(enum AVColorTransferCharacteristic trc)
{
if ((unsigned)trc >= AVCOL_TRC_NB)
return NULL;
return trc_inv_funcs[trc];
if ((unsigned)trc < AVCOL_TRC_NB)
return trc_inv_funcs[trc];
else if (((unsigned)trc >= AVCOL_TRC_EXT_BASE) &&
((unsigned)trc < AVCOL_TRC_EXT_NB))
return trc_inv_funcs_ext[trc - AVCOL_TRC_EXT_BASE];
return NULL;
}
static void eotf_linear(const double Lw, const double Lb, double E[3])

View File

@ -82,6 +82,10 @@ typedef struct VulkanDeviceFeatures {
VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR subgroup_rotate;
VkPhysicalDeviceHostImageCopyFeaturesEXT host_image_copy;
#ifdef VK_EXT_zero_initialize_device_memory
VkPhysicalDeviceZeroInitializeDeviceMemoryFeaturesEXT zero_initialize;
#endif
#ifdef VK_KHR_shader_expect_assume
VkPhysicalDeviceShaderExpectAssumeFeaturesKHR expect_assume;
#endif
@ -225,6 +229,11 @@ static void device_features_init(AVHWDeviceContext *ctx, VulkanDeviceFeatures *f
FF_VK_STRUCT_EXT(s, &feats->device, &feats->host_image_copy, FF_VK_EXT_HOST_IMAGE_COPY,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT);
#ifdef VK_EXT_zero_initialize_device_memory
FF_VK_STRUCT_EXT(s, &feats->device, &feats->zero_initialize, FF_VK_EXT_ZERO_INITIALIZE,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_DEVICE_MEMORY_FEATURES_EXT);
#endif
#ifdef VK_KHR_shader_expect_assume
FF_VK_STRUCT_EXT(s, &feats->device, &feats->expect_assume, FF_VK_EXT_EXPECT_ASSUME,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES_KHR);
@ -311,6 +320,10 @@ static void device_features_copy_needed(VulkanDeviceFeatures *dst, VulkanDeviceF
COPY_VAL(subgroup_rotate.shaderSubgroupRotate);
COPY_VAL(host_image_copy.hostImageCopy);
#ifdef VK_EXT_zero_initialize_device_memory
COPY_VAL(zero_initialize.zeroInitializeDeviceMemory);
#endif
COPY_VAL(video_maintenance_1.videoMaintenance1);
#ifdef VK_KHR_video_maintenance2
COPY_VAL(video_maintenance_2.videoMaintenance2);
@ -635,6 +648,9 @@ static const VulkanOptExtension optional_device_exts[] = {
{ VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME, FF_VK_EXT_COOP_MATRIX },
{ VK_EXT_SHADER_OBJECT_EXTENSION_NAME, FF_VK_EXT_SHADER_OBJECT },
{ VK_KHR_SHADER_SUBGROUP_ROTATE_EXTENSION_NAME, FF_VK_EXT_SUBGROUP_ROTATE },
#ifdef VK_EXT_zero_initialize_device_memory
{ VK_EXT_ZERO_INITIALIZE_DEVICE_MEMORY_EXTENSION_NAME, FF_VK_EXT_ZERO_INITIALIZE },
#endif
#ifdef VK_KHR_shader_expect_assume
{ VK_KHR_SHADER_EXPECT_ASSUME_EXTENSION_NAME, FF_VK_EXT_EXPECT_ASSUME },
#endif

View File

@ -3430,6 +3430,11 @@ static const char * const color_primaries_names[AVCOL_PRI_NB] = {
[AVCOL_PRI_EBU3213] = "ebu3213",
};
static const char * const color_primaries_names_ext[AVCOL_PRI_EXT_NB -
AVCOL_PRI_EXT_BASE] = {
[AVCOL_PRI_V_GAMUT - AVCOL_PRI_EXT_BASE] = "vgamut",
};
static const char * const color_transfer_names[] = {
[AVCOL_TRC_RESERVED0] = "reserved",
[AVCOL_TRC_BT709] = "bt709",
@ -3452,6 +3457,10 @@ static const char * const color_transfer_names[] = {
[AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
};
static const char * const color_transfer_names_ext[] = {
[AVCOL_TRC_V_LOG - AVCOL_TRC_EXT_BASE] = "vlog",
};
static const char * const color_space_names[] = {
[AVCOL_SPC_RGB] = "gbr",
[AVCOL_SPC_BT709] = "bt709",
@ -3918,8 +3927,12 @@ int av_color_range_from_name(const char *name)
const char *av_color_primaries_name(enum AVColorPrimaries primaries)
{
return (unsigned) primaries < AVCOL_PRI_NB ?
color_primaries_names[primaries] : NULL;
if ((unsigned)primaries < AVCOL_PRI_NB)
return color_primaries_names[primaries];
else if (((unsigned)primaries >= AVCOL_PRI_EXT_BASE) &&
((unsigned)primaries < AVCOL_PRI_EXT_NB))
return color_primaries_names_ext[primaries - AVCOL_TRC_EXT_BASE];
return NULL;
}
int av_color_primaries_from_name(const char *name)
@ -3934,13 +3947,25 @@ int av_color_primaries_from_name(const char *name)
return i;
}
for (i = 0; i < FF_ARRAY_ELEMS(color_primaries_names_ext); i++) {
if (!color_primaries_names_ext[i])
continue;
if (av_strstart(name, color_primaries_names_ext[i], NULL))
return AVCOL_PRI_EXT_BASE + i;
}
return AVERROR(EINVAL);
}
const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
{
return (unsigned) transfer < AVCOL_TRC_NB ?
color_transfer_names[transfer] : NULL;
if ((unsigned)transfer < AVCOL_TRC_NB)
return color_transfer_names[transfer];
else if (((unsigned)transfer >= AVCOL_TRC_EXT_BASE) &&
((unsigned)transfer < AVCOL_TRC_EXT_NB))
return color_transfer_names_ext[transfer - AVCOL_TRC_EXT_BASE];
return NULL;
}
int av_color_transfer_from_name(const char *name)
@ -3955,6 +3980,14 @@ int av_color_transfer_from_name(const char *name)
return i;
}
for (i = 0; i < FF_ARRAY_ELEMS(color_transfer_names_ext); i++) {
if (!color_transfer_names_ext[i])
continue;
if (av_strstart(name, color_transfer_names_ext[i], NULL))
return AVCOL_TRC_EXT_BASE + i;
}
return AVERROR(EINVAL);
}

View File

@ -670,7 +670,12 @@ enum AVColorPrimaries {
AVCOL_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3
AVCOL_PRI_EBU3213 = 22, ///< EBU Tech. 3213-E (nothing there) / one of JEDEC P22 group phosphors
AVCOL_PRI_JEDEC_P22 = AVCOL_PRI_EBU3213,
AVCOL_PRI_NB ///< Not part of ABI
AVCOL_PRI_NB, ///< Not part of ABI
/* The following entries are not part of H.273, but custom extensions */
AVCOL_PRI_EXT_BASE = 256,
AVCOL_PRI_V_GAMUT = AVCOL_PRI_EXT_BASE,
AVCOL_PRI_EXT_NB ///< Not part of ABI
};
/**
@ -699,7 +704,12 @@ enum AVColorTransferCharacteristic {
AVCOL_TRC_SMPTE428 = 17, ///< SMPTE ST 428-1
AVCOL_TRC_SMPTEST428_1 = AVCOL_TRC_SMPTE428,
AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma"
AVCOL_TRC_NB ///< Not part of ABI
AVCOL_TRC_NB, ///< Not part of ABI
/* The following entries are not part of H.273, but custom extensions */
AVCOL_TRC_EXT_BASE = 256,
AVCOL_TRC_V_LOG = AVCOL_TRC_EXT_BASE,
AVCOL_TRC_EXT_NB ///< Not part of ABI
};
/**

View File

@ -57,7 +57,10 @@ int main(int argc, char *argv[])
15123.4567, 19845.88923, 98678.4231, 99999.899998
};
for (enum AVColorTransferCharacteristic trc = 0; trc < AVCOL_TRC_NB; trc++) {
for (enum AVColorTransferCharacteristic trc = 0; trc < AVCOL_TRC_EXT_NB; trc++) {
if (trc == AVCOL_TRC_NB)
trc = AVCOL_TRC_EXT_BASE;
av_csp_trc_function func = av_csp_trc_func_from_id(trc);
av_csp_trc_function func_inv = av_csp_trc_func_inv_from_id(trc);
const char *name = av_color_transfer_name(trc);
@ -77,7 +80,10 @@ int main(int argc, char *argv[])
}
}
for (enum AVColorTransferCharacteristic trc = 0; trc < AVCOL_TRC_NB; trc++) {
for (enum AVColorTransferCharacteristic trc = 0; trc < AVCOL_TRC_EXT_NB; trc++) {
if (trc == AVCOL_TRC_NB)
trc = AVCOL_TRC_EXT_BASE;
av_csp_eotf_function eotf = av_csp_itu_eotf(trc);
av_csp_eotf_function eotf_inv = av_csp_itu_eotf_inv(trc);
const char *trc_name = av_color_transfer_name(trc);

View File

@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 60
#define LIBAVUTIL_VERSION_MINOR 15
#define LIBAVUTIL_VERSION_MINOR 16
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

View File

@ -50,6 +50,7 @@ typedef uint64_t FFVulkanExtensions;
#define FF_VK_EXT_EXPECT_ASSUME (1ULL << 16) /* VK_KHR_shader_expect_assume */
#define FF_VK_EXT_SUBGROUP_ROTATE (1ULL << 17) /* VK_KHR_shader_subgroup_rotate */
#define FF_VK_EXT_HOST_IMAGE_COPY (1ULL << 18) /* VK_EXT_host_image_copy */
#define FF_VK_EXT_ZERO_INITIALIZE (1ULL << 19) /* VK_EXT_zero_initialize_device_memory */
/* Video extensions */
#define FF_VK_EXT_VIDEO_QUEUE (1ULL << 36) /* VK_KHR_video_queue */

View File

@ -60,6 +60,9 @@ static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions,
{ VK_EXT_SHADER_OBJECT_EXTENSION_NAME, FF_VK_EXT_SHADER_OBJECT },
{ VK_KHR_SHADER_SUBGROUP_ROTATE_EXTENSION_NAME, FF_VK_EXT_SUBGROUP_ROTATE },
{ VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME, FF_VK_EXT_HOST_IMAGE_COPY },
#ifdef VK_EXT_zero_initialize_device_memory
{ VK_EXT_ZERO_INITIALIZE_DEVICE_MEMORY_EXTENSION_NAME, FF_VK_EXT_ZERO_INITIALIZE },
#endif
{ VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME, FF_VK_EXT_VIDEO_MAINTENANCE_1 },
#ifdef VK_KHR_video_maintenance2
{ VK_KHR_VIDEO_MAINTENANCE_2_EXTENSION_NAME, FF_VK_EXT_VIDEO_MAINTENANCE_2 },

View File

@ -1295,9 +1295,11 @@ static AVRational *generate_bayer_matrix(const int size_log2)
static bool trc_is_hdr(enum AVColorTransferCharacteristic trc)
{
static_assert(AVCOL_TRC_NB == 19, "Update this list when adding TRCs");
static_assert(AVCOL_TRC_EXT_NB == 257, "Update this list when adding TRCs");
switch (trc) {
case AVCOL_TRC_LOG:
case AVCOL_TRC_LOG_SQRT:
case AVCOL_TRC_V_LOG:
case AVCOL_TRC_SMPTEST2084:
case AVCOL_TRC_ARIB_STD_B67:
return true;

View File

@ -66,6 +66,8 @@ PIXFMT_EXT_LIST = $(PIXFMT_8_LIST) \
yuv440p10be \
yuv444p10le \
yuv444p10be \
yuv444p10msble \
yuv444p10msbbe \
y210le \
p010le \
p010be \
@ -89,6 +91,8 @@ PIXFMT_EXT_LIST = $(PIXFMT_8_LIST) \
yuv440p12be \
yuv444p12le \
yuv444p12be \
yuv444p12msble \
yuv444p12msbbe \
y212le \
p012le \
p012be \

View File

@ -302,6 +302,25 @@ trc=arib-std-b67 calling func(15123.456700) expected=2.725380 roundtrip=15123.45
trc=arib-std-b67 calling func(19845.889230) expected=2.773978 roundtrip=19845.889230
trc=arib-std-b67 calling func(98678.423100) expected=3.060803 roundtrip=98678.423100
trc=arib-std-b67 calling func(99999.899998) expected=3.063182 roundtrip=99999.899998
trc=vlog calling func(-0.100000) expected=-0.435000 roundtrip=-0.100000
trc=vlog calling func(-0.018054) expected=0.023898 roundtrip=-0.018054
trc=vlog calling func(-0.010000) expected=0.069000 roundtrip=-0.010000
trc=vlog calling func(-0.004490) expected=0.099856 roundtrip=-0.004490
trc=vlog calling func(0.000000) expected=0.125000 roundtrip=0.000000
trc=vlog calling func(0.003162) expected=0.142709 roundtrip=0.003162
trc=vlog calling func(0.005000) expected=0.153000 roundtrip=0.005000
trc=vlog calling func(0.009000) expected=0.175400 roundtrip=0.009000
trc=vlog calling func(0.015000) expected=0.205818 roundtrip=0.015000
trc=vlog calling func(0.100000) expected=0.365471 roundtrip=0.100000
trc=vlog calling func(1.000000) expected=0.599118 roundtrip=1.000000
trc=vlog calling func(52.370000) expected=1.013406 roundtrip=52.370000
trc=vlog calling func(125.098765) expected=1.104729 roundtrip=125.098765
trc=vlog calling func(1999.111230) expected=1.395405 roundtrip=1999.111230
trc=vlog calling func(6945.443000) expected=1.526030 roundtrip=6945.443000
trc=vlog calling func(15123.456700) expected=1.607650 roundtrip=15123.456700
trc=vlog calling func(19845.889230) expected=1.636154 roundtrip=19845.889230
trc=vlog calling func(98678.423100) expected=1.804381 roundtrip=98678.423100
trc=vlog calling func(99999.899998) expected=1.805776 roundtrip=99999.899998
trc=bt709 EOTF(50, 0, {0}) = {0}
trc=bt709 EOTF(50, 0, {0.1}) = {0.199054}
trc=bt709 EOTF(50, 0, {0.2}) = {1.05061}

View File

@ -0,0 +1,2 @@
b47e4ab6d421bb8a7f911787aa7ca753 *tests/data/pixfmt/gbrp-yuv444p10msbbe.yuv
7603200 tests/data/pixfmt/gbrp-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
b47e4ab6d421bb8a7f911787aa7ca753 *tests/data/pixfmt/gbrp-yuv444p10msble.yuv
7603200 tests/data/pixfmt/gbrp-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
b47e4ab6d421bb8a7f911787aa7ca753 *tests/data/pixfmt/gbrp-yuv444p12msbbe.yuv
7603200 tests/data/pixfmt/gbrp-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
b47e4ab6d421bb8a7f911787aa7ca753 *tests/data/pixfmt/gbrp-yuv444p12msble.yuv
7603200 tests/data/pixfmt/gbrp-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
1015f3ddc2979b399cc7d260d53bca21 *tests/data/pixfmt/gbrp10-yuv444p10msbbe.yuv
15206400 tests/data/pixfmt/gbrp10-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
1015f3ddc2979b399cc7d260d53bca21 *tests/data/pixfmt/gbrp10-yuv444p10msble.yuv
15206400 tests/data/pixfmt/gbrp10-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
0c1e85f0c8bb7749c33d373b730d8401 *tests/data/pixfmt/gbrp10-yuv444p12msbbe.yuv
15206400 tests/data/pixfmt/gbrp10-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
0c1e85f0c8bb7749c33d373b730d8401 *tests/data/pixfmt/gbrp10-yuv444p12msble.yuv
15206400 tests/data/pixfmt/gbrp10-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
c730816956a8da23abeba5d2d3f51ec6 *tests/data/pixfmt/gbrp12-yuv444p10msbbe.yuv
15206400 tests/data/pixfmt/gbrp12-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
c730816956a8da23abeba5d2d3f51ec6 *tests/data/pixfmt/gbrp12-yuv444p10msble.yuv
15206400 tests/data/pixfmt/gbrp12-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
6ff4167f711069638f0b2db840bdeb32 *tests/data/pixfmt/gbrp12-yuv444p12msbbe.yuv
15206400 tests/data/pixfmt/gbrp12-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
6ff4167f711069638f0b2db840bdeb32 *tests/data/pixfmt/gbrp12-yuv444p12msble.yuv
15206400 tests/data/pixfmt/gbrp12-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
b9d61649c900a0aa6d69b5095e5d7efe *tests/data/pixfmt/nv24-yuv444p10msbbe.yuv
7603200 tests/data/pixfmt/nv24-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
b9d61649c900a0aa6d69b5095e5d7efe *tests/data/pixfmt/nv24-yuv444p10msble.yuv
7603200 tests/data/pixfmt/nv24-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
b9d61649c900a0aa6d69b5095e5d7efe *tests/data/pixfmt/nv24-yuv444p12msbbe.yuv
7603200 tests/data/pixfmt/nv24-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
b9d61649c900a0aa6d69b5095e5d7efe *tests/data/pixfmt/nv24-yuv444p12msble.yuv
7603200 tests/data/pixfmt/nv24-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
60b454bfd6f48b64cc24de3041d0a01d *tests/data/pixfmt/p410-yuv444p10msbbe.yuv
15206400 tests/data/pixfmt/p410-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
60b454bfd6f48b64cc24de3041d0a01d *tests/data/pixfmt/p410-yuv444p10msble.yuv
15206400 tests/data/pixfmt/p410-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
60b454bfd6f48b64cc24de3041d0a01d *tests/data/pixfmt/p410-yuv444p12msbbe.yuv
15206400 tests/data/pixfmt/p410-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
60b454bfd6f48b64cc24de3041d0a01d *tests/data/pixfmt/p410-yuv444p12msble.yuv
15206400 tests/data/pixfmt/p410-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
51e761c143c3fce8e9921d8cceb0a433 *tests/data/pixfmt/p412-yuv444p10msbbe.yuv
15206400 tests/data/pixfmt/p412-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
51e761c143c3fce8e9921d8cceb0a433 *tests/data/pixfmt/p412-yuv444p10msble.yuv
15206400 tests/data/pixfmt/p412-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
9b5fc804354cf299fcc4c3f7bd2781ad *tests/data/pixfmt/p412-yuv444p12msbbe.yuv
15206400 tests/data/pixfmt/p412-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
9b5fc804354cf299fcc4c3f7bd2781ad *tests/data/pixfmt/p412-yuv444p12msble.yuv
15206400 tests/data/pixfmt/p412-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
b1edab4786df5840d98338d14625203f *tests/data/pixfmt/rgb24-yuv444p10msbbe.yuv
7603200 tests/data/pixfmt/rgb24-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
b1edab4786df5840d98338d14625203f *tests/data/pixfmt/rgb24-yuv444p10msble.yuv
7603200 tests/data/pixfmt/rgb24-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
b1edab4786df5840d98338d14625203f *tests/data/pixfmt/rgb24-yuv444p12msbbe.yuv
7603200 tests/data/pixfmt/rgb24-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
b1edab4786df5840d98338d14625203f *tests/data/pixfmt/rgb24-yuv444p12msble.yuv
7603200 tests/data/pixfmt/rgb24-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
7f02ab701faaf31bdddcc070b0114d1a *tests/data/pixfmt/rgb48-yuv444p10msbbe.yuv
15206400 tests/data/pixfmt/rgb48-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
7f02ab701faaf31bdddcc070b0114d1a *tests/data/pixfmt/rgb48-yuv444p10msble.yuv
15206400 tests/data/pixfmt/rgb48-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
ec3178abe146892b926760d65991da43 *tests/data/pixfmt/rgb48-yuv444p12msbbe.yuv
15206400 tests/data/pixfmt/rgb48-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
ec3178abe146892b926760d65991da43 *tests/data/pixfmt/rgb48-yuv444p12msble.yuv
15206400 tests/data/pixfmt/rgb48-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
e41775e4a6798bc545ab3212a0d88544 *tests/data/pixfmt/yuv444p-yuv444p10msbbe.yuv
7603200 tests/data/pixfmt/yuv444p-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
e41775e4a6798bc545ab3212a0d88544 *tests/data/pixfmt/yuv444p-yuv444p10msble.yuv
7603200 tests/data/pixfmt/yuv444p-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
e41775e4a6798bc545ab3212a0d88544 *tests/data/pixfmt/yuv444p-yuv444p12msbbe.yuv
7603200 tests/data/pixfmt/yuv444p-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
e41775e4a6798bc545ab3212a0d88544 *tests/data/pixfmt/yuv444p-yuv444p12msble.yuv
7603200 tests/data/pixfmt/yuv444p-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
c9f69deda55dd67c78c6e1e819b0bc52 *tests/data/pixfmt/yuv444p10-yuv444p10msbbe.yuv
15206400 tests/data/pixfmt/yuv444p10-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
c9f69deda55dd67c78c6e1e819b0bc52 *tests/data/pixfmt/yuv444p10-yuv444p10msble.yuv
15206400 tests/data/pixfmt/yuv444p10-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
c9f69deda55dd67c78c6e1e819b0bc52 *tests/data/pixfmt/yuv444p10-yuv444p12msbbe.yuv
15206400 tests/data/pixfmt/yuv444p10-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
c9f69deda55dd67c78c6e1e819b0bc52 *tests/data/pixfmt/yuv444p10-yuv444p12msble.yuv
15206400 tests/data/pixfmt/yuv444p10-yuv444p12msble.yuv

View File

@ -0,0 +1,2 @@
d885def826d77206e10cd7f9bc2ce72a *tests/data/pixfmt/yuv444p12-yuv444p10msbbe.yuv
15206400 tests/data/pixfmt/yuv444p12-yuv444p10msbbe.yuv

View File

@ -0,0 +1,2 @@
d885def826d77206e10cd7f9bc2ce72a *tests/data/pixfmt/yuv444p12-yuv444p10msble.yuv
15206400 tests/data/pixfmt/yuv444p12-yuv444p10msble.yuv

View File

@ -0,0 +1,2 @@
5d600b24fcb10ff30d9ea1bdd0df87d0 *tests/data/pixfmt/yuv444p12-yuv444p12msbbe.yuv
15206400 tests/data/pixfmt/yuv444p12-yuv444p12msbbe.yuv

View File

@ -0,0 +1,2 @@
5d600b24fcb10ff30d9ea1bdd0df87d0 *tests/data/pixfmt/yuv444p12-yuv444p12msble.yuv
15206400 tests/data/pixfmt/yuv444p12-yuv444p12msble.yuv