summaryrefslogtreecommitdiffstats
path: root/libhb/encx264.c
Commit message (Collapse)AuthorAgeFilesLines
* libhb: allow changing colorimetry in x264 optionsjstebbins2011-08-081-31/+32
| | | | | | | | Setting "colorprim", "transfer", or "colormarix" in the x264 advanced options will no longer be ignored and will propagate to the mp4 muxer where those values also get set in the container. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4164 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix crash when x264 fails to initializejstebbins2011-06-061-0/+5
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4025 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove legacy % to RF mapping.jstebbins2011-03-211-12/+3
| | | | | | | | | | Although the % option has been gone for a while in the cli and gui's, there were some mappings happening in libhb and for preset imports. This removes the last vestages of % quality mapping. Thanks to Rodeo for the patch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3857 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix 2 pass cfr x264 crashjstebbins2011-03-131-1/+1
| | | | | | | | | | | An error in interjob->vrate calculation lead to specifying a different timebase for the 1st and 2nd pass which x264 does not allow. This improves the interjob->vrate calculation accuracy and also guarantees the timebase is the same on both passes regardless of the calculations accuracy. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3848 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add parameter parsing and b-frame support to ffmpeg mpeg-4 encoderjstebbins2011-03-111-4/+4
| | | | | | | | | | | | | The cli will now accept ':' separated parameters using the '-x' option for ffmpeg mpeg-4. The linux gui has an entry box on the advanced tab to add options. The option keys and values are the same as what the ffmpeg command line allows. Calculation of DTS timestamps was added to encavcodec.c in order to allow out of order b-frames. The algorithm is similar to what x264 uses. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3839 b64f7644-9d1e-0410-96f1-a4d463321fa5
* make keyint match between 1st and 2nd passes of vfr and pfr encodes.jstebbins2011-03-081-23/+19
| | | | | | | | | | | | make keyint and fps settings consistent across video encoders. make interjob->vrate changes for pfr mode like we do for vfr since pfr is the same as vfr except when it hits it's peak. in mkv, set track default duration to actual measured vrate on 2 pass encodes. thanks to Rodeo for the corrections in encx264 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3831 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adjust x264 qpmin for QT compatibility.jstebbins2010-12-161-0/+6
| | | | | | | | | | A recent change in x264 lowered the default qpmin to 0. QuickTime has trouble with very low QPs (resulting in visual artifacts). Known to affect QuickTime 7, QuickTime X and iTunes. Testing shows that a qpmin of 3 works. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3708 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix encx264 to accomodate upcoming x264 api change.jstebbins2010-11-071-18/+15
| | | | | | | | | | i_qpplus1 is going away, so eliminate our use of it. Isn't needed anyway. Also switch from using x264_picture_alloc to x264_picture_init. We are supplying out own buffer, so we should be using init instead of alloc. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3660 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improved logging of keyint min/maxjstebbins2010-11-071-4/+21
| | | | | | | | | | | | | | | | | | And small tweak to keyint_max calculation. x264 slightly changed the way the automatic min-keyint is calculated. Also, keyint infinite was added. This does not cause any encoding issues, but depending on the settings and the framerate, the log contained keyint values that don't correspond to the actual encode's values. The keyint_max was calculated, 59.94 fps sources will get a keyint of 599 rather than 600. With this change, It is rounded to the closest integer then multiplied by 10. Thanks to Rodeo git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3658 b64f7644-9d1e-0410-96f1-a4d463321fa5
* update baseline presets with weightp=0jstebbins2010-10-231-38/+0
| | | | | | | eliminate hack that defaults weightp=0 when bframes=0 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3623 b64f7644-9d1e-0410-96f1-a4d463321fa5
* clean up crufty legacy codejstebbins2010-10-231-17/+0
| | | | | | | remove unused code relating to avi, ogm, psp, ipod, and forcing h264 levels git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3622 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix some preset issuesjstebbins2010-07-031-15/+0
| | | | | | | | | | | add b-pyramid=none to appletv presets and remove b-pyramid hack from encx264.c change samplerate from 48 to 'Auto' in all presets cap samplerate to 48khz since none of the encoders support higher rates remove obsolete UsesMaxPictureSettings from all presets. replace with UsesPictureSettings=2 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3424 b64f7644-9d1e-0410-96f1-a4d463321fa5
* x264 bump from r1523 to r1538dynaflash2010-04-141-5/+4
| | | | | | - Accompanying changes to encx264.c to address default min-keyint in x264, encx264.c patch courtesy of Rodeo. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3225 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
* 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
* 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 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
* use DTS generated by x264 when computing duration and offset in muxmp4jstebbins2010-02-061-96/+9
| | | | | | | | 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
* 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
* 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
* update x264 to r1332jstebbins2009-11-111-2/+2
| | | | | | | Default weightp to none for baseline. user can override. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2922 b64f7644-9d1e-0410-96f1-a4d463321fa5
* temporary fix for x264 b-pyramid parameter changejstebbins2009-10-311-0/+8
| | | | | | | | if value is "1", set to "normal", "0" set to "none" pass other values through. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2907 b64f7644-9d1e-0410-96f1-a4d463321fa5
* remove crf flag and all uses of itjstebbins2009-10-191-36/+8
| | | | | | | x264 encodes will only use crf now. qp mode is gone. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2891 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump x264 to r1271jstebbins2009-09-241-14/+9
| | | | | | | | | make changes required by the x264 api change fix some build issues that the x264 bump exposed git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2836 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Updates x264 to r1259-dd026f2, bringing with it a bunch of changes you can ↵jbrjake2009-09-151-0/+45
| | | | | | read about on their git log. The most prominent change is macroblock tree rate control (read about it on doom9), which is on by default, and for most content it produces smaller, better quality encodes. Due to a minor, temporary issue with fades in baseline profile encodes, for the moment I'm disabling mbtree when bframes=0, but this can be overridden through explicitly specifying mbtree=1 in the x264 options string. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2823 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Blah, need to pay more attention when transcripting patches. job->areBframes ↵jbrjake2009-08-091-1/+3
| | | | | | needs to be on when no x264 opts are specified. Thanks again, Rodeo. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2758 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Oops, forgot the job->areBframes check needed to be updated for the new x264 ↵jbrjake2009-08-091-5/+5
| | | | | | defaults. Thanks for the catch, Rodeo. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2756 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Bumps x264 to r1195-5d75a9b. x264 has new default settings: subme 6->7, ↵jbrjake2009-08-011-1/+5
| | | | | | | | | | bframes 0->3, 8x8dct 0->1, psnr 1->0, ssim 1->0, ref 1->3, mixed-refs 0->1, trellis 0->1, weightb 0->1 - Explicitly enables SSIM and PSNR metrics for all x264 encodes - MacGui: Updates Advanced tab for new x264 defaults - MacGui and CLI: Updates built-in presets to produce the same output given the new default x264 settings git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2742 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - cleanup gcc format warnings showing up on linux 64-bitkonablend2009-06-251-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2619 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds an interjob structure to preserve some encode data across jobs within ↵jbrjake2009-06-041-7/+20
| | | | | | an instance of libhb. This allows correcting the estimated bitrate/filesize of 2-pass encodes of variable framerate content, as the actual frame count is known after the first pass. Thanks for putting the idea into code, Shaya. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2482 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - minor code cleanup - use x264_nal_t.i_type instead of buffer+offset&mask.konablend2009-05-031-5/+13
| | | | | | | | - use constants instead of hardcoded values. - explicitly list expected nal types to be processed further. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2372 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - encx264 sets HB_FRAME_REF to expose ref/non-ref frame status to muxer.konablend2009-05-031-0/+6
| | | | | | | | - bump libmp4v2 r286 -> r290; required for new API (sdtp atom support). - use new API MP4WriteSampleDependency() in muxer to signal disposable frames and set a few other dependency bits for sdtp atom. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2371 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Move frame rate code from sync to the end of render so it can account for ↵van2009-05-021-3/+21
| | | | | | | | | | | | frame timing changes made by filters. - Fix a bug that would make CFR alternate between massive drops and massive dups on some titles. - If we're not doing CFR add a factor-of-two fudge factor to init_delay to account f or the awful clock resolution of some mkvs and mp4s. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2368 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: set min:max key intervals ratio to 1:10 of fpskonablend2009-04-181-4/+12
| | | | | | | | | - new behavior effects ratios only for whole-numbered input FPS - old behavior { 23.976, 24, 29.976, 30, 59.94, 60 } -> { 24:240, 25:251, 30:300, 31:301, 60:600, 61:601 } - new behavior { 23.976, 24, 29.976, 30, 59.94, 60 } -> { 24:240, 24:240, 30:300, 30:300, 60:600, 60:600 } git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2343 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Organizes anamorphic parameters in a struct, requiring some minor search and ↵jbrjake2009-01-261-3/+3
| | | | | | replace changes in the interfaces. Folds the logic for strict anamorphic mode into hb_set_anamorphic_size() and also stakes out a new, more customizable mode 3. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2097 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Correct chroma size for raw video frames - width & height need to be rounded ↵van2008-11-081-4/+6
| | | | | | up if they're odd before dividing by 2. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1905 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Ooops, I wanted height not width there.jbrjake2008-10-191-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1852 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds a configuration option for whether the COLR atom and h.264 VUI header ↵jbrjake2008-10-191-2/+15
| | | | | | should signal Bt.601 or Bt.7709 color, instead of just setting it based on whether the source is standard or high definition (which is preserved as default, and made more sensitive to letterboxed HD content). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1851 b64f7644-9d1e-0410-96f1-a4d463321fa5
* After discussion with eddyg, extending verbose logging level 2 from just ↵jbrjake2008-10-091-1/+1
| | | | | | memory-related logging to general-purpose housekeeping--stuff that isn't necessary when scrolling through activity logs users submit with bug reports and support queries. This includes things like thread start/exit messages and preview frames. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1820 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bring libhb in line with x264's new default subme level of 6.jbrjake2008-09-191-3/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1724 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Make sure we never return an unitialized buffer chain to work_loop.van2008-08-091-0/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1622 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't lose our existing buffer chain when nal_encode returns NULL.van2008-07-291-10/+16
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1592 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use PTS, not DTS, in encx264 output frames so we don't have to special-case ↵van2008-07-261-42/+9
| | | | | | its output in every muxer. Confine code that deals with Apple's mistakes in handling video with b-frames to muxmp4. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1582 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - in encx264, if an video frame is larger than init_delay split it into ↵van2008-07-261-191/+274
| | | | | | | | | | | | 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
* - fix an error in the SCR calculation that would cause an extra frame to be ↵van2008-06-301-2/+4
| | | | | | | | | | dropped at an SCR discontinuity. - fix a rounding error in the encx264 init_delay computation that would underestimate the delay for progressive content and cause spurious "init_delay too small" messages. - clean up the sync.c "video time didn't advance" logic and try to make the error mgs more useful for debugging frame duration problems. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1543 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Add COLR atom support to mpeg4ipvan2008-06-181-0/+17
| | | | | | | | - Add COLR atom to mp4 video tracks - Add colorspace info to h.264 VUI header git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1528 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Encode the initial H.264 NAL units for PPS and SPS, not just the ones during ↵jbrjake2008-06-061-6/+5
| | | | | | work. This was a regression caused by r270. Thanks for the patch, j45! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1498 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix for unplayable m4v/mp4 files due to negative numbers in ctts atom.van2008-05-311-7/+25
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1478 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Opens up another way to give x264 a constant QP or RF, by passing a direct ↵jbrjake2008-04-261-1/+24
| | | | | | value instead of a percentage that encx264.c has to convert. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1447 b64f7644-9d1e-0410-96f1-a4d463321fa5