#include "colorspace.h"
#ifdef HAVE_MMX
-#include "i386/mmx.h"
+#include "x86/mmx.h"
+#include "x86/dsputil_mmx.h"
#endif
#define xglue(x, y) x ## y
return bits;
}
-static int avcodec_find_best_pix_fmt1(int pix_fmt_mask,
+static int avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask,
int src_pix_fmt,
int has_alpha,
int loss_mask)
dst_pix_fmt = -1;
min_dist = 0x7fffffff;
for(i = 0;i < PIX_FMT_NB; i++) {
- if (pix_fmt_mask & (1 << i)) {
+ if (pix_fmt_mask & (1ULL << i)) {
loss = avcodec_get_pix_fmt_loss(i, src_pix_fmt, has_alpha) & loss_mask;
if (loss == 0) {
dist = avg_bits_per_pixel(i);
return dst_pix_fmt;
}
-int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
+int avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, int src_pix_fmt,
int has_alpha, int *loss_ptr)
{
int dst_pix_fmt, loss_mask, i;
break;
case FF_PIXEL_PLANAR:
if (plane == 1 || plane == 2)
- width >>= pf->x_chroma_shift;
+ width= -((-width)>>pf->x_chroma_shift);
return (width * pf->depth + 7) >> 3;
break;
case FF_PIXEL_PACKED:
case FF_PIXEL_PLANAR:
for(i = 0; i < pf->nb_channels; i++) {
- int w, h;
+ int h;
int bwidth = ff_get_plane_bytewidth(pix_fmt, width, i);
- w = width;
h = height;
if (i == 1 || i == 2) {
- w >>= pf->x_chroma_shift;
- h >>= pf->y_chroma_shift;
+ h= -((-height)>>pf->y_chroma_shift);
}
ff_img_copy_plane(dst->data[i], dst->linesize[i],
src->data[i], src->linesize[i],
#define BPP 2
-#include "imgconvert_template.h"
+#include "imgconvert_template.c"
/* rgb565 handling */
#define BPP 2
-#include "imgconvert_template.h"
+#include "imgconvert_template.c"
/* bgr24 handling */
#define BPP 3
-#include "imgconvert_template.h"
+#include "imgconvert_template.c"
#undef RGB_IN
#undef RGB_OUT
#define BPP 3
-#include "imgconvert_template.h"
+#include "imgconvert_template.c"
/* rgb32 handling */
#define BPP 4
-#include "imgconvert_template.h"
+#include "imgconvert_template.c"
static void mono_to_gray(AVPicture *dst, const AVPicture *src,
int width, int height, int xor_mask)
#else
{
- mmx_t rounder;
- rounder.uw[0]=4;
- rounder.uw[1]=4;
- rounder.uw[2]=4;
- rounder.uw[3]=4;
pxor_r2r(mm7,mm7);
- movq_m2r(rounder,mm6);
+ movq_m2r(ff_pw_4,mm6);
}
for (;size > 3; size-=4) {
DEINT_LINE_LUM
#else
{
- mmx_t rounder;
- rounder.uw[0]=4;
- rounder.uw[1]=4;
- rounder.uw[2]=4;
- rounder.uw[3]=4;
pxor_r2r(mm7,mm7);
- movq_m2r(rounder,mm6);
+ movq_m2r(ff_pw_4,mm6);
}
for (;size > 3; size-=4) {
DEINT_INPLACE_LINE_LUM