Skip to content

Commit

Permalink
Обновлен ffmpeg n7.1-dev-1688-ge0eff64ed1.
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lt committed Jul 6, 2024
1 parent 837c5c4 commit 66f1697
Show file tree
Hide file tree
Showing 20 changed files with 69 additions and 214 deletions.
2 changes: 1 addition & 1 deletion docs/Changelog.Rus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MPCVideoDec
Обновлен японский перевод (автор tsubasanouta).

Обновлены библиотеки:
ffmpeg n7.1-dev-1585-g0b330d8642;
ffmpeg n7.1-dev-1688-ge0eff64ed1;
vvdec v2.3.0-24-gad8f4bb.


Expand Down
2 changes: 1 addition & 1 deletion docs/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Updated Korean translation (by Hackjjang).
Updated Japanese translation (by tsubasanouta).

Updated libraries:
ffmpeg n7.1-dev-1585-g0b330d8642;
ffmpeg n7.1-dev-1688-ge0eff64ed1;
vvdec v2.3.0-24-gad8f4bb.


Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ static void complex_stereo_downmix_cur(AACDecContext *ac, ChannelElement *cpe,
}
}

static void complex_stereo_interpolate_imag(float *im, float *re, const float f[6],
static void complex_stereo_interpolate_imag(float *im, float *re, const float f[7],
int len, int factor_even, int factor_odd)
{
int i = 0;
Expand Down
2 changes: 0 additions & 2 deletions src/ExtLib/ffmpeg/libavcodec/aacsbr_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,6 @@ int ff_aac_sbr_decode_usac_data(AACDecContext *ac, ChannelElement *che,

sbr->ready_for_dequant = 1;

int start = get_bits_count(gb);

if (sbr_ch == 1) { /* sbr_single_channel_element */
/* if (harmonicSBR) ... */

Expand Down
1 change: 1 addition & 0 deletions src/ExtLib/ffmpeg/libavcodec/allcodecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ extern const FFCodec ff_h264_vaapi_encoder;
extern const FFCodec ff_h264_videotoolbox_encoder;
extern const FFCodec ff_hevc_amf_encoder;
extern const FFCodec ff_hevc_cuvid_decoder;
extern const FFCodec ff_hevc_d3d12va_encoder;
extern const FFCodec ff_hevc_mediacodec_decoder;
extern const FFCodec ff_hevc_mediacodec_encoder;
extern const FFCodec ff_hevc_mf_encoder;
Expand Down
27 changes: 10 additions & 17 deletions src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
return ff_get_format(s->avctx, pix_fmts);
}

static int set_sps(HEVCContext *s, const HEVCSPS *sps,
enum AVPixelFormat pix_fmt)
static int set_sps(HEVCContext *s, const HEVCSPS *sps)
{
int ret, i;

Expand All @@ -566,10 +565,6 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps,
if (ret < 0)
goto fail;

export_stream_params(s, sps);

s->avctx->pix_fmt = pix_fmt;

ff_hevc_pred_init(&s->hpc, sps->bit_depth);
ff_hevc_dsp_init (&s->hevcdsp, sps->bit_depth);
ff_videodsp_init (&s->vdsp, sps->bit_depth);
Expand Down Expand Up @@ -632,7 +627,7 @@ static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext
av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", pps_id);
return AVERROR_INVALIDDATA;
}
if (!sh->first_slice_in_pic_flag && pps_id != sh->pps_id) {
if (!sh->first_slice_in_pic_flag && s->ps.pps_list[pps_id] != s->pps) {
av_log(s->avctx, AV_LOG_ERROR, "PPS changed between slices.\n");
return AVERROR_INVALIDDATA;
}
Expand Down Expand Up @@ -2950,10 +2945,12 @@ static int hevc_frame_start(HEVCContext *s)

ff_hevc_clear_refs(s);

ret = set_sps(s, sps, sps->pix_fmt);
ret = set_sps(s, sps);
if (ret < 0)
return ret;

export_stream_params(s, sps);

pix_fmt = get_format(s, sps);
if (pix_fmt < 0)
return pix_fmt;
Expand Down Expand Up @@ -2996,6 +2993,10 @@ static int hevc_frame_start(HEVCContext *s)
if (pps->tiles_enabled_flag)
s->local_ctx[0].end_of_tiles_x = pps->column_width[0] << sps->log2_ctb_size;

ret = export_stream_params_from_sei(s);
if (ret < 0)
return ret;

ret = ff_hevc_set_new_ref(s, s->poc);
if (ret < 0)
goto fail;
Expand All @@ -3016,10 +3017,6 @@ static int hevc_frame_start(HEVCContext *s)
!(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) &&
!s->avctx->hwaccel;

ret = export_stream_params_from_sei(s);
if (ret < 0)
return ret;

ret = set_side_data(s);
if (ret < 0)
goto fail;
Expand Down Expand Up @@ -3624,7 +3621,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
ff_refstruct_unref(&s->pps);

if (s->ps.sps != s0->ps.sps)
if ((ret = set_sps(s, s0->ps.sps, src->pix_fmt)) < 0)
if ((ret = set_sps(s, s0->ps.sps)) < 0)
return ret;

s->seq_decode = s0->seq_decode;
Expand Down Expand Up @@ -3669,10 +3666,6 @@ static int hevc_update_thread_context(AVCodecContext *dst,
s->sei.common.content_light = s0->sei.common.content_light;
s->sei.common.aom_film_grain = s0->sei.common.aom_film_grain;

ret = export_stream_params_from_sei(s);
if (ret < 0)
return ret;

return 0;
}
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,8 +1308,6 @@ static int mpeg_field_start(Mpeg1Context *s1, const uint8_t *buf, int buf_size)
s->cur_pic.linesize[i]);
}
s->cur_pic.linesize[i] *= 2;
s->last_pic.linesize[i] *= 2;
s->next_pic.linesize[i] *= 2;
}
}

