summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
Commit message (Collapse)AuthorAgeFilesLines
* hw-encoder-vaapi: Enables VAAPI if available and supported for h264 (tested ↵Sven Gothel2021-04-201-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | w/ AMD NAVI10), untested: h265, vp8 and vp9 Tested using lates mesa master branch patched with - contrib/mesa/A00-gallium_vaapi_encpackedheader01-commit-5e10db6.patch to enable Matroska and correct packed header in general using ffmpeg. Test hardware and configuration: - Mesa Gallium driver 20.2.0-devel for AMD Radeon RX 5700 XT (NAVI10, DRM 3.37.0, 5.7.0-1-amd64, LLVM 9.0.1) Codev h264_vaapi, avcodec_open options: rc_mode=CQP,qp=24,b_depth=2,profile=100,level=40 (profile high, level 4.0) HD1080 source ~45min with 212fps PSNR and SSIM difference to x264 below 1%, having x264 using profile high, level 4.0, preset fast, rc 23. Both using constant-quality w/ variable bitrate. ++++ If FEATURE vaapi is enable (autodetected), the following libraries are linked: X11 va va-drm va-x11. - hb.c: - Adding global static 'vaapi_device_ctx0' default device initialized via hb_avcodec_init() and released via hb_avcodec_free(). The 'vaapi_device_ctx0' is used in vaa_common hb_avcodec_vaapi_set_hwframe_ctx(..). - hb_avcodec_vaapi_set_hwframe_ctx() attaches the new AVHWFramesContext to the AVCodecContext at initializing the encoder. This is the final sink for the vaapi hw-encoder and Encode(..) performs the frame conversion into it. - hb_avcodec_test_encoder(..) adds VAAPI branch, needs refinement - encavcodec.c - adding VAAPI branches, enabling available, needs refinement. Currently profile and level are set to the user preferences, additionally 'b_depth=2' is being passed. - added hb_avcodec_test_encoder*(..) functions, currently only used to check vaapi-*codec*-availability. We used this codefragment regularly in an earlier HB version. +++ Discussion: Previous version of this patch of mine worked well on Intel hardware, as described above - AMD NAVI10 also performs quite well. VAAPI Workflow: - It uses hardware frames on the target device, which are being transported from the software device. The frame transport implicitly converts the pix_fmt. - AVCodecContext's pix_fmt uses AV_PIX_FMT_VAAPI - AVHWFramesContext: format uses AV_PIX_FMT_VAAPI and sw_format AV_PIX_FMT_NV12, the latter hinting on the actual hw-frame's target format. - AV_PIX_FMT_NV12 uses interleaved UV data, where AV_PIX_FMT_YUV420P uses seperated planes. Both use a separated Y plane upfront. Therefor both formats are not picture compatible, memory requirements are same. - Encode(..) allocates a hw_frame and the source frame is being transported to the hw-frame target using the pic_fmt conversion to NV12. Finally the hw_frame is being sent 'avcodec_send_frame' and the code-path re-aligns with non VAAPI. Further fixes to do: Validate whether 'b_depth=2' (b-frames) works for all vaapi implementations, add custom extra-video-encoder field!
* preview: fix filter chain input pix_fmtHEADmasterJohn Stebbins2021-04-171-1/+1
| | | | some filters were producing psychedelic results
* Add ability to apply filters to previewsJohn Stebbins2021-04-121-0/+273
| | | | | | | | New APIs hb_get_preview3 and JSON version hb_get_preview3_json to retrieve a cached preview image and apply relevant filters from an hb_job_t to the image. Returned image also has PAR applied, i.e. PAR of image is 1:1
* qsv: redesigned adapter capabilities collection and reporingagalin892021-03-121-3/+2
|
* fixed typosfreddii2021-02-251-1/+1
|
* Update copyright dates to 2021.Bradley Sepos2021-01-011-1/+1
|
* libhb: Formatting and const correctness in preview image functions.Bradley Sepos2020-06-151-46/+52
| | | | Also silences a warning about nested pointer type qualifiers.
* libhb: Save/load preview images to/from disk using libjpeg-turbo.Bradley Sepos2020-06-151-50/+186
|
* log: Make it easier to see when hardware support is disabled.sr552020-05-091-0/+1
|
* decavsub: use libav to decode dvd subtitlesJohn Stebbins2020-03-291-2/+0
| | | | Simplifies code, removes encvobsub.c (was never used) and decvobsub.c.
* decavsub: use libav to decode EIA 608 subtitlesJohn Stebbins2020-03-291-1/+0
| | | | simplifies code, eliminates deccc608sub.c
* decavsub: add general purpose avcodec subtitle decoderJohn Stebbins2020-03-291-2/+1
| | | | Currently using it for pgs, srt, and ssa subtitles.
* Update copyright dates to 2020.Bradley Sepos2020-01-011-1/+1
|
* Gardening: Clean up trailing whitespaceNomis1012019-11-041-2/+2
| | | | Remove trailing whitespace in "*.c", "*.m", "*.h" and "*.cpp" files.
* libhb: resolve header conflicts with pango/harfbuzzJohn Stebbins2019-09-121-4/+4
| | | | | | | Newest versions appear to have a "common.h" somewhere that is interfering with libhb/common.h. move headers into "handbrake" subdirectory
* Resolve conflict with harfbuzz include file hb.hJohn Stebbins2019-09-101-1/+1
| | | | Rename hb.h to handbrake.h
* fix initialization of libswscale stride dataJohn Stebbins2019-08-261-0/+2
| | | | | swscale looks at all 4 elements even when the format has less than 4 planes. Initialize all to previent spurious warning messages.
* make: Move harden option to the new Security group in configure.py.Nomis1012019-08-211-1/+1
|
* libhb: eliminate file path length limitsJohn Stebbins2019-08-111-2/+7
|
* Fix some typos (#2202)Nomis1012019-07-311-1/+1
| | | Fix some typos
* Fix "hardening features" log messageJohn Stebbins2019-06-271-1/+1
| | | | Was getting logged when hardening was disabled
* LinGui: add queue statisticsJohn Stebbins2019-06-251-23/+37
| | | | and tweak the layout per BradleyS suggestions
* build: Add --enable-hardening flag to enable stack protection and enhanced ↵Nomis1012019-06-191-0/+5
| | | | | | buffer overflow protection. Prints the hardening status on global init to the log. Closes #2027. Was #2040.
* qsv: use HB_PROJECT_FEATURE_QSV instead of USE_QSVJohn Stebbins2019-04-171-4/+4
|
* encx265: Use HB_PROJECT_FEATURE_X265 instead of USE_X265John Stebbins2019-04-171-1/+1
|
* libhb: propagate color matrix info through the pipelineJohn Stebbins2019-04-081-1/+1
| | | | | | | | | Propagates pix_fmt, range, primaries, transfer, and matrix everywhere. Everything that passes or creates video frames tags the frames with their color matrix info. All filters know the expected color matrix info of input frames.
* avfilter: simplify internal API to avfilterJohn Stebbins2019-04-081-3/+3
| | | | | | Use this interface in decavcodec. Remove cropscale.c and use avfilter for crop and scale. Improve log output of filters that are aliases for avfilter.
* fix spurious libswscale warningJohn Stebbins2019-03-121-0/+2
| | | | | These messages only appear rarely, but they annoy. It's complaining about an uninitialized unused plane
* Fix return value of hb_blobal_init_no_hardwareJohn Stebbins2019-02-111-1/+1
| | | | control reaches end of non-void function
* libhb: Add a hb_global_init_no_hardware that disables all the hardware ↵sr552019-02-111-9/+29
| | | | encoder/decode init and check code. For users where drivers or other system issues prevent HandBrake from loading.
* libhb: Temporarily log out the error code for unlink to figure out why ↵sr552019-01-281-1/+4
| | | | previews are not being removed for a user. #1851
* Update copyright dates to 2019.Bradley Sepos2019-01-011-1/+1
|
* contrib: gtk: libhb: macosx: test: Remove remaining traces of libavresample.Bradley Sepos2018-08-161-9/+0
| | | | Extension of and closes #1422.
* Fix arithmetic exception in hb_set_anamorphic_size2() when displaying previewEmeric2018-08-081-1/+1
|
* fix race in getting sequence_id of completed jobJohn Stebbins2018-08-071-4/+3
| | | | | | | | | The sequence_id was only available for the WORKING state and not the WORKDONE state. But frontends poll for status periodically and can miss all status updates for the WORKING state if the file is very short or an error occurs early during transcoding. When WORKING status is missed, there was no way to know the sequence_id associated with the WORKDONE status.
* audio_resample: switch from avresample to swresampleJohn Stebbins2018-06-271-0/+1
| | | | Eliminates deprecation warnings for avresample
* libhb: fix snprintf compiler warningsJohn Stebbins2018-06-131-29/+45
| | | | | Our handling of temporary directory paths could truncate resulting filenames. This fixes the warnings and prevents possible truncation.
* libhb: eliminate use of deprecated av_register_all...John Stebbins2018-06-131-2/+0
| | | | ...and avformat_register_all
* libhb: eliminate use of deprecated ffmpeg lockmgrJohn Stebbins2018-06-131-27/+0
| | | | It's a NOP and does nothing in current code
* FFMPEG: Use avcodec_free_context(..) instead of deprecated leaking ↵Sven Gothel2018-05-281-4/+2
| | | | | | | avcodec_close(..) Hence rename hb_avcodec_close -> hb_avcodec_free_context and pass the required ptr-ptr. avcodec_free_context(..) ensures releasing of all resources attached to the context.
* Misc. typosluz.paz2018-02-201-1/+1
| | | Found via `codespell -q 3 --skip="./gtk/po`
* Update copyright dates to 2018.Bradley Sepos2018-01-011-1/+1
|
* Auto-rotate video that has rotation tagJohn Stebbins2017-11-091-185/+0
|
* fix use of deprecated libav definesJohn Stebbins2017-07-061-1/+1
| | | | Fixes https://github.com/HandBrake/HandBrake/issues/815
* opencl: removit it (#777)John Stebbins2017-06-121-25/+0
| | | | It was only used for scaling, it fails far too often and is only faster on a limited selectoin of hardware.
* filter: add frame parallelizing filter wrapperJohn Stebbins2017-06-061-0/+4
| | | | | | | | | | | | This wrapper can be used to frame parallelize simple video filters. By simple, I mean there can be no temporal context that is shared from one frame to the next. Wrap unsharp and lapsharp filters. unsharp required a small rework to separate out temporary storage that is required when processing each frame. We now need to duplicate this storage for each thread. Closes #759.
* libhb: force title rescan after completing a job encode (#488)John Stebbins2017-01-161-0/+5
| | | Fixes https://forum.handbrake.fr/viewtopic.php?f=12&t=35583
* opencl: Workaround broken drivers that crash when you call clGetPlatformIDs ↵Scott2017-01-151-2/+19
| | | | with valid inputs. #496
* Update copyright dates to 2017.Bradley Sepos2017-01-011-1/+1
|
* libhb: add new color tags for Bt 2020 and SMPTE ST 2084Damiano Galassi2016-12-211-0/+5
|