cosmetics: Break some overly long lines.
[ffmpeg.git] / libavcodec / mpegvideo_common.h
index 0698e1d..4bf0581 100644 (file)
@@ -27,8 +27,8 @@
  * The simplest mpeg encoder (well, it was the simplest!).
  */
 
-#ifndef MPEGVIDEO_COMMON_H
-#define MPEGVIDEO_COMMON_H
+#ifndef FFMPEG_MPEGVIDEO_COMMON_H
+#define FFMPEG_MPEGVIDEO_COMMON_H
 
 #include "avcodec.h"
 #include "dsputil.h"
@@ -238,14 +238,16 @@ static inline int hpel_motion(MpegEncContext *s,
 }
 
 /* apply one mpeg motion vector to the three components */
-static av_always_inline void mpeg_motion(MpegEncContext *s,
-                               uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
-                               int field_based, int bottom_field, int field_select,
-                               uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
-                               int motion_x, int motion_y, int h)
+static av_always_inline
+void mpeg_motion(MpegEncContext *s,
+                 uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
+                 int field_based, int bottom_field, int field_select,
+                 uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
+                 int motion_x, int motion_y, int h)
 {
     uint8_t *ptr_y, *ptr_cb, *ptr_cr;
-    int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos, uvlinesize, linesize;
+    int dxy, uvdxy, mx, my, src_x, src_y,
+        uvsrc_x, uvsrc_y, v_edge_pos, uvlinesize, linesize;
 
 #if 0
 if(s->quarter_sample)
@@ -312,18 +314,27 @@ if(s->quarter_sample)
        || (unsigned)src_y >    v_edge_pos - (motion_y&1) - h){
             if(s->codec_id == CODEC_ID_MPEG2VIDEO ||
                s->codec_id == CODEC_ID_MPEG1VIDEO){
-                av_log(s->avctx,AV_LOG_DEBUG,"MPEG motion vector out of boundary\n");
+                av_log(s->avctx,AV_LOG_DEBUG,
+                        "MPEG motion vector out of boundary\n");
                 return ;
             }
-            ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
-                             src_x, src_y<<field_based, s->h_edge_pos, s->v_edge_pos);
+            ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize,
+                                17, 17+field_based,
+                                src_x, src_y<<field_based,
+                                s->h_edge_pos, s->v_edge_pos);
             ptr_y = s->edge_emu_buffer;
             if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
                 uint8_t *uvbuf= s->edge_emu_buffer+18*s->linesize;
-                ff_emulated_edge_mc(uvbuf  , ptr_cb, s->uvlinesize, 9, 9+field_based,
-                                 uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
-                ff_emulated_edge_mc(uvbuf+16, ptr_cr, s->uvlinesize, 9, 9+field_based,
-                                 uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
+                ff_emulated_edge_mc(uvbuf ,
+                                    ptr_cb, s->uvlinesize,
+                                    9, 9+field_based,
+                                    uvsrc_x, uvsrc_y<<field_based,
+                                    s->h_edge_pos>>1, s->v_edge_pos>>1);
+                ff_emulated_edge_mc(uvbuf+16,
+                                    ptr_cr, s->uvlinesize,
+                                    9, 9+field_based,
+                                    uvsrc_x, uvsrc_y<<field_based,
+                                    s->h_edge_pos>>1, s->v_edge_pos>>1);
                 ptr_cb= uvbuf;
                 ptr_cr= uvbuf+16;
             }
@@ -344,10 +355,13 @@ if(s->quarter_sample)
     pix_op[0][dxy](dest_y, ptr_y, linesize, h);
 
     if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
-        pix_op[s->chroma_x_shift][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift);
-        pix_op[s->chroma_x_shift][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift);
+        pix_op[s->chroma_x_shift][uvdxy]
+                (dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift);
+        pix_op[s->chroma_x_shift][uvdxy]
+                (dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift);
     }
-    if((ENABLE_H261_ENCODER || ENABLE_H261_DECODER) && s->out_format == FMT_H261){
+    if((ENABLE_H261_ENCODER || ENABLE_H261_DECODER) &&
+         s->out_format == FMT_H261){
         ff_h261_loop_filter(s);
     }
 }
