Unified · Split
| @@ -1714,6 +1714,7 @@ skip: · 1713 unmodified lines | |||
| 1714 | if (!err) { | 1714 | if (!err) { |
| 1715 | avctx->sample_rate = s->sample_rate; | 1715 | avctx->sample_rate = s->sample_rate; |
| 1716 | avctx->bit_rate = s->bit_rate + s->prev_bit_rate; | 1716 | avctx->bit_rate = s->bit_rate + s->prev_bit_rate; |
| 1717 | avctx->profile = s->eac3_extension_type_a == 1 ? FF_PROFILE_EAC3_DDP_ATMOS : FF_PROFILE_UNKNOWN; | ||
| 1717 | } | 1718 | } |
| 1718 | 1719 | ||
| 1719 | if (!avctx->sample_rate) { | 1720 | if (!avctx->sample_rate) { |
| @@ -102,6 +102,7 @@ typedef struct AC3DecodeContext { · 101 unmodified lines | |||
| 102 | int eac3; ///< indicates if current frame is E-AC-3 | 102 | int eac3; ///< indicates if current frame is E-AC-3 |
| 103 | int eac3_frame_dependent_found; ///< bitstream has E-AC-3 dependent frame(s) | 103 | int eac3_frame_dependent_found; ///< bitstream has E-AC-3 dependent frame(s) |
| 104 | int eac3_subsbtreamid_found; ///< bitstream has E-AC-3 additional substream(s) | 104 | int eac3_subsbtreamid_found; ///< bitstream has E-AC-3 additional substream(s) |
| 105 | int eac3_extension_type_a; ///< bitstream has E-AC-3 extension type A enabled frame(s) | ||
| 105 | int dolby_surround_mode; ///< dolby surround mode (dsurmod) | 106 | int dolby_surround_mode; ///< dolby surround mode (dsurmod) |
| 106 | int dolby_surround_ex_mode; ///< dolby surround ex mode (dsurexmod) | 107 | int dolby_surround_ex_mode; ///< dolby surround ex mode (dsurexmod) |
| 107 | int dolby_headphone_mode; ///< dolby headphone mode (dheadphonmod) | 108 | int dolby_headphone_mode; ///< dolby headphone mode (dheadphonmod) |
| @@ -33,6 +33,7 @@ · 32 unmodified lines | |||
| 33 | 33 | ||
| 34 | #include "ac3dec.h" | 34 | #include "ac3dec.h" |
| 35 | #include "codec_internal.h" | 35 | #include "codec_internal.h" |
| 36 | #include "profiles.h" | ||
| 36 | #include "eac3dec.c" | 37 | #include "eac3dec.c" |
| 37 | #include "ac3dec.c" | 38 | #include "ac3dec.c" |
| 38 | 39 | ||
| @@ -92,6 +93,7 @@ const FFCodec ff_eac3_decoder = { · 53 unmodified lines | |||
| 92 | .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | 93 | .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, |
| 93 | AV_SAMPLE_FMT_NONE }, | 94 | AV_SAMPLE_FMT_NONE }, |
| 94 | .p.priv_class = &ac3_eac3_decoder_class, | 95 | .p.priv_class = &ac3_eac3_decoder_class, |
| 96 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_eac3_profiles), | ||
| 95 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, | 97 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 96 | }; | 98 | }; |
| 97 | #endif | 99 | #endif |
| @@ -1591,6 +1591,8 @@ typedef struct AVCodecContext { · 1590 unmodified lines | |||
| 1591 | #define FF_PROFILE_DTS_HD_MA 60 | 1591 | #define FF_PROFILE_DTS_HD_MA 60 |
| 1592 | #define FF_PROFILE_DTS_EXPRESS 70 | 1592 | #define FF_PROFILE_DTS_EXPRESS 70 |
| 1593 | 1593 | ||
| 1594 | #define FF_PROFILE_EAC3_DDP_ATMOS 30 | ||
| 1595 | |||
| 1594 | #define FF_PROFILE_MPEG2_422 0 | 1596 | #define FF_PROFILE_MPEG2_422 0 |
| 1595 | #define FF_PROFILE_MPEG2_HIGH 1 | 1597 | #define FF_PROFILE_MPEG2_HIGH 1 |
| 1596 | #define FF_PROFILE_MPEG2_SS 2 | 1598 | #define FF_PROFILE_MPEG2_SS 2 |
| @@ -2931,6 +2931,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 2930 unmodified lines | |||
| 2931 | .name = "eac3", | 2931 | .name = "eac3", |
| 2932 | .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), | 2932 | .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), |
| 2933 | .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, | 2933 | .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, |
| 2934 | .profiles = NULL_IF_CONFIG_SMALL(ff_eac3_profiles), | ||
| 2934 | }, | 2935 | }, |
| 2935 | { | 2936 | { |
| 2936 | .id = AV_CODEC_ID_SIPR, | 2937 | .id = AV_CODEC_ID_SIPR, |
| @@ -464,7 +464,16 @@ static int ff_eac3_parse_header(AC3DecodeContext *s) · 463 unmodified lines | |||
| 464 | if (get_bits1(gbc)) { | 464 | if (get_bits1(gbc)) { |
| 465 | int addbsil = get_bits(gbc, 6); | 465 | int addbsil = get_bits(gbc, 6); |
| 466 | for (i = 0; i < addbsil + 1; i++) { | 466 | for (i = 0; i < addbsil + 1; i++) { |
| 467 | skip_bits(gbc, 8); // skip additional bit stream info | 467 | if (i == 0) { |
| 468 | /* In this 8 bit chunk, the LSB is equal to flag_ec3_extension_type_a | ||
| 469 | which can be used to detect Atmos presence */ | ||
| 470 | skip_bits(gbc, 7); | ||
| 471 | if (get_bits1(gbc)) { | ||
| 472 | s->eac3_extension_type_a = 1; | ||
| 473 | } | ||
| 474 | } else { | ||
| 475 | skip_bits(gbc, 8); // skip additional bit stream info | ||
| 476 | } | ||
| 468 | } | 477 | } |
| 469 | } | 478 | } |
| 470 | 479 | ||
| @@ -45,6 +45,11 @@ const AVProfile ff_dca_profiles[] = { · 44 unmodified lines | |||
| 45 | { FF_PROFILE_UNKNOWN }, | 45 | { FF_PROFILE_UNKNOWN }, |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | const AVProfile ff_eac3_profiles[] = { | ||
| 49 | { FF_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"}, | ||
| 50 | { FF_PROFILE_UNKNOWN }, | ||
| 51 | }; | ||
| 52 | |||
| 48 | const AVProfile ff_dnxhd_profiles[] = { | 53 | const AVProfile ff_dnxhd_profiles[] = { |
| 49 | { FF_PROFILE_DNXHD, "DNXHD"}, | 54 | { FF_PROFILE_DNXHD, "DNXHD"}, |
| 50 | { FF_PROFILE_DNXHR_LB, "DNXHR LB"}, | 55 | { FF_PROFILE_DNXHR_LB, "DNXHR LB"}, |
| @@ -58,6 +58,7 @@ · 57 unmodified lines | |||
| 58 | 58 | ||
| 59 | extern const AVProfile ff_aac_profiles[]; | 59 | extern const AVProfile ff_aac_profiles[]; |
| 60 | extern const AVProfile ff_dca_profiles[]; | 60 | extern const AVProfile ff_dca_profiles[]; |
| 61 | extern const AVProfile ff_eac3_profiles[]; | ||
| 61 | extern const AVProfile ff_dnxhd_profiles[]; | 62 | extern const AVProfile ff_dnxhd_profiles[]; |
| 62 | extern const AVProfile ff_h264_profiles[]; | 63 | extern const AVProfile ff_h264_profiles[]; |
| 63 | extern const AVProfile ff_hevc_profiles[]; | 64 | extern const AVProfile ff_hevc_profiles[]; |