1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '381dc1a5ec0925b281c573457c413ae643567086'

* commit '381dc1a5ec0925b281c573457c413ae643567086':
  fate: ac3: Place E-AC-3 tests and AC-3 tests in different groups
  fate: Add shorthands for acodec PCM and ADPCM tests
  avconv: Drop unused function argument from do_video_stats()
  cmdutils: Conditionally compile libswscale-related bits
  aacenc: Drop some unused function arguments
  rtsp: Avoid a cast when calling strtol
  nut: support textual data
  nutenc: verbosely report unsupported negative pts

Conflicts:
	cmdutils.c
	ffmpeg.c
	libavformat/nut.c
	libavformat/nutenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-30 13:45:44 +01:00
commit cd37963684
11 changed files with 47 additions and 24 deletions

View File

@ -440,7 +440,8 @@ int opt_default(void *optctx, const char *opt, const char *arg)
int consumed = 0;
char opt_stripped[128];
const char *p;
const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(), *sc, *swr_class;
const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
const AVClass *sc, *swr_class;
if (!(p = strchr(opt, ':')))
p = opt + strlen(opt);

View File

@ -70,6 +70,12 @@ PFD[32] would for example be signed 32 bit little-endian IEEE float
@item DVBS @tab DVB subtitles
@end multitable
@section Raw Data
@multitable @columnfractions .4 .4
@item UTF8 @tab Raw UTF-8
@end multitable
@section Codecs
@multitable @columnfractions .4 .4

View File

