summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
Commit message (Collapse)AuthorAgeFilesLines
* Use hb_audio_resample for downmixing AC3 sources. DRC is still applied by ↵Rodeo2012-08-021-22/+15
| | | | | | | | | | | | | | | | | liba52. Add support for center & surround mix levels to hb_audio_resample. This allows us to support upmixing all audio sources. For sources that have at least 2 front and one back or side channel(s), allow upmixing to 5.1: 3.0/3.1 (2 front and 1 back channels) 4.0/4.1 (3 front and 1 back channels) 4.0/4.1 (2 front and 2 side channels) 5.0 (3 front and 2 side channels) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4885 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Allow control of audio mix normalizationjstebbins2012-08-011-0/+3
| | | | | | | | | | | | Since switching to libavresample for audio mixing, our output volume levels have been reduced because libavresample does mix level normalization by default. This change applies a patch to libav to allow us to disable this behavior and adds a new field to hb_audio_config_t to allow the hb frontends to control this feature. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4884 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use HB_INVALID_AMIXDOWN and HB_AMIXDOWN_NONE where applicable.Rodeo2012-07-291-3/+3
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4879 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Introduce a negative HB_INVALID_AMIXDOWN.Rodeo2012-07-271-1/+1
| | | | | | | | | | Having the audio->config.out.mixdown start at 0 caused it to be treated as usigned (under OS X at least), causing the sanitizing code in work.c to fail: line 820, (audio->config.out.mixdown <= 0) would evaluate as false, and so the best mixdown was being set instead of the default one. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4878 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix hb_mixdown_get_discrete_channel_count for HB_AMIXDOWN_NONE (passthrough).Rodeo2012-06-271-5/+8
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4783 b64f7644-9d1e-0410-96f1-a4d463321fa5
* common.h, common.c: minor modifications.Rodeo2012-06-201-3/+3
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4758 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_get_best_mixdown: fix bug introduced in revision 4755.Rodeo2012-06-201-1/+8
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4757 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: update hb_get_best_mixdown(). I was partially borken after revision 4754.Rodeo2012-06-191-57/+34
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4755 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: drop HB_INPUT_CH_LAYOUT_*Rodeo2012-06-181-16/+14
| | | | | | | | AV_CH_LAYOUT_* works for us, and as its usage becomes more widespread in libhb, translating between the two formats gets increasingly tedious. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4754 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
* Make HB_AMIXDOWN_* defines a simple enumeration. The existing system wasn't ↵Rodeo2012-06-061-7/+21
| | | | | | necessary and didn't work in all decoders for Dolby downmixing. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4714 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decdca: attempt to fix Dolby Surround and Pro Logic II mixdown. We were ↵Rodeo2012-05-271-29/+33
| | | | | | | | | | | | | | doing it wrong in some cases. This means Dolby Pro Logic II is now only available for sources with at least L, R, C, Ls, Rs channels (as well as any additional channels), due to some libdca limitations. This will eventually go away when we use our own downmixing for all sources. Further cleanup to follow. Also cleans up usage of audio->config.in.flags (was audio->config.flags.*). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4705 b64f7644-9d1e-0410-96f1-a4d463321fa5
* PGS (bluray) subtitle support \o/jstebbins2012-04-261-0/+59
| | | | | | | | | | | | 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
* LinGui: allow the user to select and use a bitrate for audio autopassthrujstebbins2012-04-261-1/+4
| | | | | | | | If the fallback encoder is used, the user should be able to set the bitrate that is used. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4604 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb/hd_dict.c, add newline at end of file.Rodeo2012-03-291-1/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4556 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rework filter pipelinejstebbins2012-03-271-19/+79
| | | | | | | | | | | | | | | | | | | | 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
* Add framerate values for 30, 50, 60000/1001 and 60 fps.Rodeo2012-03-191-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4518 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add HB_INVALID_AUDIO_QUALITY define. -1 is valid for Vorbis VBR and thus ↵Rodeo2012-02-211-4/+4
| | | | | | | | | | doesn't work for this purpose. Fixes Vorbis VBR with --aq < 0 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4461 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Print more Auto Passthru information to the Activity Log: passthru mask ↵Rodeo2012-02-171-2/+74
| | | | | | (allowed codecs), fallback encoder. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4454 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Set default audio compression in hb_autopassthru_apply_settings to get rid ↵Rodeo2012-02-171-0/+1
| | | | | | of an annoying warning in the log. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4453 b64f7644-9d1e-0410-96f1-a4d463321fa5
* ca_aac: set minimum VBR quality to 1 instead of 0.Rodeo2012-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | That way, (high-low)/granularity divides cleanly by 1. Old qualities (low to high in increments of granularity): { 0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99, 108, 117, 126 } (the default, 91, is not in that list) New qualities (low to high in increments of granularity): { 1, 10, 19, 28, 37, 46, 55, 64, 73, 82, 91 (default), 100, 109, 118, 127 } Actual output is unchanged (ca_aac has quality ranges; a 1-point bump will not change the range for each quality). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4422 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Vorbis: adjust default VBR quality after revision 4385.Rodeo2012-01-251-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4421 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use -2 to 10 range for Vorbis audio quality (same as what oggenc uses), ↵Rodeo2011-12-231-3/+3
| | | | | | instead of the native libvorbis API values. This is what users will expect. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4385 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix spurious audio compression & quality log warningjstebbins2011-11-141-0/+2
| | | | | | | quality and compression_level were not getting initialized to -1 for passthru. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4350 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Allow vorbis quality to go down to -0.2jstebbins2011-10-311-1/+1
| | | | | | | Bizzaro vorbis allows negative quality factors. They go to 11 in the wrong direction. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4332 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Wrap encoder lists in functions to expose them to Pinvoke.randomengy2011-10-221-0/+15
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4311 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump Libav from v0.7.1 to v0.7-1241-g5f3fb59jstebbins2011-10-151-0/+1
| | | | | | | | | | | | Fixes VC-1 decode issue Adds partial support for interlaced VC-1 decode Adds ProRes decoder Fixes ac3 encoder dolby flag Fixes DCA frame size setting (delete patch A04) Fixes VC-1 repeat field processing (delete patch A05) Numerous other bug fixes and enhancements git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4291 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add flac + quality + compression level supportjstebbins2011-10-121-5/+178
| | | | | | | | | 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
* log printable ascii with hexdumpsjstebbins2011-09-291-3/+14
| | | | | | Provides similar output to 'hexdump -C' *nix command. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4262 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a crash in HandBrakeCLIjstebbins2011-09-271-0/+6
| | | | | | | | | | | | | When the audio tracks are omitted (no -a), the cli uses the first source audio track and replicates it for each audio output codec. The way it knows what to replicate is to look at audio->in.track for the last audio that was added to the job. This track number was being copied from the title's in.track. But title track numbers are not guaranteed to be sequential (e.g. scan drops tracks it can't decode). So when adding an audio to a job, set in.track to the value of in.track that is passed in the audio_config structure passed to hb_audio_add. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4260 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add utility function for doing hexdumps to logjstebbins2011-09-271-0/+33
| | | | | | | 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
* MacGui: since Auto Passthru isn't enabled yet, we still need to fall back to ↵Rodeo2011-09-191-1/+1
| | | | | | | | | | AC3 Passthru when loading a preset. Also, update an outdated comment. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4238 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Auto Passthru and audio/video encoder lists.Rodeo2011-09-191-11/+139
| | | | | | | | | | | | | | This adds Auto Passthru as another encoder in libhb. Used in LinGUI and CLI. MacGUI features a partial impplmentation (with hardcoded values), which is disabled for now. Also, audio and video encoders are now stored in "lists", like we previously did for mixdowns. New mixdown "None" (HB_AMIXDOWN_NONE) added to hb_audio_mixdowns (was previously declared in MacGUI/LinGUI). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4237 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Blu-ray: display playlist number in log, CLI scan output, and title drop-down.Rodeo2011-08-161-0/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4182 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix or simplify several hacks involved with Libav supportjstebbins2011-07-271-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For files that are demuxed by Libav, we must share the format context with the decoder iso that it can obtain the codec context for each stream. The code that did this was very convoluted and difficult to understand. It is simplified by simply passing the context in hb_title_t. Reader was closing stream files before the decoder was finished with the context. This created the need to delay the actual close and cache the context. Changed reader so it behaves more like the rest of handbrake's work objects which lets us explicitly close after the decoders are finished. Libav does some probing of the file when av_find_stream_info is called. This probing leaves the format context in a bad state for some files and causes subsequent reads or seeks to misbehave. So open 2 contexts in ffmpeg_open. One is used only for probing, and the other only for reading. decavcodec.c had 2 separate decoders for files demuxed by hb and files demuxed by Libav. They have been combined and simplified. Previously, it was not possible to decode one source audio track multiple times in order to fan it out to multiple output tracks if the file is demuxed by Libav. We were using the codec context from the format context. Since there is only one of these for each stream, we could only do one decode for each stream. Use avcodec_copy_context to make copies of the codec context and allow multiple decodes. This allows removal of a lot of special case code for Libav streams that was necessary to duplicate the output of the decoder. Patch Libav's mkv demux to fix a seek problem. This has been pushed upstreams, so the next time we update Libav, we must remove this patch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4141 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: plug a few memory leaksjstebbins2011-07-191-0/+5
| | | | | | | Noticed when debugging a memory corruption issue with valgrind git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4122 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix some warnings in the clijstebbins2011-07-011-1/+1
| | | | | | | and add printf attribute to hb_strdup_printf git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4081 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix a warning in decssasub.c by adding new hb_valog functionjstebbins2011-06-151-32/+38
| | | | | | | | And consolidate logging code in hb_valog. hb_log and hb_deep_log call hb_valog. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4060 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add DTS-HD passthru \o/jstebbins2011-06-141-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4055 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: generalize channel remapping between decoders and encodersjstebbins2011-06-121-0/+1
| | | | | | | | Decoders set the channel map of their output in hb_audio_config_t. Encoders use this information to remap while encoding. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4052 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: add support for libav aac encoder (libhb only)jstebbins2011-06-071-0/+16
| | | | | | | | | This generalizes the ac3 encoder to make it easy to add support for any audio encoder that libav supports. Since ffaac is not quite ready, the cli and gui does not expose ffaac yet. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4029 b64f7644-9d1e-0410-96f1-a4d463321fa5
* LinGui: Add support for naming audio tracks.jstebbins2011-06-031-0/+4
| | | | | | | | Also fix hb_audio_add. It was not copying the audio name. And fix audio track name parsing in the CLI. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4020 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove the depreciated hb_calc_bitrate methodsr552011-05-211-115/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3987 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix some problems with rgb2yuv and yuv2rgbjstebbins2011-05-171-8/+8
| | | | | | | | | | yuv2rgb converted incorrectly. Cb and Cr were swapped in 2 of the 3 conversion expressions. rgb2yuv was setting the color channels in the incorrect order in the output. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3981 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Make order of audio tracks found in PS streams more predictablejstebbins2011-04-251-0/+34
| | | | | | | | | Since PS streams don't have a directory of streams, we find them by scanning the PES headers for stream types. We were adding them in the order found which is pretty random. This sorts audios by substream id. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3958 b64f7644-9d1e-0410-96f1-a4d463321fa5
* HE-AAC support for the OSX port. Thanks go to amarcus, ritsuka and rodeo.sr552011-04-181-18/+47
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3937 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix int overflow that can happen when computing PARjstebbins2011-04-161-0/+56
| | | | | | | | | | If the source has large non-reduced PAR values, our computed value was overflowing an int. Compute it in an int64_t then reduce it. Also, keep num and den below 65535. Larger values just aren't really significant and will cause more overflow issues. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3931 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add audio gain adjustment to libhb and CLIjstebbins2011-04-051-0/+1
| | | | | | | | New CLI option is --gain <float>. Value is measured in dB. Negative values are quieter, positive values are louder. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3902 b64f7644-9d1e-0410-96f1-a4d463321fa5
* make keyint match between 1st and 2nd passes of vfr and pfr encodes.jstebbins2011-03-081-2/+1
| | | | | | | | | | | | 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
* initialize title->angle_count to 1jstebbins2011-03-011-0/+1
| | | | | | | sources that don't support multiple angles should default to 1 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3821 b64f7644-9d1e-0410-96f1-a4d463321fa5