Unified · Split
| @@ -1584,12 +1584,15 @@ typedef struct AVCodecContext { · 1583 unmodified lines | ||
| 1584 | 1584 | #define FF_PROFILE_DNXHR_HQX 4 |
| 1585 | 1585 | #define FF_PROFILE_DNXHR_444 5 |
| 1586 | 1586 | |
| 1587 | −#define FF_PROFILE_DTS 20 | |
| 1588 | −#define FF_PROFILE_DTS_ES 30 | |
| 1589 | −#define FF_PROFILE_DTS_96_24 40 | |
| 1590 | −#define FF_PROFILE_DTS_HD_HRA 50 | |
| 1591 | −#define FF_PROFILE_DTS_HD_MA 60 | |
| 1592 | −#define FF_PROFILE_DTS_EXPRESS 70 | |
| 1587 | +#define FF_PROFILE_DTS 20 | |
| 1588 | +#define FF_PROFILE_DTS_ES 30 | |
| 1589 | +#define FF_PROFILE_DTS_96_24 40 | |
| 1590 | +#define FF_PROFILE_DTS_HD_HRA 50 | |
| 1591 | +#define FF_PROFILE_DTS_HD_MA 60 | |
| 1592 | +#define FF_PROFILE_DTS_EXPRESS 70 | |
| 1593 | +#define FF_PROFILE_DTS_HD_MA_X 61 | |
| 1594 | +#define FF_PROFILE_DTS_HD_MA_X_IMAX 62 | |
| 1595 | + | |
| 1593 | 1596 | |
| 1594 | 1597 | #define FF_PROFILE_EAC3_DDP_ATMOS 30 |
| 1595 | 1598 | |
| @@ -33,4 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | #define DCA_SYNCWORD_SUBSTREAM_CORE 0x02B09261U |
| 34 | 34 | #define DCA_SYNCWORD_REV1AUX 0x9A1105A0U |
| 35 | 35 | |
| 36 | +#define DCA_SYNCWORD_XLL_X 0x02000850U | |
| 37 | +#define DCA_SYNCWORD_XLL_X_IMAX 0xF14000D0U | |
| 38 | + | |
| 36 | 39 | #endif /* AVCODEC_DCA_SYNCWORDS_H */ |
| @@ -18,6 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | +#include "avcodec.h" | |
| 21 | 22 | #include "libavutil/channel_layout.h" |
| 22 | 23 | #include "dcadec.h" |
| 23 | 24 | #include "dcadata.h" |
| @@ -1054,6 +1055,22 @@ static int parse_frame(DCAXllDecoder *s, const uint8_t *data, int size, DCAExssA · 1030 unmodified lines | ||
| 1054 | 1055 | return ret; |
| 1055 | 1056 | if ((ret = parse_band_data(s)) < 0) |
| 1056 | 1057 | return ret; |
| 1058 | + | |
| 1059 | + if (s->frame_size * 8 > FFALIGN(get_bits_count(&s->gb), 32)) { | |
| 1060 | + unsigned int extradata_syncword; | |
| 1061 | + | |
| 1062 | + // Align to dword | |
| 1063 | + skip_bits_long(&s->gb, -get_bits_count(&s->gb) & 31); | |
| 1064 | + | |
| 1065 | + extradata_syncword = show_bits_long(&s->gb, 32); | |
| 1066 | + | |
| 1067 | + if (extradata_syncword == DCA_SYNCWORD_XLL_X) { | |
| 1068 | + s->x_syncword_present = 1; | |
| 1069 | + } else if ((extradata_syncword >> 1) == (DCA_SYNCWORD_XLL_X_IMAX >> 1)) { | |
| 1070 | + s->x_imax_syncword_present = 1; | |
| 1071 | + } | |
| 1072 | + } | |
| 1073 | + | |
| 1057 | 1074 | if (ff_dca_seek_bits(&s->gb, s->frame_size * 8)) { |
| 1058 | 1075 | av_log(s->avctx, AV_LOG_ERROR, "Read past end of XLL frame\n"); |
| 1059 | 1076 | return AVERROR_INVALIDDATA; |
| @@ -1428,8 +1445,15 @@ int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame) · 368 unmodified lines | ||
| 1428 | 1445 | return AVERROR(EINVAL); |
| 1429 | 1446 | } |
| 1430 | 1447 | |
| 1448 | + if (s->x_imax_syncword_present) { | |
| 1449 | + avctx->profile = FF_PROFILE_DTS_HD_MA_X_IMAX; | |
| 1450 | + } else if (s->x_syncword_present) { | |
| 1451 | + avctx->profile = FF_PROFILE_DTS_HD_MA_X; | |
| 1452 | + } else { | |
| 1453 | + avctx->profile = FF_PROFILE_DTS_HD_MA; | |
| 1454 | + } | |
| 1455 | + | |
| 1431 | 1456 | avctx->bits_per_raw_sample = p->storage_bit_res; |
| 1432 | − avctx->profile = FF_PROFILE_DTS_HD_MA; | |
| 1433 | 1457 | avctx->bit_rate = 0; |
| 1434 | 1458 | |
| 1435 | 1459 | frame->nb_samples = nsamples = s->nframesamples << (s->nfreqbands - 1); |
| @@ -135,6 +135,9 @@ typedef struct DCAXllDecoder { · 134 unmodified lines | ||
| 135 | 135 | |
| 136 | 136 | DCADSPContext *dcadsp; |
| 137 | 137 | |
| 138 | + int x_syncword_present; ///< Syncword for extension data at end of frame (DTS:X) is present | |
| 139 | + int x_imax_syncword_present; ///< Syncword for extension data at end of frame (DTS:X IMAX) is present | |
| 140 | + | |
| 138 | 141 | int output_mask; |
| 139 | 142 | int32_t *output_samples[DCA_SPEAKER_COUNT]; |
| 140 | 143 | } DCAXllDecoder; |
| @@ -36,12 +36,14 @@ const AVProfile ff_aac_profiles[] = { · 35 unmodified lines | ||
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | 38 | const AVProfile ff_dca_profiles[] = { |
| 39 | − { FF_PROFILE_DTS, "DTS" }, | |
| 40 | − { FF_PROFILE_DTS_ES, "DTS-ES" }, | |
| 41 | − { FF_PROFILE_DTS_96_24, "DTS 96/24" }, | |
| 42 | − { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" }, | |
| 43 | − { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" }, | |
| 44 | − { FF_PROFILE_DTS_EXPRESS, "DTS Express" }, | |
| 39 | + { FF_PROFILE_DTS, "DTS" }, | |
| 40 | + { FF_PROFILE_DTS_ES, "DTS-ES" }, | |
| 41 | + { FF_PROFILE_DTS_96_24, "DTS 96/24" }, | |
| 42 | + { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" }, | |
| 43 | + { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" }, | |
| 44 | + { FF_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" }, | |
| 45 | + { FF_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" }, | |
| 46 | + { FF_PROFILE_DTS_EXPRESS, "DTS Express" }, | |
| 45 | 47 | { FF_PROFILE_UNKNOWN }, |
| 46 | 48 | }; |
| 47 | 49 | |