h263dsp: K&R formatting cosmetics

Also remove array element numbering comments.
pull/73/head
Diego Biurrun 11 years ago
parent 0338c39698
commit cb56c3961b
  1. 52
      libavcodec/h263dsp.c

@ -24,11 +24,12 @@
#include "h263dsp.h"
const uint8_t ff_h263_loop_filter_strength[32] = {
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9,10,10,10,11,11,11,12,12,12
0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7,
7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12
};
static void h263_h_loop_filter_c(uint8_t *src, int stride, int qscale){
static void h263_h_loop_filter_c(uint8_t *src, int stride, int qscale)
{
int y;
const int strength = ff_h263_loop_filter_strength[qscale];
@ -40,16 +41,23 @@ static void h263_h_loop_filter_c(uint8_t *src, int stride, int qscale){
int p3 = src[y * stride + 1];
int d = (p0 - p3 + 4 * (p2 - p1)) / 8;
if (d<-2*strength) d1= 0;
else if(d<- strength) d1=-2*strength - d;
else if(d< strength) d1= d;
else if(d< 2*strength) d1= 2*strength - d;
else d1= 0;
if (d < -2 * strength)
d1 = 0;
else if (d < -strength)
d1 = -2 * strength - d;
else if (d < strength)
d1 = d;
else if (d < 2 * strength)
d1 = 2 * strength - d;
else
d1 = 0;
p1 += d1;
p2 -= d1;
if(p1&256) p1= ~(p1>>31);
if(p2&256) p2= ~(p2>>31);
if (p1 & 256)
p1 = ~(p1 >> 31);
if (p2 & 256)
p2 = ~(p2 >> 31);
src[y * stride - 1] = p1;
src[y * stride + 0] = p2;
@ -63,7 +71,8 @@ static void h263_h_loop_filter_c(uint8_t *src, int stride, int qscale){
}
}
static void h263_v_loop_filter_c(uint8_t *src, int stride, int qscale){
static void h263_v_loop_filter_c(uint8_t *src, int stride, int qscale)
{
int x;
const int strength = ff_h263_loop_filter_strength[qscale];
@ -75,16 +84,23 @@ static void h263_v_loop_filter_c(uint8_t *src, int stride, int qscale){
int p3 = src[x + 1 * stride];
int d = (p0 - p3 + 4 * (p2 - p1)) / 8;
if (d<-2*strength) d1= 0;
else if(d<- strength) d1=-2*strength - d;
else if(d< strength) d1= d;
else if(d< 2*strength) d1= 2*strength - d;
else d1= 0;
if (d < -2 * strength)
d1 = 0;
else if (d < -strength)
d1 = -2 * strength - d;
else if (d < strength)
d1 = d;
else if (d < 2 * strength)
d1 = 2 * strength - d;
else
d1 = 0;
p1 += d1;
p2 -= d1;
if(p1&256) p1= ~(p1>>31);
if(p2&256) p2= ~(p2>>31);
if (p1 & 256)
p1 = ~(p1 >> 31);
if (p2 & 256)
p2 = ~(p2 >> 31);
src[x - 1 * stride] = p1;
src[x + 0 * stride] = p2;

Loading…
Cancel
Save