summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
Commit message (Collapse)AuthorAgeFilesLines
* VAAPI: Add new HB_GID_VCODEC_*_VAAPI IDsSven Gothel2021-04-201-0/+4
|
* hw-encoder-vaapi: Enables VAAPI if available and supported for h264 (tested ↵Sven Gothel2021-04-201-0/+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!
* Add ability to apply filters to previewsJohn Stebbins2021-04-121-0/+97
| | | | | | | | 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: fix adapter details info when multiple runsagalin892021-03-211-1/+0
|
* qsv: redesigned adapter capabilities collection and reporingagalin892021-03-121-1/+2
|
* common: add videotoolbox hevc 10bit to hb_video_encoder_get_depth().Damiano Galassi2021-03-021-0/+3
|
* libhb: add videotoolbox 10bit hevc encoder.Damiano Galassi2021-02-281-0/+8
|
* libhb: remove gargabe characters in comments that were added in a multiline ↵Damiano Galassi2021-02-221-2/+2
| | | | edit.
* Gate MediaFoundation encoder behind --enable-mf.Bradley Sepos2021-02-201-1/+1
| | | | Windows (mingw-w64) only for now.
* Add support for using the ffmpeg MediaFoundation encoder wrapperMartin Storsjö2021-02-201-0/+29
| | | | | | | | | | | | | This works fine for e.g. the Qualcomm H264 and HEVC encoders on ARM64 windows devices, and should work the same for other vendors HW encoders on X86 devices (even though those encoders usually are available via vendor specific APIs as well, and this patch is currently only tested and tuned for Qualcomm). There's no detection for whether the MediaFoundation wrapper is going to provide a working encoder for either format (it currently forcibly tries to use a HW encoder and fails if there isn't a matchine one, or if it doesn't accept the parameters that have been set).
* libhb: passthru mastering display metadata and content light level metadata.Damiano Galassi2021-02-011-0/+2
|
* libhb: revert part of the previous colormatrix override commit.Damiano Galassi2021-01-251-0/+27
|
* libhb: change the color-matrix cli option behavior. Set the color info at ↵Damiano Galassi2021-01-241-27/+0
| | | | the begin of the pipeline. Fix a typo in the preset key that prevented it from working.
* libhb: update the audio encoders list after the latest hb_encoder_internal_t ↵Damiano Galassi2021-01-231-35/+35
| | | | struct changes.
* libhb: re-implement colorspace filter with zimg, add tonemap, and expose the ↵Damiano Galassi2021-01-231-128/+0
| | | | colorspace filter in the cli
* libhb: properly set the 'PresetDisabled' presets property.Damiano Galassi2021-01-041-36/+49
|
* Update copyright dates to 2021.Bradley Sepos2021-01-011-1/+1
|
* libhb: Group video encoder fallbacks by implementation instead of specification.Bradley Sepos2020-12-121-17/+25
|
* libhb: add 8bit to 10/12bit blend functions to rendersub.Damiano Galassi2020-11-181-0/+18
| | | | decode video to 10bit or 12bit yuv if there is no 8bit filter in the chain.
* MP2 PassThru (libhb part)Nomis1012020-11-081-1/+3
|
* libhb: improve videotoolbox detection and add support for constant quality ↵Damiano Galassi2020-08-231-3/+22
| | | | encoding mode when available.
* qsv: fix incorrect async depth values in GUI binaryagalin892020-07-291-1/+1
|
* qsv: more depth helps for better performanceDmitrichenko, Max2020-07-111-1/+1
|
* Only dither audio when necessaryJohn Stebbins2020-07-011-2/+8
| | | | | If dither is "auto", only enable dither if source depth > dest depth Lossy codecs do not have a fixed bit depth, so we treat them as >= 24
* scan: Fix aspect ratio warning for DVD and BDJohn Stebbins2020-03-311-1/+1
| | | | | DVD and BD do not have PAR specified at container level. Since the title is initialized with PAR 1:1, the warning was triggered.
* fix job logging of dvb subtitle sourceJohn Stebbins2020-03-291-0/+2
|
* decavsub: enable dvb subtitle passthrough in mkvJohn Stebbins2020-03-291-0/+1
|
* decavsub: add DVB subtitle *burn-only* supportJohn Stebbins2020-03-291-1/+1
| | | | passthrough will hopefully come later ;)
* decavsub: add general purpose avcodec subtitle decoderJohn Stebbins2020-03-291-5/+9
| | | | Currently using it for pgs, srt, and ssa subtitles.
* Update copyright dates to 2020.Bradley Sepos2020-01-011-1/+1
|
* libhb: make hb_buffer_t libhb privateJohn Stebbins2019-09-121-0/+1
| | | | hb_buffer_t conflicts with a harfbuzz typedef by the same name
* libhb: resolve header conflicts with pango/harfbuzzJohn Stebbins2019-09-121-9/+9
| | | | | | | 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 empty "" subtitle nameJohn Stebbins2019-09-091-0/+8
| | | | Empty subtitle name could result in double free
* libhb: eliminate file path length limitsJohn Stebbins2019-08-111-9/+19
|
* add subtitle track name read/writeJohn Stebbins2019-08-111-0/+18
| | | | | | | | | | | | | | | | Works similar to audio track names. If source has a subtitle track name, hb_subtitle_t.name is set. To set output subtitle track name, set hb_subtitle_config_t.name. Source track names are available in title returned by hb_title_to_dict and hb_title_to_json in SubtitleList[].Name In job dict it is also SubtitleList[].Name hb_preset_job_init and hb_preset_job_init_json initialize output tracks with the source track name. Also adds subtitle name support to LinGui
* a few fixes for audio track name handlingJohn Stebbins2019-08-111-2/+2
| | | | fixes a memory leak makes name const
* libhb: make source audio track name available to frontendsJohn Stebbins2019-08-111-0/+5
| | | | | | | | | | | | | It gets stored in new hb_audio_config_t.in.name field. It is available in the title dict read through hb_title_to_dict() or hb_title_to_json() in AudioList[].Name. When a job is initialized with hb_preset_job_init or hb_preset_job_init_json(), output audio tracks are initialized with the source track name. Also adds output track name initialization to LinGui.
* Fix some typos (#2202)Nomis1012019-07-311-1/+1
| | | Fix some typos
* Fix dropped audio when embedded CC sub is selectedJohn Stebbins2019-07-151-1/+2
| | | | | | | The subtitle ID assigned to CC embedded in video collided with regular track IDs in some file types. Fixes https://github.com/HandBrake/HandBrake/issues/2103
* av_aac: use HB_PROJECT_FEATURE_FFMPEG_AAC instead of USE_FFMPEG_AACJohn Stebbins2019-04-171-1/+1
|
* vce: use HB_PROJECT_FEATURE_VCE instead of USE_VCEJohn Stebbins2019-04-171-5/+4
|
* nvenc: use HB_PROJECT_FEATURE_NVENC instead of USE_NVENCJohn Stebbins2019-04-171-2/+2
|
* qsv: use HB_PROJECT_FEATURE_QSV instead of USE_QSVJohn Stebbins2019-04-171-10/+10
|
* encx265: Use HB_PROJECT_FEATURE_X265 instead of USE_X265John Stebbins2019-04-171-4/+4
|
* libhb: change preset key to VideoColorMatrixCodeOverrideJohn Stebbins2019-04-081-0/+27
| | | | | | Reserve VideoColorMatrixCode for doing color conversion. VideoColorMatrixCodeOverride sets color flags without transforming video frame colors.
* Add missing yuv444p12 colorspace optonJohn Stebbins2019-04-081-0/+2
|
* libhb: propagate color matrix info through the pipelineJohn Stebbins2019-04-081-0/+132
| | | | | | | | | 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.
* libhb: Initial implementation of Chroma Smooth filter.Bradley Sepos2019-03-281-0/+5
|
* Add WebM support (#1822)Justin Bull2019-02-131-11/+18
| | | Note that since webm has no official subtitle support, only burned in subtitles can be used with this muxer at this time.