summaryrefslogtreecommitdiffstats
path: root/libhb/declpcm.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates to 2019.Bradley Sepos2019-01-011-1/+1
|
* audio_resample: switch from avresample to swresampleJohn Stebbins2018-06-271-1/+2
| | | | Eliminates deprecation warnings for avresample
* Update copyright dates to 2018.Bradley Sepos2018-01-011-1/+1
|
* Update copyright dates to 2017.Bradley Sepos2017-01-011-1/+1
|
* sync: correct timestamp discontinuities in sync instead of reader (#192)John Stebbins2016-05-241-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sync: correct timestamp discontinuities in sync instead of reader This patch passes discontinuity information through the pipeline till it reaches sync.c. The timestamps are passed through the pipeline as read and unmodified to sync.c (instead of attempting to correct discontinuities in reader). In sync, when we see a discontinuity, we know where the next timestamp should be based on the timestamp and duration of the previous buffer (before the discontinuity). So we calculate an "SCR" offset based on the timestamp after the discontinuity and what we calculate it should be. The old discontinuity handling code was broken due to the following. The MPEG STD timing model relies heavily on the decoder having an STC that is phase lock looped to the PCRs in the stream. When decoding a broadcast stream, the decoder can count on the time measure between PCRs using the STC to match to a high degree of accuracy. I.e. STC - lastSTC == PCR - lastPCR. When a discontinuity occurs, the decoder calculates a new PCR offset = PCR - STC. I.e. the offset is the new PCR value minus what it would have been if there had been no discontinuity. The above does not work without a reliable STC, which we do not have. We have been attempting to approximate one by avereraging the duration of received packets and extrapolating an "STC" based on the last PTS and the average packet duration. But this is highly variable and unreliable. * decavcodec: fix data type of next_pts It needs to be double so that partial ticks are not lost * deccc608sub: clarify comment * sync: allow queueing more audio Audio is small, and there is often a significant amount of audio in the stream before the first video frame. * sync: improve handling of damaged streams When data is missing, the audio decoder was extrapolating timestamps from the last pts before the error caused by the missing data which caused sync issues. Also, missing data can cause the video decoder to output a frame out of order with the wrong scr sequence. Drop such frames.
* libhb: remove unused hb_buffer_t sequence numberJohn Stebbins2016-05-171-3/+0
|
* Update copyright dates to 2016.Bradley Sepos2016-01-011-1/+1
|
* libhb: add hb_buffer_listJohn Stebbins2015-09-241-13/+12
| | | | | This brings together several independent implementations of a simple buffer list manager.
* libhb: Use a buffer flat to indicate EOFjstebbins2015-05-011-1/+1
| | | | | | | | | | | | ... instead of a 0 length buffer. This fixes this issue: https://forum.handbrake.fr/viewtopic.php?f=12&t=31959 Theora can create 0 length output. These 0 length frames indicate duplicate frames. So we can't use 0 length buffers to indicate the end of the stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7143 b64f7644-9d1e-0410-96f1-a4d463321fa5
* New audio output options.Rodeo2015-02-151-0/+1
| | | | | | | | | Dolby Digital Plus (E-AC-3), Dolby TrueHD and FLAC can now be passed through without re-encoding. They aren't covered by Auto Passthru yet, however. In addition, encoding to E-AC-3 is now possible. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6908 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update year to 2015.bradleys2015-02-011-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6852 b64f7644-9d1e-0410-96f1-a4d463321fa5
* json: add json APIsjstebbins2014-12-161-2/+2
| | | | | | | | | | There are several changes to job and title structs that break current windows interop code. The interop code should be changed such that it only uses json APIs. So if there is any missing features (or bugs) in these APIs, please let me know. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6602 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update some copyright dates to 2014.Rodeo2014-02-181-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6042 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: support AV_FRAME_DATA_MATRIXENCODING side data.Rodeo2014-01-261-0/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6000 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decavcodec: prefer AVFrame fields over their AVCodecContext equivalent.Rodeo2014-01-251-2/+1
| | | | | | | These fields correspond to the actual audio data in the AVFrame, and should always be set (otherwise, we must submit a bug report to libav). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5994 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Updated all the copyright headers to 2013.sr552013-03-091-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5318 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve support for planar audio.Rodeo2012-11-211-2/+2
| | | | | | | | | | | | | | - encavcodecaudio: use libavresample directly (instead of via the hb_audio_resample wrapper), and add support for planar output - hb_audio_resample: add support for planar input - hb_audio_remap: add support for planar input - deca52: output planar float samples (no re-interleaving) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5073 b64f7644-9d1e-0410-96f1-a4d463321fa5
* declpcm: remove an unnecessary instruction.Rodeo2012-10-271-8/+6
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5041 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: remove unnecessary usage of hb_audio_remap.Rodeo2012-09-231-1/+0
| | | | | | | | All decoders now output channels in Libav order. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4977 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Move mixdown-> channel_layout/matrix_encoding translation to ↵Rodeo2012-08-271-4/+4
| | | | | | | | | | hb_audio_resample_init(). Unlike hb_audio_remap, hb_audio_resample will never be used in situations where we don't have a mixdown. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4923 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_audio_resample: move setters out of hb_audio_resample_update(), to ↵Rodeo2012-08-271-4/+4
| | | | | | dedicated functions. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4922 b64f7644-9d1e-0410-96f1-a4d463321fa5
* declpcm: modify hdr2layout.Rodeo2012-08-151-3/+2
| | | | | | | | AV_CH_LAYOUT_STEREO w/7 or 8 channels is invalid anyway, and will get sanitized in hb_ff_layout_xlat(). Doing it in declpcm directly avoids an unnecessary call to that function, with identical results. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4905 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Check the return code of hb_audio_resample_update(). This allows us to log ↵Rodeo2012-08-151-4/+9
| | | | | | an error when it fails, so we know which decoder actually called the function. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4904 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use hb_audio_resample for downmixing AC3 sources. DRC is still applied by ↵Rodeo2012-08-021-1/+2
| | | | | | | | | | | | | | | | | liba52. Add support for center & surround mix levels to hb_audio_resample. This allows us to support upmixing all audio sources. For sources that have at least 2 front and one back or side channel(s), allow upmixing to 5.1: 3.0/3.1 (2 front and 1 back channels) 4.0/4.1 (3 front and 1 back channels) 4.0/4.1 (2 front and 2 side channels) 5.0 (3 front and 2 side channels) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4885 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Allow control of audio mix normalizationjstebbins2012-08-011-1/+2
| | | | | | | | | | | | Since switching to libavresample for audio mixing, our output volume levels have been reduced because libavresample does mix level normalization by default. This change applies a patch to libav to allow us to disable this behavior and adds a new field to hb_audio_config_t to allow the hb frontends to control this feature. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4884 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_audio_resample: libvaresample wrapper.Rodeo2012-07-151-89/+21
| | | | | | | | Avoids having code that's mostly identical in multiple files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4838 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump libav to libav-v0.8-2197-g1a068bfjstebbins2012-07-111-26/+129
| | | | | | | | | | | | Resolves several deprecated api's Eliminates several libav patches Eliminates our builtin downmix in favour of avresample Eliminate HB_INPUT_CH_LAYOUT_* and replace with AV_CH_LAYOUT_* Resolves 6.x and 7.0 input channel layout issues HB had Adds downmix support to declpcm. We never had it! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4825 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: drop HB_INPUT_CH_LAYOUT_*Rodeo2012-06-181-5/+6
| | | | | | | | AV_CH_LAYOUT_* works for us, and as its usage becomes more widespread in libhb, translating between the two formats gets increasingly tedious. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4754 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Updated file copyright / GPL headerssr552012-06-151-3/+6
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4737 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix problem with incorrect addition of audio silencejstebbins2012-05-011-0/+1
| | | | | | | | | | | | sync needs the precise duration of a frame of audio and has no way to compute it for passthru audio. So add a duration member to hb_buffer_t and set it in the audio decoders. This should eventually supersede hb_buffer_t member "stop" since it provides redundant information. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4618 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rework filter pipelinejstebbins2012-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | This patch enhances the filter objects. The 2 key improvements are: 1. A filter can change the image dimensions as frames pass through it. 2. A filter can output more than one frame. In addition, I have: Moved cropping & scalling into a filter object Added 90 degree rotation to the rotate filter Moved subtitle burn-in rendering to a filter object. Moved VFR/CFR handling into a framerate shaping filter object. Removed render.c since all it's responsibilities got moved to filters. Improves VOBSUB and SSA subtitle handling. Allows subtitle animations. SSA karaoke support. My apologies in advance if anything breaks ;) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4546 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix for broken lpcm streamsjstebbins2011-09-141-41/+109
| | | | | | | | fixes streams that have broken frame count field. since this value can be computed from the frame size, we can ignore it. Also fixes some decode errors in 20 and 24bit lpcm. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4221 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add more audio passthru optionsjstebbins2011-08-011-0/+2
| | | | | | | | | | | | | | | | | adds aac and mp3 passthru for mp4 and mkv containers adds dts and dtshd for mp4 container (mkv already had it) Note: The only player known (to me) to support dts(hd) in mp4 is ff/avplay In LinGui there is a new option to limit which passthru codecs will be used by the "Auto Passthru" audio codec options. The CLI already has this ability with "--audio_copy-mask" which is use in conjunction with the "copy" audio codec option. Also corrects some A/V sync issues when video frames are dropped due to a gap detected in the audio. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4149 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: generalize channel remapping between decoders and encodersjstebbins2011-06-121-0/+2
| | | | | | | | Decoders set the channel map of their output in hb_audio_config_t. Encoders use this information to remap while encoding. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4052 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Change internal audio representation rangejstebbins2011-04-081-7/+7
| | | | | | | | | | | ...from float [-32768...32767] to float [-1.0...1.0] Using the range [-1.0..1.0] requires fewer translations of the range for our various encoders and decoders. This also gets rid of a hacky translation from float to int to float in decavcodec audio decoding. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3908 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix zero duration lpcm frame handlingjstebbins2010-10-191-1/+6
| | | | | | | | a zero duration frame caused us to send a buffer with zero size which we then interpreted as the end of the stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3607 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - in encx264, if an video frame is larger than init_delay split it into ↵van2008-07-261-5/+6
| | | | | | | | | | | | pieces so we don't get jerky output caused by out-of-order frames. - add an explicit EOF for all streams, not just video. - don't generate extra audio silence at the end of an encode (don't need it with explicit eof). - get rid of 80ms initial delay in AAC encode & flush final four frames buffered in encoder. - put mp4 'chap' atom on first track (usually video) rather than first audio track since we can now do video without audio (atom just needs to go on an enabled media track & video is always enabled). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1581 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - support blu-ray, avchd & dvb x264van2008-05-311-7/+38
| | | | | | | - support video files handled by ffmpeg (avi, mkv, mp4, etc.) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1480 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Saearch & Replace domain names to move from .m0k.org to handbrake.fr. Only ↵jbrjake2008-04-151-1/+1
| | | | | | covers trunk files, libhb, and test. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1418 b64f7644-9d1e-0410-96f1-a4d463321fa5
* scan and pcm audio fixes.van2008-04-021-44/+189
| | | | | | | | | | | | | | - lpcm audio fixed to handle 24 bit & interpret header correctly. - get aspect ratio from libmpeg2 rather than doing it ourselves. - announce when aspect ratio changes during preview scan. - if aspect ratio isn't either 4:3 or 16:9 complain & map to either 4:3 or 16:9 (whichever is closest). - start stream previews from file position 0 rather than 1/11 in case there's only on mpeg sequence header in the file. - don't give up on a file just because we can't get a preview due to a missing sequence header - only give up if we can't get any previews. - get audio bitstream characteristics during preview in a uniform way (we were treating PCM & MPEG audio specially which resulted in not getting their sample rate which caused a divide by zero in sync). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1370 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Formatting: Remove a lot of trailing whitespace.saintdev2008-02-211-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1307 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Merge the 5.1 branch into the trunk.prigaux2007-03-061-0/+90
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@422 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Merge the 0.8.0_mpeg4ip branch into the trunkprigaux2007-02-111-90/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@285 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Structural changes, in order to eventually be able to compile HBtiter2006-03-161-26/+18
| | | | | | | without certain encoders git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@34 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Softer resampling when audio dates are messed up (fix for LPCM issues).titer2006-02-231-19/+4
| | | | | | | Disabled verbose in the OS X UI git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@30 b64f7644-9d1e-0410-96f1-a4d463321fa5
* HandBrake 0.7.0handbrake2006-01-141-0/+113
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@16 b64f7644-9d1e-0410-96f1-a4d463321fa5