Mercurial > libavcodec.hg
comparison dsputil.c @ 3373:b8996cc5ccae libavcodec
Disable w53 and w97 cmp methods when snow encoder is disabled
Patch by Diego 'Flameeyes' Petteno flameeyes AH gentoo PP org
Original thread:
Date: Jun 30, 2006 1:16 AM
Subject: [Ffmpeg-devel] [PATCH] Disable w53 and w97 cmp methods when snow encoder is disabled
author | gpoirier |
---|---|
date | Fri, 30 Jun 2006 07:50:30 +0000 |
parents | 87c54a3f8d19 |
children | adccbf4a1040 |
comparison
equal
deleted
inserted
replaced
3372:055f0405c523 | 3373:b8996cc5ccae |
---|---|
290 } | 290 } |
291 return s; | 291 return s; |
292 } | 292 } |
293 | 293 |
294 | 294 |
295 #ifdef CONFIG_SNOW_ENCODER //dwt is in snow.c | |
295 static inline int w_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int w, int h, int type){ | 296 static inline int w_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int w, int h, int type){ |
296 #ifdef CONFIG_SNOW_ENCODER //dwt is in snow.c | |
297 int s, i, j; | 297 int s, i, j; |
298 const int dec_count= w==8 ? 3 : 4; | 298 const int dec_count= w==8 ? 3 : 4; |
299 int tmp[32*32]; | 299 int tmp[32*32]; |
300 int level, ori; | 300 int level, ori; |
301 static const int scale[2][2][4][4]={ | 301 static const int scale[2][2][4][4]={ |
358 } | 358 } |
359 } | 359 } |
360 } | 360 } |
361 assert(s>=0); | 361 assert(s>=0); |
362 return s>>9; | 362 return s>>9; |
363 #endif | |
364 } | 363 } |
365 | 364 |
366 static int w53_8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ | 365 static int w53_8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ |
367 return w_c(v, pix1, pix2, line_size, 8, h, 1); | 366 return w_c(v, pix1, pix2, line_size, 8, h, 1); |
368 } | 367 } |
384 } | 383 } |
385 | 384 |
386 int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ | 385 int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ |
387 return w_c(v, pix1, pix2, line_size, 32, h, 0); | 386 return w_c(v, pix1, pix2, line_size, 32, h, 0); |
388 } | 387 } |
388 #endif | |
389 | 389 |
390 static void get_pixels_c(DCTELEM *restrict block, const uint8_t *pixels, int line_size) | 390 static void get_pixels_c(DCTELEM *restrict block, const uint8_t *pixels, int line_size) |
391 { | 391 { |
392 int i; | 392 int i; |
393 | 393 |
3210 cmp[i]= zero_cmp; | 3210 cmp[i]= zero_cmp; |
3211 break; | 3211 break; |
3212 case FF_CMP_NSSE: | 3212 case FF_CMP_NSSE: |
3213 cmp[i]= c->nsse[i]; | 3213 cmp[i]= c->nsse[i]; |
3214 break; | 3214 break; |
3215 #ifdef CONFIG_SNOW_ENCODER | |
3215 case FF_CMP_W53: | 3216 case FF_CMP_W53: |
3216 cmp[i]= c->w53[i]; | 3217 cmp[i]= c->w53[i]; |
3217 break; | 3218 break; |
3218 case FF_CMP_W97: | 3219 case FF_CMP_W97: |
3219 cmp[i]= c->w97[i]; | 3220 cmp[i]= c->w97[i]; |
3220 break; | 3221 break; |
3222 #endif | |
3221 default: | 3223 default: |
3222 av_log(NULL, AV_LOG_ERROR,"internal error in cmp function selection\n"); | 3224 av_log(NULL, AV_LOG_ERROR,"internal error in cmp function selection\n"); |
3223 } | 3225 } |
3224 } | 3226 } |
3225 } | 3227 } |
4019 c->vsad[4]= vsad_intra16_c; | 4021 c->vsad[4]= vsad_intra16_c; |
4020 c->vsse[0]= vsse16_c; | 4022 c->vsse[0]= vsse16_c; |
4021 c->vsse[4]= vsse_intra16_c; | 4023 c->vsse[4]= vsse_intra16_c; |
4022 c->nsse[0]= nsse16_c; | 4024 c->nsse[0]= nsse16_c; |
4023 c->nsse[1]= nsse8_c; | 4025 c->nsse[1]= nsse8_c; |
4026 #ifdef CONFIG_SNOW_ENCODER | |
4024 c->w53[0]= w53_16_c; | 4027 c->w53[0]= w53_16_c; |
4025 c->w53[1]= w53_8_c; | 4028 c->w53[1]= w53_8_c; |
4026 c->w97[0]= w97_16_c; | 4029 c->w97[0]= w97_16_c; |
4027 c->w97[1]= w97_8_c; | 4030 c->w97[1]= w97_8_c; |
4031 #endif | |
4028 | 4032 |
4029 c->add_bytes= add_bytes_c; | 4033 c->add_bytes= add_bytes_c; |
4030 c->diff_bytes= diff_bytes_c; | 4034 c->diff_bytes= diff_bytes_c; |
4031 c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c; | 4035 c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c; |
4032 c->bswap_buf= bswap_buf; | 4036 c->bswap_buf= bswap_buf; |