summaryrefslogtreecommitdiffstats
path: root/libhb/internal.h
Commit message (Collapse)AuthorAgeFilesLines
* libhb: detect read errors and propagatejstebbins2015-06-291-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7332 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Use a buffer flat to indicate EOFjstebbins2015-05-011-13/+14
| | | | | | | | | | | | ... 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
* demuxmpeg: Don't drop frames with bad timestampsjstebbins2015-04-221-2/+0
| | | | | | Just invalidate the timestamps and let the decoders interpolate. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7121 b64f7644-9d1e-0410-96f1-a4d463321fa5
* stream: Improve transport stream PCR handlingjstebbins2015-04-221-1/+3
| | | | | | | | When a new PCR is seen, emit all currently cached data. This prevents data that was referenced to the previous PCR from being associated with the new PCR. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7120 b64f7644-9d1e-0410-96f1-a4d463321fa5
* sync: fix frame p-to-p extra audio after end framejstebbins2015-04-221-0/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7119 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Eliminate global variable hb_gui_use_hwd_flagjstebbins2015-03-291-7/+16
| | | | | | | | | | | | This global was shared between the CLI and libhb and used as a back door to force scan and encode passes to use the same ffmpeg context for hardware decoding. Aside from the fact that this context sharing should not be necessary and needs fixing, this information belongs in the hb_handle_t that is shared between the scan and the encode. So put it there and make sure the hb_handle_t get propagated to where the flag is needed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7028 b64f7644-9d1e-0410-96f1-a4d463321fa5
* json: automatically scan title when processing json jobsjstebbins2015-03-071-0/+1
| | | | | | | | | | | | | | | Simplifies the WinGui. This also changes how jobs are processed. Creating the sub-jobs for multiple passes is delayed until after scanning and immediately before running the job. Working status has also changed. Sub-job passes are identified in status with an ID that allows the frontend to definitively identify what pass is in progress. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6976 b64f7644-9d1e-0410-96f1-a4d463321fa5
* mux: fix chapter timestamps, factor in video encoder delayjstebbins2015-02-041-1/+1
| | | | | | | | libav does not fix chapter timestamps for us, so we must do this until I can figure out a good fix to libav. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6871 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
* libhb: add hb_image_init to create blank imagesjstebbins2014-12-191-0/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6613 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: thread nlmeans filterjstebbins2014-09-091-34/+37
| | | | | | | Scales well with number of CPUs, so is 4x faster on quad cores. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6397 b64f7644-9d1e-0410-96f1-a4d463321fa5
* build: remove mp4v2 and libmkv dependenciesjstebbins2014-08-181-5/+0
| | | | | | | ...and enable x265 by default git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6309 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: add new function for retrieving previewsjstebbins2014-07-291-1/+2
| | | | | | | | | | | | | | | | This new function has a couple advantages over the old one (which we should phase out). It does not require hb_job_t as a parameter, instead it uses hb_ui_geometry_t which is a smaller and simpler struct. The entire job struct is overkill as input to this function. It returns an hb_image_t that fully describes the returned image instead of just a uint8_t array. The caller does not have to make assumptions about image size, line stide, or pixel format since hb_image_t specifies these things. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6242 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: work around libav decoder error durint p-to-p encodingjstebbins2014-07-141-0/+1
| | | | | | | | | In some cases, initial data when in p-to-p mode causes libav decoder initialization to fail. This only happens when multi-threaded encoding is enabled. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6229 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: New denoiser, nlmeans.bradleys2014-06-191-0/+1
| | | | | | | | Non-local means averages multiple patches of similar pixels together, preserving similarities and attenuating variance (usually noise). This is typically more effective than lowpass and more faithfully restores the appearance of structure and detail found in the original source, especially in the high frequency range. Parameters for origin patch weight tuning and pre-filtering further improve on the original algorithm. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6216 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Fix decoding avi with palettejstebbins2014-05-291-0/+4
| | | | | | | | | ... and probably other formats that use a palette. The palette is stored in AVPacket side data which we did not read. So read the side data and stash it in hb_buffer_t so that it can be used later by the decoder. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6207 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove libfaacsr552014-03-021-1/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6094 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bump x265 to r6321 8a84c10e5116.Rodeo2014-02-281-0/+6
| | | | | | | | | | | - rational framerates - libx265 now provides decode time stamps (DTS) - encx265: minor refactoring + prepare for muxing to MP4/Matroska git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6088 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: remove a52decjstebbins2014-02-201-18/+0
| | | | | | | replace it with libavcodec ac3 decoder git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6049 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
* Initial x265 integration. Patch by Zhang Zhiqiang. Thanks!Rodeo2014-02-101-0/+1
| | | | | | | | | | | Build with --enable-x265 (requires CMake). Use via HandBrakeCLI with -a none -e x265 -f raw Only raw HEVC output is supported for now (no audio or subtitles). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6023 b64f7644-9d1e-0410-96f1-a4d463321fa5
* remove contrib mpeg2decjstebbins2014-01-131-4/+2
| | | | | | | | We no longer need mpeg2dec. libav now has all the features we need for mpeg2 decoding. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5966 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump libav, libav-v10_alpha1-90-g63debaajstebbins2014-01-121-0/+2
| | | | | | | | | Adds interlaced VC1 and HEVC support. Eliminates the need for most of our local patches. Many assorted bug fixes and improvements. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5962 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Revert previous borked commit. Sorry!Rodeo2014-01-071-2/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5958 b64f7644-9d1e-0410-96f1-a4d463321fa5
* parsecsv: always check result of malloc()Rodeo2014-01-071-0/+2
| | | | | | | | | RebiewBoard #670. Patch by icchan. Thanks! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5957 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: remove use of avpicture_deinterlacejstebbins2013-12-021-0/+2
| | | | | | | | This function is being remove from libav. so replace it's functionality with a threaded implementation of our own. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5911 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix a bunch of compiler warningsjstebbins2013-11-261-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5905 b64f7644-9d1e-0410-96f1-a4d463321fa5
* OpenCL: use the new library loading architecture for all OpenCL code.Rodeo2013-11-081-2/+2
| | | | | | | | | | | An OpenCL SDK is no longer needed to build OpenCL support. Note: as a result, the --enable-opencl configure option is removed. Also, libOpenCL is no longer needed to run the application (it is still necessary to use OpenCL features, of course). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5886 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Merging-in the OpenCL Scaling code from the OpenCL branch to trunk. sr552013-09-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Patch originally by the Multicoreware Inc team, followed by improvements and fixes by Micheal Wootton from AMD Inc, OpenCL: This patch implements Bicubic Scaling in OpenCL. Note that HandBrake currently uses Lanczos so the performance difference appears to be much more significant. We may offer an option of BiCubic in software later. Bicubic scaling may appear a bit sharper than the equivalent Lanczos encode and may increase file size a bit. Quality may be better or worse depending on the scaling and content and personal preference towards sharpness. When comparing performance with a custom HandBrake build that runs Software Bicubic to OpenCL Bicubic, performance increase is about 5~7% on average on a modern GPU. Hardware Decode via DXVA: We also have optional DXVA decoding which may come in useful for slower/lower end systems that have a capable GPU. This is only available on input sources that use the libav decode path. Most GPU hardware for decoding is designed for playback, so if you are running on a high end CPU, it will bottleneck the encode process. Requires OpenCL 1.1 or later supporting GPU. Front end changes and testing framework are not included in this patch. This will be resolved later. Patch will be revised further before the UI is implemented. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5792 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Big merge, QSV to trunk: part 1 (tracked files).Rodeo2013-08-221-0/+13
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5737 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: add experimental avformat muxer for mkv and mp4jstebbins2013-06-301-10/+13
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5620 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_system_sleep: allow/prevent sleep from the UI rather than libhb.Rodeo2013-03-181-3/+1
| | | | | | | | | | The code that sets/unsets the "power assertions" is still in libhb. Patch by Jérôme Lacube. Thanks! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5336 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
* Prevent OSX ML sleep during encoding, thanks to Jerome Lacubesr552013-02-041-1/+3
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5238 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bump libav to v9_beta3.Rodeo2012-12-311-14/+13
| | | | | | | | Miscellaneous bugfixes and improvements. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5124 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve management of titles and jobsjstebbins2012-11-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleans up several several unavoidable memory leaks caused by old api. Clearly separates titles from jobs. Titles are set during scan and never modified now. Since titles are immutable, this lead to API some changes. For example, We were setting chapter names in the title from the front ends. Now these get set in the job. These new APIs allow us to start moving away from our use of title->job. Eventually, I would like to eliminate title->job completely, but the mac ui is too tightly tied to using this field to allow removing it at this time. So there is temporarily a convenience function used only by the mac ui that allows it to continue using title->job and also use the new APIs. New APIs: typedef struct hb_title_set_s hb_title_set_t; struct hb_title_set_s { hb_list_t * list_title; int feature; // Detected DVD feature title }; hb_title_set_t * hb_get_title_set( hb_handle_t * ); This is just something I added to clean up how "feature title" info is passed. hb_job_t * hb_job_init( hb_title_t * title ); Initializes a new job with default settings from the title. hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index ); Same as hb_job_init(). For use by win Interop lib. void hb_job_reset( hb_job_t * job ); Convenience function for the MacUi. Clears audio, subtitle, and filter lists. The macui still uses title->job because it is so intricately tied to it. So I created this convenience function that it can call after adding a job. void hb_job_close( hb_job_t ** job ); Releases the job an all resources it contains. void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts ); Makes a copy of "advanced_opts" and stores in job. Freed by hb_job_close(). void hb_job_set_file( hb_job_t *job, const char *file ); Makes a copy of "file" and stores in job. Freed by hb_job_close(). void hb_chapter_set_title(hb_chapter_t *chapter, const char *title); Makes a copy of "title" and stores in chapter. Freed by hb_chapter_close(). Recommended usage (cli and lingui are updated to do this): job = hb_job_init( title ); // set job settings ... hb_add(h, job); hb_job_close( &job ); I have also added new APIs for managing metadata. These are used to add metadata to a job. void hb_metadata_set_name( hb_metadata_t *metadata, const char *name ); void hb_metadata_set_artist( hb_metadata_t *metadata, const char *artist ); void hb_metadata_set_composer( hb_metadata_t *metadata, const char *composer ); void hb_metadata_set_release_date( hb_metadata_t *metadata, const char *release_date ); void hb_metadata_set_comment( hb_metadata_t *metadata, const char *comment ); void hb_metadata_set_genre( hb_metadata_t *metadata, const char *genre ); void hb_metadata_set_album( hb_metadata_t *metadata, const char *album ); void hb_metadata_set_coverart( hb_metadata_t *metadata, const uint8_t *coverart, int size ); Example: job = hb_job_init( &job ); // set job settings ... hb_metadata_set_artist( job->metadata, "Danny Elfman" ); hb_add(h, job); hb_job_close( &job ); Some APIs have changed in order to avoid using title incorrectly and use the new hb_title_set_t. -void hb_autopassthru_apply_settings( hb_job_t * job, hb_title_t * title ); +void hb_autopassthru_apply_settings( hb_job_t * job ); -void hb_get_preview( hb_handle_t *, hb_title_t *, int, uint8_t * ); +void hb_get_preview( hb_handle_t *, hb_job_t *, int, uint8_t * ); hb_thread_t * hb_scan_init( hb_handle_t *, volatile int * die, const char * path, int title_index, - hb_list_t * list_title, int preview_count, + hb_title_set_t * title_set, int preview_count, int store_previews, uint64_t min_duration ); These APIs have been removed. Win Interop will need some changes. I think what I've provided will be suffecient, but let me know if it's not. -void hb_get_preview_by_index( hb_handle_t *, int, int, uint8_t * ); -void hb_set_anamorphic_size_by_index( hb_handle_t *, int, - int *output_width, int *output_height, - int *output_par_width, int *output_par_height ); git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5058 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: decomb and deinterlace improvementsjstebbins2012-08-271-1/+2
| | | | | | | | | | | | | | | | | | Use hb_buffer_t for reference buffers. This is what eliminates extra buffer copies. Simplified a lot of the code. This resulted in some minor speed improvements and easier to read code. Allow mcdeint+bob. Previously these could not be used together. Thread the erode-dilate-erode-check steps in decomb3. More speed improvement. Speed of default decomb went from 62fps to 76fps. Speed of fast decomb went from 90fps to 95fps. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4919 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use libav for dts audio decoding instead of libdca jstebbins2012-07-151-1/+0
| | | | | | | | | libdca has no advantage over libav for dts audio decoding. It doesn't do drc and it's downmix capabilities are actually inferior to libav. So this completely removes libdca from libhb git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4844 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix deinterlace fast problem with sources that have <mod8 alignmentjstebbins2012-06-251-1/+19
| | | | | | | | | | avpicture_deinterlace requires that both width and height of the input be 8 pixel aligned. Video buffers already have padding to align horizontally to 16 pixels, but they were not padded vertically. This adds vertical padding. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4776 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
* PGS (bluray) subtitle support \o/jstebbins2012-04-261-1/+2
| | | | | | | | | | | | Thanks to patches supplied by David Mitchell and Rob McMullen we finally have PGS support. I added a fix for libav pgs timestamp processing and detection of forced subtitles to their work, then made foreign audio search work with PGS subs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4605 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix cfr encodingjstebbins2012-03-311-116/+7
| | | | | | | | | | | | when frames are duplicated, the frame was not copied properly and resulted in divide by 0 later when the frame is processed. This fix is a bit larger than the minimum size necessary to fix the problem. I took the oportunity to clean up some buffer initialization and copy operations. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4563 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rework filter pipelinejstebbins2012-03-271-50/+192
| | | | | | | | | | | | | | | | | | | | 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 interleaving of subtitles in muxerjstebbins2011-11-141-0/+1
| | | | | | | | | | | | | 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. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4351 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump libvorbis from aoTuV b5 to b6.03jstebbins2011-10-211-1/+1
| | | | | | | | | | 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 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4302 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add flac + quality + compression level supportjstebbins2011-10-121-1/+1
| | | | | | | | | 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 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4281 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add utility function for doing hexdumps to logjstebbins2011-09-271-0/+1
| | | | | | | I find myself re-writing a quick and dirty hexdump function far too often when debugging. This will save some time in the future. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4259 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix framerate detection for AVCHD-Litejstebbins2011-09-241-0/+2
| | | | | | | | The AVCHD-Lite specification only supports 50 or 60 fps. So to get 25 or 30 fps, they double every frame using repeat flags. Detect this and adjust the framerate accordingly. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4242 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix corrupt first frame in BD point-to-pointjstebbins2011-09-191-1/+0
| | | | | | | | | | | Seek point may be a recovery point which will not be a complete clean frame. So consume frames till we reach the recovery frame count. Patches Libav so it can tell us when the recovery point has been reached. Also improves detection of recovery points in TS files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4231 b64f7644-9d1e-0410-96f1-a4d463321fa5