58 printf(
"motion-test [-h]\n" 59 "test motion implementations\n");
72 printf(
"testing '%s'\n", name);
75 for(it=0;it<20;it++) {
80 for(y=0;y<HEIGHT-17;y++) {
81 for(x=0;x<
WIDTH-17;x++) {
82 ptr =
img2 + y * WIDTH + x;
83 d1 = test_func(
NULL,
img1, ptr, WIDTH, 8);
84 d2 = ref_func(
NULL,
img1, ptr, WIDTH, 8);
86 printf(
"error: mmx=%d c=%d\n", d1, d2);
98 for(x=0;x<
WIDTH-17;x++) {
99 ptr =
img2 + y * WIDTH + x;
100 d1 += test_func(
NULL,
img1, ptr, WIDTH, 8);
110 (
double)(ti / 1000.0));
114 int main(
int argc,
char **argv)
120 int flags_size = HAVE_MMXEXT ? 2 : 1;
127 printf(
"ffmpeg motion test\n");
132 memset(&cctx, 0,
sizeof(cctx));
134 for (c = 0; c < flags_size; c++) {
137 memset(&mmxctx, 0,
sizeof(mmxctx));
140 for (x = 0; x < 2; x++) {
141 printf(
"%s for %dx%d pixels\n", c ?
"mmx2" :
"mmx",
142 x ? 8 : 16, x ? 8 : 16);
Context structure for the Lagged Fibonacci PRNG.
av_cold void ff_me_cmp_init(MECmpContext *c, AVCodecContext *avctx)
static void fill_random(uint8_t *tab, int size)
Memory handling functions.
static uint8_t img2[WIDTH *HEIGHT]
static uint8_t img1[WIDTH *HEIGHT]
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
#define AV_CPU_FLAG_MMXEXT
SSE integer functions or AMD MMX ext.
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i you should get a foobar png with Lena edge detected That s it
int(* me_cmp_func)(struct MpegEncContext *c, uint8_t *blk1, uint8_t *blk2, ptrdiff_t stride, int h)
int flags
AV_CODEC_FLAG_*.
me_cmp_func pix_abs[2][4]
common internal API header
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
main external API structure.
#define AV_CPU_FLAG_MMX
standard MMX
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
static void test_motion(const char *name, me_cmp_func test_func, me_cmp_func ref_func)
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
int64_t av_gettime_relative(void)
Get the current time in microseconds since some unspecified starting point.
#define flags(name, subs,...)
printf("static const uint8_t my_array[100] = {\n")
int main(int argc, char **argv)
static const struct twinvq_data tab
void av_force_cpu_flags(int arg)
Disables cpu detection and forces the specified flags.