Skip to content

Commit

Permalink
Update LIBAVCODEC (ffmpeg)
Browse files Browse the repository at this point in the history
Updating all libavcodecs to have the latest changes. Necessary for certain stuff in YouTube Reborn.
  • Loading branch information
arichornlover authored Jun 19, 2024
1 parent f4c6330 commit e541732
Show file tree
Hide file tree
Showing 21 changed files with 1,527 additions and 651 deletions.
762 changes: 348 additions & 414 deletions MobileFFmpeg/libavcodec/avcodec.h

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions MobileFFmpeg/libavcodec/avfft.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#ifndef AVCODEC_AVFFT_H
#define AVCODEC_AVFFT_H

#include "../libavutil/attributes.h"
#include "version_major.h"
#if FF_API_AVFFT

/**
* @file
* @ingroup lavc_fft
Expand All @@ -44,26 +48,42 @@ typedef struct FFTContext FFTContext;
* Set up a complex FFT.
* @param nbits log2 of the length of the input array
* @param inverse if 0 perform the forward transform, if 1 perform the inverse
* @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT
*/
attribute_deprecated
FFTContext *av_fft_init(int nbits, int inverse);

/**
* Do the permutation needed BEFORE calling ff_fft_calc().
* @deprecated without replacement
*/
attribute_deprecated
void av_fft_permute(FFTContext *s, FFTComplex *z);

/**
* Do a complex FFT with the parameters defined in av_fft_init(). The
* input data must be permuted before. No 1.0/sqrt(n) normalization is done.
* @deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation
*/
attribute_deprecated
void av_fft_calc(FFTContext *s, FFTComplex *z);

attribute_deprecated
void av_fft_end(FFTContext *s);

/**
* @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_MDCT,
* with a flag of AV_TX_FULL_IMDCT for a replacement to av_imdct_calc.
*/
attribute_deprecated
FFTContext *av_mdct_init(int nbits, int inverse, double scale);
attribute_deprecated
void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
attribute_deprecated
void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
attribute_deprecated
void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
attribute_deprecated
void av_mdct_end(FFTContext *s);

/* Real Discrete Fourier Transform */
Expand All @@ -81,9 +101,14 @@ typedef struct RDFTContext RDFTContext;
* Set up a real FFT.
* @param nbits log2 of the length of the input array
* @param trans the type of transform
*
* @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_RDFT
*/
attribute_deprecated
RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
attribute_deprecated
void av_rdft_calc(RDFTContext *s, FFTSample *data);
attribute_deprecated
void av_rdft_end(RDFTContext *s);

