summaryrefslogtreecommitdiffstats
path: root/libhb
Commit message (Collapse)AuthorAgeFilesLines
* fix some mingw warnings and a mingw build issuejstebbins2010-04-106-12/+14
| | | | | | | mingw gcc-4.5 has linker issues against shared libstdc++ git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3217 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix audio clipping when downmixing and output codec is lamejstebbins2010-04-073-19/+27
| | | | | | | | | | The lame codec has a more limited input range than the other codecs. So tell the downmixers to stay strictly within the level range requested. also changes some tabs into spaces in deca52 and decdca git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3205 b64f7644-9d1e-0410-96f1-a4d463321fa5
* generalize audio channel map reorderingjstebbins2010-04-053-119/+404
| | | | | | | | | | | | | | | | this allows remapping any channel order to any other channel order with the appropriate map definitions. channel maps currently supplied are smpte (used by ffmpeg), qt (our standard channel order), and ac3 (as delivered by a52dec). remapping can also be applied to the downmixer with the function hb_downmix_set_chan_map(hb_chan_map_t * map_in, hb_chan_map_t * map_out). this allows downmixing and channel reordering in a single step. there is no additional cost to reordering since the matrix multiply used to do the downmix simultaneously reorders. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3201 b64f7644-9d1e-0410-96f1-a4d463321fa5
* small error in the last change. Missed a comman in the libhb build script ↵sr552010-04-051-1/+1
| | | | | | change. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3200 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libgcc is no longer needed. Thanks to golgol7777 for pointing out the ↵sr552010-04-051-0/+1
| | | | | | necessary changes in the build system git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3199 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix silence insertion problem in audio sync and pipeline stall problemjstebbins2010-04-034-33/+74
| | | | | | | | | | | | | | | | | | | | the current audio buffer was being dropped when silence was inserted, causing the time to fall even further behind and provoke more silence insertion in some cases. with pont-to-point, it is possible for one stream to complete before the other(s). when the work_loop exits for that stream, the fifo is no longer serviced and may fill. This can back up and cause a stall in reader causing the streams that are not yet complete to stall. The Solution is to continue servicing the fifo after work for a stream is complete. This was complicated by the fact that the video sync work object was being used as the indicator that all work was finished. When it exited everything was told to stop. So now, the muxer work object (last in the chain) is the indicator when work is done. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3197 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix stupid error in my last commitjstebbins2010-04-031-10/+10
| | | | | | | double hb_buffer_close caused crash git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3196 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix audio detection problem during scan of ffmpeg audio sourcesjstebbins2010-04-025-37/+99
| | | | | | | | | | | | audio frames can be larger than their container packet sizes, but during scan, we only feed one container packet to the decoder, then reset the decoder and try the next packet. so the audio is never detected. as buffers are tested, they are added to a cache. the entire cache is passed to the decoder to scan for info. the cache is limited to 4KB. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3195 b64f7644-9d1e-0410-96f1-a4d463321fa5
* handle YUV422P video in the mpeg2 decoderjstebbins2010-04-021-10/+31
| | | | | | | | if the image format is 422, convert it to 420 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3187 b64f7644-9d1e-0410-96f1-a4d463321fa5
* flush frames x264 has cached properlyjstebbins2010-04-021-2/+4
| | | | | | | | | | waiting until the returned size is == 0 isn't adequate. you must use the function x264_encoder_delayed_frames encoding very short clips resulted in invalid unplayable files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3186 b64f7644-9d1e-0410-96f1-a4d463321fa5
* when in cfr mode, tell x264 we are doing cfr and allow x264 to set the ↵jstebbins2010-04-021-2/+11
| | | | | | | | | | | timebase to the framerate. fixes compatibility issue with tsMuxer which many PS3 users use. now they can select a specific framerate, which will output cfr video that tsMuxer can grok. we should have been doing this anyway. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3185 b64f7644-9d1e-0410-96f1-a4d463321fa5
* downmix support for ffmpeg audio sourcesjstebbins2010-04-028-91/+1540
| | | | | | | | now we can eat our own dogfood. i.e. aac 6ch discrete input now works, along with any other multi-channel audio ffmpeg can toss at us. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3182 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a problem processing PS stream that look a lot like DVD PS but are not.jstebbins2010-04-011-0/+17
| | | | | | | | | these streams have start codes that all align on 2048 byte boundaries which makes them look like DVD PS. But within the 2048 bytes, they have multiple pack headers which we were tripping on. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3181 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: change the x264 header NAL array order from sei - sps - pps to sps - ↵dynaflash2010-03-311-4/+4
| | | | | | | | pps - sei as per x265 r1510 - Thanks golgol7777 for the patch! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3180 b64f7644-9d1e-0410-96f1-a4d463321fa5
* handle bluray LPCM streamsjstebbins2010-03-272-25/+87
| | | | | | | | | | | | | | | bluray lpcm uses an stype that is normally used for digicipher. so we use the registration descriptor == HDMV in the PMT to recognize bluray streams. also, ffmpeg doesn't provide a parser for this audio type because none is needed. so when the parser is NULL, pass our buffer data directly to the decoder. Since ffmpeg is doing the decoding, we will still suffer from the same problem with multi-channel ffmpeg streams. So this currenlty only works properly with stereo. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3175 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix sporadic incorrect bitrate calculation of muxed tracksjstebbins2010-03-271-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3173 b64f7644-9d1e-0410-96f1-a4d463321fa5
* make it possible to dynamically create and close multiple libhb instancesjstebbins2010-03-265-42/+85
| | | | | | | | | | tweaks to make libhb more usable from a C# app remove pointers from preview filenames, replaces with hb instance and title id's removes only previews upon hb_close, leaves temp dir for hb_global_close git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3170 b64f7644-9d1e-0410-96f1-a4d463321fa5
* reduce mux interleave threshold more to prevent out of memory situationsjstebbins2010-03-191-1/+1
| | | | | | | | | | when skewed timestamps or premature end of a stream is encountered, the muxer buffers streams in an attempt to interleave stream timestamps. this threshold tells it when to give up. The previous value still allowed out of memory conditions with windows 2GB per application limit. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3169 b64f7644-9d1e-0410-96f1-a4d463321fa5
* improve lame audio quality by using ABR mode and disabling joint stereo modejstebbins2010-03-142-2/+38
| | | | | | | add mp3 muxing into mp4 container. cli and gtk gui now support this. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3167 b64f7644-9d1e-0410-96f1-a4d463321fa5
* extend search range for TS re-syncjstebbins2010-03-131-14/+24
| | | | | | | | we were only checking approx the next 16K bytes when sync was lost in a transport stream. now we will continues searching to the end of the file. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3165 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a crash that happens when subtitle scan selects a subtitle thatjstebbins2010-03-071-0/+1
| | | | | | | is alread in the list of subtitles to encode. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3154 b64f7644-9d1e-0410-96f1-a4d463321fa5
* temporary hack to use old x264 b-pyramid default of 0 (none)jstebbins2010-03-051-0/+3
| | | | | | | | this will be reverted when the gui's and presets are updated to reflect the new default of 2 (normal). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3150 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix incorrect comment in PS detection functionjstebbins2010-02-121-3/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3119 b64f7644-9d1e-0410-96f1-a4d463321fa5
* try harder to identify program streams that do not begin with a pack headerjstebbins2010-02-121-8/+22
| | | | | | | | search deeper into the file for a pack header followed by another start code prefix. Fixes problem with file cut by StreamClip on non-pack header boundary git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3118 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adjustable picture modulus: Base patch by BradleyS, Thanks BradleyS!dynaflash2010-02-114-32/+34
| | | | | | | - Enables setting modulus for all anamorphic modes (including non-anamorphic) except strict. The job variable "anamorphic.modulus" is repurposed for this and is renamed to simply "modulus" - Other changes: Increases minimum output dimensions to 32x32 pixels in libhb (prevents possible crashes, notably in macgui). Better crop value and maximum crop value calculations to prevent crashes. Some code optimization / refactoring. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3113 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix compiler warning about "definition has no type or storage class"jstebbins2010-02-101-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3108 b64f7644-9d1e-0410-96f1-a4d463321fa5
* put a limit on how many buffers the muxer will cache when it isjstebbins2010-02-091-4/+11
| | | | | | | | | | | having trouble interleaving timestamps This prevents some out of memory crashes. In particular, it fixes a crashed caused by a source in which the audio stream ends substantially before the video stream ends. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3106 b64f7644-9d1e-0410-96f1-a4d463321fa5
* removed test codesr552010-02-062-8/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3102 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb dll fix by RandomEngysr552010-02-062-0/+19
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3101 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix keyint mismatch between 1st and 2nd passes of a 2pass encodejstebbins2010-02-061-10/+5
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3100 b64f7644-9d1e-0410-96f1-a4d463321fa5
* dvdnav: fix seeking on some dvds that use multiple pgc's in a titlejstebbins2010-02-061-2/+7
| | | | | | | | The code that was in place to handle this did not allow for the possibility that there could be sector gaps between the segments git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3098 b64f7644-9d1e-0410-96f1-a4d463321fa5
* use DTS generated by x264 when computing duration and offset in muxmp4jstebbins2010-02-065-117/+101
| | | | | | | | also fix an issue where ffmpeg generated negative PTS for initial frames of video. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3097 b64f7644-9d1e-0410-96f1-a4d463321fa5
* osx doesn't have fread_unlockedjstebbins2010-01-311-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3090 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix problem with reading program streamsjstebbins2010-01-311-1/+33
| | | | | | | | audio PES packets can have sequences that look like start codes in the data so parse PES enough to get the length and skip the data. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3089 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix cancel during p-to-p searchjstebbins2010-01-201-0/+5
| | | | | | | | | when canceling, video sync was closed, but audio sync was stuck waiting on a condition variable. so force audio sync to wake up when video sync closes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3078 b64f7644-9d1e-0410-96f1-a4d463321fa5
* prevent hang during foreign audio searchjstebbins2010-01-101-4/+5
| | | | | | | was waiting for an audio pts during the indepth scan when there is no audio being processed git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3065 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Added some errors checks and a flush function to encode the remaining data ↵ritsuka2009-12-311-14/+72
| | | | | | | | in the fifo. It may fix the "0.5 seconds of digital noise" issue, but I was unable to reproduce it, so I don't know if it actually helps. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3053 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add point-to-point encodingjstebbins2009-12-238-37/+449
| | | | | | | | | | | | | | allows frame and pts based start points. end points were already previously supported. New job variables pts_to_start and frame_to_start specify the start point. There can be a period during the encode where it has to search for the start point. During this period, libhb sets a new state HB_STATE_SEARCHING and sets progress and eta till start point found. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3039 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds a very crude, CLI-only rotation filter to flip pixels vertically (mode ↵jbrjake2009-12-193-1/+390
| | | | | | 1), horizontally (mode 2), or both (mode 3, default). Called with --rotate. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3036 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix potential runaway buffer usagejstebbins2009-12-154-3/+40
| | | | | | | | | | pthread_cond_timedwait can wake early. under certain system load conditions, this happens often. I was going ahead and adding buffers whenever it woke, regardless of whether the condition had actually been met. so the fifo depth would increase until memory ran out. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3030 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump ffmpeg to svn 20817jstebbins2009-12-141-0/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3028 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix crash with vobsub passthrujstebbins2009-12-131-1/+3
| | | | | | | | the last subtitle buffer was getting added to the buffer pool twice and ultimately freed twice. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3027 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Only display mux stats oncejstebbins2009-12-101-42/+42
| | | | | | | | Close prints mux stats and gets called for each stream. So only print the stats when the last stream is closed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3023 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix dvdnav read error retry jstebbins2009-12-101-1/+1
| | | | | | | | | the error count was being reset on dvdnav events that didn't involve any actual reading. So we got caught in an very long loop alternating between read failures and valid events. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3022 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Avert a rare race condition.jstebbins2009-12-091-5/+6
| | | | | | | | | | | | | | | | | A bad source can cause reader to call hb_stream_close before decavcodecviWork ever starts. This causes hb_ffmpeg_context to access an invalid pointer. So move the call to hb_ffmpeg_context to after we check for a 0 length buffer in decavcodecvoiWork since reader will have sent this to signal that it has reached the end of the stream. This does not eliminate the race condition, but it does make it much less likely to happen and fixes the specific case where we found this occuring. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3020 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Disables chapter markers when there is only one chapter. Most interfaces ↵jbrjake2009-12-091-0/+6
| | | | | | already do this, but now they have no choice. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3019 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Removes obsolete check for mbtree being off before adjusting render offsets ↵jbrjake2009-12-091-3/+3
| | | | | | for b-pyramid. Also corrects a bit of coding style. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3018 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix buffer leak during indepth scan jstebbins2009-12-083-0/+23
| | | | | | | and fix a couple potential leaks if the timing is just right in work loops git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3016 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Faster combing detection through slightly less stupid use of pointers. Also ↵jbrjake2009-12-081-68/+61
| | | | | | realigns boundary points for the combing mask checker to match what the code actually does. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3015 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use the correct render offset when b-pyramid is enabled in the x264 ↵jbrjake2009-12-081-39/+24
| | | | | | parameter string but is being disabled inside libx264 due to mb-tree. Thanks, Rodeo, and good catch! Also adds a logging message to note weight-p being disabled in bframeless encodes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3013 b64f7644-9d1e-0410-96f1-a4d463321fa5