Skip to content

Commit

Permalink
Обновлен ffmpeg n7.2-dev-301-g5557c673ea. Для компиляции кода ассембл…
Browse files Browse the repository at this point in the history
…ере теперь используется NASM вместо YASM.
  • Loading branch information
v0lt committed Oct 12, 2024
1 parent 2984bac commit 343b16f
Show file tree
Hide file tree
Showing 41 changed files with 911 additions and 592 deletions.
2 changes: 2 additions & 0 deletions docs/Changelog.Rus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

1.8.0.x dev
=============================
Обновлены библиотеки:
ffmpeg n7.2-dev-301-g5557c673ea.


1.8.0 - 2024-10-07
Expand Down
2 changes: 2 additions & 0 deletions docs/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

1.8.0.x dev
=============================
Updated libraries:
ffmpeg n7.2-dev-301-g5557c673ea.


1.8.0 - 2024-10-07
Expand Down
32 changes: 16 additions & 16 deletions src/ExtLib/ffmpeg/ffmpeg.mak
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ LIB_LIBSWSCALE = $(OBJ_DIR)libswscale.a
TARGET_LIB = $(TARGET_LIB_DIR)/ffmpeg.lib
ARSCRIPT = $(OBJ_DIR)script.ar

# Compiler and yasm flags
# Compiler and NASM flags
CFLAGS = -I. -I.. -Icompat/atomics/win32 -Icompat/windows \
-Ilibavcodec \
-I$(ZLIB_DIR) -I$(SPEEX_DIR) -I$(SOXR_DIR) -I$(DAV1_DIR) -I$(FFNVCODEC_DIR) -I$(UAVS3D_DIR) -I$(VVDEC_DIR) \
Expand All @@ -40,19 +40,19 @@ CFLAGS = -I. -I.. -Icompat/atomics/win32 -Icompat/windows \
-D_WIN32_WINNT=0x0601 -DWINVER=0x0601 \
-fomit-frame-pointer -std=c17 \
-fno-common -fno-ident -mthreads -Wno-discarded-qualifiers
YASMFLAGS = -I. -Pconfig.asm
NASMFLAGS = -I. -Pconfig.asm

ifeq ($(64BIT),yes)
GCC_PREFIX = x86_64-w64-mingw32-
TARGET_OS = x86_64-w64-mingw32
CFLAGS += -DWIN64 -D_WIN64 -DARCH_X86_64 -DPIC
OPTFLAGS = -m64 -fno-leading-underscore
YASMFLAGS += -f win32 -m amd64 -DWIN64=1 -DARCH_X86_32=0 -DARCH_X86_64=1 -DPIC
NASMFLAGS += -f win64 -DWIN64=1 -DARCH_X86_32=0 -DARCH_X86_64=1 -DPIC
else
TARGET_OS = i686-w64-mingw32
CFLAGS += -DWIN32 -D_WIN32 -DARCH_X86_32
OPTFLAGS = -m32 -march=i686 -msse -msse2 -mfpmath=sse -mstackrealign
YASMFLAGS += -f win32 -m x86 -DWIN32=1 -DARCH_X86_32=1 -DARCH_X86_64=0 -DPREFIX
NASMFLAGS += -f win32 -DWIN32=1 -DARCH_X86_32=1 -DARCH_X86_64=0 -DPREFIX
endif

ifeq ($(DEBUG),yes)
Expand Down Expand Up @@ -832,8 +832,8 @@ SRCS_LS = \
libswscale/x86/swscale.c \
libswscale/x86/yuv2rgb.c

# Yasm objects
SRCS_YASM_LC = \
# Asm objects
SRCS_ASM_LC = \
libavcodec/x86/aacpsdsp.asm \
libavcodec/x86/ac3dsp.asm \
libavcodec/x86/ac3dsp_downmix.asm \
Expand Down Expand Up @@ -920,9 +920,9 @@ SRCS_YASM_LC = \
libavcodec/x86/vvc/vvc_of.asm \
libavcodec/x86/vvc/vvc_sad.asm

SRCS_YASM_LF =
SRCS_ASM_LF =