/* Discrete Cosine Transform */
Expand All @@ -106,13 +131,19 @@ enum DCTTransformType {
* @param type the type of transform
*
* @note the first element of the input of DST-I is ignored
*
* @deprecated use av_tx_init from libavutil/tx.h with an appropriate type of AV_TX_FLOAT_DCT
*/
attribute_deprecated
DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
attribute_deprecated
void av_dct_calc(DCTContext *s, FFTSample *data);
attribute_deprecated
void av_dct_end (DCTContext *s);

/**
* @}
*/

#endif /* FF_API_AVFFT */
#endif /* AVCODEC_AVFFT_H */
9 changes: 1 addition & 8 deletions MobileFFmpeg/libavcodec/codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,8 @@ typedef struct AVCodec {
const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
#if FF_API_OLD_CHANNEL_LAYOUT
/**
* @deprecated use ch_layouts instead
*/
attribute_deprecated
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
#endif
const AVClass *priv_class; ///< AVClass for the private context
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN}

/**
* Group name of the codec implementation.
Expand Down
2 changes: 1 addition & 1 deletion MobileFFmpeg/libavcodec/codec_desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef struct AVCodecDescriptor {
const char *const *mime_types;
/**
* If non-NULL, an array of profiles recognized for this codec.
* Terminated with FF_PROFILE_UNKNOWN.
* Terminated with AV_PROFILE_UNKNOWN.
*/
const struct AVProfile *profiles;
} AVCodecDescriptor;
Expand Down
11 changes: 8 additions & 3 deletions MobileFFmpeg/libavcodec/codec_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,6 @@ enum AVCodecID {
AV_CODEC_ID_AVRP,
AV_CODEC_ID_012V,
AV_CODEC_ID_AVUI,
#if FF_API_AYUV_CODECID
AV_CODEC_ID_AYUV,
#endif
AV_CODEC_ID_TARGA_Y216,
AV_CODEC_ID_V308,
AV_CODEC_ID_V408,
Expand Down Expand Up @@ -321,6 +318,10 @@ enum AVCodecID {
AV_CODEC_ID_MEDIA100,
AV_CODEC_ID_VQC,
AV_CODEC_ID_PDV,
AV_CODEC_ID_EVC,
AV_CODEC_ID_RTV1,
AV_CODEC_ID_VMIX,
AV_CODEC_ID_LEAD,

/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
Expand Down Expand Up @@ -539,6 +540,10 @@ enum AVCodecID {
AV_CODEC_ID_FTR,
AV_CODEC_ID_WAVARC,
AV_CODEC_ID_RKA,
AV_CODEC_ID_AC4,
AV_CODEC_ID_OSQ,
AV_CODEC_ID_QOA,
AV_CODEC_ID_LC3,

/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
Expand Down
69 changes: 29 additions & 40 deletions MobileFFmpeg/libavcodec/codec_par.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,14 @@
#include "../libavutil/pixfmt.h"

#include "codec_id.h"
#include "defs.h"
#include "packet.h"

/**
* @addtogroup lavc_core
* @{
*/

enum AVFieldOrder {
AV_FIELD_UNKNOWN,
AV_FIELD_PROGRESSIVE,
AV_FIELD_TT, ///< Top coded_first, top displayed first
AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
AV_FIELD_TB, ///< Top coded first, bottom displayed first
AV_FIELD_BT, ///< Bottom coded first, top displayed first
};

/**
* This struct describes the properties of an encoded stream.
*
Expand Down Expand Up @@ -79,6 +72,19 @@ typedef struct AVCodecParameters {
*/
int extradata_size;

/**
* Additional data associated with the entire stream.
*
* Should be allocated with av_packet_side_data_new() or
* av_packet_side_data_add(), and will be freed by avcodec_parameters_free().
*/
AVPacketSideData *coded_side_data;

/**
* Amount of entries in @ref coded_side_data.
*/
int nb_coded_side_data;

/**
* - video: the pixel format, the value corresponds to enum AVPixelFormat.
* - audio: the sample format, the value corresponds to enum AVSampleFormat.
Expand Down Expand Up @@ -137,6 +143,18 @@ typedef struct AVCodecParameters {
*/
AVRational sample_aspect_ratio;

/**
* Video only. Number of frames per second, for streams with constant frame
* durations. Should be set to { 0, 1 } when some frames have differing
* durations or if the value is not known.
*
* @note This field correponds to values that are stored in codec-level
* headers and is typically overridden by container/transport-layer
* timestamps, when available. It should thus be used only as a last resort,
* when no higher-level timing information is available.
*/
AVRational framerate;

/**
* Video only. The order of the fields in interlaced video.
*/
Expand All @@ -156,22 +174,10 @@ typedef struct AVCodecParameters {
*/
int video_delay;

#if FF_API_OLD_CHANNEL_LAYOUT
/**
* Audio only. The channel layout bitmask. May be 0 if the channel layout is
* unknown or unspecified, otherwise the number of bits set must be equal to
* the channels field.
* @deprecated use ch_layout
*/
attribute_deprecated
uint64_t channel_layout;
/**
* Audio only. The number of audio channels.
* @deprecated use ch_layout.nb_channels
* Audio only. The channel layout and number of channels.
*/
attribute_deprecated
int channels;
#endif
AVChannelLayout ch_layout;
/**
* Audio only. The number of audio samples per second.
*/
Expand Down Expand Up @@ -206,23 +212,6 @@ typedef struct AVCodecParameters {
* Audio only. Number of samples to skip after a discontinuity.
*/
int seek_preroll;

/**
* Audio only. The channel layout and number of channels.
*/
AVChannelLayout ch_layout;

/**
* Video only. Number of frames per second, for streams with constant frame
* durations. Should be set to { 0, 1 } when some frames have differing
* durations or if the value is not known.
*
* @note This field correponds to values that are stored in codec-level
* headers and is typically overridden by container/transport-layer
* timestamps, when available. It should thus be used only as a last resort,
* when no higher-level timing information is available.
*/
AVRational framerate;
} AVCodecParameters;

/**
Expand Down
3 changes: 0 additions & 3 deletions MobileFFmpeg/libavcodec/d3d11va.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
* @{
*/

#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for Direct3D11 and old UVD/UVD+ ATI video cards
#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for Direct3D11 and old Intel GPUs with ClearVideo interface

/**
* This structure is used to provides the necessary configurations and data
* to the Direct3D11 FFmpeg HWAccel implementation.
Expand Down
Loading

0 comments on commit e541732

Please sign in to comment.