Implement NV12 to RGB24 color conversion with SYCL#2
Merged
dvrogozh merged 1 commit intointel:mainfrom Feb 27, 2026
Merged
Conversation
See ffmpeg color yuv2rgb color conversion reference: * https://github.com/FFmpeg/FFmpeg/blob/a5d4c398b411a00ac09d8fe3b66117222323844c/libavfilter/opencl/colorspace_common.cl#L111 Color conversion matrix copied from the ffmpeg internal output of: ``` ff_fill_rgb2yuv_table(av_csp_luma_coeffs_from_avcsp(color_space), rgb2yuv); ff_matrix_invert_3x3(rgb2yuv, yuv2rgb); ``` with color space `AVCOL_PRI_BT470BG` and `AVCOL_PRI_BT709`. Reference results for the nasa clip from torchcodec: ``` ffmpeg -i nasa_13013.mp4 -vf "scale=480:270:sws_flags=bilinear,format=rgb24" -y nasa_13013_ffmpeg_cpu.rgb ffmpeg -f rawvideo -pix_fmt rgb24 -s:v 480x270 -i nasa_13013_xpu.rgb -f rawvideo -pix_fmt rgb24 -s:v 480x270 -i nasa_13013_ffmpeg_cpu.rgb -filter_complex "psnr" PSNR r:52.915639 g:48.554012 b:52.363531 average:50.815521 min:49.467900 max:51.852806 ``` Signed-off-by: Edgar Romo Montiel <edgar.romo.montiel@intel.com> Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> Co-authored-by: Edgar Romo Montiel <edgar.romo.montiel@intel.com> Co-authored-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See ffmpeg color yuv2rgb color conversion reference:
Color conversion matrix copied from the ffmpeg internal output of:
with color space
AVCOL_PRI_BT470BGandAVCOL_PRI_BT709.Reference results for the nasa clip from torchcodec:
CC: @eromomon