@ -109,7 +109,7 @@ const int program_birth_year = 2000;
static FILE *vstats_file;
static void do_video_stats(AVFormatContext *os, OutputStream *ost, int frame_size);
static void do_video_stats(OutputStream *ost, int frame_size);
static int64_t getutime(void);
static int run_as_daemon = 0;
@ -921,7 +921,7 @@ static void do_video_out(AVFormatContext *s,
}
if (vstats_filename && frame_size)
do_video_stats(output_files[ost->file_index]->ctx, ost, frame_size);
do_video_stats(ost, frame_size);
}
static double psnr(double d)
@ -929,8 +929,7 @@ static double psnr(double d)
return -10.0 * log(d) / log(10.0);
}
static void do_video_stats(AVFormatContext *os, OutputStream *ost,
int frame_size)
static void do_video_stats(OutputStream *ost, int frame_size)
{
AVCodecContext *enc;
int frame_number;

View File

@ -302,7 +302,7 @@ static void encode_ms_info(PutBitContext *pb, ChannelElement *cpe)
/**
* Produce integer coefficients from scalefactors provided by the model.
*/
static void adjust_frame_information(AACEncContext *apc, ChannelElement *cpe, int chans)
static void adjust_frame_information(ChannelElement *cpe, int chans)
{
int i, w, w2, g, ch;
int start, maxsfb, cmaxsfb;
@ -459,8 +459,7 @@ static int encode_individual_channel(AVCodecContext *avctx, AACEncContext *s,
/**
* Write some auxiliary information about the created AAC file.
*/
static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s,
const char *name)
static void put_bitstream_info(AACEncContext *s, const char *name)
{
int i, namelen, padbits;
@ -582,7 +581,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
init_put_bits(&s->pb, avpkt->data, avpkt->size);
if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & CODEC_FLAG_BITEXACT))
put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);
put_bitstream_info(s, LIBAVCODEC_IDENT);
start_ch = 0;
memset(chan_el_counter, 0, sizeof(chan_el_counter));
for (i = 0; i < s->chan_map[0]; i++) {
@ -624,7 +623,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
s->coder->search_for_ms(s, cpe, s->lambda);
}
}
adjust_frame_information(s, cpe, chans);
adjust_frame_information(cpe, chans);
if (chans == 2) {
put_bits(&s->pb, 1, cpe->common_window);
if (cpe->common_window) {

View File

@ -34,6 +34,11 @@ const AVCodecTag ff_nut_subtitle_tags[] = {
{ AV_CODEC_ID_NONE , 0 }
};
const AVCodecTag ff_nut_data_tags[] = {
{ AV_CODEC_ID_TEXT , MKTAG('U', 'T', 'F', '8') },
{ AV_CODEC_ID_NONE , 0 }
};
const AVCodecTag ff_nut_video_tags[] = {
{ AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 15 ) },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 15 ) },
@ -140,7 +145,7 @@ const AVCodecTag ff_nut_audio_tags[] = {
const AVCodecTag * const ff_nut_codec_tags[] = {
ff_nut_video_tags, ff_nut_subtitle_tags,
ff_codec_bmp_tags, ff_codec_wav_tags, ff_nut_audio_tags, 0
ff_codec_bmp_tags, ff_codec_wav_tags, ff_nut_audio_tags, ff_nut_data_tags, 0
};
void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){

View File

@ -110,6 +110,7 @@ typedef struct NUTContext {
extern const AVCodecTag ff_nut_subtitle_tags[];
extern const AVCodecTag ff_nut_video_tags[];
extern const AVCodecTag ff_nut_audio_tags[];
extern const AVCodecTag ff_nut_data_tags[];
extern const AVCodecTag * const ff_nut_codec_tags[];

View File

@ -382,6 +382,7 @@ static int decode_stream_header(NUTContext *nut)
break;
case 3:
st->codec->codec_type = AVMEDIA_TYPE_DATA;
st->codec->codec_id = ff_codec_get_id(ff_nut_data_tags, tmp);
break;
default:
av_log(s, AV_LOG_ERROR, "unknown stream class (%d)\n", class);

View File

@ -812,7 +812,9 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
int ret;
if (pkt->pts < 0) {
av_log(s, AV_LOG_ERROR, "Invalid negative packet pts %"PRId64" in input\n", pkt->pts);
av_log(s, AV_LOG_ERROR,
"Negative pts not supported stream %d, pts %"PRId64"\n",
pkt->stream_index, pkt->pts);
return AVERROR(EINVAL);
}

View File

@ -766,8 +766,10 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
th->lower_transport = RTSP_LOWER_TRANSPORT_UDP_MULTICAST;
} else if (!strcmp(parameter, "ttl")) {
if (*p == '=') {
char *end;
p++;
th->ttl = strtol(p, (char **)&p, 10);
th->ttl = strtol(p, &end, 10);
p = end;
}
} else if (!strcmp(parameter, "destination")) {
if (*p == '=') {

View File

@ -26,23 +26,23 @@ FATE_AC3 += fate-ac3-5.1-downmix-stereo
fate-ac3-5.1-downmix-stereo: CMD = pcm -request_channels 2 -i $(SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3
fate-ac3-5.1-downmix-stereo: REF = $(SAMPLES)/ac3/monsters_inc_5.1_448_small_stereo.pcm
FATE_AC3 += fate-eac3-1
FATE_EAC3 += fate-eac3-1
fate-eac3-1: CMD = pcm -i $(SAMPLES)/eac3/csi_miami_5.1_256_spx_small.eac3
fate-eac3-1: REF = $(SAMPLES)/eac3/csi_miami_5.1_256_spx_small.pcm
FATE_AC3 += fate-eac3-2
FATE_EAC3 += fate-eac3-2
fate-eac3-2: CMD = pcm -i $(SAMPLES)/eac3/csi_miami_stereo_128_spx_small.eac3
fate-eac3-2: REF = $(SAMPLES)/eac3/csi_miami_stereo_128_spx_small.pcm
FATE_AC3 += fate-eac3-3
FATE_EAC3 += fate-eac3-3
fate-eac3-3: CMD = pcm -i $(SAMPLES)/eac3/matrix2_commentary1_stereo_192_small.eac3
fate-eac3-3: REF = $(SAMPLES)/eac3/matrix2_commentary1_stereo_192_small.pcm
FATE_AC3 += fate-eac3-4
FATE_EAC3 += fate-eac3-4
fate-eac3-4: CMD = pcm -i $(SAMPLES)/eac3/serenity_english_5.1_1536_small.eac3
fate-eac3-4: REF = $(SAMPLES)/eac3/serenity_english_5.1_1536_small.pcm
$(FATE_AC3): CMP = oneoff
$(FATE_AC3) $(FATE_EAC3): CMP = oneoff
FATE_AC3_ENCODE += fate-ac3-encode
fate-ac3-encode: CMD = enc_dec_pcm ac3 wav s16le $(REF) -c:a ac3 -b:a 128k
@ -51,7 +51,7 @@ fate-ac3-encode: CMP_TARGET = 399.62
fate-ac3-encode: SIZE_TOLERANCE = 488
fate-ac3-encode: FUZZ = 4
FATE_AC3_ENCODE += fate-eac3-encode
FATE_EAC3_ENCODE += fate-eac3-encode
fate-eac3-encode: CMD = enc_dec_pcm eac3 wav s16le $(REF) -c:a eac3 -b:a 128k
fate-eac3-encode: CMP_SHIFT = -1024
fate-eac3-encode: CMP_TARGET = 514.02
@ -61,12 +61,15 @@ fate-eac3-encode: FUZZ = 3
fate-ac3-encode fate-eac3-encode: CMP = stddev
fate-ac3-encode fate-eac3-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
FATE_AC3_ENCODE += fate-ac3-fixed-encode
FATE_AC3_FIXED_ENCODE += fate-ac3-fixed-encode
fate-ac3-fixed-encode: tests/data/asynth-44100-2.wav
fate-ac3-fixed-encode: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
fate-ac3-fixed-encode: CMD = md5 -i $(SRC) -c ac3_fixed -ab 128k -f ac3 -flags +bitexact
fate-ac3-fixed-encode: CMP = oneline
fate-ac3-fixed-encode: REF = a1d1fc116463b771abf5aef7ed37d7b1
FATE_SAMPLES_AVCONV += $(FATE_AC3) $(FATE_AC3_ENCODE)
fate-ac3: $(FATE_AC3) $(FATE_AC3_ENCODE)
FATE_SAMPLES_AVCONV += $(FATE_AC3) $(FATE_AC3_ENCODE) $(FATE_AC3_FIXED_ENCODE)
FATE_SAMPLES_AVCONV += $(FATE_EAC3) $(FATE_EAC3_ENCODE)
fate-ac3: $(FATE_AC3) $(FATE_AC3_ENCODE) $(FATE_AC3_FIXED_ENCODE)
fate-ac3: $(FATE_EAC3) $(FATE_EAC3_ENCODE)

View File

@ -18,7 +18,9 @@ FATE_ACODEC_PCM-$(call ENCDEC, PCM_F32LE, WAV) += f32le
FATE_ACODEC_PCM-$(call ENCDEC, PCM_F64BE, AU) += f64be
FATE_ACODEC_PCM-$(call ENCDEC, PCM_F64LE, WAV) += f64le
FATE_ACODEC += $(FATE_ACODEC_PCM-yes:%=fate-acodec-pcm-%)
FATE_ACODEC_PCM := $(FATE_ACODEC_PCM-yes:%=fate-acodec-pcm-%)
FATE_ACODEC += $(FATE_ACODEC_PCM)
fate-acodec-pcm: $(FATE_ACODEC_PCM)
fate-acodec-pcm-%: FMT = wav
fate-acodec-pcm-%: CODEC = pcm_$(@:fate-acodec-pcm-%=%)
@ -34,7 +36,9 @@ FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_MS, WAV) += ms
FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_SWF, FLV) += swf
FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_YAMAHA, WAV) += yamaha
FATE_ACODEC += $(FATE_ACODEC_ADPCM-yes:%=fate-acodec-adpcm-%)
FATE_ACODEC_ADPCM := $(FATE_ACODEC_ADPCM-yes:%=fate-acodec-adpcm-%)
FATE_ACODEC += $(FATE_ACODEC_ADPCM)
fate-acodec-adpcm: $(FATE_ACODEC_ADPCM)
fate-acodec-adpcm-%: CODEC = adpcm_$(@:fate-acodec-adpcm-%=%)