1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

lavc/vvcdec: remove unneeded VVCContext->pix_fmt

AVCodecContext->sw_pix_fmt is used to hold the software pixel format.

Co-authored-by: Frank Plowman <post@frankplowman.com>
This commit is contained in:
Nuo Mi
2025-01-26 11:10:20 +08:00
parent 61ff0fac35
commit 974d4a8f0a
2 changed files with 6 additions and 13 deletions

View File

@@ -799,18 +799,15 @@ static int export_frame_params(VVCContext *s, const VVCFrameContext *fc)
AVCodecContext *c = s->avctx;
const VVCSPS *sps = fc->ps.sps;
const VVCPPS *pps = fc->ps.pps;
int ret;
// Reset HW config if pix_fmt/w/h change.
if (s->pix_fmt != sps->pix_fmt || c->coded_width != pps->width || c->coded_height != pps->height) {
// Reset the format if pix_fmt/w/h change.
if (c->sw_pix_fmt != sps->pix_fmt || c->coded_width != pps->width || c->coded_height != pps->height) {
c->coded_width = pps->width;
c->coded_height = pps->height;
ret = get_format(c, sps);
if (ret < 0)
return ret;
c->pix_fmt = ret;
s->pix_fmt = sps->pix_fmt;
c->sw_pix_fmt = sps->pix_fmt;
c->pix_fmt = get_format(c, sps);
if (c->pix_fmt < 0)
return AVERROR_INVALIDDATA;
}
c->width = pps->width - ((pps->r->pps_conf_win_left_offset + pps->r->pps_conf_win_right_offset) << sps->hshift[CHROMA]);
@@ -1138,8 +1135,6 @@ static av_cold int vvc_decode_init(AVCodecContext *avctx)
GDR_SET_RECOVERED(s);
ff_thread_once(&init_static_once, init_default_scale_m);
s->pix_fmt = AV_PIX_FMT_NONE;
return 0;
}

View File

@@ -241,8 +241,6 @@ typedef struct VVCContext {
uint64_t nb_frames; ///< processed frames
int nb_delayed; ///< delayed frames
enum AVPixelFormat pix_fmt; ///< pix format of current frame
} VVCContext ;
#endif /* AVCODEC_VVC_DEC_H */