Expand Down
53 changes: 27 additions & 26 deletions src/ExtLib/ffmpeg/libavcodec/pngdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ typedef struct PNGDecContext {
int have_clli;
uint32_t clli_max;
uint32_t clli_avg;
int have_mdvc;
uint16_t mdvc_primaries[3][2];
uint16_t mdvc_white_point[2];
uint32_t mdvc_max_lum;
uint32_t mdvc_min_lum;
/* Mastering Display Color Volume */
int have_mdcv;
uint16_t mdcv_primaries[3][2];
uint16_t mdcv_white_point[2];
uint32_t mdcv_max_lum;
uint32_t mdcv_min_lum;

enum PNGHeaderState hdr_state;
enum PNGImageState pic_state;
Expand Down Expand Up @@ -763,24 +764,24 @@ static int populate_avctx_color_fields(AVCodecContext *avctx, AVFrame *frame)
}
}

if (s->have_mdvc) {
AVMasteringDisplayMetadata *mdvc;
if (s->have_mdcv) {
AVMasteringDisplayMetadata *mdcv;

ret = ff_decode_mastering_display_new(avctx, frame, &mdvc);
ret = ff_decode_mastering_display_new(avctx, frame, &mdcv);
if (ret < 0)
return ret;

if (mdvc) {
mdvc->has_primaries = 1;
if (mdcv) {
mdcv->has_primaries = 1;
for (int i = 0; i < 3; i++) {
mdvc->display_primaries[i][0] = av_make_q(s->mdvc_primaries[i][0], 50000);
mdvc->display_primaries[i][1] = av_make_q(s->mdvc_primaries[i][1], 50000);
mdcv->display_primaries[i][0] = av_make_q(s->mdcv_primaries[i][0], 50000);
mdcv->display_primaries[i][1] = av_make_q(s->mdcv_primaries[i][1], 50000);
}
mdvc->white_point[0] = av_make_q(s->mdvc_white_point[0], 50000);
mdvc->white_point[1] = av_make_q(s->mdvc_white_point[1], 50000);
mdvc->has_luminance = 1;
mdvc->max_luminance = av_make_q(s->mdvc_max_lum, 10000);
mdvc->min_luminance = av_make_q(s->mdvc_min_lum, 10000);
mdcv->white_point[0] = av_make_q(s->mdcv_white_point[0], 50000);
mdcv->white_point[1] = av_make_q(s->mdcv_white_point[1], 50000);
mdcv->has_luminance = 1;
mdcv->max_luminance = av_make_q(s->mdcv_max_lum, 10000);
mdcv->min_luminance = av_make_q(s->mdcv_min_lum, 10000);
}
}

Expand Down Expand Up @@ -1571,20 +1572,20 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
s->clli_max = bytestream2_get_be32u(&gb_chunk);
s->clli_avg = bytestream2_get_be32u(&gb_chunk);
break;
case MKTAG('m', 'D', 'V', 'c'):
case MKTAG('m', 'D', 'C', 'v'):
if (bytestream2_get_bytes_left(&gb_chunk) != 24) {
av_log(avctx, AV_LOG_WARNING, "Invalid mDVc chunk size: %d\n", bytestream2_get_bytes_left(&gb_chunk));
av_log(avctx, AV_LOG_WARNING, "Invalid mDCv chunk size: %d\n", bytestream2_get_bytes_left(&gb_chunk));
break;
}
s->have_mdvc = 1;
s->have_mdcv = 1;
for (int i = 0; i < 3; i++) {
s->mdvc_primaries[i][0] = bytestream2_get_be16u(&gb_chunk);
s->mdvc_primaries[i][1] = bytestream2_get_be16u(&gb_chunk);
s->mdcv_primaries[i][0] = bytestream2_get_be16u(&gb_chunk);
s->mdcv_primaries[i][1] = bytestream2_get_be16u(&gb_chunk);
}
s->mdvc_white_point[0] = bytestream2_get_be16u(&gb_chunk);
s->mdvc_white_point[1] = bytestream2_get_be16u(&gb_chunk);
s->mdvc_max_lum = bytestream2_get_be32u(&gb_chunk);
s->mdvc_min_lum = bytestream2_get_be32u(&gb_chunk);
s->mdcv_white_point[0] = bytestream2_get_be16u(&gb_chunk);
s->mdcv_white_point[1] = bytestream2_get_be16u(&gb_chunk);
s->mdcv_max_lum = bytestream2_get_be32u(&gb_chunk);
s->mdcv_min_lum = bytestream2_get_be32u(&gb_chunk);
break;
case MKTAG('I', 'E', 'N', 'D'):
if (!(s->pic_state & PNG_ALLIMAGE))
Expand Down
5 changes: 1 addition & 4 deletions src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,10 +1128,7 @@ void vc1_b_h_intfi_loop_filter(VC1Context *v, uint8_t *dest, const uint32_t *cbp
dst = dest + (block_num & 2) * 4 * s->linesize + (block_num & 1) * 8;

if (!(flags & RIGHT_EDGE) || !(block_num & 5)) {
if (block_num > 3)
v->vc1dsp.vc1_h_loop_filter8(dst + 8, linesize, pq);
else
v->vc1dsp.vc1_h_loop_filter8(dst + 8, linesize, pq);
v->vc1dsp.vc1_h_loop_filter8(dst + 8, linesize, pq);
}

tt = ttblk[0] >> (block_num * 4) & 0xf;
Expand Down
2 changes: 0 additions & 2 deletions src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1878,8 +1878,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in
cu->lfnst_idx = lfnst_idx_decode(lc);
cu->mts_idx = mts_idx_decode(lc);
set_qp_c(lc);
if (ret < 0)
return ret;
} else {
ret = skipped_transform_tree_unit(lc);
if (ret < 0)
Expand Down
18 changes: 10 additions & 8 deletions src/ExtLib/ffmpeg/libavcodec/vvc/dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,14 @@ static int slices_realloc(VVCFrameContext *fc)
return 0;
}

static void ep_init_cabac_decoder(SliceContext *sc, const int index,
static int ep_init_cabac_decoder(SliceContext *sc, const int index,
const H2645NAL *nal, GetBitContext *gb, const CodedBitstreamUnit *unit)
{
const H266RawSlice *slice = unit->content_ref;
const H266RawSliceHeader *rsh = sc->sh.r;
EntryPoint *ep = sc->eps + index;
int size;
int ret;

if (index < rsh->num_entry_points) {
int skipped = 0;
Expand All @@ -501,8 +502,11 @@ static void ep_init_cabac_decoder(SliceContext *sc, const int index,
size = get_bits_left(gb) / 8;
}
av_assert0(gb->buffer + get_bits_count(gb) / 8 + size <= gb->buffer_end);
ff_init_cabac_decoder (&ep->cc, gb->buffer + get_bits_count(gb) / 8, size);
ret = ff_init_cabac_decoder (&ep->cc, gb->buffer + get_bits_count(gb) / 8, size);
if (ret < 0)
return ret;
skip_bits(gb, size * 8);
return 0;
}

static int slice_init_entry_points(SliceContext *sc,
Expand Down Expand Up @@ -538,7 +542,9 @@ static int slice_init_entry_points(SliceContext *sc,
fc->tab.slice_idx[rs] = sc->slice_idx;
}

ep_init_cabac_decoder(sc, i, nal, &gb, unit);
ret = ep_init_cabac_decoder(sc, i, nal, &gb, unit);
if (ret < 0)
return ret;

if (i + 1 < sc->nb_eps)
ctu_addr = sh->entry_point_start_ctu[i];
Expand Down Expand Up @@ -835,7 +841,6 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt)
const CodedBitstreamH266Context *h266 = s->cbc->priv_data;
CodedBitstreamFragment *frame = &s->current_frame;
int ret = 0;
int eos_at_start = 1;
s->last_eos = s->eos;
s->eos = 0;

Expand All @@ -851,10 +856,7 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt)
const CodedBitstreamUnit *unit = frame->units + i;

if (unit->type == VVC_EOB_NUT || unit->type == VVC_EOS_NUT) {
if (eos_at_start)
s->last_eos = 1;
else
s->eos = 1;
s->last_eos = 1;
} else {
ret = decode_nal_unit(s, fc, nal, unit);
if (ret < 0) {
Expand Down
1 change: 1 addition & 0 deletions src/ExtLib/ffmpeg/libavfilter/allfilters.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ extern const AVFilter ff_vsrc_openclsrc;
extern const AVFilter ff_vsrc_qrencodesrc;
extern const AVFilter ff_vsrc_pal75bars;
extern const AVFilter ff_vsrc_pal100bars;
extern const AVFilter ff_vsrc_perlin;
extern const AVFilter ff_vsrc_rgbtestsrc;
extern const AVFilter ff_vsrc_sierpinski;
extern const AVFilter ff_vsrc_smptebars;
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static AVBufferRef *d3d12va_pool_alloc(void *opaque, size_t size)
.Format = hwctx->format,
.SampleDesc = {.Count = 1, .Quality = 0 },
.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
.Flags = D3D12_RESOURCE_FLAG_NONE,
.Flags = hwctx->flags,
};

frame = av_mallocz(sizeof(AVD3D12VAFrame));
Expand Down
8 changes: 8 additions & 0 deletions src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ typedef struct AVD3D12VAFramesContext {
* If unset, will be automatically set.
*/
DXGI_FORMAT format;

/**
* Options for working with resources.
* If unset, this will be D3D12_RESOURCE_FLAG_NONE.
*
* @see https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_resource_flags
*/
D3D12_RESOURCE_FLAGS flags;
} AVD3D12VAFramesContext;

// ==> Start patch MPC
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavutil/timestamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ char *av_ts_make_time_string2(char *buf, int64_t ts, AVRational tb)
snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
} else {
double val = av_q2d(tb) * ts;
double log = floor(log10(fabs(val)));
double log = (fpclassify(val) == FP_ZERO ? -INFINITY : floor(log10(fabs(val))));
int precision = (isfinite(log) && log < 0) ? -log + 5 : 6;
int last = snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.*f", precision, val);
last = FFMIN(last, AV_TS_MAX_STRING_SIZE - 1) - 1;
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavutil/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
*/

#define LIBAVUTIL_VERSION_MAJOR 59
#define LIBAVUTIL_VERSION_MINOR 27
#define LIBAVUTIL_VERSION_MINOR 28
#define LIBAVUTIL_VERSION_MICRO 100

#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
Expand Down
4 changes: 2 additions & 2 deletions src/ExtLib/ffmpeg/libswresample/swresample.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
* matrix). This is using the swr_alloc() function.
* @code
* SwrContext *swr = swr_alloc();
* av_opt_set_channel_layout(swr, "in_channel_layout", AV_CH_LAYOUT_5POINT1, 0);
* av_opt_set_channel_layout(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
* av_opt_set_chlayout(swr, "in_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1, 0);
* av_opt_set_chlayout(swr, "out_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO, 0);
* av_opt_set_int(swr, "in_sample_rate", 48000, 0);
* av_opt_set_int(swr, "out_sample_rate", 44100, 0);
* av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
Expand Down
Loading

0 comments on commit 66f1697

Please sign in to comment.