SRCS_YASM_LU = \
SRCS_ASM_LU = \
libavutil/x86/cpuid.asm \
libavutil/x86/emms.asm \
libavutil/x86/fixed_dsp.asm \
Expand All @@ -931,12 +931,12 @@ SRCS_YASM_LU = \
libavutil/x86/lls.asm \
libavutil/x86/tx_float.asm

SRCS_YASM_LR = \
SRCS_ASM_LR = \
libswresample/x86/audio_convert.asm \
libswresample/x86/rematrix.asm \
libswresample/x86/resample.asm

SRCS_YASM_LS = \
SRCS_ASM_LS = \
libswscale/x86/input.asm \
libswscale/x86/output.asm \
libswscale/x86/range_convert.asm \
Expand All @@ -948,7 +948,7 @@ SRCS_YASM_LS = \

OBJS_LC = \
$(SRCS_LC:%.c=$(OBJ_DIR)%.o) \
$(SRCS_YASM_LC:%.asm=$(OBJ_DIR)%.o)
$(SRCS_ASM_LC:%.asm=$(OBJ_DIR)%.o)

OBJS_LC_B = \
$(SRCS_LC_B:%.c=$(OBJ_DIR)%.o)
Expand All @@ -958,19 +958,19 @@ OBJS_LC_BSF = \

OBJS_LF = \
$(SRCS_LF:%.c=$(OBJ_DIR)%.o) \
$(SRCS_YASM_LF:%.asm=$(OBJ_DIR)%.o)
$(SRCS_ASM_LF:%.asm=$(OBJ_DIR)%.o)

OBJS_LU = \
$(SRCS_LU:%.c=$(OBJ_DIR)%.o) \
$(SRCS_YASM_LU:%.asm=$(OBJ_DIR)%.o)
$(SRCS_ASM_LU:%.asm=$(OBJ_DIR)%.o)

OBJS_LR = \
$(SRCS_LR:%.c=$(OBJ_DIR)%.o) \
$(SRCS_YASM_LR:%.asm=$(OBJ_DIR)%.o)
$(SRCS_ASM_LR:%.asm=$(OBJ_DIR)%.o)

OBJS_LS = \
$(SRCS_LS:%.c=$(OBJ_DIR)%.o) \
$(SRCS_YASM_LS:%.asm=$(OBJ_DIR)%.o)
$(SRCS_ASM_LS:%.asm=$(OBJ_DIR)%.o)

# Commands
$(OBJ_DIR)%.o: %.c
Expand All @@ -979,7 +979,7 @@ $(OBJ_DIR)%.o: %.c

$(OBJ_DIR)%.o: %.asm
@echo $<
@yasm $(YASMFLAGS) -I$(<D)/ -o $@ $<
@nasm $(NASMFLAGS) -I$(<D)/ -o $@ $<

$(LIB_LIBAVCODEC): $(OBJS_LC)
@echo $@
Expand Down
2 changes: 2 additions & 0 deletions src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,9 @@ static av_cold void flush(AVCodecContext *avctx)
}
}

#if CONFIG_AAC_DECODER
ff_aac_usac_reset_state(ac, &ac->oc[1]);
#endif
}

