Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/FFmpeg/FFmpeg
Merge new changes of https://github.com/FFmpeg/FFmpeg
2016/04/08

Conflicts:
	libavcodec/pngenc.c
Fixed.
(applied official fix c3320a5 instead of 9bcb20e)

Automerge ok.
  • Loading branch information
cho-dev committed Apr 8, 2016
2 parents 0d9d215 + 259879d commit 745b20c
Show file tree
Hide file tree
Showing 175 changed files with 4,879 additions and 1,638 deletions.
7 changes: 6 additions & 1 deletion Changelog
Expand Up @@ -16,7 +16,12 @@ version <next>:
- AudioToolbox audio decoders
- AudioToolbox audio encoders
- coreimage filter (GPU based image filtering on OSX)

- libdcadec removed
- bitstream filter for extracting DTS core
- ADPCM IMA DAT4 decoder
- musx demuxer
- aix demuxer
- remap filter

version 3.0:
- Common Encryption (CENC) MP4 encoding and decoding support
Expand Down
12 changes: 5 additions & 7 deletions configure
Expand Up @@ -219,7 +219,6 @@ External library support:
--enable-libcdio enable audio CD grabbing with libcdio [no]
--enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
and libraw1394 [no]
--enable-libdcadec enable DCA decoding via libdcadec [no]
--enable-libfaac enable AAC encoding via libfaac [no]
--enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
--enable-libflite enable flite (voice synthesis) support via libflite [no]
Expand Down Expand Up @@ -1469,7 +1468,6 @@ EXTERNAL_LIBRARY_LIST="
libcdio
libcelt
libdc1394
libdcadec
libfaac
libfdk_aac
libflite
Expand Down Expand Up @@ -2654,6 +2652,7 @@ ac3_at_decoder_deps="audiotoolbox"
adpcm_ima_qt_at_decoder_deps="audiotoolbox"
alac_at_decoder_deps="audiotoolbox"
amr_nb_at_decoder_deps="audiotoolbox"
eac3_at_decoder_deps="audiotoolbox"
gsm_ms_at_decoder_deps="audiotoolbox"
ilbc_at_decoder_deps="audiotoolbox"
mp1_at_decoder_deps="audiotoolbox"
Expand All @@ -2676,7 +2675,6 @@ pcm_mulaw_at_encoder_select="audio_frame_queue"
chromaprint_muxer_deps="chromaprint"
h264_videotoolbox_encoder_deps="videotoolbox_encoder pthreads"
libcelt_decoder_deps="libcelt"
libdcadec_decoder_deps="libdcadec"
libfaac_encoder_deps="libfaac"
libfaac_encoder_select="audio_frame_queue"
libfdk_aac_decoder_deps="libfdk_aac"
Expand Down Expand Up @@ -4642,9 +4640,9 @@ case $target_os in
# however ld then forgets what the entry point should be (oops) so we
# have to manually (re)set it.
if enabled x86_32; then
add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
elif enabled x86_64; then
add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
check_ldflags -Wl,--high-entropy-va # binutils 2.25
# Set image base >4GB for extra entropy with HEASLR
add_ldexeflags -Wl,--image-base,0x140000000
Expand Down Expand Up @@ -5522,7 +5520,8 @@ enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActi
enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
{ check_lib2 "dlfcn.h" dlopen -ldl; } ||
die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
enabled cuda && check_lib cuda.h cuInit -lcuda
enabled cuda && { check_lib cuda.h cuInit -lcuda ||
die "ERROR: CUDA not found"; }
enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
enabled coreimage_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimage_filter; }
enabled coreimagesrc_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimagesrc_filter; }
Expand All @@ -5541,7 +5540,6 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
enabled libdcadec && require_pkg_config "dcadec >= 0.1.0" libdcadec/dca_context.h dcadec_context_create
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfdk_aac && { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
{ require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
Expand Down
7 changes: 7 additions & 0 deletions doc/APIchanges
Expand Up @@ -15,6 +15,13 @@ libavutil: 2015-08-28

API changes, most recent first:

2016-04-02 - xxxxxxx - lavu 55.20.100 - base64.h
Add AV_BASE64_DECODE_SIZE(x) macro.

2016-xx-xx - lavc 57.33.0 - avcodec.h
xxxxxxx - Add AVCodecParameters and its related API.
xxxxxxx - Add av_get_audio_frame_duration2().

2016-03-11 - xxxxxxx - lavf/lavc 57.28.101
Add requirement to bitstream filtering API that returned packets with
size == 0 and side_data_elems == 0 are to be skipped by the caller.
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile
Expand Up @@ -1429,7 +1429,7 @@ PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------

# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
# generate an inheritance diagram (in HTML, RTF and LaTeX) for classes with base
# or super classes. Setting the tag to NO turns the diagrams off. Note that
# this option is superseded by the HAVE_DOT option below. This is only a
# fallback. It is recommended to install and use dot, since it yields more
Expand Down
4 changes: 4 additions & 0 deletions doc/bitstream_filters.texi
Expand Up @@ -67,6 +67,10 @@ the header stored in extradata to the key packets:
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
@end example

@section dca_core

Extract DCA core from DTS-HD streams.

@section h264_mp4toannexb

Convert an H.264 bitstream from length prefixed mode to start code
Expand Down
2 changes: 1 addition & 1 deletion doc/codecs.texi
Expand Up @@ -257,7 +257,7 @@ Specify how strictly to follow the standards.
Possible values:
@table @samp
@item very
strictly conform to a older more strict version of the spec or reference software
strictly conform to an older more strict version of the spec or reference software
@item strict
strictly conform to all the things in the spec no matter what consequences
@item normal
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/filtering_audio.c
Expand Up @@ -65,7 +65,7 @@ static int open_input_file(const char *filename)
/* select the audio stream */
ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &dec, 0);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot find a audio stream in the input file\n");
av_log(NULL, AV_LOG_ERROR, "Cannot find an audio stream in the input file\n");
return ret;
}
audio_stream_index = ret;
Expand Down
73 changes: 70 additions & 3 deletions doc/filters.texi
Expand Up @@ -3217,11 +3217,44 @@ HRTFs. Default is 1.

