[libav-devel] [PATCH] snow: add ff_ prefix to the common functions

Luca Barbato lu_zero at gentoo.org
Sat Nov 19 06:55:04 CET 2011


---
 libavcodec/snow.c    |   18 +++++++++---------
 libavcodec/snow.h    |   24 ++++++++++++------------
 libavcodec/snowdec.c |   14 +++++++-------
 libavcodec/snowenc.c |   16 ++++++++--------
 4 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 5ee543e..a290358 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -68,7 +68,7 @@ void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, uint8_
     }
 }
 
-void snow_reset_contexts(SnowContext *s){ //FIXME better initial contexts
+void ff_snow_reset_contexts(SnowContext *s){ //FIXME better initial contexts
     int plane_index, level, orientation;
 
     for(plane_index=0; plane_index<3; plane_index++){
@@ -82,7 +82,7 @@ void snow_reset_contexts(SnowContext *s){ //FIXME better initial contexts
     memset(s->block_state, MID_STATE, sizeof(s->block_state));
 }
 
-int snow_alloc_blocks(SnowContext *s){
+int ff_snow_alloc_blocks(SnowContext *s){
     int w= -((-s->avctx->width )>>LOG2_MB_SIZE);
     int h= -((-s->avctx->height)>>LOG2_MB_SIZE);
 
@@ -287,7 +287,7 @@ static void mc_block(Plane *p, uint8_t *dst, const uint8_t *src, int stride, int
     }
 }
 
-void snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){
+void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){
     if(block->type & BLOCK_INTRA){
         int x, y;
         const int color = block->color[plane_index];
@@ -382,7 +382,7 @@ mca( 8, 0,8)
 mca( 0, 8,8)
 mca( 8, 8,8)
 
-av_cold int snow_common_init(AVCodecContext *avctx){
+av_cold int ff_snow_common_init(AVCodecContext *avctx){
     SnowContext *s = avctx->priv_data;
     int width, height;
     int i, j;
@@ -451,7 +451,7 @@ av_cold int snow_common_init(AVCodecContext *avctx){
     return 0;
 }
 
-int snow_common_init_after_header(AVCodecContext *avctx) {
+int ff_snow_common_init_after_header(AVCodecContext *avctx) {
     SnowContext *s = avctx->priv_data;
     int plane_index, level, orientation;
 
@@ -548,7 +548,7 @@ static void halfpel_interpol(SnowContext *s, uint8_t *halfpel[4][4], AVFrame *fr
     }
 }
 
-void snow_release_buffer(AVCodecContext *avctx)
+void ff_snow_release_buffer(AVCodecContext *avctx)
 {
     SnowContext *s = avctx->priv_data;
     int i;
@@ -561,7 +561,7 @@ void snow_release_buffer(AVCodecContext *avctx)
     }
 }
 
-int snow_frame_start(SnowContext *s){
+int ff_snow_frame_start(SnowContext *s){
    AVFrame tmp;
    int w= s->avctx->width; //FIXME round up to x16 ?
    int h= s->avctx->height;
@@ -578,7 +578,7 @@ int snow_frame_start(SnowContext *s){
                           EDGE_WIDTH/2, EDGE_WIDTH/2, EDGE_TOP | EDGE_BOTTOM);
     }
 
-    snow_release_buffer(s->avctx);
+    ff_snow_release_buffer(s->avctx);
 
     tmp= s->last_picture[s->max_ref_frames-1];
     memmove(s->last_picture+1, s->last_picture, (s->max_ref_frames-1)*sizeof(AVFrame));
@@ -613,7 +613,7 @@ int snow_frame_start(SnowContext *s){
     return 0;
 }
 
-av_cold void snow_common_end(SnowContext *s)
+av_cold void ff_snow_common_end(SnowContext *s)
 {
     int plane_index, level, orientation, i;
 
diff --git a/libavcodec/snow.h b/libavcodec/snow.h
index 7a806c6..f43deb1 100644
--- a/libavcodec/snow.h
+++ b/libavcodec/snow.h
@@ -213,14 +213,14 @@ static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTE
 
 /* common code */
 
-int snow_common_init(AVCodecContext *avctx);
-int snow_common_init_after_header(AVCodecContext *avctx);
-void snow_common_end(SnowContext *s);
-void snow_release_buffer(AVCodecContext *avctx);
-void snow_reset_contexts(SnowContext *s);
-int snow_alloc_blocks(SnowContext *s);
-int snow_frame_start(SnowContext *s);
-void snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride,
+int ff_snow_common_init(AVCodecContext *avctx);
+int ff_snow_common_init_after_header(AVCodecContext *avctx);
+void ff_snow_common_end(SnowContext *s);
+void ff_snow_release_buffer(AVCodecContext *avctx);
+void ff_snow_reset_contexts(SnowContext *s);
+int ff_snow_alloc_blocks(SnowContext *s);
+int ff_snow_frame_start(SnowContext *s);
+void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride,
                      int sx, int sy, int b_w, int b_h, BlockNode *block,
                      int plane_index, int w, int h);
 /* common inline functions */
@@ -336,14 +336,14 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer
     ptmp= tmp + 3*tmp_step;
     block[0]= ptmp;
     ptmp+=tmp_step;
-    snow_pred_block(s, block[0], tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h);
+    ff_snow_pred_block(s, block[0], tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h);
 
     if(same_block(lt, rt)){
         block[1]= block[0];
     }else{
         block[1]= ptmp;
         ptmp+=tmp_step;
-        snow_pred_block(s, block[1], tmp, src_stride, src_x, src_y, b_w, b_h, rt, plane_index, w, h);
+        ff_snow_pred_block(s, block[1], tmp, src_stride, src_x, src_y, b_w, b_h, rt, plane_index, w, h);
     }
 
     if(same_block(lt, lb)){
@@ -353,7 +353,7 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer
     }else{
         block[2]= ptmp;
         ptmp+=tmp_step;
-        snow_pred_block(s, block[2], tmp, src_stride, src_x, src_y, b_w, b_h, lb, plane_index, w, h);
+        ff_snow_pred_block(s, block[2], tmp, src_stride, src_x, src_y, b_w, b_h, lb, plane_index, w, h);
     }
 
     if(same_block(lt, rb) ){
@@ -364,7 +364,7 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer
         block[3]= block[2];
     }else{
         block[3]= ptmp;
-        snow_pred_block(s, block[3], tmp, src_stride, src_x, src_y, b_w, b_h, rb, plane_index, w, h);
+        ff_snow_pred_block(s, block[3], tmp, src_stride, src_x, src_y, b_w, b_h, rb, plane_index, w, h);
     }
     if(sliced){
         s->dwt.inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 3f7629b..2b6f6e1 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -266,7 +266,7 @@ static int decode_header(SnowContext *s){
 
     s->keyframe= get_rac(&s->c, kstate);
     if(s->keyframe || s->always_reset){
-        snow_reset_contexts(s);
+        ff_snow_reset_contexts(s);
         s->spatial_decomposition_type=
         s->qlog=
         s->qbias=
@@ -344,7 +344,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 {
     avctx->pix_fmt= PIX_FMT_YUV420P;
 
-    snow_common_init(avctx);
+    ff_snow_common_init(avctx);
 
     return 0;
 }
@@ -376,7 +376,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     s->current_picture.pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P
     if(decode_header(s)<0)
         return -1;
-    snow_common_init_after_header(avctx);
+    ff_snow_common_init_after_header(avctx);
 
     // realloc slice buffer for the case that spatial_decomposition_count changed
     ff_slice_buffer_destroy(&s->sb);
@@ -389,9 +389,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
                                               && p->hcoeff[2]==2;
     }
 
-    snow_alloc_blocks(s);
+    ff_snow_alloc_blocks(s);
 
-    if(snow_frame_start(s) < 0)
+    if(ff_snow_frame_start(s) < 0)
         return -1;
     //keyframe flag duplication mess FIXME
     if(avctx->debug&FF_DEBUG_PICT_INFO)
@@ -507,7 +507,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
 
     emms_c();
 
-    snow_release_buffer(avctx);
+    ff_snow_release_buffer(avctx);
 
     if(!(s->avctx->debug&2048))
         *picture= s->current_picture;
@@ -528,7 +528,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
 
     ff_slice_buffer_destroy(&s->sb);
 
-    snow_common_end(s);
+    ff_snow_common_end(s);
 
     return 0;
 }
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 334c460..4926eef 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -185,8 +185,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
         s->plane[plane_index].fast_mc= 1;
     }
 
-    snow_common_init(avctx);
-    snow_alloc_blocks(s);
+    ff_snow_common_init(avctx);
+    ff_snow_alloc_blocks(s);
 
     s->version=0;
 
@@ -689,7 +689,7 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, con
     int y1= FFMIN(block_w*2, h-sy);
     int i,x,y;
 
-    snow_pred_block(s, cur, tmp, ref_stride, sx, sy, block_w*2, block_w*2, &s->block[mb_x + mb_y*b_stride], plane_index, w, h);
+    ff_snow_pred_block(s, cur, tmp, ref_stride, sx, sy, block_w*2, block_w*2, &s->block[mb_x + mb_y*b_stride], plane_index, w, h);
 
     for(y=y0; y<y1; y++){
         const uint8_t *obmc1= obmc_edged + y*obmc_stride;
@@ -1432,7 +1432,7 @@ static void encode_header(SnowContext *s){
 
     put_rac(&s->c, kstate, s->keyframe);
     if(s->keyframe || s->always_reset){
-        snow_reset_contexts(s);
+        ff_snow_reset_contexts(s);
         s->last_spatial_decomposition_type=
         s->last_qlog=
         s->last_qbias=
@@ -1647,7 +1647,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
         s->lambda = 0;
     }//else keep previous frame's qlog until after motion estimation
 
-    snow_frame_start(s);
+    ff_snow_frame_start(s);
 
     s->m.current_picture_ptr= &s->m.current_picture;
     s->m.last_picture.f.pts = s->m.current_picture.f.pts;
@@ -1709,7 +1709,7 @@ redo_frame:
     s->m.pict_type = pict->pict_type;
     s->qbias= pict->pict_type == AV_PICTURE_TYPE_P ? 2 : 0;
 
-    snow_common_init_after_header(avctx);
+    ff_snow_common_init_after_header(avctx);
 
     if(s->last_spatial_decomposition_count != s->spatial_decomposition_count){
         for(plane_index=0; plane_index<3; plane_index++){
@@ -1848,7 +1848,7 @@ redo_frame:
 
     update_last_header_values(s);
 
-    snow_release_buffer(avctx);
+    ff_snow_release_buffer(avctx);
 
     s->current_picture.coded_picture_number = avctx->frame_number;
     s->current_picture.pict_type = pict->pict_type;
@@ -1879,7 +1879,7 @@ static av_cold int encode_end(AVCodecContext *avctx)
 {
     SnowContext *s = avctx->priv_data;
 
-    snow_common_end(s);
+    ff_snow_common_end(s);
     if (s->input_picture.data[0])
         avctx->release_buffer(avctx, &s->input_picture);
     av_free(avctx->stats_out);
-- 
1.7.8.rc1



More information about the libav-devel mailing list