Commit 60b433d9 authored by Tim Nicholson's avatar Tim Nicholson Committed by Michael Niedermayer

movenc.c: Add support for >16bit BE flavours

Currently only LE handled correctly
Updated fate checksums to reflect new headers
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2e8dcde1
......@@ -288,6 +288,14 @@ static int mov_write_enda_tag(AVIOContext *pb)
return 10;
}
static int mov_write_enda_tag_be(AVIOContext *pb)
{
avio_wb32(pb, 10);
ffio_wfourcc(pb, "enda");
avio_wb16(pb, 0); /* big endian */
return 10;
}
static void put_descr(AVIOContext *pb, int tag, unsigned int size)
{
int i = 3;
......@@ -369,6 +377,14 @@ static int mov_pcm_le_gt16(enum AVCodecID codec_id)
codec_id == AV_CODEC_ID_PCM_F64LE;
}
static int mov_pcm_be_gt16(enum AVCodecID codec_id)
{
return codec_id == AV_CODEC_ID_PCM_S24BE ||
codec_id == AV_CODEC_ID_PCM_S32BE ||
codec_id == AV_CODEC_ID_PCM_F32BE ||
codec_id == AV_CODEC_ID_PCM_F64BE;
}
static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track)
{
int64_t pos = avio_tell(pb);
......@@ -432,8 +448,10 @@ static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track)
ffio_wfourcc(pb, "mp4a");
avio_wb32(pb, 0);
mov_write_esds_tag(pb, track);
} else if (mov_pcm_le_gt16(track->enc->codec_id)) {
mov_write_enda_tag(pb);
} else if (mov_pcm_le_gt16(track->enc->codec_id)) {
mov_write_enda_tag(pb);
} else if (mov_pcm_be_gt16(track->enc->codec_id)) {
mov_write_enda_tag_be(pb);
} else if (track->enc->codec_id == AV_CODEC_ID_AMR_NB) {
mov_write_amr_tag(pb, track);
} else if (track->enc->codec_id == AV_CODEC_ID_AC3) {
......@@ -629,6 +647,7 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
tag = AV_RL32("lpcm");
version = 2;
} else if (track->audio_vbr || mov_pcm_le_gt16(track->enc->codec_id) ||
mov_pcm_be_gt16(track->enc->codec_id) ||
track->enc->codec_id == AV_CODEC_ID_ADPCM_MS ||
track->enc->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV ||
track->enc->codec_id == AV_CODEC_ID_QDM2) {
......@@ -697,7 +716,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
track->enc->codec_id == AV_CODEC_ID_ADPCM_MS ||
track->enc->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV ||
track->enc->codec_id == AV_CODEC_ID_QDM2 ||
(mov_pcm_le_gt16(track->enc->codec_id) && version==1)))
(mov_pcm_le_gt16(track->enc->codec_id) && version==1) ||
(mov_pcm_be_gt16(track->enc->codec_id) && version==1)))
mov_write_wave_tag(pb, track);
else if(track->tag == MKTAG('m','p','4','a'))
mov_write_esds_tag(pb, track);
......
5d843e1f56796aae3185016f164b16b7 *tests/data/fate/acodec-pcm-s24be.mov
1588269 tests/data/fate/acodec-pcm-s24be.mov
cbf0bd68d21099335e197ae812834110 *tests/data/fate/acodec-pcm-s24be.mov
1588323 tests/data/fate/acodec-pcm-s24be.mov
64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s24be.out.wav
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400
b34c66c56df1b1e75688929cf20670b9 *tests/data/fate/acodec-pcm-s32be.mov
2117473 tests/data/fate/acodec-pcm-s32be.mov
856b157d3ab505f0859b0de692e6a8bc *tests/data/fate/acodec-pcm-s32be.mov
2117527 tests/data/fate/acodec-pcm-s32be.mov
64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s32be.out.wav
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment