[FFmpeg-cvslog] r20725 - in trunk/libavcodec: h263.c mpegvideo.h mpegvideo_enc.c

michael subversion
Thu Dec 3 22:36:58 CET 2009


Author: michael
Date: Thu Dec  3 22:36:58 2009
New Revision: 20725

Log:
Move ff_init_qscale_tab() from h263.c to mpegvideo, the function is not h263 specific.

Modified:
   trunk/libavcodec/h263.c
   trunk/libavcodec/mpegvideo.h
   trunk/libavcodec/mpegvideo_enc.c

Modified: trunk/libavcodec/h263.c
==============================================================================
--- trunk/libavcodec/h263.c	Thu Dec  3 20:19:57 2009	(r20724)
+++ trunk/libavcodec/h263.c	Thu Dec  3 22:36:58 2009	(r20725)
@@ -504,20 +504,6 @@ static inline void restore_ac_coeffs(Mpe
 }
 
 /**
- * init s->current_picture.qscale_table from s->lambda_table
- */
-static void ff_init_qscale_tab(MpegEncContext *s){
-    int8_t * const qscale_table= s->current_picture.qscale_table;
-    int i;
-
-    for(i=0; i<s->mb_num; i++){
-        unsigned int lam= s->lambda_table[ s->mb_index2xy[i] ];
-        int qp= (lam*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
-        qscale_table[ s->mb_index2xy[i] ]= av_clip(qp, s->avctx->qmin, s->avctx->qmax);
-    }
-}
-
-/**
  * modify qscale so that encoding is acually possible in h263 (limit difference to -2..2)
  */
 void ff_clean_h263_qscales(MpegEncContext *s){

Modified: trunk/libavcodec/mpegvideo.h
==============================================================================
--- trunk/libavcodec/mpegvideo.h	Thu Dec  3 20:19:57 2009	(r20724)
+++ trunk/libavcodec/mpegvideo.h	Thu Dec  3 22:36:58 2009	(r20725)
@@ -855,6 +855,7 @@ int ff_h263_get_gob_height(MpegEncContex
 void ff_mpeg4_init_direct_mv(MpegEncContext *s);
 int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my);
 void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code);
+void ff_init_qscale_tab(MpegEncContext *s);
 
 
 /* rv10.c */

Modified: trunk/libavcodec/mpegvideo_enc.c
==============================================================================
--- trunk/libavcodec/mpegvideo_enc.c	Thu Dec  3 20:19:57 2009	(r20724)
+++ trunk/libavcodec/mpegvideo_enc.c	Thu Dec  3 22:36:58 2009	(r20725)
@@ -146,6 +146,20 @@ void ff_write_quant_matrix(PutBitContext
         put_bits(pb, 1, 0);
 }
 
+/**
+ * init s->current_picture.qscale_table from s->lambda_table
+ */
+void ff_init_qscale_tab(MpegEncContext *s){
+    int8_t * const qscale_table= s->current_picture.qscale_table;
+    int i;
+
+    for(i=0; i<s->mb_num; i++){
+        unsigned int lam= s->lambda_table[ s->mb_index2xy[i] ];
+        int qp= (lam*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
+        qscale_table[ s->mb_index2xy[i] ]= av_clip(qp, s->avctx->qmin, s->avctx->qmax);
+    }
+}
+
 static void copy_picture_attributes(MpegEncContext *s, AVFrame *dst, AVFrame *src){
     int i;
 



More information about the ffmpeg-cvslog mailing list