ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | Fri Apr 11 00:38:59 2025 +0200| [6a202c343139d74b1cba4208b04e05c57cff28d7] | committer: Andreas Rheinhardt
avcodec/asvenc: Use tighter MAX_MB_SIZE constant Also document the constant. Reviewed-by: Michael Niedermayer <mich...@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a202c343139d74b1cba4208b04e05c57cff28d7 --- libavcodec/asvenc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c index e7d931cca9..52666ee547 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -50,6 +50,14 @@ typedef struct ASVEncContext { int q_intra_matrix[64]; } ASVEncContext; +enum { + ASV1_MAX_BLOCK_SIZE = 8 + 10 * FFMAX(2 /* skip */, 5 /* ccp */ + 4 * 11 /* level */) + 5, + ASV1_MAX_MB_SIZE = 6 * ASV1_MAX_BLOCK_SIZE, + ASV2_MAX_BLOCK_SIZE = 4 + 8 + 16 * (6 /* ccp */ + 4 * 13 /* level */), + ASV2_MAX_MB_SIZE = 6 * ASV2_MAX_BLOCK_SIZE, + MAX_MB_SIZE = (FFMAX(ASV1_MAX_MB_SIZE, ASV2_MAX_MB_SIZE) + 7) / 8 +}; + static inline void asv1_put_level(PutBitContext *pb, int level) { unsigned int index = level + 3; @@ -177,8 +185,6 @@ static inline void asv2_encode_block(ASVEncContext *a, int16_t block[64]) } } -#define MAX_MB_SIZE (30 * 16 * 16 * 3 / 2 / 8) - static inline int encode_mb(ASVEncContext *a, int16_t block[6][64]) { int i; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".