Repository navigation
Enable AMF Decoder, HWContext AMF, vpp_amf filter - #7698
Hotactioncop wants to merge 2 commits into
Conversation
698ca71 to
cf2c8d4
Compare
|
There is a lot of code duplication and unrelated changes that honestly I don't like. The goal should be to avoid as many HB_PROJECT_FEATURE_VCE as possible, not to add yet another custom path that is probably not needed. If an additional feature is needed, it should be added in a general way, and not by making yet another custom gadget that will complicate the already complicated decavcodec.c. It would be better to move the UI changes to a different commit, and the translation changes are unnecessary (they are imported from transifex.com, and adding them here won't sync to transifex). I don't have any AMD hardware around to test it, but I'll add some comments. |
07151bf to
b9a49aa
Compare
galad87
left a comment
There was a problem hiding this comment.
The UI changes should be moved to a separate commit, and all the localizations changes should be removed because they handled on transifex.
aaa582e to
1d0e8df
Compare
Thanks for the review. |
galad87
left a comment
There was a problem hiding this comment.
The full hw path needs to be tested with:
- https://download.blender.org/demo/movies/BBB/bbb_sunflower_1080p_30fps_normal.mp4.zip with the align a/v option enabled. HandBrake will add some black frames at the beginning. Needs testing with both the align a/v option enabled and with the scale filter too.
- https://www.swisstransfer.com/d/775bbb45-e74f-409a-80fc-edc6e2cce23a multiple size changes in the video stream. This needs to be tested at the initial source resolution, and a second time with a scale filter too.
- Color range conversion too, but it looks like it has not been implemented yet.
I ran the requested tests for the AMF decoder / full HW pipeline patch. For the BBB sunflower sample: Tested with Align A/V Start enabled and disabled, with and without scale filter. For the multiple resolution changes sample: Tested both at source resolution and with scale enabled. When unsupported filters are present (for example Decomb or rotate), the pipeline correctly falls back to system memory: In the Decomb + Scale test, both filters were processed in software because vpp_amf does not appear to support Decomb. Logs from all test runs were saved. |
| // decoder, keep it marked as supported for the encode job. | ||
| if (hwaccel != NULL && hw_device_ctx != NULL) | ||
| { | ||
| vid_info.video_decode_support |= hwaccel->id; |
There was a problem hiding this comment.
This is already set in decavcodec.c:2449, or somewhere around.
| #include "handbrake/qsv_common.h" | ||
| #endif | ||
| #if HB_PROJECT_FEATURE_VCE | ||
| #include "handbrake/vce_common.h" |
| json_t *video = json_object_get(dict, "Video"); | ||
| if (video != NULL) | ||
| { | ||
| json_t *hardware_decode = json_object_get(video, "HardwareDecode"); |
There was a problem hiding this comment.
There is already "HWDecode" decode key, what's the use of this one?
| #include "handbrake/hbavfilter.h" | ||
| #include "handbrake/avfilter_priv.h" | ||
| #include "handbrake/hwaccel.h" | ||
| #include "handbrake/vce_common.h" |
|
|
||
| do | ||
| { | ||
| if(send_packet) |
There was a problem hiding this comment.
Please add a whitespace after the if, in all the other places too.
| #endif | ||
|
|
||
| #if HB_PROJECT_FEATURE_VCE | ||
| #include "handbrake/vce_common.h" |
There was a problem hiding this comment.
I guess this can be removed too now.
bc6bd76 to
9e4bff2
Compare
9e4bff2 to
fa8c9d2
Compare
|
Urgh, let's do this: I'll commit the good libhb and cli parts first, and then we try to get it working in the cli. Then we'll try to WinGui changes, then maybe the LinGui because there is no maintainer at the moment. |
|
I commited the libhb and cli parts that seemed OK to me in 99aeb91 |
|
Thanks @galad87. I've tested it with HandBrakeCLI first, and then verified in the GUI on both Windows and Linux. It works as expected. |
|
Now that the basic parts are in, it would be better to open a new PR for the WinGui changes first, and another for the LinGui after. |
|
Thanks, |
This PR supersedes #6475.
It continues AMF decode integration, adds support for the
vpp_amffilter, and implements full HW pipeline behavior with explicit SW fallback for unsupported filters.Benefits:
Compression Artefact Removal(in future plans)
(like for encoder)
Tested on:
Build / Run
Build with AMF decode support:
./configure --enable-vce --enable-amfdec ...make -j$(nproc)Run with AMF decode enabled:
HandBrakeCLI --enable-hw-decoding amfdec ...Notes
vpp_amfcrop/scale/format) or when no frame-data SW filters are required.