@item type
Set processing type. Can be @var{time} or @var{freq}. @var{time} is
processing audio in time domain which is slow but gives high quality output.
@var{freq} is processing audio in frequency domain which is fast but gives
mediocre output. Default is @var{freq}.
processing audio in time domain which is slow.
@var{freq} is processing audio in frequency domain which is fast.
Default is @var{freq}.

@item speakers
Set custom positions of virtual loudspeakers. Syntax for this option is:
<CH> <AZIM> <ELEV>[|<CH> <AZIM> <ELEV>|...].
Each virtual loudspeaker is described with short channel name following with
azimuth and elevation in degreees.
Each virtual loudspeaker description is separated by '|'.
For example to override front left and front right channel positions use:
'speakers=FL 45 15|FR 345 15'.
Descriptions with unrecognised channel names are ignored.
@end table

@subsection Examples

@itemize
@item
Using ClubFritz6 sofa file:
@example
sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
@end example

@item
Using ClubFritz12 sofa file and bigger radius with small rotation:
@example
sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
@end example

@item
Similar as above but with custom speaker positions for front left, front right, rear left and rear right
and also with custom gain:
@example
"sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|RL 135|RR 225:gain=28"
@end example
@end itemize

@section stereotools

This filter has some handy utilities to manage stereo signals, for converting
Expand Down Expand Up @@ -3319,6 +3352,22 @@ Set S/C level. Default is 1. Allowed range is from 1 to 100.
Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
@end table

@subsection Examples

@itemize
@item
Apply karaoke like effect:
@example
stereotools=mlev=0.015625
@end example

@item
Convert M/S signal to L/R:
@example
"stereotools=mode=ms>lr"
@end example
@end itemize

@section stereowiden

This filter enhance the stereo effect by suppressing signal common to both
Expand Down Expand Up @@ -6507,6 +6556,12 @@ Show the text at the center of the video frame:
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
@end example

@item
Show the text at a random position, switching to a new position every 30 seconds:
@example
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)"
@end example

@item
Show a text line sliding from right to left in the last row of the video
frame. The file @file{LONG_LINE} is assumed to contain a single line
Expand Down Expand Up @@ -10370,6 +10425,18 @@ less than @code{0}, the filter will try to use a good random seed on a
best effort basis.
@end table

