mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
libavfilter/qsvvpp: Change the alignment to meet the requirement of YUV420P format
When process yuv420 frames, FFmpeg uses same alignment on Y/U/V planes. VPL and MSDK use Y plane's pitch / 2 as U/V planes's pitch, which makes U/V planes 16-bytes aligned. We need to set a separate alignment to meet runtime's behaviour. Now alignment is changed to 16 so that the linesizes of U/V planes meet the requirment of VPL/MSDK. Add get_buffer.video callback to qsv filters to change the default get_buffer behaviour. Now the commandline works fine: ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 3082x1884 \ -i ./3082x1884.yuv -vf 'vpp_qsv=w=2466:h=1508' -f rawvideo \ -pix_fmt yuv420p 2466_1508.yuv Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
This commit is contained in:
parent
d4f853f4ed
commit
20f2941191
@ -1015,3 +1015,16 @@ int ff_qsvvpp_create_mfx_session(void *ctx,
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
AVFrame *ff_qsvvpp_get_video_buffer(AVFilterLink *inlink, int w, int h)
|
||||
{
|
||||
/* When process YUV420 frames, FFmpeg uses same alignment on Y/U/V
|
||||
* planes. VPL and MSDK use Y plane's pitch / 2 as U/V planes's
|
||||
* pitch, which makes U/V planes 16-bytes aligned. We need to set a
|
||||
* separate alignment to meet runtime's behaviour.
|
||||
*/
|
||||
return ff_default_get_video_buffer2(inlink,
|
||||
FFALIGN(inlink->w, 32),
|
||||
FFALIGN(inlink->h, 32),
|
||||
16);
|
||||
}
|
||||
|
@ -127,4 +127,5 @@ int ff_qsvvpp_print_warning(void *log_ctx, mfxStatus err,
|
||||
int ff_qsvvpp_create_mfx_session(void *ctx, void *loader, mfxIMPL implementation,
|
||||
mfxVersion *pver, mfxSession *psession);
|
||||
|
||||
AVFrame *ff_qsvvpp_get_video_buffer(AVFilterLink *inlink, int w, int h);
|
||||
#endif /* AVFILTER_QSVVPP_H */
|
||||
|
@ -581,6 +581,7 @@ static const AVFilterPad qsvdeint_inputs[] = {
|
||||
.name = "default",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.filter_frame = qsvdeint_filter_frame,
|
||||
.get_buffer.video = ff_qsvvpp_get_video_buffer,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -399,11 +399,13 @@ static const AVFilterPad overlay_qsv_inputs[] = {
|
||||
.name = "main",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.config_props = config_main_input,
|
||||
.get_buffer.video = ff_qsvvpp_get_video_buffer,
|
||||
},
|
||||
{
|
||||
.name = "overlay",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.config_props = config_overlay_input,
|
||||
.get_buffer.video = ff_qsvvpp_get_video_buffer,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -641,6 +641,7 @@ static const AVFilterPad qsvscale_inputs[] = {
|
||||
.name = "default",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.filter_frame = qsvscale_filter_frame,
|
||||
.get_buffer.video = ff_qsvvpp_get_video_buffer,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -634,6 +634,7 @@ static const AVFilterPad vpp_inputs[] = {
|
||||
.name = "default",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.config_props = config_input,
|
||||
.get_buffer.video = ff_qsvvpp_get_video_buffer,
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user