avcodec/mpegpicture: Reduce value of MAX_PLANES define

No mpegvideo based codec supports alpha.
While just at it, also make the define shorter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-10-04 16:14:40 +02:00
parent ec1eba792a
commit 1c40a17922
3 changed files with 5 additions and 6 deletions

View File

@ -27,7 +27,7 @@
#include "motion_est.h"
#include "threadframe.h"
#define MPEGVIDEO_MAX_PLANES 4
#define MPV_MAX_PLANES 3
#define MAX_PICTURE_COUNT 36
#define EDGE_WIDTH 16

View File

@ -256,7 +256,7 @@ typedef struct MpegEncContext {
uint8_t *mb_mean; ///< Table for MB luminance
int64_t mb_var_sum; ///< sum of MB variance for current frame
int64_t mc_mb_var_sum; ///< motion compensated MB variance for current frame
uint64_t encoding_error[MPEGVIDEO_MAX_PLANES];
uint64_t encoding_error[MPV_MAX_PLANES];
int motion_est; ///< ME algorithm
int me_penalty_compensation;

View File

@ -1634,7 +1634,7 @@ no_output_pic:
} else {
// input is not a shared pix -> reuse buffer for current_pix
s->cur_pic_ptr = s->reordered_input_picture[0];
for (i = 0; i < 4; i++) {
for (int i = 0; i < MPV_MAX_PLANES; i++) {
if (s->new_pic->data[i])
s->new_pic->data[i] += INPLACE_OFFSET;
}
@ -1861,12 +1861,11 @@ vbv_retry:
if (avctx->flags & AV_CODEC_FLAG_PASS1)
ff_write_pass1_stats(s);
for (i = 0; i < 4; i++) {
for (int i = 0; i < MPV_MAX_PLANES; i++)
avctx->error[i] += s->encoding_error[i];
}
ff_side_data_set_encoder_stats(pkt, s->cur_pic.f->quality,
s->encoding_error,
(avctx->flags&AV_CODEC_FLAG_PSNR) ? MPEGVIDEO_MAX_PLANES : 0,
(avctx->flags&AV_CODEC_FLAG_PSNR) ? MPV_MAX_PLANES : 0,
s->pict_type);
if (avctx->flags & AV_CODEC_FLAG_PASS1)