Skip to content

Commit

Permalink
Обновлен ffmpeg n7.1-dev-1805-g9af348bd1a.
Browse files Browse the repository at this point in the history
Устранена ошибка компиляции после FFmpeg/FFmpeg@e9e8bea.
  • Loading branch information
v0lt committed Jul 13, 2024
1 parent 6e6ce70 commit 7d333b8
Show file tree
Hide file tree
Showing 26 changed files with 235 additions and 86 deletions.
2 changes: 1 addition & 1 deletion docs/Changelog.Rus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MPCVideoDec

Обновлены библиотеки:
dav1d 1.4.2-15-g2355eeb;
ffmpeg n7.1-dev-1688-ge0eff64ed1;
ffmpeg n7.1-dev-1805-g9af348bd1a;
ResizableLib v1.5.3-8-g25a89da;
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 @@ -20,7 +20,7 @@ Updated Japanese translation (by tsubasanouta).

Updated libraries:
dav1d 1.4.2-15-g2355eeb;
ffmpeg n7.1-dev-1688-ge0eff64ed1;
ffmpeg n7.1-dev-1805-g9af348bd1a;
ResizableLib v1.5.3-8-g25a89da;
vvdec v2.3.0-24-gad8f4bb.

Expand Down
2 changes: 2 additions & 0 deletions src/ExtLib/ffmpeg/libavcodec/flac_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ static int check_header_mismatch(FLACParseContext *fpc,
for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS && curr != child; i++)
curr = curr->next;

av_assert0(i < FLAC_MAX_SEQUENTIAL_HEADERS);

if (header->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY ||
header->link_penalty[i] == FLAC_HEADER_NOT_PENALIZED_YET) {
FLACHeaderMarker *start, *end;
Expand Down
5 changes: 5 additions & 0 deletions src/ExtLib/ffmpeg/libavcodec/golomb.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit,
log = av_log2(buf);

if (log > 31 - limit) {
av_assert2(log >= k);
buf >>= log - k;
buf += (30U - log) << k;
LAST_SKIP_BITS(re, gb, 32 + k - log);
Expand All @@ -424,6 +425,8 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit,

/**
* read unsigned golomb rice code (jpegls).
*
* @returns -1 on error
*/
static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
int esc_len)
Expand Down Expand Up @@ -535,6 +538,8 @@ static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,

/**
* read signed golomb rice code (flac).
*
* @returns INT_MIN on error
*/
static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit,
int esc_len)
Expand Down
21 changes: 11 additions & 10 deletions src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2789,14 +2789,8 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext
const HEVCPPS *pps = s->pps;
int ret;

if (s->sh.dependent_slice_segment_flag) {
int ctb_addr_ts = pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs];
int prev_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1];
if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) {
av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n");
return AVERROR_INVALIDDATA;
}
}
if (!s->sh.first_slice_in_pic_flag)
s->slice_idx += !s->sh.dependent_slice_segment_flag;

if (!s->sh.dependent_slice_segment_flag && s->sh.slice_type != HEVC_SLICE_I) {
ret = ff_hevc_slice_rpl(s);
Expand All @@ -2818,6 +2812,15 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext
return AVERROR_PATCHWELCOME;
}

if (s->sh.dependent_slice_segment_flag) {
int ctb_addr_ts = pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs];
int prev_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1];
if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) {
av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n");
return AVERROR_INVALIDDATA;
}
}

s->local_ctx[0].first_qp_group = !s->sh.dependent_slice_segment_flag;

if (!pps->cu_qp_delta_enabled_flag)
Expand All @@ -2826,8 +2829,6 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext
s->local_ctx[0].tu.cu_qp_offset_cb = 0;
s->local_ctx[0].tu.cu_qp_offset_cr = 0;

s->slice_idx += !s->sh.dependent_slice_segment_flag;