@section remap

Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.

Destination pixel at position (X, Y) will be picked from source (x, y) position
where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
value for pixel will be used for destination pixel.

Xmap and Ymap input video streams must be of same dimensions. Output video stream
will have Xmap/Ymap video stream dimensions.
Xmap and Ymap input video streams are 16bit depth, single channel.

@section removegrain

The removegrain filter is a spatial denoiser for progressive video.
Expand Down
5 changes: 5 additions & 0 deletions doc/muxers.texi
Expand Up @@ -1238,6 +1238,11 @@ muxers/codecs. It is set to @code{0} by default.
@item initial_offset @var{offset}
Specify timestamp offset to apply to the output packet timestamps. The
argument must be a time duration specification, and defaults to 0.

@item write_empty_segments @var{1|0}
If enabled, write an empty segment if there are no packets during the period a
segment would usually span. Otherwise, the segment will be filled with the next
packet written. Defaults to @code{0}.
@end table

@subsection Examples
Expand Down
2 changes: 1 addition & 1 deletion doc/snow.txt
Expand Up @@ -527,7 +527,7 @@ Wavelet Transform:
==================

Snow supports 2 wavelet transforms, the symmetric biorthogonal 5/3 integer
transform and a integer approximation of the symmetric biorthogonal 9/7
transform and an integer approximation of the symmetric biorthogonal 9/7
daubechies wavelet.

2D IDWT (inverse discrete wavelet transform)
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg_filter.c
Expand Up @@ -656,7 +656,7 @@ int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOu
DESCRIBE_FILTER_LINK(ofilter, out, 0);

if (!ofilter->ost) {
av_log(NULL, AV_LOG_FATAL, "Filter %s has a unconnected output\n", ofilter->name);
av_log(NULL, AV_LOG_FATAL, "Filter %s has an unconnected output\n", ofilter->name);
exit_program(1);
}

