jstebbins [Tue, 15 Nov 2011 22:56:19 +0000 (22:56 +0000)]
Fix out of memory condition on mingw32
realloc doesn't really release memory under most circumstances, so it's
not suitable for reducing the size of an hb_buffer_t. So instead,
allocate a new smaller buffer, copy the data, and return the old larger
buffer to the buffer pool for reuse.
jstebbins [Tue, 15 Nov 2011 21:36:45 +0000 (21:36 +0000)]
Make sure decvobsub.c generates valid timestamps
sync.c expects that timestamps will all be resolved by the time buffers
reach it. Reader will invalidate timestamps while waiting to
resynchronize the SCR. So decoders (inparticular decvobsub) need to
extrapolate timestamps when they are not supplied.
jstebbins [Mon, 14 Nov 2011 23:50:18 +0000 (23:50 +0000)]
Fix interleaving of subtitles in muxer
Specifically, this affects closed captions which are pushed into the
pipeline very late. CC's are dribbled in 2 bytes per video frame.
The entire CC that we put into a subtitle frame isn't available till
we see the signal for the end of the CC. This can be several seconds
after it began. So I have established a minimum buffer size that the
muxer accumulates before it outputs any data. This allows CCs to get
into the pipeline before the muxer outputs the interleave interval that
they belong in.
jstebbins [Thu, 10 Nov 2011 23:29:23 +0000 (23:29 +0000)]
Fix closed captioning crash
Prevent the same CC buffer from being attached to multiple tags. The
same buffer would get pushed to a fifo multiple times and ultimately
freed multiple times.
jstebbins [Sun, 6 Nov 2011 01:43:21 +0000 (01:43 +0000)]
Fix probing mpeg video in program streams
... and probably some other formats as well. Libav's probe routine
doesn't necessarily return names that match the codec names
that can be looked up by avcodec_find_decoder_by_name(). So we
have to manually map the names if the lookup fails. Lookup for
mpeg video started failing with the last Libav bump because
they removed an obsolete "mpegvideo" decoder that we were matching
on. The correct decoder is "mpeg2video", but probe doesn't return
that string.
Also fix our implementation of the ff_lockmgr callback. Current
git Libav fails if we don't fix it. So might as well fix it now.
jstebbins [Wed, 2 Nov 2011 16:26:11 +0000 (16:26 +0000)]
Disable DTS-HD LBR secondary audio tracks
DTS-HD LBR used in HD-DVD and bluray for secondary audio
streams. Libav can not decode yet. Having it in the audio
list causes long delays during scan while we try to get stream
parameters. So skip this audio type for now.
Fixes problem setting dsur_mode in ac3 encoder that caused encode
failures if using ac3 encoder and mixdown is dolby or dplii.
Fixes a VC-1 decode issue that caused scattered misplaced blocks.
Fixes swscale bug that caused banding.
jstebbins [Tue, 25 Oct 2011 02:18:15 +0000 (02:18 +0000)]
Add optional yasm contrib
To enable, "configure --enable-local-yasm"
Ubuntu 10.04 LTS (lucid) has yasm 0.8 which is no longer compatible with
x264. This change allows us to build yasm as a contrib and use it for
building both Libav and x264 which require yasm.
jstebbins [Sat, 22 Oct 2011 19:36:15 +0000 (19:36 +0000)]
Add new decomb modes
This is jbrjakes decomb3 patch.
New modes are gamma compensation and erode dialate filter.
Gamma adjusting pixel values makes less visible differences count less
in the metric that is calculated. Filtering removes isolated "hits"
that are more likely noise. This all makes decomb more discerning and
therefore the thresholds can be lowered.
The filter's defaults use these new modes with lower thresholds. If you
want the old behavior, use:
7:2:6:9:1:80
jstebbins [Fri, 21 Oct 2011 18:24:43 +0000 (18:24 +0000)]
ASS bump to 0.10.0
libass has a new dependency on fribidi. So also add fribidi to
contribs. I repackaged the libass distribution because the configure
script shipped with it is damaged beyond repair for darwin.
jstebbins [Fri, 21 Oct 2011 17:44:51 +0000 (17:44 +0000)]
bump libvorbis from aoTuV b5 to b6.03
Libvorbis aoTuV was unified with Xiph.Org's libvorbis1.3.2.
Many bug fixes and improvements.
Enlarge buffer for audio headers. The new vorbis generates
larger code book headers.
patch configure to fix llvm -O4 bug
jstebbins [Mon, 17 Oct 2011 21:36:53 +0000 (21:36 +0000)]
detect progressive upsampling in vfr
progressive 23.976 fps content that has upsampled to progressive 59.94
fps can result in juddery output if you don't drop the "right" frames
while downsampling back to 23.976. This adds a test that computes the
sum of squared errors between 2 candidate frames to drop and makes a
more intelligent decision based on this metric.
jstebbins [Mon, 17 Oct 2011 16:24:24 +0000 (16:24 +0000)]
fix a problem with resolution changes in h.264
First, the scaling code in decavcodec.c was broken and didn't properly
compensate for frames that had a different resolution than the rest of
the stream.
Second, libav can not handle resolution changes when doing frame based
multi-threading. So disable threading when resolution changes are
detected.
jstebbins [Sun, 16 Oct 2011 17:33:20 +0000 (17:33 +0000)]
LinGui: experimental support for batch queuing
This allows all titles in the title popup to be added to the queue in
one go. It uses the current *preset* for the settings. I.e. settings
changes in the UI are ignored. This deficiency will be rectified at a
future time.
jstebbins [Sat, 15 Oct 2011 21:46:25 +0000 (21:46 +0000)]
set ac3 dolby flag when downmix is dolby
If doing dolby or dplii downmix and encoding to ac3, set the
dolby flag in output ac3 stream so players (and handbrake) will
know that the stream is dolby matrix encoded.
jstebbins [Sat, 15 Oct 2011 00:16:02 +0000 (00:16 +0000)]
fix crash during 2 pass encoding TS or PS source
stream.c cached information that it probed during the first time it
opened any source. Then later it would re-use that cached data. I
was prematurely deleting the cached data during 2 pass encodes.
The problem is that there is no way to know when the cached data is no
longer needed. You could have a thousand items in the queue all using
the same source, or you could have only 1. So you either have to (a)
keep the cached data indefinitely, or (b) you have to be able to handle
the case where scanned cached data is flushed before you start an
encode. (a) is poor design. And if you choose (b) you might as well
eliminate the cache all together. It doesn't really save any time and
only complicates the code.
jstebbins [Wed, 12 Oct 2011 20:19:33 +0000 (20:19 +0000)]
Add flac + quality + compression level support
Adds flac audio to cli, lingui, and macgui
Adds quality and compression level options to cli
Adds quality option to lingui
Quality option works for vorbis and lame
jstebbins [Tue, 11 Oct 2011 00:44:16 +0000 (00:44 +0000)]
fix log spam during batch scan of TS files
IDRs detected before generating previews were not being remembered. So
we started decoding on non-IDR boundaries which generates a lot of
decoder log spam.
jstebbins [Sun, 2 Oct 2011 21:28:45 +0000 (21:28 +0000)]
CLI: x264 preset, tuning, and profile support
New cli options --x264-preset, --x264-tune, and --x264-profile. x264
preset and tune are set first, followed by any custom x264 option string,
and finally the profile is applied.
The PCR comparison we were doing could cause us to drop all the
timestamps for an audio stream when the audio packets are very widely
spaced. Now, it detects PCR changes explicitely and only drops the
timestamps if a discontinuity PCR prior to the packets current PCR has
already been sent to the reader.
When the audio tracks are omitted (no -a), the cli uses the first source
audio track and replicates it for each audio output codec. The way it
knows what to replicate is to look at audio->in.track for the last audio
that was added to the job. This track number was being copied from the
title's in.track. But title track numbers are not guaranteed to be
sequential (e.g. scan drops tracks it can't decode). So when adding an
audio to a job, set in.track to the value of in.track that is passed in
the audio_config structure passed to hb_audio_add.
Extracts duplicated code from decomb.c and deinterlace.c and puts
it in a shared module. Fixes a bug that existed in the decomb
version of mcdeint_filter.