#include "libavutil/imgutils.h"
#if HAVE_MMX_EXTERNAL
-#include "x86/dsputil_mmx.h"
+#include "x86/dsputil_x86.h"
#endif
#if HAVE_MMX_EXTERNAL
static int is_gray(const AVPixFmtDescriptor *desc)
{
- return desc->nb_components - (desc->flags & PIX_FMT_ALPHA) == 1;
+ return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;
}
int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
loss |= FF_LOSS_RESOLUTION;
- if ((src_desc->flags & PIX_FMT_RGB) != (dst_desc->flags & PIX_FMT_RGB))
+ if ((src_desc->flags & AV_PIX_FMT_FLAG_RGB) != (dst_desc->flags & AV_PIX_FMT_FLAG_RGB))
loss |= FF_LOSS_COLORSPACE;
- if (has_alpha && !(dst_desc->flags & PIX_FMT_ALPHA) &&
- (dst_desc->flags & PIX_FMT_ALPHA))
+ if (has_alpha && !(dst_desc->flags & AV_PIX_FMT_FLAG_ALPHA) &&
+ (dst_desc->flags & AV_PIX_FMT_FLAG_ALPHA))
loss |= FF_LOSS_ALPHA;
if (dst_pix_fmt == AV_PIX_FMT_PAL8 && !is_gray(src_desc))
return dst_pix_fmt;
}
-#if FF_API_FIND_BEST_PIX_FMT
-enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr)
-{
- enum AVPixelFormat list[64];
- int i, j = 0;
-
- // test only the first 64 pixel formats to avoid undefined behaviour
- for (i = 0; i < 64; i++) {
- if (pix_fmt_mask & (1ULL << i))
- list[j++] = i;
- }
- list[j] = AV_PIX_FMT_NONE;
-
- return avcodec_find_best_pix_fmt2(list, src_pix_fmt, has_alpha, loss_ptr);
-}
-#endif /* FF_API_FIND_BEST_PIX_FMT */
-
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
enum AVPixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr)
/* return true if yuv planar */
static inline int is_yuv_planar(const AVPixFmtDescriptor *desc)
{
- return (!(desc->flags & PIX_FMT_RGB) &&
- (desc->flags & PIX_FMT_PLANAR));
+ return (!(desc->flags & AV_PIX_FMT_FLAG_RGB) &&
+ (desc->flags & AV_PIX_FMT_FLAG_PLANAR));
}
int av_picture_crop(AVPicture *dst, const AVPicture *src,
const uint8_t *lum,
int size)
{
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
int sum;
for(;size > 0;size--) {
uint8_t *lum_m2, uint8_t *lum_m1,
uint8_t *lum, int size)
{
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
int sum;
for(;size > 0;size--) {