summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
Commit message (Collapse)AuthorAgeFilesLines
* libhb: add new function for retrieving previewsjstebbins2014-07-291-31/+91
| | | | | | | | | | | | | | | | 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
* cli: Simplify output geometry calculationjstebbins2014-07-161-15/+13
| | | | | | | | Fix bug where non-anamorphic mode ignores modulus Change default modulus to 2 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6234 b64f7644-9d1e-0410-96f1-a4d463321fa5
* macui/cli/libhb: cleanupjstebbins2014-06-181-113/+6
| | | | | | | | | | | | macui: Simplifies code in Controller.m and fixes a few bugs macui: Fixes "Windows 8 Phone" preset aspect ratio problem macui: round up to next mod boundary when limiting to title dimensions - crop libhb: Eliminates hb_fix_aspect and hb_set_size functions. libhb: Makes hb_validate_size a passthru to hb_set_anamorphic_size cli: eliminage use of hb_validate_size git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6215 b64f7644-9d1e-0410-96f1-a4d463321fa5
* macui: fix PcitureController geometry calculationsjstebbins2014-06-101-132/+250
| | | | | | | | simplifies the code and makes it work better also updates preview window size calculations git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6209 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove libfaacsr552014-03-021-3/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6094 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: remove a52decjstebbins2014-02-201-1/+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
* libhb: make encoder options less x264-centric.Rodeo2014-02-131-12/+12
| | | | | | | | profile/level control and, to a lesser extent, encoder presets and tunes are becoming more common. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6031 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Initial x265 integration. Patch by Zhang Zhiqiang. Thanks!Rodeo2014-02-101-0/+3
| | | | | | | | | | | 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
* decavcodec: prefer AVFrame fields over their AVCodecContext equivalent.Rodeo2014-01-251-17/+0
| | | | | | | 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
* remove contrib mpeg2decjstebbins2014-01-131-1/+0
| | | | | | | | 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
* libhb: remove use of avpicture_deinterlacejstebbins2013-12-021-9/+1
| | | | | | | | 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-5/+0
| | | | | | | | | | | 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
* RB626: return code support addedmaxd2013-11-051-0/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5876 b64f7644-9d1e-0410-96f1-a4d463321fa5
* OpenCL: initial work on a new OpenCl wrapper, which will eventually phase ↵Rodeo2013-11-021-2/+1
| | | | | | | | | | out the existing one. Based on an x264 patch by Anton Mitrofanov. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5870 b64f7644-9d1e-0410-96f1-a4d463321fa5
* scan: print CPU info, GPU info, then QSV info.Rodeo2013-10-111-5/+10
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5830 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Prettify CPU info in the log.Rodeo2013-09-241-7/+6
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5804 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: make libhb internal character code utf8jstebbins2013-09-221-2/+2
| | | | | | | | | | This makes libhb expect all strings passed to it to be in utf8 format. The cli converts the converts from the current code page to utf8. libhb converts back to the current code page when necessary for libraries that expect it. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5798 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Merging-in the OpenCL Scaling code from the OpenCL branch to trunk. sr552013-09-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Print QSV info in all logs in a libhb-friendly manner, via hb_scan (was ↵Rodeo2013-08-261-5/+5
| | | | | | | | | | printed in hb_init). Also, print an error to the log if attempting to print uninitialized QSV info. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5751 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Big merge, QSV to trunk: part 1 (tracked files).Rodeo2013-08-221-0/+21
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5737 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: store and print additional CPU informationRodeo2013-07-131-1/+12
| | | | | | | | Printed in hb_scan(), so that it's present in all Activity Logs (both encode and scan). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5648 b64f7644-9d1e-0410-96f1-a4d463321fa5
* improve aac encoder build options and change some aac encoder defaultsjstebbins2013-06-151-0/+2
| | | | | | | | | | By default, faac is no longer built. Libav aac is now the default aac encoder on all platforms except osx where ca_aac is the default. fdk-aac is now built by default (except on osx). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5581 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: move one-time registrations to hb_global_init().Rodeo2013-06-061-62/+33
| | | | | | | | There's no need to do this in each call to hb_init(). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5566 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb/common: improve fallback mechanism.Rodeo2013-06-031-25/+16
| | | | | | | | | | | | | | | | | | | | API changes: - added hb_global_init(), must be called before any other libhb function - removed (somewhat pointless) hb_mixdown_t.internal_name - some hb_*_get_from_name() functions now return 0 instead of -1. Instead of hardcoded fallbacks, list items now have a specific fallback, and a generic ID for when the specific fallback is unavailable. Encoder availability is checked at runtime (hb_global_init calling hb_common_global_init) and the item's value/fallback is sanity-checked and updated if necessary. See https://reviews.handbrake.fr/r/506/ for more detailed information. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5547 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Disable Libav's AVX and FMA4 optimizations under Windows x86_64.Rodeo2013-04-241-1/+9
| | | | | | | | | | They cause crashes in avresample. SSE* optimizations are still enabled, so the performance hit should be pretty minimal. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5409 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_system_sleep: refactoring.Rodeo2013-03-181-9/+10
| | | | | | | | | | | | Also: - release power assertions before freeing them - actually free the power assertions in hb_close() (previously unused) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5340 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_system_sleep: minor cleanup after last commit.Rodeo2013-03-181-4/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5337 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_system_sleep: allow/prevent sleep from the UI rather than libhb.Rodeo2013-03-181-1/+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-2/+25
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5238 b64f7644-9d1e-0410-96f1-a4d463321fa5
* x264 preset system: miscellaneous improvements.Rodeo2013-01-301-2/+2
| | | | | | | | See https://reviews.handbrake.fr/r/421/ for details. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5225 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bump libav to v9_beta3.Rodeo2012-12-311-17/+24
| | | | | | | | Miscellaneous bugfixes and improvements. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5124 b64f7644-9d1e-0410-96f1-a4d463321fa5
* LinGui: add x264 preset/tune/profile/level supportjstebbins2012-12-271-0/+9
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5110 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve management of titles and jobsjstebbins2012-11-121-271/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* hb_ff_set_sample_fmt() improvements.Rodeo2012-10-171-14/+31
| | | | | | | | | | - allow setting a sample_fmt other than AV_SAMPLE_FMT_FLT - fall back on planar/packed variant of the requested format if available git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5019 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Audio improvements.Rodeo2012-09-031-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New supported samplerates: 8, 11.025, 12, 16 kHz. Now 8, 11.025, 12, 16, 22.05, 24, 42, 44.1, 48 Khz are supported. Unsupported samplerates are sanitized to the closest samplerate for all encoders. Samplerates < 32 kHz are now forbidden for AC3 encoding (sanitized to 32 kHz). Most AC3 decoders don't support such samplerates. New upmixing: 3.0 (Front Left, Right & Center) can now be upmixed to 5.1 to preserve the center channel. New mixdowns: 6.1 (Front Left, Right & Center, Surround Left, Right & Center, LFE) 7.1 (Front Left, Right & Center, Surround Left & Right, Rear Left & Right, LFE) -> available to Vorbis & FLAC encoders for compatible input channel layouts 7.1 (Front Left, Right & Center, Front Left & Right of Center, Surround Left & Right, LFE) -> available to AAC encoders (ca_aac, ca_haac, faac) for compatible input channel layouts Mono (Left Only): Stereo to Mono by discarding the Right channel Mono (Right Only): Stereo to Mono by discarding the Left channel -> available to all encoders for non-Dolby Stereo input The "6-channel discrete" mixdown becomes "5.1 Channels". New bitrates: 960 - 1536 Kbps. This lets users work around poor audio quality in crappy encoders by throwing more bits at them. Bitrate limits have been re-worked and re-tested for all encoders. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4930 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove unused code.Rodeo2012-08-191-15/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4909 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve last commit. While the AC3 decoder doesn't use hb_ff_layout_xlat(), ↵Rodeo2012-08-111-5/+0
| | | | | | the code I added to it really belongs in hb_audio_resample. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4899 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix a bug where we were attempting to downmix Dolby Surround ↵Rodeo2012-08-111-2/+6
| | | | | | (AV_CH_LAYOUT_STEREO_DOWNMIX) to AV_CH_LAYOUT_STEREO via libavresample (which is not implemented). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4898 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix deinterlace fast green stripejstebbins2012-07-181-8/+8
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4865 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use libav for dts audio decoding instead of libdca jstebbins2012-07-151-2/+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
* bump libav to libav-v0.8-2197-g1a068bfjstebbins2012-07-111-42/+59
| | | | | | | | | | | | 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: fix hb_read_preview() when invalid index is passedjstebbins2012-07-111-0/+1
| | | | | | | Was returning last preview instead of NULL git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4823 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix problem reading previewjstebbins2012-07-101-2/+11
| | | | | | | | | The title "index" is not an index into list_title. It is a unique number assigned to each title in the list. So we must scan the list for a matching "index". git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4822 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix comb detection crash and decomb crashjstebbins2012-07-061-23/+10
| | | | | | | | | | | | | hb_detect_comb() could crash because the dimensions of the video buffer don't have to match the dimensions returned by work object info() method if the video has segments of differeing resolutions. decomb was allocating reference buffers that were too small. This bug appears to have always existed but doesn't usually get triggered because malloc usually rounds allocation sizes up. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4812 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix deinterlace fast problem with sources that have <mod8 alignmentjstebbins2012-06-251-48/+80
| | | | | | | | | | 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
* libhb: fix potential overflow in par calculationsjstebbins2012-06-221-12/+10
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4765 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove encca_haac_available(). It's no longer needed since we dropped ↵Rodeo2012-06-201-53/+0
| | | | | | support for OS X 10.5. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4759 b64f7644-9d1e-0410-96f1-a4d463321fa5