Hi All,

i found this in the DXVA code, and i would like to optimize it a bit:
('s' is AVCodecContext* .. )

----------------

/* add surfaces based on number of possible refs */
if (s->codec_id == AV_CODEC_ID_H264 || s->codec_id == AV_CODEC_ID_HEVC)
ctx->num_surfaces += 16;

-----------------

Would it be correct to say

-----------------

if (s->codec_id == AV_CODEC_ID_H264 || s->codec_id == AV_CODEC_ID_HEVC)
ctx->num_surfaces += min( 16, s->gop_size );

-----------------

In some situations this can save memory, when the GOP size
is lower than 16. I assume there cannot be more pictures
referenced than GOP size, since GOP is defined to be completely
self-dependent?

Thank you,
Heiner



_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to