@@ -482,15 +496,20 @@ static inline void qpel_motion(MpegEncContext *s,
 
     if(   (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 16
        || (unsigned)src_y >    v_edge_pos - (motion_y&3) - h  ){
-        ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
-                         src_x, src_y<<field_based, s->h_edge_pos, s->v_edge_pos);
+        ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize,
+                            17, 17+field_based, src_x, src_y<<field_based,
+                            s->h_edge_pos, s->v_edge_pos);
         ptr_y= s->edge_emu_buffer;
         if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
             uint8_t *uvbuf= s->edge_emu_buffer + 18*s->linesize;
-            ff_emulated_edge_mc(uvbuf, ptr_cb, s->uvlinesize, 9, 9 + field_based,
-                             uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
-            ff_emulated_edge_mc(uvbuf + 16, ptr_cr, s->uvlinesize, 9, 9 + field_based,
-                             uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
+            ff_emulated_edge_mc(uvbuf, ptr_cb, s->uvlinesize,
+                                9, 9 + field_based,
+                                uvsrc_x, uvsrc_y<<field_based,
+                                s->h_edge_pos>>1, s->v_edge_pos>>1);
+            ff_emulated_edge_mc(uvbuf + 16, ptr_cr, s->uvlinesize,
+                                9, 9 + field_based,
+                                uvsrc_x, uvsrc_y<<field_based,
+                                s->h_edge_pos>>1, s->v_edge_pos>>1);
             ptr_cb= uvbuf;
             ptr_cr= uvbuf + 16;
         }
@@ -555,7 +574,9 @@ static inline void chroma_4mv_motion(MpegEncContext *s,
     if(s->flags&CODEC_FLAG_EMU_EDGE){
         if(   (unsigned)src_x > (s->h_edge_pos>>1) - (dxy &1) - 8
            || (unsigned)src_y > (s->v_edge_pos>>1) - (dxy>>1) - 8){
-            ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
+            ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,
+                                9, 9, src_x, src_y,
+                                s->h_edge_pos>>1, s->v_edge_pos>>1);
             ptr= s->edge_emu_buffer;
             emu=1;
         }
@@ -564,7 +585,9 @@ static inline void chroma_4mv_motion(MpegEncContext *s,
 
     ptr = ref_picture[2] + offset;
     if(emu){
-        ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
+        ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,
+                            9, 9, src_x, src_y,
+                            s->h_edge_pos>>1, s->v_edge_pos>>1);
         ptr= s->edge_emu_buffer;
     }
     pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8);
@@ -595,9 +618,11 @@ static inline void prefetch_motion(MpegEncContext *s, uint8_t **pix, int dir){
  * the motion vectors are taken from s->mv and the MV type from s->mv_type
  */
 static inline void MPV_motion(MpegEncContext *s,
-                              uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
-                              int dir, uint8_t **ref_picture,
-                              op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16])
+                              uint8_t *dest_y, uint8_t *dest_cb,
+                              uint8_t *dest_cr, int dir,
+                              uint8_t **ref_picture,
+                              op_pixels_func (*pix_op)[4],
+                              qpel_mc_func (*qpix_op)[16])
 {
     int dxy, mx, my, src_x, src_y, motion_x, motion_y;
     int mb_x, mb_y, i;
@@ -608,7 +633,7 @@ static inline void MPV_motion(MpegEncContext *s,
 
     prefetch_motion(s, ref_picture, dir);
 
-    if(s->obmc && s->pict_type != B_TYPE){
+    if(s->obmc && s->pict_type != FF_B_TYPE){
         int16_t mv_cache[4][4][2];
         const int xy= s->mb_x + s->mb_y*s->mb_stride;
         const int mot_stride= s->b8_stride;
@@ -720,7 +745,10 @@ static inline void MPV_motion(MpegEncContext *s,
                 if(s->flags&CODEC_FLAG_EMU_EDGE){
                     if(   (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 8
                        || (unsigned)src_y > s->v_edge_pos - (motion_y&3) - 8 ){
-                        ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->linesize, 9, 9, src_x, src_y, s->h_edge_pos, s->v_edge_pos);
+                        ff_emulated_edge_mc(s->edge_emu_buffer, ptr,
+                                            s->linesize, 9, 9,
+                                            src_x, src_y,
+                                            s->h_edge_pos, s->v_edge_pos);
                         ptr= s->edge_emu_buffer;
                     }
                 }
@@ -770,7 +798,7 @@ static inline void MPV_motion(MpegEncContext *s,
                             s->mv[dir][1][0], s->mv[dir][1][1], 8);
             }
         } else {
-            if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != B_TYPE && !s->first_field){
+            if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != FF_B_TYPE && !s->first_field){
                 ref_picture= s->current_picture_ptr->data;
             }
 
@@ -784,7 +812,8 @@ static inline void MPV_motion(MpegEncContext *s,
         for(i=0; i<2; i++){
             uint8_t ** ref2picture;
 
-            if(s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == B_TYPE || s->first_field){
+            if(s->picture_structure == s->field_select[dir][i] + 1
+               || s->pict_type == FF_B_TYPE || s->first_field){
                 ref2picture= ref_picture;
             }else{
                 ref2picture= s->current_picture_ptr->data;
@@ -833,4 +862,4 @@ static inline void MPV_motion(MpegEncContext *s,
     }
 }
 
-#endif /* MPEGVIDEO_COMMON_H */
+#endif /* FFMPEG_MPEGVIDEO_COMMON_H */