Expand Down
8 changes: 4 additions & 4 deletions ffplay.c
Expand Up @@ -2870,7 +2870,7 @@ static int audio_decode_frame(VideoState *is)
static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
{
VideoState *is = opaque;
int audio_size, len1, silence = 0;
int audio_size, len1;

audio_callback_time = av_gettime_relative();

Expand All @@ -2879,7 +2879,7 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
audio_size = audio_decode_frame(is);
if (audio_size < 0) {
/* if error, just output silence */
silence = 1;
is->audio_buf = NULL;
is->audio_buf_size = SDL_AUDIO_MIN_BUFFER_SIZE / is->audio_tgt.frame_size * is->audio_tgt.frame_size;
} else {
if (is->show_mode != SHOW_MODE_VIDEO)
Expand All @@ -2891,11 +2891,11 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
len1 = is->audio_buf_size - is->audio_buf_index;
if (len1 > len)
len1 = len;
if (!is->muted && !silence && is->audio_volume == SDL_MIX_MAXVOLUME)
if (!is->muted && is->audio_buf && is->audio_volume == SDL_MIX_MAXVOLUME)
memcpy(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, len1);
else {
memset(stream, 0, len1);
if (!is->muted && !silence)
if (!is->muted && is->audio_buf)
SDL_MixAudio(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, len1, is->audio_volume);
}
len -= len1;
Expand Down
4 changes: 3 additions & 1 deletion libavcodec/Makefile
Expand Up @@ -695,6 +695,7 @@ OBJS-$(CONFIG_ADPCM_G726_ENCODER) += g726.o
OBJS-$(CONFIG_ADPCM_G726LE_DECODER) += g726.o
OBJS-$(CONFIG_ADPCM_IMA_AMV_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_APC_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_DAT4_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER) += adpcm.o adpcm_data.o
Expand Down Expand Up @@ -806,6 +807,7 @@ OBJS-$(CONFIG_AC3_AT_DECODER) += audiotoolboxdec.o
OBJS-$(CONFIG_ADPCM_IMA_QT_AT_DECODER) += audiotoolboxdec.o
OBJS-$(CONFIG_ALAC_AT_DECODER) += audiotoolboxdec.o
OBJS-$(CONFIG_AMR_NB_AT_DECODER) += audiotoolboxdec.o
OBJS-$(CONFIG_EAC3_AT_DECODER) += audiotoolboxdec.o
OBJS-$(CONFIG_GSM_MS_AT_DECODER) += audiotoolboxdec.o
OBJS-$(CONFIG_ILBC_AT_DECODER) += audiotoolboxdec.o
OBJS-$(CONFIG_MP1_AT_DECODER) += audiotoolboxdec.o
Expand All @@ -821,7 +823,6 @@ OBJS-$(CONFIG_ILBC_AT_ENCODER) += audiotoolboxenc.o
OBJS-$(CONFIG_PCM_ALAW_AT_ENCODER) += audiotoolboxenc.o
OBJS-$(CONFIG_PCM_MULAW_AT_ENCODER) += audiotoolboxenc.o
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
OBJS-$(CONFIG_LIBDCADEC_DECODER) += libdcadec.o dca.o
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o
OBJS-$(CONFIG_LIBFDK_AAC_DECODER) += libfdk-aacdec.o
OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o
Expand Down Expand Up @@ -926,6 +927,7 @@ OBJS-$(CONFIG_AAC_ADTSTOASC_BSF) += aac_adtstoasc_bsf.o aacadtsdec.o \
mpeg4audio.o
OBJS-$(CONFIG_CHOMP_BSF) += chomp_bsf.o
OBJS-$(CONFIG_DUMP_EXTRADATA_BSF) += dump_extradata_bsf.o
OBJS-$(CONFIG_DCA_CORE_BSF) += dca_core_bsf.o
OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.o
OBJS-$(CONFIG_HEVC_MP4TOANNEXB_BSF) += hevc_mp4toannexb_bsf.o
OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF) += imx_dump_header_bsf.o
Expand Down
14 changes: 11 additions & 3 deletions libavcodec/aaccoder_twoloop.h
Expand Up @@ -77,7 +77,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
int toomanybits, toofewbits;
char nzs[128];
uint8_t nextband[128];
int maxsf[128];
int maxsf[128], minsf[128];
float dists[128] = { 0 }, qenergies[128] = { 0 }, uplims[128], euplims[128], energies[128];
float maxvals[128], spread_thr_r[128];
float min_spread_thr_r, max_spread_thr_r;
Expand Down Expand Up @@ -294,11 +294,19 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
ff_quantize_band_cost_cache_init(s);

for (i = 0; i < sizeof(minsf) / sizeof(minsf[0]); ++i)
minsf[i] = 0;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
const float *scaled = s->scoefs + start;
int minsfidx;
maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled);
if (maxvals[w*16+g] > 0) {
minsfidx = coef2minsf(maxvals[w*16+g]);
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++)
minsf[(w+w2)*16+g] = minsfidx;
}
start += sce->ics.swb_sizes[g];
}
}
Expand Down Expand Up @@ -425,7 +433,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
recomprd = 1;
for (i = 0; i < 128; i++) {
if (sce->sf_idx[i] > SCALE_ONE_POS) {
int new_sf = FFMAX(SCALE_ONE_POS, sce->sf_idx[i] - qstep);
int new_sf = FFMAX3(minsf[i], SCALE_ONE_POS, sce->sf_idx[i] - qstep);
if (new_sf != sce->sf_idx[i]) {
sce->sf_idx[i] = new_sf;
changed = 1;
Expand Down Expand Up @@ -595,7 +603,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
int cmb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
int mindeltasf = FFMAX(0, prev - SCALE_MAX_DIFF);
int maxdeltasf = FFMIN(SCALE_MAX_POS - SCALE_DIV_512, prev + SCALE_MAX_DIFF);
if ((!cmb || dists[w*16+g] > uplims[w*16+g]) && sce->sf_idx[w*16+g] > mindeltasf) {
if ((!cmb || dists[w*16+g] > uplims[w*16+g]) && sce->sf_idx[w*16+g] > FFMAX(mindeltasf, minsf[w*16+g])) {
/* Try to make sure there is some energy in every nonzero band
* NOTE: This algorithm must be forcibly imbalanced, pushing harder
* on holes or more distorted bands at first, otherwise there's
Expand Down

0 comments on commit 745b20c

Please sign in to comment.