comparison cavs.h @ 5239:5760ab0250aa libavcodec

move modification of intra prediction modes into its own inline function
author stefang
date Sat, 07 Jul 2007 06:15:05 +0000
parents 871a49faf887
children 1701ce572fed
comparison
equal deleted inserted replaced
5238:871a49faf887 5239:5760ab0250aa
222 222
223 int got_keyframe; 223 int got_keyframe;
224 DCTELEM *block; 224 DCTELEM *block;
225 } AVSContext; 225 } AVSContext;
226 226
227 extern const int_fast8_t ff_left_modifier_l[8];
228 extern const int_fast8_t ff_top_modifier_l[8];
229 extern const int_fast8_t ff_left_modifier_c[7];
230 extern const int_fast8_t ff_top_modifier_c[7];
227 extern const vector_t ff_cavs_un_mv; 231 extern const vector_t ff_cavs_un_mv;
228 232
229 static inline void load_intra_pred_luma(AVSContext *h, uint8_t *top, 233 static inline void load_intra_pred_luma(AVSContext *h, uint8_t *top,
230 uint8_t **left, int block) { 234 uint8_t **left, int block) {
231 int i; 235 int i;
296 static inline void modify_pred(const int_fast8_t *mod_table, int *mode) { 300 static inline void modify_pred(const int_fast8_t *mod_table, int *mode) {
297 *mode = mod_table[*mode]; 301 *mode = mod_table[*mode];
298 if(*mode < 0) { 302 if(*mode < 0) {
299 av_log(NULL, AV_LOG_ERROR, "Illegal intra prediction mode\n"); 303 av_log(NULL, AV_LOG_ERROR, "Illegal intra prediction mode\n");
300 *mode = 0; 304 *mode = 0;
305 }
306 }
307
308 static inline void modify_mb_i(AVSContext *h, int *pred_mode_uv) {
309 /* save pred modes before they get modified */
310 h->pred_mode_Y[3] = h->pred_mode_Y[5];
311 h->pred_mode_Y[6] = h->pred_mode_Y[8];
312 h->top_pred_Y[h->mbx*2+0] = h->pred_mode_Y[7];
313 h->top_pred_Y[h->mbx*2+1] = h->pred_mode_Y[8];
314
315 /* modify pred modes according to availability of neighbour samples */
316 if(!(h->flags & A_AVAIL)) {
317 modify_pred(ff_left_modifier_l, &h->pred_mode_Y[4] );
318 modify_pred(ff_left_modifier_l, &h->pred_mode_Y[7] );
319 modify_pred(ff_left_modifier_c, pred_mode_uv );
320 }
321 if(!(h->flags & B_AVAIL)) {
322 modify_pred(ff_top_modifier_l, &h->pred_mode_Y[4] );
323 modify_pred(ff_top_modifier_l, &h->pred_mode_Y[5] );
324 modify_pred(ff_top_modifier_c, pred_mode_uv );
301 } 325 }
302 } 326 }
303 327
304 static inline void set_mvs(vector_t *mv, enum block_t size) { 328 static inline void set_mvs(vector_t *mv, enum block_t size) {
305 switch(size) { 329 switch(size) {