enum PixelFormat src_pix_fmt, dst_pix_fmt;
};
-struct ImgReSampleContext {
+typedef struct ImgReSampleContext {
int iwidth, iheight, owidth, oheight;
int topBand, bottomBand, leftBand, rightBand;
int padtop, padbottom, padleft, padright;
DECLARE_ALIGNED_8(int16_t, h_filters[NB_PHASES][NB_TAPS]); /* horizontal filters */
DECLARE_ALIGNED_8(int16_t, v_filters[NB_PHASES][NB_TAPS]); /* vertical filters */
uint8_t *line_buf;
-};
+} ImgReSampleContext;
void av_build_filter(int16_t *filter, double factor, int tap_count, int phase_count, int scale, int type);
n = dst_width;
}
#ifdef HAVE_MMX
- if ((mm_flags & MM_MMX) && NB_TAPS == 4)
+ if ((mm_flags & FF_MM_MMX) && NB_TAPS == 4)
h_resample_fast4_mmx(dst, n,
src, src_width, src_start, src_incr, filters);
else
phase_y = get_phase(src_y);
#ifdef HAVE_MMX
/* desactivated MMX because loss of precision */
- if ((mm_flags & MM_MMX) && NB_TAPS == 4 && 0)
+ if ((mm_flags & FF_MM_MMX) && NB_TAPS == 4 && 0)
v_resample4_mmx(output, owidth,
s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
&s->v_filters[phase_y][0]);
else
#endif
#ifdef HAVE_ALTIVEC
- if ((mm_flags & MM_ALTIVEC) && NB_TAPS == 4 && FILTER_BITS <= 6)
- v_resample16_altivec(output, owidth,
- s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
- &s->v_filters[phase_y][0]);
+ if ((mm_flags & FF_MM_ALTIVEC) && NB_TAPS == 4 && FILTER_BITS <= 6)
+ v_resample16_altivec(output, owidth,
+ s->line_buf + (ring_y - NB_TAPS + 1) * owidth,
+ owidth, &s->v_filters[phase_y][0]);
else
#endif
v_resample(output, owidth,
}
}
-ImgReSampleContext *img_resample_init(int owidth, int oheight,
- int iwidth, int iheight)
-{
- return img_resample_full_init(owidth, oheight, iwidth, iheight,
- 0, 0, 0, 0, 0, 0, 0, 0);
-}
-
ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
int iwidth, int iheight,
int topBand, int bottomBand,
return NULL;
}
+ImgReSampleContext *img_resample_init(int owidth, int oheight,
+ int iwidth, int iheight)
+{
+ return img_resample_full_init(owidth, oheight, iwidth, iheight,
+ 0, 0, 0, 0, 0, 0, 0, 0);
+}
+
void img_resample(ImgReSampleContext *s,
AVPicture *output, const AVPicture *input)
{
av_free(s);
}
-static const AVClass context_class = { "imgresample", NULL, NULL };
+static const char *context_to_name(void* ptr)
+{
+ return "imgconvert";
+}
+
+static const AVClass context_class = { "imgresample", context_to_name, NULL };
struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat,
int dstW, int dstH, int dstFormat,
}
}
save_pgm("/tmp/in.pgm", img, XSIZE, YSIZE);
- for(i=0;i<sizeof(factors)/sizeof(float);i++) {
+ for(i=0;i<FF_ARRAY_ELEMS(factors);i++) {
fact = factors[i];
xsize = (int)(XSIZE * fact);
ysize = (int)((YSIZE - 100) * fact);
fact = 0.72;
xsize = (int)(XSIZE * fact);
ysize = (int)(YSIZE * fact);
- mm_flags = MM_MMX;
+ mm_flags = FF_MM_MMX;
s = img_resample_init(xsize, ysize, XSIZE, YSIZE);
component_resample(s, img1, xsize, xsize, ysize,
img, XSIZE, XSIZE, YSIZE);