if (s->avctx->active_thread_type == FF_THREAD_SLICE &&
s->sh.num_entry_point_offsets > 0 &&
pps->num_tile_rows == 1 && pps->num_tile_columns == 1)
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavcodec/me_cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ av_cold int ff_set_cmp(const MECmpContext *c, me_cmp_func *cmp, int type, int mp
cmp[i] = zero_cmp;
return 0;
}
if (type > FF_ARRAY_ELEMS(cmp_func_list) ||
if (type >= FF_ARRAY_ELEMS(cmp_func_list) ||
!cmp_func_list[type].available ||
!mpvenc && cmp_func_list[type].mpv_only) {
av_log(NULL, AV_LOG_ERROR,
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavcodec/motion_est.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y)
s->b_direct_mv_table[mot_xy][0]= 0;
s->b_direct_mv_table[mot_xy][1]= 0;

return 256*256*256*64;
return 256*256*256*64-1;
}

c->xmin= xmin;
Expand Down
1 change: 1 addition & 0 deletions src/ExtLib/ffmpeg/libavcodec/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type)
case AV_PKT_DATA_IAMF_MIX_GAIN_PARAM: return "IAMF Mix Gain Parameter Data";
case AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM: return "IAMF Demixing Info Parameter Data";
case AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM: return "IAMF Recon Gain Info Parameter Data";
case AV_PKT_DATA_FRAME_CROPPING: return "Frame Cropping";
}
return NULL;
}
Expand Down
13 changes: 13 additions & 0 deletions src/ExtLib/ffmpeg/libavcodec/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,19 @@ enum AVPacketSideDataType {
*/
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,

/**
* The number of pixels to discard from the top/bottom/left/right border of the
* decoded frame to obtain the sub-rectangle intended for presentation.
*
* @code
* u32le crop_top
* u32le crop_bottom
* u32le crop_left
* u32le crop_right
* @endcode
*/
AV_PKT_DATA_FRAME_CROPPING,

/**
* The number of side data types.
* This is not part of the public API/ABI in the sense that it may
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavcodec/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "version_major.h"

#define LIBAVCODEC_VERSION_MINOR 9
#define LIBAVCODEC_VERSION_MINOR 10
#define LIBAVCODEC_VERSION_MICRO 100

#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavcodec/vvc/refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void ff_vvc_bump_frame(VVCContext *s, VVCFrameContext *fc)

static VVCFrame *find_ref_idx(VVCContext *s, VVCFrameContext *fc, int poc, uint8_t use_msb)
{
const int mask = use_msb ? ~0 : fc->ps.sps->max_pic_order_cnt_lsb - 1;
const unsigned mask = use_msb ? ~0 : fc->ps.sps->max_pic_order_cnt_lsb - 1;

for (int i = 0; i < FF_ARRAY_ELEMS(fc->DPB); i++) {
VVCFrame *ref = &fc->DPB[i];
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavcodec/vvc/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ static void task_run_stage(VVCTask *t, VVCContext *s, VVCLocalContext *lc)
VVCFrameContext *fc = t->fc;
VVCFrameThread *ft = fc->ft;
const VVCTaskStage stage = t->stage;
run_func run[] = {
static const run_func run[] = {
run_parse,
run_inter,
run_recon,
Expand Down
5 changes: 4 additions & 1 deletion src/ExtLib/ffmpeg/libavfilter/af_aresample.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref)
av_frame_copy_props(outsamplesref, insamplesref);
outsamplesref->format = outlink->format;
ret = av_channel_layout_copy(&outsamplesref->ch_layout, &outlink->ch_layout);
if (ret < 0)
if (ret < 0) {
av_frame_free(&outsamplesref);
av_frame_free(&insamplesref);
return ret;
}
outsamplesref->sample_rate = outlink->sample_rate;

if(insamplesref->pts != AV_NOPTS_VALUE) {
Expand Down
16 changes: 13 additions & 3 deletions src/ExtLib/ffmpeg/libavutil/executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include "config.h"

#include <stdbool.h>

#include "mem.h"
#include "thread.h"

Expand Down Expand Up @@ -49,6 +51,7 @@ typedef struct ThreadInfo {
struct AVExecutor {
AVTaskCallbacks cb;
int thread_count;
bool recursive;

ThreadInfo *threads;
uint8_t *local_contexts;
Expand Down Expand Up @@ -194,18 +197,25 @@ void av_executor_execute(AVExecutor *e, AVTask *t)
AVTaskCallbacks *cb = &e->cb;
AVTask **prev;

ff_mutex_lock(&e->lock);
if (e->thread_count)
ff_mutex_lock(&e->lock);
if (t) {
for (prev = &e->tasks; *prev && cb->priority_higher(*prev, t); prev = &(*prev)->next)
/* nothing */;
add_task(prev, t);
}
ff_cond_signal(&e->cond);
ff_mutex_unlock(&e->lock);
if (e->thread_count) {
ff_cond_signal(&e->cond);
ff_mutex_unlock(&e->lock);
}

