1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-23 03:37:27 +00:00

vd_lavc, mp_image: remove weird mpv specific palette constant

Was for times when we were trying to be less dependent on libav* I
guess.
This commit is contained in:
wm4 2017-12-01 22:03:38 +01:00
parent d891239d72
commit 9d367cb0f9
3 changed files with 3 additions and 9 deletions

View File

@ -52,10 +52,6 @@
#include "video/sws_utils.h"
#include "video/out/vo.h"
#if AVPALETTE_SIZE != MP_PALETTE_SIZE
#error palette too large, adapt video/mp_image.h:MP_PALETTE_SIZE
#endif
#include "options/m_option.h"
static void init_avctx(struct dec_video *vd);

View File

@ -77,7 +77,7 @@ static int mp_image_layout(int imgfmt, int w, int h, int stride_align,
out_plane_size[n] = out_stride[n] * alloc_h;
}
if (desc.flags & MP_IMGFLAG_PAL)
out_plane_size[1] = MP_PALETTE_SIZE;
out_plane_size[1] = AVPALETTE_SIZE;
int sum = 0;
for (int n = 0; n < MP_MAX_PLANES; n++) {
@ -472,7 +472,7 @@ static void mp_image_copy_cb(struct mp_image *dst, struct mp_image *src,
}
// Watch out for AV_PIX_FMT_FLAG_PSEUDOPAL retardation
if ((dst->fmt.flags & MP_IMGFLAG_PAL) && dst->planes[1] && src->planes[1])
memcpy(dst->planes[1], src->planes[1], MP_PALETTE_SIZE);
memcpy(dst->planes[1], src->planes[1], AVPALETTE_SIZE);
}
void mp_image_copy(struct mp_image *dst, struct mp_image *src)
@ -508,7 +508,7 @@ void mp_image_copy_attributes(struct mp_image *dst, struct mp_image *src)
if ((dst->fmt.flags & MP_IMGFLAG_PAL) && (src->fmt.flags & MP_IMGFLAG_PAL)) {
if (dst->planes[1] && src->planes[1]) {
if (mp_image_make_writeable(dst))
memcpy(dst->planes[1], src->planes[1], MP_PALETTE_SIZE);
memcpy(dst->planes[1], src->planes[1], AVPALETTE_SIZE);
}
}
av_buffer_unref(&dst->icc_profile);

View File

@ -28,8 +28,6 @@
#include "csputils.h"
#include "video/img_format.h"
#define MP_PALETTE_SIZE (256 * 4)
#define MP_IMGFIELD_TOP_FIRST 0x02
#define MP_IMGFIELD_REPEAT_FIRST 0x04
#define MP_IMGFIELD_INTERLACED 0x20