summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
Commit message (Collapse)AuthorAgeFilesLines
* Add VP8 supportjstebbins2014-04-151-0/+13
| | | | | | | Thanks to Matthew Harvey for this patch git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6165 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Convert all text subtitles to ASS subsjstebbins2014-04-131-38/+75
| | | | | | | | | Add support for font color to tx3g. Allow more than one style flag at time in tx3g. Add positioning support to CC subs git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6163 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: enable burn-in of all supported text subtitle formatsjstebbins2014-03-301-2/+3
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6141 b64f7644-9d1e-0410-96f1-a4d463321fa5
* x265: enable MP4 and Matroska muxing.Rodeo2014-03-131-6/+1
| | | | | | | Also remove the raw muxer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6105 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove libfaacsr552014-03-021-29/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6094 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: dynamic detection of availability of libav audio encodersjstebbins2014-03-011-7/+9
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6089 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove HB_API_OLD_PRESET_SETTERS cruft.Rodeo2014-02-181-27/+0
| | | | | | | All UIs and Interop should be up-to-date. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6044 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
* QSV: API 1.8 support and related improvementsRodeo2014-02-181-13/+42
| | | | | | | | | Optional feature detection now done via MFXVideoENCODE_Query. This should work better with future hardware and encoder implementations. Optional API 1.8 features are not tested (not supported by the software implementation, and no drivers with API 1.8 support available yet). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6041 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: make encoder options less x264-centric.Rodeo2014-02-131-28/+55
| | | | | | | | 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
* Fix typo in previous commit.Rodeo2014-02-131-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6030 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: write encoding library's name in the Activity Log.Rodeo2014-02-131-42/+96
| | | | | | | We lost them for some encoders in SVN revision 5586. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6029 b64f7644-9d1e-0410-96f1-a4d463321fa5
* x265: misc. container-related fixes.Rodeo2014-02-121-4/+4
| | | | | | | CLI users: please use -f x265 instead of -f raw git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6027 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Initial x265 integration. Patch by Zhang Zhiqiang. Thanks!Rodeo2014-02-101-0/+32
| | | | | | | | | | | 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
* libhb: support AV_FRAME_DATA_MATRIXENCODING side data.Rodeo2014-01-261-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6000 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decavcodec: DRC support.Rodeo2014-01-251-0/+22
| | | | | | | Adds DRC support for E-AC-3 audio (as well as any future libavcodec decoders with DRC support). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5995 b64f7644-9d1e-0410-96f1-a4d463321fa5
* remove contrib mpeg2decjstebbins2014-01-131-1/+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
* libhb: make avformat-based muxers the default.Rodeo2013-11-081-2/+2
| | | | | | | | They've matured enough by now. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5890 b64f7644-9d1e-0410-96f1-a4d463321fa5
* New getters for video presets, tunes, profiles and levels.Rodeo2013-11-081-0/+57
| | | | | | | | | | x264 is no longer the only encoder with a built-in preset system; QSV has its own presets, and supports setting the H.264 profile and level, too. Old getters still in place for compatibility with the old API.. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5883 b64f7644-9d1e-0410-96f1-a4d463321fa5
* QSV: libhb-based preset system.Rodeo2013-09-241-0/+1
| | | | | | | | | | | | Modeled after x264's preset system. MMBRC and LookAhead RC are now enabled by default, whereas Trellis is disabled by default. Please note that Windows GUI support will come later, and that preset names are not definitive. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5806 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: make libhb internal character code utf8jstebbins2013-09-221-0/+19
| | | | | | | | | | 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/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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
* QSV: minor refactoring.Rodeo2013-09-151-3/+4
| | | | | | | | | | Address the easy issues first. Apologies if I broke HandBrakeInterop. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5783 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Big merge, QSV to trunk: part 1 (tracked files).Rodeo2013-08-221-2/+31
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5737 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add hb_video_quality_get_limits and hb_video_quality_get_name to libhb API.Rodeo2013-07-131-0/+49
| | | | | | | | Includes a MacGui implementation. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5647 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: add experimental avformat muxer for mkv and mp4jstebbins2013-06-301-45/+54
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5620 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Cosmetics after last commit.Rodeo2013-06-151-8/+8
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5587 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: improve video and audio encoder names.Rodeo2013-06-151-29/+25
| | | | | | | | | | | | | | | | | | When we only have one encoder for a particular codec: - don't add (library_name) in the name - don't prefix with ff or otherwise use the library name in the short name AAC (ffmpeg) -> AAC (avcodec): works for both Libav and FFmpeg. consistency: ffaac -> av_aac (like ca_aac, fdk_aac and so on) VP3 (Theora) -> Theora: Theora is based on VP3, but is not exactly VP3. manicure updated to handle the new names, but built-in presets left untouched (this will require WinGUI updates). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5586 b64f7644-9d1e-0410-96f1-a4d463321fa5
* improve aac encoder build options and change some aac encoder defaultsjstebbins2013-06-151-5/+4
| | | | | | | | | | 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
* hb_mixdown_*: use meaningful values instead of -1.Rodeo2013-06-041-3/+3
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5553 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_video_encoders: cosmetics.Rodeo2013-06-031-8/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5550 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb/common: improve fallback mechanism.Rodeo2013-06-031-418/+759
| | | | | | | | | | | | | | | | | | | | 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
* Don't expose rate, mixdown, dither and encoder arrays to the UIs.Rodeo2013-05-301-621/+1229
| | | | | | | | | | | | | | | | | | | | - instead, make these lists available through enumerators: --> hb_*_get_next(<type> *last); - this should give us more flexibility to populate the lists at runtime, using the implementation(s) of our choice, whether they use arrays or not, without requiring UI modifications - use consistent naming for getters --> hb_get_best_foo() becomes hb_foo_get_best(), and so on - hb_*_get_from_name() and hb_*_ sanitize_name() sanitize the requested value to a supported one if it's unavailable - adds an additional, passthru-specific fallback mechanism - adds a list of video containers git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5526 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix log pollution when Auto Passthru is not possible and uses the fallback ↵Rodeo2013-04-281-1/+1
| | | | | | | | | | audio encoder, if that encoder does not accept s16(p) input samples. "work: track 1, dithering not supported by codec" git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5421 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_get_best_mixdown: fix out-of-array reads.Rodeo2013-04-281-2/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5420 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
* fdkaac: new bitrate limits.Rodeo2013-03-041-3/+40
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5297 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fdk_haac: samplerates < 16 kHz are not supported.Rodeo2013-03-041-0/+6
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5296 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add optional fdk-aac encoderjstebbins2013-03-031-0/+9
| | | | | | | configure --enable-fdk-aac to enable this encoder git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5287 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Audio dithering.Rodeo2013-02-051-0/+57
| | | | | | | | | | | | Works with encoders that accept 16-bit signed integers as input (currently, only ffflac). When supported, the default method is standard triangular. CLI users can request a specific dither algorithm via the --adither option. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5241 b64f7644-9d1e-0410-96f1-a4d463321fa5
* x264 preset system: miscellaneous improvements.Rodeo2013-01-301-5/+5
| | | | | | | | See https://reviews.handbrake.fr/r/421/ for details. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5225 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_rate_s, hb_mixdown_s, hb_encoder_s: use const char * instead of char *Rodeo2013-01-041-1/+2
| | | | | | | | These are used in hardcoded tables, so there will never be a need for mutable strings. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5148 b64f7644-9d1e-0410-96f1-a4d463321fa5
* CLI: avoid an #fidef.Rodeo2013-01-041-0/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5146 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: add hb_get_default_audio_encoder().Rodeo2013-01-041-7/+12
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5144 b64f7644-9d1e-0410-96f1-a4d463321fa5
* FLAC: add 24-bit encoding.Rodeo2013-01-021-1/+8
| | | | | | | | | | Works via a dedicated encoder: "FLAC (24-bit)", "ffflac24". Users who prefer 16-bit can use the previous FLAC encoder: "FLAC (ffmpeg)", "ffflac". git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5134 b64f7644-9d1e-0410-96f1-a4d463321fa5
* LinGui: add x264 preset/tune/profile/level supportjstebbins2012-12-271-0/+40
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5110 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix mac ui scaling problem after performing live preview encodejstebbins2012-12-171-1/+36
| | | | | | | | we can't touch the picture settings when resetting the job. the mac ui currently depends on these remaining to what it set last. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5099 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix some crashes in the macuijstebbins2012-12-121-0/+2
| | | | | | | | | I missed setting some pointers to NULL after free and missed place where the ui was setting job->file directly instead of using hb_job_set_file(). Also, a NULL chapter name caused a crash. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5097 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: refactor job initialization and cleanupjstebbins2012-12-091-95/+77
| | | | | | | | Separates out some duplicate code in hb_job_reset, hb_job_close, and hb_job_init. Also removes some vestigial function definitions in hb.h git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5096 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve management of titles and jobsjstebbins2012-11-121-38/+704
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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