[FFmpeg-soc] [soc]: r3794 - in dirac/libavcodec: dirac.c dirac.h dirac_arith.c dirac_wavelet.c diracdec.c diracenc.c

conrad subversion at mplayerhq.hu
Mon Nov 10 04:12:03 CET 2008


Author: conrad
Date: Mon Nov 10 04:12:02 2008
New Revision: 3794

Log:
Cosmetics: place the starting brace of a function on its own line
Previously it was inconsistent.


Modified:
   dirac/libavcodec/dirac.c
   dirac/libavcodec/dirac.h
   dirac/libavcodec/dirac_arith.c
   dirac/libavcodec/dirac_wavelet.c
   dirac/libavcodec/diracdec.c
   dirac/libavcodec/diracenc.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Mon Nov 10 04:12:02 2008
@@ -129,7 +129,8 @@ static const weights_t eighthpel_weights
 /**
  * Dump the source parameters.  DEBUG needs to be defined.
  */
-void dirac_dump_source_parameters(AVCodecContext *avctx) {
+void dirac_dump_source_parameters(AVCodecContext *avctx)
+{
     DiracContext *s = avctx->priv_data;
     dirac_source_params *source = &s->source;
     const char *chroma_format_str[] = { "4:4:4", "4:2:2", "4:2:0" };
@@ -329,7 +330,8 @@ int dirac_reference_frame_idx(DiracConte
  */
 static void interpolate_frame_halfpel(AVFrame *refframe, int width, int height,
                                       int8_t *pixels, int comp,
-                                      int xpad, int ypad) {
+                                      int xpad, int ypad)
+{
     int8_t *lineout;
     uint8_t *refdata;
     uint8_t *lineinref;
@@ -514,7 +516,8 @@ static void motion_comp_block2refs(Dirac
                                    int ystart, int ystop, int8_t *ref1,
                                    int8_t *ref2,
                                    struct dirac_blockmotion *currblock,
-                                   int comp, int border) {
+                                   int comp, int border)
+{
     int x, y;
     int xs, ys;
     int16_t *line;
@@ -707,7 +710,8 @@ static void motion_comp_block1ref(DiracC
                                   int ystart, int ystop, int8_t *refframe,
                                   int ref,
                                   struct dirac_blockmotion *currblock,
-                                  int comp, int border) {
+                                  int comp, int border)
+{
     int x, y;
     int xs, ys;
     int16_t *line;
@@ -850,7 +854,8 @@ STOP_TIMER("single_refframe");
 static inline
 void motion_comp_dc_block(DiracContext *s, int16_t *coeffs, int i, int j,
                           int xstart, int xstop, int ystart, int ystop,
-                          int dcval, int border) {
+                          int dcval, int border)
+{
     int x, y;
     int xs, ys;
     int16_t *line;

Modified: dirac/libavcodec/dirac.h
==============================================================================
--- dirac/libavcodec/dirac.h	(original)
+++ dirac/libavcodec/dirac.h	Mon Nov 10 04:12:02 2008
@@ -276,7 +276,8 @@ typedef enum {
  * @param level subband level
  * @return subband width
  */
-static int inline subband_width(DiracContext *s, int level) {
+static int inline subband_width(DiracContext *s, int level)
+{
     if (level == 0)
         return s->padded_width >> s->decoding.wavelet_depth;
     return s->padded_width >> (s->decoding.wavelet_depth - level + 1);
@@ -288,13 +289,15 @@ static int inline subband_width(DiracCon
  * @param level subband level
  * @return height of the subband
  */
-static int inline subband_height(DiracContext *s, int level) {
+static int inline subband_height(DiracContext *s, int level)
+{
     if (level == 0)
         return s->padded_height >> s->decoding.wavelet_depth;
     return s->padded_height >> (s->decoding.wavelet_depth - level + 1);
 }
 
-static int inline coeff_quant_factor(int idx) {
+static int inline coeff_quant_factor(int idx)
+{
     uint64_t base;
     idx = FFMAX(idx, 0);
     base = 1 << (idx / 4);
@@ -311,7 +314,8 @@ static int inline coeff_quant_factor(int
     return 0; /* XXX: should never be reached */
 }
 
-static int inline coeff_quant_offset(DiracContext *s, int idx) {
+static int inline coeff_quant_offset(DiracContext *s, int idx)
+{
     if (idx == 0)
         return 1;
 
@@ -335,7 +339,8 @@ static int inline coeff_quant_offset(Dir
  * @return horizontal position within the coefficient array
  */
 static int inline coeff_posx(DiracContext *s, int level,
-                             subband_t orientation, int x) {
+                             subband_t orientation, int x)
+{
     if (orientation == subband_hl || orientation == subband_hh)
         return subband_width(s, level) + x;
 
@@ -385,7 +390,8 @@ int zero_neighbourhood(DiracContext *s, 
  */
 static inline
 int sign_predict(DiracContext *s, int16_t *data, subband_t orientation,
-                 int v, int h) {
+                 int v, int h)
+{
     if (orientation == subband_hl && v > 0)
         return DIRAC_SIGN(data[-s->padded_width]);
     else if (orientation == subband_lh && h > 0)

Modified: dirac/libavcodec/dirac_arith.c
==============================================================================
--- dirac/libavcodec/dirac_arith.c	(original)
+++ dirac/libavcodec/dirac_arith.c	Mon Nov 10 04:12:02 2008
@@ -62,7 +62,8 @@ static uint16_t arith_lookup[256] = {
     805, 750,   690,  625,  553,  471,  376,  255
 };
 
-static void dirac_arith_init_common(dirac_arith_state_t arith) {
+static void dirac_arith_init_common(dirac_arith_state_t arith)
+{
     int i;
 
     arith->low   = 0;
@@ -82,7 +83,8 @@ static void dirac_arith_init_common(dira
  * @param length amount of bytes to decode
  */
 void dirac_arith_init(dirac_arith_state_t arith,
-                      GetBitContext *gb, int length) {
+                      GetBitContext *gb, int length)
+{
     align_get_bits(gb);
     arith->pb        = NULL;
     arith->bits_left = 8 * length - 16;
@@ -92,7 +94,8 @@ void dirac_arith_init(dirac_arith_state_
     dirac_arith_init_common(arith);
 }
 
-void dirac_arith_coder_init(dirac_arith_state_t arith, PutBitContext *pb) {
+void dirac_arith_coder_init(dirac_arith_state_t arith, PutBitContext *pb)
+{
     arith->pb        = pb;
     arith->carry     = 0;
     arith->gb        = NULL;
@@ -107,7 +110,8 @@ void dirac_arith_coder_init(dirac_arith_
  * @param context the context of the bit to read
  * @return the bit read
  */
-int dirac_arith_get_bit(dirac_arith_state_t arith, int context) {
+int dirac_arith_get_bit(dirac_arith_state_t arith, int context)
+{
     GetBitContext *gb = arith->gb;
     unsigned int prob_zero = arith->contexts[context];
     unsigned int count;
@@ -162,7 +166,8 @@ int dirac_arith_get_bit(dirac_arith_stat
  * @param context the context of the bit to write
  * @param bit the bit to write
  */
-void dirac_arith_put_bit(dirac_arith_state_t arith, int context, int bit) {
+void dirac_arith_put_bit(dirac_arith_state_t arith, int context, int bit)
+{
     PutBitContext *pb = arith->pb;
     unsigned int prob_zero = arith->contexts[context];
 
@@ -197,7 +202,8 @@ void dirac_arith_put_bit(dirac_arith_sta
 
 static inline
 unsigned int follow_context(int index,
-                            struct dirac_arith_context_set *context_set) {
+                            struct dirac_arith_context_set *context_set)
+{
     int pos;
     pos = FFMIN(index, 5);
     return context_set->follow[pos];
@@ -210,7 +216,8 @@ unsigned int follow_context(int index,
  * @return value read by arithmetic decoder
  */
 unsigned int dirac_arith_read_uint(dirac_arith_state_t arith,
-                                   struct dirac_arith_context_set *context_set) {
+                                   struct dirac_arith_context_set *context_set)
+{
     int ret = 1;
     int index = 0;
 
@@ -233,7 +240,8 @@ unsigned int dirac_arith_read_uint(dirac
  */
 void dirac_arith_write_uint(dirac_arith_state_t arith,
                             struct dirac_arith_context_set *context_set,
-                            unsigned int i) {
+                            unsigned int i)
+{
     int log = av_log2(++i);
     int index = 0;
     while(log) {
@@ -251,7 +259,8 @@ void dirac_arith_write_uint(dirac_arith_
  * @return value read by arithmetic decoder
  */
 int dirac_arith_read_int(dirac_arith_state_t arith,
-                         struct dirac_arith_context_set *context_set) {
+                         struct dirac_arith_context_set *context_set)
+{
     int ret = dirac_arith_read_uint(arith, context_set);
     if (ret != 0 && dirac_arith_get_bit(arith, context_set->sign))
         ret = -ret;
@@ -267,7 +276,8 @@ int dirac_arith_read_int(dirac_arith_sta
  */
 void dirac_arith_write_int(dirac_arith_state_t arith,
                            struct dirac_arith_context_set *context_set,
-                           int i) {
+                           int i)
+{
     dirac_arith_write_uint(arith, context_set, FFABS(i));
     if (i)
         dirac_arith_put_bit(arith, context_set->sign, i < 0);
@@ -278,7 +288,8 @@ void dirac_arith_write_int(dirac_arith_s
  * Flush the arithmetic decoder, consume all bytes up to the
  * initialized length.
  */
-void dirac_arith_flush(dirac_arith_state_t arith) {
+void dirac_arith_flush(dirac_arith_state_t arith)
+{
     assert(!arith->pb);
     skip_bits_long(arith->gb, arith->bits_left);
     arith->bits_left = 0;
@@ -288,7 +299,8 @@ void dirac_arith_flush(dirac_arith_state
 /**
  * Flush the arithmetic coder.
  */
-void dirac_arith_coder_flush(dirac_arith_state_t arith) {
+void dirac_arith_coder_flush(dirac_arith_state_t arith)
+{
     int i;
     int rem;
     assert(!arith->gb);

Modified: dirac/libavcodec/dirac_wavelet.c
==============================================================================
--- dirac/libavcodec/dirac_wavelet.c	(original)
+++ dirac/libavcodec/dirac_wavelet.c	Mon Nov 10 04:12:02 2008
@@ -39,7 +39,8 @@
  */
 static void dirac_subband_idwt_interleave(int16_t *data, int width,
                                           int height, int padded_width,
-                                          int16_t *synth, int level) {
+                                          int16_t *synth, int level)
+{
     int x, y;
     int synth_width     = width << 1;
     int16_t *synth_line = synth;
@@ -67,7 +68,8 @@ static void dirac_subband_idwt_interleav
 
 static void dirac_subband_dwt_deinterleave(int16_t *data, int width,
                                            int height, int padded_width,
-                                           int16_t *synth, int level) {
+                                           int16_t *synth, int level)
+{
     int x, y;
     int synth_width     = width << 1;
     int16_t *synth_line = synth;
@@ -102,7 +104,8 @@ static void dirac_subband_dwt_deinterlea
  */
 int dirac_subband_idwt_53(AVCodecContext *avctx, int width, int height,
                           int padded_width, int16_t *data, int16_t *synth,
-                          int level) {
+                          int level)
+{
     int16_t *synthline;
     int x, y;
     int synth_width = width  << 1;
@@ -220,7 +223,8 @@ STOP_TIMER("idwt53")
  * @return 0 when successful, otherwise -1 is returned
  */
 int dirac_subband_dwt_53(AVCodecContext *avctx, int width, int height,
-                         int padded_width, int16_t *data, int level) {
+                         int padded_width, int16_t *data, int level)
+{
     int16_t *synth, *synthline, *dataline;
     int x, y;
     int synth_width = width  << 1;
@@ -345,7 +349,8 @@ STOP_TIMER("dwt53")
  */
 int dirac_subband_idwt_97(AVCodecContext *avctx, int width, int height,
                           int padded_width, int16_t *data, int16_t *synth,
-                          int level) {
+                          int level)
+{
     int16_t *synthline;
     int x, y;
     int synth_width = width  << 1;
@@ -474,7 +479,8 @@ STOP_TIMER("idwt95")
  */
 int dirac_subband_dwt_97(AVCodecContext *avctx, int width, int height,
                                 int padded_width,
-                                int16_t *data, int level) {
+                                int16_t *data, int level)
+{
     int16_t *synth, *synthline, *dataline;
     int x, y;
     int synth_width = width  << 1;

Modified: dirac/libavcodec/diracdec.c
==============================================================================
--- dirac/libavcodec/diracdec.c	(original)
+++ dirac/libavcodec/diracdec.c	Mon Nov 10 04:12:02 2008
@@ -37,7 +37,8 @@
 #include "dirac_wavelet.h"
 #include "mpeg12data.h"
 
-static int decode_init(AVCodecContext *avctx){
+static int decode_init(AVCodecContext *avctx)
+{
     av_log_set_level(AV_LOG_DEBUG);
     return 0;
 }
@@ -52,7 +53,8 @@ static int decode_end(AVCodecContext *av
 /**
  * Parse the source parameters in the access unit header
  */
-static int parse_source_parameters(DiracContext *s) {
+static int parse_source_parameters(DiracContext *s)
+{
     GetBitContext *gb = &s->gb;
 
     /* Override the luma dimensions.  */
@@ -196,7 +198,8 @@ static int parse_source_parameters(Dirac
 /**
  * Parse the sequence header
  */
-static int parse_sequence_header(DiracContext *s) {
+static int parse_sequence_header(DiracContext *s)
+{
     GetBitContext *gb = &s->gb;
     unsigned int version_major;
     unsigned int version_minor;
@@ -269,7 +272,8 @@ static inline int coeff_dequant(int coef
  */
 static void coeff_unpack(DiracContext *s, int16_t *data, int level,
                          subband_t orientation, int v, int h,
-                         int qoffset, int qfactor) {
+                         int qoffset, int qfactor)
+{
     int parent = 0;
     int nhood;
     int idx;
@@ -325,7 +329,8 @@ static void coeff_unpack(DiracContext *s
  */
 static void codeblock(DiracContext *s, int16_t *data, int level,
                       subband_t orientation, int x, int y,
-                      int qoffset, int qfactor) {
+                      int qoffset, int qfactor)
+{
     int blockcnt_one = (s->codeblocksh[level] + s->codeblocksv[level]) == 2;
     int left, right, top, bottom;
     int v, h;
@@ -352,7 +357,8 @@ static void codeblock(DiracContext *s, i
  *
  * @param data coefficients
  */
-static void intra_dc_prediction(DiracContext *s, int16_t *data) {
+static void intra_dc_prediction(DiracContext *s, int16_t *data)
+{
     int x, y;
     int16_t *line = data;
 
@@ -372,7 +378,8 @@ static void intra_dc_prediction(DiracCon
  * @param orientation orientation of the subband
  */
 static int subband(DiracContext *s, int16_t *data, int level,
-                   subband_t orientation) {
+                   subband_t orientation)
+{
     GetBitContext *gb = &s->gb;
     unsigned int length;
     unsigned int quant, qoffset, qfactor;
@@ -405,7 +412,8 @@ static int subband(DiracContext *s, int1
  * @param level subband level
  * @param orientation orientation of the subband
  */
-static int subband_dc(DiracContext *s, int16_t *data) {
+static int subband_dc(DiracContext *s, int16_t *data)
+{
     GetBitContext *gb = &s->gb;
     unsigned int length;
     unsigned int quant, qoffset, qfactor;
@@ -442,7 +450,8 @@ static int subband_dc(DiracContext *s, i
 /**
  * Unpack the motion compensation parameters
  */
-static int dirac_unpack_prediction_parameters(DiracContext *s) {
+static int dirac_unpack_prediction_parameters(DiracContext *s)
+{
     GetBitContext *gb = &s->gb;
 
     /* Read block parameters.  */
@@ -606,7 +615,8 @@ static void unpack_block_dc(DiracContext
  * @param dir direction horizontal=0, vertical=1
  */
 static void dirac_unpack_motion_vector(DiracContext *s, int ref, int dir,
-                                       int x, int y) {
+                                       int x, int y)
+{
     int res;
     const int refmask = (ref + 1) | DIRAC_REF_MASK_GLOBAL;
 
@@ -1006,7 +1016,8 @@ static int parse_frame(DiracContext *s)
 
 
 int dirac_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
-                        const uint8_t *buf, int buf_size) {
+                        const uint8_t *buf, int buf_size)
+{
     DiracContext *s = avctx->priv_data;
     AVFrame *picture = data;
     int i;

Modified: dirac/libavcodec/diracenc.c
==============================================================================
--- dirac/libavcodec/diracenc.c	(original)
+++ dirac/libavcodec/diracenc.c	Mon Nov 10 04:12:02 2008
@@ -292,7 +292,8 @@ static void dirac_encode_access_unit_hea
 
 
 static void encode_coeff(DiracContext *s, int16_t *coeffs, int level,
-                         int orientation, int x, int y) {
+                         int orientation, int x, int y)
+{
     int parent = 0;
     int nhood;
     int idx;
@@ -330,7 +331,8 @@ static void encode_coeff(DiracContext *s
 }
 
 static void encode_codeblock(DiracContext *s, int16_t *coeffs, int level,
-                             int orientation, int xpos, int ypos) {
+                             int orientation, int xpos, int ypos)
+{
     int blockcnt_one = (s->codeblocksh[level] + s->codeblocksv[level]) == 2;
     int left, right, top, bottom;
     int x, y;
@@ -410,7 +412,8 @@ void dirac_arithblk_writedata(DiracConte
 }
 
 static int encode_subband(DiracContext *s, int level,
-                          int orientation, int16_t *coeffs) {
+                          int orientation, int16_t *coeffs)
+{
     int xpos, ypos;
     PutBitContext pb;
 
@@ -556,7 +559,8 @@ static void blockglob_encode(DiracContex
 }
 
 static void dirac_pack_motion_vector(DiracContext *s, int ref, int dir,
-                                     int x, int y) {
+                                     int x, int y)
+{
     int res;
     const int refmask = (ref + 1) | DIRAC_REF_MASK_GLOBAL;
 
@@ -886,7 +890,8 @@ static int dirac_encode_frame(DiracConte
 }
 
 static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
-                        int buf_size, void *data) {
+                        int buf_size, void *data)
+{
     DiracContext *s = avctx->priv_data;
     AVFrame *picture = data;
     unsigned char *dst = &buf[5];



More information about the FFmpeg-soc mailing list