/**
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 @@ -841,6 +841,7 @@ extern const FFCodec ff_av1_nvenc_encoder;
extern const FFCodec ff_av1_qsv_decoder;
extern const FFCodec ff_av1_qsv_encoder;
extern const FFCodec ff_av1_amf_encoder;
extern const FFCodec ff_av1_mf_encoder;
extern const FFCodec ff_av1_vaapi_encoder;
extern const FFCodec ff_libopenh264_encoder;
extern const FFCodec ff_libopenh264_decoder;
Expand Down
7 changes: 7 additions & 0 deletions src/ExtLib/ffmpeg/libavcodec/codec_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("LEAD MCMP"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
},
{
.id = AV_CODEC_ID_DNXUC,
.type = AVMEDIA_TYPE_VIDEO,
.name = "dnxuc",
.long_name = NULL_IF_CONFIG_SMALL("DNxUncompressed / SMPTE RDD 50"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},

/* various PCM "codecs" */
{
Expand Down
1 change: 1 addition & 0 deletions src/ExtLib/ffmpeg/libavcodec/codec_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ enum AVCodecID {
AV_CODEC_ID_RTV1,
AV_CODEC_ID_VMIX,
AV_CODEC_ID_LEAD,
AV_CODEC_ID_DNXUC,

/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
Expand Down
7 changes: 7 additions & 0 deletions src/ExtLib/ffmpeg/libavcodec/ffv1.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
return 0;
}

int ff_need_new_slices(int width, int num_h_slices, int chroma_shift) {
int mpw = 1<<chroma_shift;
int i = width * (int64_t)(num_h_slices - 1) / num_h_slices;

return width % mpw && (width - i) % mpw == 0;
}

av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
{
int max_slice_count = f->num_h_slices * f->num_v_slices;
Expand Down
2 changes: 2 additions & 0 deletions src/ExtLib/ffmpeg/libavcodec/ffv1.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ typedef struct FFV1Context {
int64_t picture_number;
int key_frame;
ProgressFrame picture, last_picture;
uint32_t crcref;

const AVFrame *cur_enc_frame;
int plane_count;
Expand Down Expand Up @@ -171,6 +172,7 @@ PlaneContext *ff_ffv1_planes_alloc(void);
int ff_ffv1_allocate_initial_states(FFV1Context *f);
void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1SliceContext *sc);
int ff_ffv1_close(AVCodecContext *avctx);
int ff_need_new_slices(int width, int num_h_slices, int chroma_shift);

static av_always_inline int fold(int diff, int bits)
{
Expand Down
10 changes: 6 additions & 4 deletions src/ExtLib/ffmpeg/libavcodec/ffv1dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,17 @@ static int read_extra_header(FFV1Context *f)

if (f->version > 2) {
f->ec = get_symbol(&c, state, 0);
if (f->ec >= 2)
f->crcref = 0x7a8c4079;
if (f->micro_version > 2)
f->intra = get_symbol(&c, state, 0);
}

if (f->version > 2) {
unsigned v;
v = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0,
v = av_crc(av_crc_get_table(AV_CRC_32_IEEE), f->crcref,
f->avctx->extradata, f->avctx->extradata_size);
if (v || f->avctx->extradata_size < 4) {
if (v != f->crcref || f->avctx->extradata_size < 4) {
av_log(f->avctx, AV_LOG_ERROR, "CRC mismatch %X!\n", v);
return AVERROR_INVALIDDATA;
}
Expand Down Expand Up @@ -948,8 +950,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
buf_p -= v;

if (f->ec) {
unsigned crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0, buf_p, v);
if (crc) {
unsigned crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), f->crcref, buf_p, v);
if (crc != f->crcref) {
int64_t ts = avpkt->pts != AV_NOPTS_VALUE ? avpkt->pts : avpkt->dts;
av_log(f->avctx, AV_LOG_ERROR, "slice CRC mismatch %X!", crc);
if (ts != AV_NOPTS_VALUE && avctx->pkt_timebase.num) {
Expand Down
20 changes: 17 additions & 3 deletions src/ExtLib/ffmpeg/libavcodec/hevc/ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ static int decode_vps_ext(GetBitContext *gb, AVCodecContext *avctx, HEVCVPS *vps
PTL ptl_dummy;
uint8_t max_sub_layers[HEVC_MAX_LAYERS];

int splitting_flag, dimension_id_len, view_id_len, num_add_olss,
int splitting_flag, dimension_id_len, view_id_len, num_add_olss, num_scalability_types,
default_output_layer_idc, direct_dep_type_len, direct_dep_type,
sub_layers_max_present, sub_layer_flag_info_present_flag, nb_ptl;
unsigned non_vui_extension_length;
Expand Down Expand Up @@ -532,13 +532,17 @@ static int decode_vps_ext(GetBitContext *gb, AVCodecContext *avctx, HEVCVPS *vps
return AVERROR_INVALIDDATA;

splitting_flag = get_bits1(gb);
num_scalability_types = 0;
for (int i = 0; i <= HEVC_SCALABILITY_MASK_MAX; i++) {
int scalability_mask_flag = get_bits1(gb);
if (scalability_mask_flag != (i == HEVC_SCALABILITY_MULTIVIEW)) {
if (scalability_mask_flag && (i != HEVC_SCALABILITY_MULTIVIEW)) {
av_log(avctx, AV_LOG_ERROR, "Scalability type %d not supported\n", i);
return AVERROR_PATCHWELCOME;
}
num_scalability_types += scalability_mask_flag;
}
if (num_scalability_types != 1)
return AVERROR_INVALIDDATA;

if (!splitting_flag)
dimension_id_len = get_bits(gb, 3) + 1;
Expand Down Expand Up @@ -1154,6 +1158,7 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
HEVCWindow *ow;
int ret = 0;
int bit_depth_chroma, num_comps, multi_layer_ext;
int vps_max_sub_layers;
int i;

// Coded parameters
Expand All @@ -1178,7 +1183,10 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,

sps->max_sub_layers = sps->vps->vps_max_sub_layers;
}
if (sps->max_sub_layers > HEVC_MAX_SUB_LAYERS) {
vps_max_sub_layers = sps->vps ? sps->vps->vps_max_sub_layers
: FFMIN(sps->max_sub_layers, HEVC_MAX_SUB_LAYERS);

if (sps->max_sub_layers > vps_max_sub_layers) {
av_log(avctx, AV_LOG_ERROR, "sps_max_sub_layers out of range: %d\n",
sps->max_sub_layers);
return AVERROR_INVALIDDATA;
Expand All @@ -1203,6 +1211,12 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
if (multi_layer_ext) {
const RepFormat *rf = &sps->vps->rep_format;

if (sps->vps->nb_layers == 1) {
av_log(avctx, AV_LOG_WARNING, "SPS %d references an unsupported VPS extension. Ignoring\n",
*sps_id);
return AVERROR(ENOSYS);
}

if (get_bits1(gb) && // update_rep_format_flag
get_bits(gb, 8)) { // sps_rep_format_idx
av_log(avctx, AV_LOG_ERROR, "sps_rep_format_idx!=0\n");
Expand Down
4 changes: 2 additions & 2 deletions src/ExtLib/ffmpeg/libavcodec/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ enum AVPacketSideDataType {
*
* Global side data is handled as follows:
* - During demuxing, it may be exported through
* @ref AVStream.codecpar.side_data "AVStream's codec parameters", which can
* @ref AVCodecParameters.coded_side_data "AVStream's codec parameters", which can
* then be passed as input to decoders through the
* @ref AVCodecContext.coded_side_data "decoder context's side data", for
* initialization.
* - For muxing, it can be fed through @ref AVStream.codecpar.side_data
* - For muxing, it can be fed through @ref AVCodecParameters.coded_side_data
* "AVStream's codec parameters", typically the output of encoders through
* the @ref AVCodecContext.coded_side_data "encoder context's side data", for
* initialization.
Expand Down
1 change: 1 addition & 0 deletions src/ExtLib/ffmpeg/libavcodec/parsers.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ extern const AVCodecParser ff_cri_parser;
extern const AVCodecParser ff_dca_parser;
extern const AVCodecParser ff_dirac_parser;
extern const AVCodecParser ff_dnxhd_parser;
extern const AVCodecParser ff_dnxuc_parser;
extern const AVCodecParser ff_dolby_e_parser;
extern const AVCodecParser ff_dpx_parser;
extern const AVCodecParser ff_dvaudio_parser;
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ffmpeg/libavcodec/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION;

unsigned avcodec_version(void)
{
static_assert(AV_CODEC_ID_LEAD == 269 &&
static_assert(AV_CODEC_ID_DNXUC == 270 &&
AV_CODEC_ID_PCM_SGA == 65572 &&
AV_CODEC_ID_ADPCM_XMD == 69683 &&
AV_CODEC_ID_CBD2_DPCM == 81928 &&
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 21
#define LIBAVCODEC_VERSION_MINOR 22
#define LIBAVCODEC_VERSION_MICRO 100

#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
Expand Down
Loading

0 comments on commit 343b16f

Please sign in to comment.