]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dsputil.c
Define POW_SF2_ZERO in aac.h and use for ff_aac_pow2sf_tabp[] offsets instead
[ffmpeg] / libavcodec / dsputil.c
index 15925f656bf6f63e0b438be86733b6e553bea4be..dbfc8ce162d31ef1d410bf46d776b24b4502e7b4 100644 (file)
@@ -298,17 +298,11 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
 
 /* draw the edges of width 'w' of an image of size width, height */
 //FIXME check that this is ok for mpeg4 interlaced
-static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w)
+static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w, int sides)
 {
     uint8_t *ptr, *last_line;
     int i;
 
-    last_line = buf + (height - 1) * wrap;
-    for(i=0;i<w;i++) {
-        /* top and bottom */
-        memcpy(buf - (i + 1) * wrap, buf, width);
-        memcpy(last_line + (i + 1) * wrap, last_line, width);
-    }
     /* left and right */
     ptr = buf;
     for(i=0;i<height;i++) {
@@ -316,13 +310,16 @@ static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w)
         memset(ptr + width, ptr[width-1], w);
         ptr += wrap;
     }
-    /* corners */
-    for(i=0;i<w;i++) {
-        memset(buf - (i + 1) * wrap - w, buf[0], w); /* top left */
-        memset(buf - (i + 1) * wrap + width, buf[width-1], w); /* top right */
-        memset(last_line + (i + 1) * wrap - w, last_line[0], w); /* top left */
-        memset(last_line + (i + 1) * wrap + width, last_line[width-1], w); /* top right */
-    }
+
+    /* top and bottom + corners */
+    buf -= w;
+    last_line = buf + (height - 1) * wrap;
+    if (sides & EDGE_TOP)
+        for(i = 0; i < w; i++)
+            memcpy(buf - (i + 1) * wrap, buf, width + w + w); // top
+    if (sides & EDGE_BOTTOM)
+        for (i = 0; i < w; i++)
+            memcpy(last_line + (i + 1) * wrap, last_line, width + w + w); // bottom
 }
 
 /**
@@ -2103,7 +2100,6 @@ QPEL_MC(0, avg_       , _       , op_avg)
 #define put_no_rnd_qpel8_mc00_c  ff_put_pixels8x8_c
 #define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_c
 
-#if 1
 #define H264_LOWPASS(OPNAME, OP, OP2) \
 static av_unused void OPNAME ## h264_qpel2_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
     const int h=2;\
@@ -2525,7 +2521,6 @@ H264_MC(avg_, 16)
 #undef op_put
 #undef op2_avg
 #undef op2_put
-#endif
 
 #define put_h264_qpel8_mc00_c  ff_put_pixels8x8_c
 #define avg_h264_qpel8_mc00_c  ff_avg_pixels8x8_c
@@ -3830,7 +3825,7 @@ static inline uint32_t clipf_c_one(uint32_t a, uint32_t mini,
 {
 
     if(a > mini) return mini;
-    else if((a^(1<<31)) > maxisign) return maxi;
+    else if((a^(1U<<31)) > maxisign) return maxi;
     else return a;
 }
 
@@ -3838,7 +3833,7 @@ static void vector_clipf_c_opposite_sign(float *dst, const float *src, float *mi
     int i;
     uint32_t mini = *(uint32_t*)min;
     uint32_t maxi = *(uint32_t*)max;
-    uint32_t maxisign = maxi ^ (1<<31);
+    uint32_t maxisign = maxi ^ (1U<<31);
     uint32_t *dsti = (uint32_t*)dst;
     const uint32_t *srci = (const uint32_t*)src;
     for(i=0; i<len; i+=8) {
@@ -4064,7 +4059,7 @@ int ff_check_alignment(void){
                 "Compiler did not align stack variables. Libavcodec has been miscompiled\n"
                 "and may be very slow or crash. This is not a bug in libavcodec,\n"
                 "but in the compiler. You may try recompiling using gcc >= 4.2.\n"
-                "Do not report crashes to FFmpeg developers.\n");
+                "Do not report crashes to Libav developers.\n");
 #endif
             did_fail=1;
         }