if (!e->thread_count || !HAVE_THREADS) {
if (e->recursive)
return;
e->recursive = true;
// We are running in a single-threaded environment, so we must handle all tasks ourselves
while (run_one_task(e, e->local_contexts))
/* nothing */;
e->recursive = false;
}
}
3 changes: 2 additions & 1 deletion src/ExtLib/ffmpeg/libavutil/hwcontext_d3d11va.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ static AVBufferRef *wrap_texture_buf(AVHWFramesContext *ctx, ID3D11Texture2D *te
sizeof(*frames_hwctx->texture_infos));
if (!frames_hwctx->texture_infos) {
ID3D11Texture2D_Release(tex);
av_free(desc);
return NULL;
}
s->nb_surfaces = s->nb_surfaces_used + 1;
Expand All @@ -212,7 +213,7 @@ static AVBufferRef *wrap_texture_buf(AVHWFramesContext *ctx, ID3D11Texture2D *te
desc->texture = tex;
desc->index = index;

buf = av_buffer_create((uint8_t *)desc, sizeof(desc), free_texture, tex, 0);
buf = av_buffer_create((uint8_t *)desc, sizeof(*desc), free_texture, tex, 0);
if (!buf) {
ID3D11Texture2D_Release(tex);
av_free(desc);
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavutil/hwcontext_dxva2.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static AVBufferRef *dxva2_pool_alloc(void *opaque, size_t size)
if (s->nb_surfaces_used < hwctx->nb_surfaces) {
s->nb_surfaces_used++;
return av_buffer_create((uint8_t*)s->surfaces_internal[s->nb_surfaces_used - 1],
sizeof(*hwctx->surfaces), dxva2_pool_release_dummy, 0, 0);
sizeof(**hwctx->surfaces), dxva2_pool_release_dummy, 0, 0);
}

return NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavutil/imgutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enu
stride = 8LL*w;
stride += 128*8;

if ((int)w<=0 || (int)h<=0 || stride >= INT_MAX || stride*(uint64_t)(h+128) >= INT_MAX) {
if (w==0 || h==0 || w > INT32_MAX || h > INT32_MAX || stride >= INT_MAX || stride*(h + 128ULL) >= INT_MAX) {
av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h);
return AVERROR(EINVAL);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavutil/wchar_filename.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static inline int wchartocp(unsigned int code_page, const wchar_t *filename_w,
errno = EINVAL;
return -1;
}
*filename = (char*)av_malloc_array(num_chars, sizeof *filename);
*filename = (char*)av_malloc_array(num_chars, sizeof **filename);
if (!*filename) {
errno = ENOMEM;
return -1;
Expand Down
32 changes: 9 additions & 23 deletions src/ExtLib/ffmpeg/libavutil/x86/intreadwrite.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,27 @@

#include <stdint.h>
#include "config.h"
#if HAVE_INTRINSICS_SSE2 && defined(__SSE2__)
#include <emmintrin.h>
#endif
#include "libavutil/attributes.h"

#if HAVE_MMX

#ifdef __SSE__
#if HAVE_INTRINSICS_SSE2 && defined(__SSE2__)

#define AV_COPY128 AV_COPY128
static av_always_inline void AV_COPY128(void *d, const void *s)
{
struct v {uint64_t v[2];};

__asm__("movaps %1, %%xmm0 \n\t"
"movaps %%xmm0, %0 \n\t"
: "=m"(*(struct v*)d)
: "m" (*(const struct v*)s)
: "xmm0");
__m128i tmp = _mm_load_si128((const __m128i *)s);
_mm_store_si128((__m128i *)d, tmp);
}

#endif /* __SSE__ */

#ifdef __SSE2__

#define AV_ZERO128 AV_ZERO128
static av_always_inline void AV_ZERO128(void *d)
{
struct v {uint64_t v[2];};

__asm__("pxor %%xmm0, %%xmm0 \n\t"
"movdqa %%xmm0, %0 \n\t"
: "=m"(*(struct v*)d)
:: "xmm0");
__m128i zero = _mm_setzero_si128();
_mm_store_si128((__m128i *)d, zero);
}

#endif /* __SSE2__ */

#endif /* HAVE_MMX */
#endif /* HAVE_INTRINSICS_SSE2 && defined(__SSE2__) */

#endif /* AVUTIL_X86_INTREADWRITE_H */
4 changes: 2 additions & 2 deletions src/ExtLib/ffmpeg/libswscale/swscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ int sws_receive_slice(struct SwsContext *c, unsigned int slice_start,
}

for (int i = 0; i < FF_ARRAY_ELEMS(dst); i++) {
ptrdiff_t offset = c->frame_dst->linesize[i] * (slice_start >> c->chrDstVSubSample);
ptrdiff_t offset = c->frame_dst->linesize[i] * (ptrdiff_t)(slice_start >> c->chrDstVSubSample);
dst[i] = FF_PTR_ADD(c->frame_dst->data[i], offset);
}

Expand Down Expand Up @@ -1236,7 +1236,7 @@ void ff_sws_slice_worker(void *priv, int jobnr, int threadnr,
for (int i = 0; i < FF_ARRAY_ELEMS(dst) && parent->frame_dst->data[i]; i++) {
const int vshift = (i == 1 || i == 2) ? c->chrDstVSubSample : 0;
const ptrdiff_t offset = parent->frame_dst->linesize[i] *
((slice_start + parent->dst_slice_start) >> vshift);
(ptrdiff_t)((slice_start + parent->dst_slice_start) >> vshift);

dst[i] = parent->frame_dst->data[i] + offset;
}
Expand Down
2 changes: 0 additions & 2 deletions src/ExtLib/ffmpeg/libswscale/swscale_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@

#define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE

#define DITHER1XBPP

#if HAVE_BIGENDIAN
#define ALT32_CORR (-1)
#else
Expand Down
4 changes: 0 additions & 4 deletions src/ExtLib/ffmpeg/libswscale/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1952,14 +1952,10 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter,
av_log(c, AV_LOG_INFO, "%s scaler, from %s to %s%s ",
scaler,
av_get_pix_fmt_name(srcFormat),
#ifdef DITHER1XBPP
dstFormat == AV_PIX_FMT_BGR555 || dstFormat == AV_PIX_FMT_BGR565 ||
dstFormat == AV_PIX_FMT_RGB444BE || dstFormat == AV_PIX_FMT_RGB444LE ||
dstFormat == AV_PIX_FMT_BGR444BE || dstFormat == AV_PIX_FMT_BGR444LE ?
"dithered " : "",
#else
"",
#endif
av_get_pix_fmt_name(dstFormat));

if (INLINE_MMXEXT(cpu_flags))
Expand Down
2 changes: 0 additions & 2 deletions src/ExtLib/ffmpeg/libswscale/x86/swscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const DECLARE_ALIGNED(8, uint64_t, ff_dither8)[2] = {

#if HAVE_INLINE_ASM

#define DITHER1XBPP

DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL;
DECLARE_ASM_CONST(8, uint64_t, bFC)= 0xFCFCFCFCFCFCFCFCLL;

Expand Down
Loading

0 comments on commit 7d333b8

Please sign in to comment.