|
|
@ -709,7 +709,7 @@ static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2){ |
|
|
|
return v; |
|
|
|
return v; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static always_inline void lift(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ |
|
|
|
static av_always_inline void lift(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ |
|
|
|
const int mirror_left= !highpass; |
|
|
|
const int mirror_left= !highpass; |
|
|
|
const int mirror_right= (width&1) ^ highpass; |
|
|
|
const int mirror_right= (width&1) ^ highpass; |
|
|
|
const int w= (width>>1) - 1 + (highpass & width); |
|
|
|
const int w= (width>>1) - 1 + (highpass & width); |
|
|
@ -732,7 +732,7 @@ static always_inline void lift(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifndef lift5 |
|
|
|
#ifndef lift5 |
|
|
|
static always_inline void lift5(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ |
|
|
|
static av_always_inline void lift5(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ |
|
|
|
const int mirror_left= !highpass; |
|
|
|
const int mirror_left= !highpass; |
|
|
|
const int mirror_right= (width&1) ^ highpass; |
|
|
|
const int mirror_right= (width&1) ^ highpass; |
|
|
|
const int w= (width>>1) - 1 + (highpass & width); |
|
|
|
const int w= (width>>1) - 1 + (highpass & width); |
|
|
@ -764,7 +764,7 @@ static always_inline void lift5(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int ds |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef liftS |
|
|
|
#ifndef liftS |
|
|
|
static always_inline void liftS(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ |
|
|
|
static av_always_inline void liftS(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ |
|
|
|
const int mirror_left= !highpass; |
|
|
|
const int mirror_left= !highpass; |
|
|
|
const int mirror_right= (width&1) ^ highpass; |
|
|
|
const int mirror_right= (width&1) ^ highpass; |
|
|
|
const int w= (width>>1) - 1 + (highpass & width); |
|
|
|
const int w= (width>>1) - 1 + (highpass & width); |
|
|
@ -2206,7 +2206,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static always_inline int same_block(BlockNode *a, BlockNode *b){ |
|
|
|
static av_always_inline int same_block(BlockNode *a, BlockNode *b){ |
|
|
|
if((a->type&BLOCK_INTRA) && (b->type&BLOCK_INTRA)){ |
|
|
|
if((a->type&BLOCK_INTRA) && (b->type&BLOCK_INTRA)){ |
|
|
|
return !((a->color[0] - b->color[0]) | (a->color[1] - b->color[1]) | (a->color[2] - b->color[2])); |
|
|
|
return !((a->color[0] - b->color[0]) | (a->color[1] - b->color[1]) | (a->color[2] - b->color[2])); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
@ -2553,7 +2553,7 @@ void ff_snow_inner_add_yblock(uint8_t *obmc, const int obmc_stride, uint8_t * * |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//FIXME name clenup (b_w, block_w, b_width stuff)
|
|
|
|
//FIXME name clenup (b_w, block_w, b_width stuff)
|
|
|
|
static always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer *sb, DWTELEM *dst, uint8_t *dst8, const uint8_t *obmc, int src_x, int src_y, int b_w, int b_h, int w, int h, int dst_stride, int src_stride, int obmc_stride, int b_x, int b_y, int add, int offset_dst, int plane_index){ |
|
|
|
static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer *sb, DWTELEM *dst, uint8_t *dst8, const uint8_t *obmc, int src_x, int src_y, int b_w, int b_h, int w, int h, int dst_stride, int src_stride, int obmc_stride, int b_x, int b_y, int add, int offset_dst, int plane_index){ |
|
|
|
const int b_width = s->b_width << s->block_max_depth; |
|
|
|
const int b_width = s->b_width << s->block_max_depth; |
|
|
|
const int b_height= s->b_height << s->block_max_depth; |
|
|
|
const int b_height= s->b_height << s->block_max_depth; |
|
|
|
const int b_stride= b_width; |
|
|
|
const int b_stride= b_width; |
|
|
@ -2712,7 +2712,7 @@ assert(src_stride > 2*MB_SIZE + 5); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, DWTELEM * old_buffer, int plane_index, int add, int mb_y){ |
|
|
|
static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, DWTELEM * old_buffer, int plane_index, int add, int mb_y){ |
|
|
|
Plane *p= &s->plane[plane_index]; |
|
|
|
Plane *p= &s->plane[plane_index]; |
|
|
|
const int mb_w= s->b_width << s->block_max_depth; |
|
|
|
const int mb_w= s->b_width << s->block_max_depth; |
|
|
|
const int mb_h= s->b_height << s->block_max_depth; |
|
|
|
const int mb_h= s->b_height << s->block_max_depth; |
|
|
@ -2779,7 +2779,7 @@ static always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * |
|
|
|
STOP_TIMER("predict_slice") |
|
|
|
STOP_TIMER("predict_slice") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static always_inline void predict_slice(SnowContext *s, DWTELEM *buf, int plane_index, int add, int mb_y){ |
|
|
|
static av_always_inline void predict_slice(SnowContext *s, DWTELEM *buf, int plane_index, int add, int mb_y){ |
|
|
|
Plane *p= &s->plane[plane_index]; |
|
|
|
Plane *p= &s->plane[plane_index]; |
|
|
|
const int mb_w= s->b_width << s->block_max_depth; |
|
|
|
const int mb_w= s->b_width << s->block_max_depth; |
|
|
|
const int mb_h= s->b_height << s->block_max_depth; |
|
|
|
const int mb_h= s->b_height << s->block_max_depth; |
|
|
@ -2836,7 +2836,7 @@ static always_inline void predict_slice(SnowContext *s, DWTELEM *buf, int plane_ |
|
|
|
STOP_TIMER("predict_slice") |
|
|
|
STOP_TIMER("predict_slice") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static always_inline void predict_plane(SnowContext *s, DWTELEM *buf, int plane_index, int add){ |
|
|
|
static av_always_inline void predict_plane(SnowContext *s, DWTELEM *buf, int plane_index, int add){ |
|
|
|
const int mb_h= s->b_height << s->block_max_depth; |
|
|
|
const int mb_h= s->b_height << s->block_max_depth; |
|
|
|
int mb_y; |
|
|
|
int mb_y; |
|
|
|
for(mb_y=0; mb_y<=mb_h; mb_y++) |
|
|
|
for(mb_y=0; mb_y<=mb_h; mb_y++) |
|
|
@ -3094,7 +3094,7 @@ static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ |
|
|
|
return distortion + rate*penalty_factor; |
|
|
|
return distortion + rate*penalty_factor; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int p[3], int intra, const uint8_t *obmc_edged, int *best_rd){ |
|
|
|
static av_always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int p[3], int intra, const uint8_t *obmc_edged, int *best_rd){ |
|
|
|
const int b_stride= s->b_width << s->block_max_depth; |
|
|
|
const int b_stride= s->b_width << s->block_max_depth; |
|
|
|
BlockNode *block= &s->block[mb_x + mb_y * b_stride]; |
|
|
|
BlockNode *block= &s->block[mb_x + mb_y * b_stride]; |
|
|
|
BlockNode backup= *block; |
|
|
|
BlockNode backup= *block; |
|
|
@ -3133,12 +3133,12 @@ static always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int p[3 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* special case for int[2] args we discard afterward, fixes compilation prob with gcc 2.95 */ |
|
|
|
/* special case for int[2] args we discard afterward, fixes compilation prob with gcc 2.95 */ |
|
|
|
static always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, const uint8_t *obmc_edged, int *best_rd){ |
|
|
|
static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, const uint8_t *obmc_edged, int *best_rd){ |
|
|
|
int p[2] = {p0, p1}; |
|
|
|
int p[2] = {p0, p1}; |
|
|
|
return check_block(s, mb_x, mb_y, p, 0, obmc_edged, best_rd); |
|
|
|
return check_block(s, mb_x, mb_y, p, 0, obmc_edged, best_rd); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){ |
|
|
|
static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){ |
|
|
|
const int b_stride= s->b_width << s->block_max_depth; |
|
|
|
const int b_stride= s->b_width << s->block_max_depth; |
|
|
|
BlockNode *block= &s->block[mb_x + mb_y * b_stride]; |
|
|
|
BlockNode *block= &s->block[mb_x + mb_y * b_stride]; |
|
|
|
BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]}; |
|
|
|
BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]}; |
|
|
|