* commit 'ef1b23ad21e3f12fc4ff2a73a6d4d4cd9d630c4b': (21 commits) jvdec: set channel layout iss: set channel layout ipmovie: set channel layout iff: set channel layout idroqdec: set channel layout gxfdec: set channel layout when applicable gsmdec: set channel layout flvdec: set channel layout dv: set channel layout dsicin: set channel layout daud: set channel layout cdxl: set channel layout bmv: set channel layout bink: set channel layout bfi: set channel layout bethsoftvid: set channel layout apc: set channel layout amr: set channel_layout ppc: replace pointer casting with AV_COPY32 ppc: fix some unused variable warnings ... Conflicts: libavformat/amr.c libavformat/iff.c Merged-by: Michael Niedermayer <michaelni@gmx.at>tags/n1.1
@@ -638,11 +638,10 @@ print_config(){ | |||
} | |||
print_enabled(){ | |||
test x"$1" = x-n && end=" " && shift || end="\n" | |||
suf=$1 | |||
shift | |||
for v; do | |||
enabled $v && printf "%s$end" ${v%$suf}; | |||
enabled $v && printf "%s\n" ${v%$suf}; | |||
done | |||
} | |||
@@ -19,6 +19,7 @@ | |||
*/ | |||
#include "libavutil/cpu.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "libavutil/ppc/types_altivec.h" | |||
#include "libavutil/ppc/util_altivec.h" | |||
#include "libavcodec/dsputil.h" | |||
@@ -788,7 +789,7 @@ static inline vec_u8 h264_deblock_q1(register vec_u8 p0, | |||
alphavec = vec_splat(alphavec, 0x0); \ | |||
mask = h264_deblock_mask(p0, p1, q0, q1, alphavec, betavec); /*if in block */ \ | |||
\ | |||
*((int *)temp) = *((int *)tc0); \ | |||
AV_COPY32(temp, tc0); \ | |||
tc0vec = vec_ld(0, (signed char*)temp); \ | |||
tc0vec = vec_mergeh(tc0vec, tc0vec); \ | |||
tc0vec = vec_mergeh(tc0vec, tc0vec); \ | |||
@@ -322,7 +322,7 @@ static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, i | |||
pp1A, pp1B, pp2A, pp2B, pp3A, pp3B, | |||
psumA, psumB, sumA, sumB; | |||
vec_u8 sum, vdst, fsum; | |||
vec_u8 sum, fsum; | |||
for (i = 0 ; i < 16 ; i ++) { | |||
vec_u8 srcR1 = vec_ld(-2, src); | |||
@@ -423,9 +423,8 @@ static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, i | |||
sum = vec_packsu(sumA, sumB); | |||
ASSERT_ALIGNED(dst); | |||
vdst = vec_ld(0, dst); | |||
OP_U8_ALTIVEC(fsum, sum, vdst); | |||
OP_U8_ALTIVEC(fsum, sum, vec_ld(0, dst)); | |||
vec_st(fsum, 0, dst); | |||
@@ -486,7 +485,7 @@ static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, i | |||
srcP3ssA, srcP3ssB, | |||
sum1A, sum1B, sum2A, sum2B, sum3A, sum3B; | |||
vec_u8 sum, vdst, fsum, srcP3a, srcP3b, srcP3; | |||
vec_u8 sum, fsum, srcP3a, srcP3b, srcP3; | |||
for (i = 0 ; i < 16 ; i++) { | |||
srcP3a = vec_ld(0, srcbis += srcStride); | |||
@@ -532,9 +531,8 @@ static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, i | |||
sum = vec_packsu(sumA, sumB); | |||
ASSERT_ALIGNED(dst); | |||
vdst = vec_ld(0, dst); | |||
OP_U8_ALTIVEC(fsum, sum, vdst); | |||
OP_U8_ALTIVEC(fsum, sum, vec_ld(0, dst)); | |||
vec_st(fsum, 0, dst); | |||
@@ -582,7 +580,7 @@ static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, | |||
pp3Ae, pp3Ao, pp3Be, pp3Bo, pp1cAe, pp1cAo, pp1cBe, pp1cBo, | |||
pp32Ae, pp32Ao, pp32Be, pp32Bo, sumAe, sumAo, sumBe, sumBo, | |||
ssumAe, ssumAo, ssumBe, ssumBo; | |||
vec_u8 fsum, sumv, sum, vdst; | |||
vec_u8 fsum, sumv, sum; | |||
vec_s16 ssume, ssumo; | |||
src -= (2 * srcStride); | |||
@@ -766,9 +764,8 @@ static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, | |||
sum = vec_perm(sumv, sumv, mperm); | |||
ASSERT_ALIGNED(dst); | |||
vdst = vec_ld(0, dst); | |||
OP_U8_ALTIVEC(fsum, sum, vdst); | |||
OP_U8_ALTIVEC(fsum, sum, vec_ld(0, dst)); | |||
vec_st(fsum, 0, dst); | |||
@@ -25,7 +25,9 @@ Write and read amr data according to RFC3267, http://www.ietf.org/rfc/rfc3267.tx | |||
Only mono files are supported. | |||
*/ | |||
#include "libavutil/avassert.h" | |||
#include "libavutil/channel_layout.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -98,6 +100,7 @@ static int amr_read_header(AVFormatContext *s) | |||
st->codec->sample_rate = 8000; | |||
} | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate); | |||
@@ -20,6 +20,8 @@ | |||
*/ | |||
#include <string.h> | |||
#include "libavutil/channel_layout.h" | |||
#include "avformat.h" | |||
static int apc_probe(AVProbeData *p) | |||
@@ -58,9 +60,13 @@ static int apc_read_header(AVFormatContext *s) | |||
/* initial predictor values for adpcm decoder */ | |||
avio_read(pb, st->codec->extradata, 2 * 4); | |||
st->codec->channels = 1; | |||
if (avio_rl32(pb)) | |||
st->codec->channels = 2; | |||
if (avio_rl32(pb)) { | |||
st->codec->channels = 2; | |||
st->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||
} else { | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
} | |||
st->codec->bits_per_coded_sample = 4; | |||
st->codec->bit_rate = st->codec->bits_per_coded_sample * st->codec->channels | |||
@@ -27,6 +27,7 @@ | |||
* @see http://www.svatopluk.com/andux/docs/dfvid.html | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -240,6 +241,7 @@ static int vid_read_packet(AVFormatContext *s, | |||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
st->codec->codec_id = AV_CODEC_ID_PCM_U8; | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
st->codec->bits_per_coded_sample = 8; | |||
st->codec->sample_rate = vid->sample_rate; | |||
st->codec->bit_rate = 8 * st->codec->sample_rate; | |||
@@ -26,6 +26,7 @@ | |||
* @see http://wiki.multimedia.cx/index.php?title=BFI | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -96,6 +97,7 @@ static int bfi_read_header(AVFormatContext * s) | |||
astream->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
astream->codec->codec_id = AV_CODEC_ID_PCM_U8; | |||
astream->codec->channels = 1; | |||
astream->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
astream->codec->bits_per_coded_sample = 8; | |||
astream->codec->bit_rate = | |||
astream->codec->sample_rate * astream->codec->bits_per_coded_sample; | |||
@@ -28,6 +28,7 @@ | |||
* http://wiki.multimedia.cx/index.php?title=Bink_Container | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -143,7 +144,13 @@ static int read_header(AVFormatContext *s) | |||
flags = avio_rl16(pb); | |||
ast->codec->codec_id = flags & BINK_AUD_USEDCT ? | |||
AV_CODEC_ID_BINKAUDIO_DCT : AV_CODEC_ID_BINKAUDIO_RDFT; | |||
ast->codec->channels = flags & BINK_AUD_STEREO ? 2 : 1; | |||
if (flags & BINK_AUD_STEREO) { | |||
ast->codec->channels = 2; | |||
ast->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||
} else { | |||
ast->codec->channels = 1; | |||
ast->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
} | |||
ast->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE); | |||
if (!ast->codec->extradata) | |||
return AVERROR(ENOMEM); | |||
@@ -19,6 +19,7 @@ | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -58,6 +59,7 @@ static int bmv_read_header(AVFormatContext *s) | |||
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
ast->codec->codec_id = AV_CODEC_ID_BMV_AUDIO; | |||
ast->codec->channels = 2; | |||
ast->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||
ast->codec->sample_rate = 22050; | |||
avpriv_set_pts_info(ast, 16, 1, 22050); | |||
@@ -19,6 +19,7 @@ | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "libavutil/parseutils.h" | |||
#include "libavutil/opt.h" | |||
@@ -143,7 +144,13 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt) | |||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
st->codec->codec_tag = 0; | |||
st->codec->codec_id = AV_CODEC_ID_PCM_S8; | |||
st->codec->channels = cdxl->header[1] & 0x10 ? 2 : 1; | |||
if (cdxl->header[1] & 0x10) { | |||
st->codec->channels = 2; | |||
st->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||
} else { | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
} | |||
st->codec->sample_rate = cdxl->sample_rate; | |||
st->start_time = 0; | |||
cdxl->audio_stream_index = st->index; | |||
@@ -18,6 +18,8 @@ | |||
* License along with FFmpeg; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "avformat.h" | |||
static int daud_header(AVFormatContext *s) { | |||
@@ -28,6 +30,7 @@ static int daud_header(AVFormatContext *s) { | |||
st->codec->codec_id = AV_CODEC_ID_PCM_S24DAUD; | |||
st->codec->codec_tag = MKTAG('d', 'a', 'u', 'd'); | |||
st->codec->channels = 6; | |||
st->codec->channel_layout = AV_CH_LAYOUT_5POINT1; | |||
st->codec->sample_rate = 96000; | |||
st->codec->bit_rate = 3 * 6 * 96000 * 8; | |||
st->codec->block_align = 3 * 6; | |||
@@ -24,6 +24,7 @@ | |||
* Delphine Software International CIN file demuxer | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -132,6 +133,7 @@ static int cin_read_header(AVFormatContext *s) | |||
st->codec->codec_id = AV_CODEC_ID_DSICINAUDIO; | |||
st->codec->codec_tag = 0; /* no tag */ | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
st->codec->sample_rate = 22050; | |||
st->codec->bits_per_coded_sample = 8; | |||
st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels; | |||
@@ -33,6 +33,7 @@ | |||
#include "internal.h" | |||
#include "libavcodec/dv_profile.h" | |||
#include "libavcodec/dvdata.h" | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "libavutil/mathematics.h" | |||
#include "libavutil/timecode.h" | |||
@@ -252,6 +253,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame) | |||
} | |||
c->ast[i]->codec->sample_rate = dv_audio_frequency[freq]; | |||
c->ast[i]->codec->channels = 2; | |||
c->ast[i]->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||
c->ast[i]->codec->bit_rate = 2 * dv_audio_frequency[freq] * 16; | |||
c->ast[i]->start_time = 0; | |||
} | |||
@@ -25,6 +25,7 @@ | |||
*/ | |||
#include "libavutil/avstring.h" | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/dict.h" | |||
#include "libavutil/opt.h" | |||
#include "libavutil/intfloat.h" | |||
@@ -778,6 +779,8 @@ retry_duration: | |||
bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8; | |||
if(!st->codec->channels || !st->codec->sample_rate || !st->codec->bits_per_coded_sample) { | |||
st->codec->channels = channels; | |||
st->codec->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO : | |||
AV_CH_LAYOUT_STEREO; | |||
st->codec->sample_rate = sample_rate; | |||
st->codec->bits_per_coded_sample = bits_per_coded_sample; | |||
} | |||
@@ -824,6 +827,7 @@ retry_duration: | |||
if (avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata, | |||
st->codec->extradata_size * 8, 1) >= 0) { | |||
st->codec->channels = cfg.channels; | |||
st->codec->channel_layout = 0; | |||
if (cfg.ext_sample_rate) | |||
st->codec->sample_rate = cfg.ext_sample_rate; | |||
else | |||
@@ -19,6 +19,7 @@ | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/mathematics.h" | |||
#include "libavutil/opt.h" | |||
#include "avformat.h" | |||
@@ -63,6 +64,7 @@ static int gsm_read_header(AVFormatContext *s) | |||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
st->codec->codec_id = s->iformat->raw_codec_id; | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
st->codec->sample_rate = c->sample_rate; | |||
st->codec->bit_rate = GSM_BLOCK_SIZE * 8 * c->sample_rate / GSM_BLOCK_SAMPLES; | |||
@@ -19,6 +19,7 @@ | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/common.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -141,6 +142,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { | |||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
st->codec->codec_id = AV_CODEC_ID_PCM_S24LE; | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
st->codec->sample_rate = 48000; | |||
st->codec->bit_rate = 3 * 1 * 48000 * 8; | |||
st->codec->block_align = 3 * 1; | |||
@@ -150,6 +152,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { | |||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
st->codec->codec_id = AV_CODEC_ID_PCM_S16LE; | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
st->codec->sample_rate = 48000; | |||
st->codec->bit_rate = 2 * 1 * 48000 * 8; | |||
st->codec->block_align = 2 * 1; | |||
@@ -159,6 +162,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { | |||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
st->codec->codec_id = AV_CODEC_ID_AC3; | |||
st->codec->channels = 2; | |||
st->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||
st->codec->sample_rate = 48000; | |||
break; | |||
// timecode tracks: | |||
@@ -27,6 +27,7 @@ | |||
* http://www.csse.monash.edu.au/~timf/ | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -178,7 +179,14 @@ static int roq_read_packet(AVFormatContext *s, | |||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
st->codec->codec_id = AV_CODEC_ID_ROQ_DPCM; | |||
st->codec->codec_tag = 0; /* no tag */ | |||
st->codec->channels = roq->audio_channels = chunk_type == RoQ_SOUND_STEREO ? 2 : 1; | |||
if (chunk_type == RoQ_SOUND_STEREO) { | |||
st->codec->channels = 2; | |||
st->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||
} else { | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
} | |||
roq->audio_channels = st->codec->channels; | |||
st->codec->sample_rate = RoQ_AUDIO_SAMPLE_RATE; | |||
st->codec->bits_per_coded_sample = 16; | |||
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * | |||
@@ -28,10 +28,11 @@ | |||
* http://wiki.multimedia.cx/index.php?title=IFF | |||
*/ | |||
#include "libavcodec/bytestream.h" | |||
#include "libavutil/avassert.h" | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "libavutil/dict.h" | |||
#include "libavcodec/bytestream.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -155,6 +156,7 @@ static int iff_read_header(AVFormatContext *s) | |||
return AVERROR(ENOMEM); | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
avio_skip(pb, 8); | |||
// codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and interlaced (ILBM) content | |||
st->codec->codec_tag = avio_rl32(pb); | |||
@@ -191,7 +193,13 @@ static int iff_read_header(AVFormatContext *s) | |||
case ID_CHAN: | |||
if (data_size < 4) | |||
return AVERROR_INVALIDDATA; | |||
st->codec->channels = (avio_rb32(pb) < 6) ? 1 : 2; | |||
if (avio_rb32(pb) < 6) { | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
} else { | |||
st->codec->channels = 2; | |||
st->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||
} | |||
break; | |||
case ID_CAMG: | |||
@@ -32,6 +32,7 @@ | |||
* up and sending out the chunks. | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -605,6 +606,8 @@ static int ipmovie_read_header(AVFormatContext *s) | |||
st->codec->codec_id = ipmovie->audio_type; | |||
st->codec->codec_tag = 0; /* no tag */ | |||
st->codec->channels = ipmovie->audio_channels; | |||
st->codec->channel_layout = st->codec->channels == 1 ? AV_CH_LAYOUT_MONO : | |||
AV_CH_LAYOUT_STEREO; | |||
st->codec->sample_rate = ipmovie->audio_sample_rate; | |||
st->codec->bits_per_coded_sample = ipmovie->audio_bits; | |||
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * | |||
@@ -26,6 +26,7 @@ | |||
* @see http://wiki.multimedia.cx/index.php?title=FunCom_ISS | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
#include "libavutil/avstring.h" | |||
@@ -99,7 +100,13 @@ static av_cold int iss_read_header(AVFormatContext *s) | |||
return AVERROR(ENOMEM); | |||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | |||
st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_ISS; | |||
st->codec->channels = stereo ? 2 : 1; | |||
if (stereo) { | |||
st->codec->channels = 2; | |||
st->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||
} else { | |||
st->codec->channels = 1; | |||
st->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
} | |||
st->codec->sample_rate = 44100; | |||
if(rate_divisor > 0) | |||
st->codec->sample_rate /= rate_divisor; | |||
@@ -25,6 +25,7 @@ | |||
* @author Peter Ross <pross@xvid.org> | |||
*/ | |||
#include "libavutil/channel_layout.h" | |||
#include "libavutil/intreadwrite.h" | |||
#include "avformat.h" | |||
#include "internal.h" | |||
@@ -91,6 +92,7 @@ static int read_header(AVFormatContext *s) | |||
ast->codec->codec_tag = 0; /* no fourcc */ | |||
ast->codec->sample_rate = avio_rl16(pb); | |||
ast->codec->channels = 1; | |||
ast->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||
avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate); | |||
avio_skip(pb, 10); | |||