mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avcodec/eac3dec: add detection of Atmos spatial extension profile
Signed-off-by: Marth64 <marth64@proxyid.net>
This commit is contained in:
parent
814178f926
commit
a4e5b94633
@ -1714,6 +1714,7 @@ skip:
|
||||
if (!err) {
|
||||
avctx->sample_rate = s->sample_rate;
|
||||
avctx->bit_rate = s->bit_rate + s->prev_bit_rate;
|
||||
avctx->profile = s->eac3_extension_type_a == 1 ? FF_PROFILE_EAC3_DDP_ATMOS : FF_PROFILE_UNKNOWN;
|
||||
}
|
||||
|
||||
if (!avctx->sample_rate) {
|
||||
|
@ -102,6 +102,7 @@ typedef struct AC3DecodeContext {
|
||||
int eac3; ///< indicates if current frame is E-AC-3
|
||||
int eac3_frame_dependent_found; ///< bitstream has E-AC-3 dependent frame(s)
|
||||
int eac3_subsbtreamid_found; ///< bitstream has E-AC-3 additional substream(s)
|
||||
int eac3_extension_type_a; ///< bitstream has E-AC-3 extension type A enabled frame(s)
|
||||
int dolby_surround_mode; ///< dolby surround mode (dsurmod)
|
||||
int dolby_surround_ex_mode; ///< dolby surround ex mode (dsurexmod)
|
||||
int dolby_headphone_mode; ///< dolby headphone mode (dheadphonmod)
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include "ac3dec.h"
|
||||
#include "codec_internal.h"
|
||||
#include "profiles.h"
|
||||
#include "eac3dec.c"
|
||||
#include "ac3dec.c"
|
||||
|
||||
@ -92,6 +93,7 @@ const FFCodec ff_eac3_decoder = {
|
||||
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
.p.priv_class = &ac3_eac3_decoder_class,
|
||||
.p.profiles = NULL_IF_CONFIG_SMALL(ff_eac3_profiles),
|
||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||
};
|
||||
#endif
|
||||
|
@ -1591,6 +1591,8 @@ typedef struct AVCodecContext {
|
||||
#define FF_PROFILE_DTS_HD_MA 60
|
||||
#define FF_PROFILE_DTS_EXPRESS 70
|
||||
|
||||
#define FF_PROFILE_EAC3_DDP_ATMOS 30
|
||||
|
||||
#define FF_PROFILE_MPEG2_422 0
|
||||
#define FF_PROFILE_MPEG2_HIGH 1
|
||||
#define FF_PROFILE_MPEG2_SS 2
|
||||
|
@ -2931,6 +2931,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
|
||||
.name = "eac3",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
|
||||
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
|
||||
.profiles = NULL_IF_CONFIG_SMALL(ff_eac3_profiles),
|
||||
},
|
||||
{
|
||||
.id = AV_CODEC_ID_SIPR,
|
||||
|
@ -464,7 +464,16 @@ static int ff_eac3_parse_header(AC3DecodeContext *s)
|
||||
if (get_bits1(gbc)) {
|
||||
int addbsil = get_bits(gbc, 6);
|
||||
for (i = 0; i < addbsil + 1; i++) {
|
||||
skip_bits(gbc, 8); // skip additional bit stream info
|
||||
if (i == 0) {
|
||||
/* In this 8 bit chunk, the LSB is equal to flag_ec3_extension_type_a
|
||||
which can be used to detect Atmos presence */
|
||||
skip_bits(gbc, 7);
|
||||
if (get_bits1(gbc)) {
|
||||
s->eac3_extension_type_a = 1;
|
||||
}
|
||||
} else {
|
||||
skip_bits(gbc, 8); // skip additional bit stream info
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,11 @@ const AVProfile ff_dca_profiles[] = {
|
||||
{ FF_PROFILE_UNKNOWN },
|
||||
};
|
||||
|
||||
const AVProfile ff_eac3_profiles[] = {
|
||||
{ FF_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"},
|
||||
{ FF_PROFILE_UNKNOWN },
|
||||
};
|
||||
|
||||
const AVProfile ff_dnxhd_profiles[] = {
|
||||
{ FF_PROFILE_DNXHD, "DNXHD"},
|
||||
{ FF_PROFILE_DNXHR_LB, "DNXHR LB"},
|
||||
|
@ -58,6 +58,7 @@
|
||||
|
||||
extern const AVProfile ff_aac_profiles[];
|
||||
extern const AVProfile ff_dca_profiles[];
|
||||
extern const AVProfile ff_eac3_profiles[];
|
||||
extern const AVProfile ff_dnxhd_profiles[];
|
||||
extern const AVProfile ff_h264_profiles[];
|
||||
extern const AVProfile ff_hevc_profiles[];
|
||||
|
Loading…
Reference in New Issue
Block a user