mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
hw_base_encode: refactor picture allocation/freeing
This commit cleans up and refactors the mess of private state upon private state that used to be. Now, FFHWBaseEncodePicture is fully initialized upon call-time, and, most importantly, this lets APIs which require initialization data for frames (VkImageViews) to initialize this for both the input image, and the reconstruction (DPB) image. Signed-off-by: Tong Wu <wutong1208@outlook.com>
This commit is contained in:
parent
fdf8025eb6
commit
9db68ed042
14 changed files with 201 additions and 211 deletions
|
|
@ -147,7 +147,7 @@ fail:
|
|||
}
|
||||
|
||||
static int vaapi_encode_mjpeg_write_extra_buffer(AVCodecContext *avctx,
|
||||
VAAPIEncodePicture *pic,
|
||||
FFHWBaseEncodePicture *base,
|
||||
int index, int *type,
|
||||
char *data, size_t *data_len)
|
||||
{
|
||||
|
|
@ -220,11 +220,11 @@ static int vaapi_encode_mjpeg_write_extra_buffer(AVCodecContext *avctx,
|
|||
}
|
||||
|
||||
static int vaapi_encode_mjpeg_init_picture_params(AVCodecContext *avctx,
|
||||
VAAPIEncodePicture *vaapi_pic)
|
||||
FFHWBaseEncodePicture *pic)
|
||||
{
|
||||
FFHWBaseEncodeContext *base_ctx = avctx->priv_data;
|
||||
VAAPIEncodeMJPEGContext *priv = avctx->priv_data;
|
||||
const FFHWBaseEncodePicture *pic = &vaapi_pic->base;
|
||||
VAAPIEncodePicture *vaapi_pic = pic->priv;
|
||||
JPEGRawFrameHeader *fh = &priv->frame_header;
|
||||
JPEGRawScanHeader *sh = &priv->scan.header;
|
||||
VAEncPictureParameterBufferJPEG *vpic = vaapi_pic->codec_picture_params;
|
||||
|
|
@ -414,7 +414,7 @@ static int vaapi_encode_mjpeg_init_picture_params(AVCodecContext *avctx,
|
|||
}
|
||||
|
||||
static int vaapi_encode_mjpeg_init_slice_params(AVCodecContext *avctx,
|
||||
VAAPIEncodePicture *pic,
|
||||
FFHWBaseEncodePicture *base,
|
||||
VAAPIEncodeSlice *slice)
|
||||
{
|
||||
VAAPIEncodeMJPEGContext *priv = avctx->priv_data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue