Commit 3ddd3389 authored by michael's avatar michael

more simplifications


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5795 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent db150fc8
...@@ -1369,9 +1369,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, ...@@ -1369,9 +1369,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
short predicted_dc; short predicted_dc;
/* validity flags for the left, up-left, up, and up-right fragments */
int fl, ful, fu, fur;
/* DC values for the left, up-left, up, and up-right fragments */ /* DC values for the left, up-left, up, and up-right fragments */
int vl, vul, vu, vur; int vl, vul, vu, vur;
...@@ -1384,26 +1381,24 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, ...@@ -1384,26 +1381,24 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
* 1: up multiplier * 1: up multiplier
* 2: up-right multiplier * 2: up-right multiplier
* 3: left multiplier * 3: left multiplier
* 4: mask
* 5: right bit shift divisor (e.g., 7 means >>=7, a.k.a. div by 128)
*/ */
int predictor_transform[16][6] = { int predictor_transform[16][4] = {
{ 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0},
{ 0, 0, 0, 1, 0, 0 }, // PL { 0, 0, 0,128}, // PL
{ 0, 0, 1, 0, 0, 0 }, // PUR { 0, 0,128, 0}, // PUR
{ 0, 0, 53, 75, 127, 7 }, // PUR|PL { 0, 0, 53, 75}, // PUR|PL
{ 0, 1, 0, 0, 0, 0 }, // PU { 0,128, 0, 0}, // PU
{ 0, 1, 0, 1, 1, 1 }, // PU|PL { 0, 64, 0, 64}, // PU|PL
{ 0, 1, 0, 0, 0, 0 }, // PU|PUR { 0,128, 0, 0}, // PU|PUR
{ 0, 0, 53, 75, 127, 7 }, // PU|PUR|PL { 0, 0, 53, 75}, // PU|PUR|PL
{ 1, 0, 0, 0, 0, 0 }, // PUL {128, 0, 0, 0}, // PUL
{ 0, 0, 0, 1, 0, 0 }, // PUL|PL { 0, 0, 0,128}, // PUL|PL
{ 1, 0, 1, 0, 1, 1 }, // PUL|PUR { 64, 0, 64, 0}, // PUL|PUR
{ 0, 0, 53, 75, 127, 7 }, // PUL|PUR|PL { 0, 0, 53, 75}, // PUL|PUR|PL
{ 0, 1, 0, 0, 0, 0 }, // PUL|PU { 0,128, 0, 0}, // PUL|PU
{-26, 29, 0, 29, 31, 5 }, // PUL|PU|PL {-104,116, 0,116}, // PUL|PU|PL
{ 3, 10, 3, 0, 15, 4 }, // PUL|PU|PUR { 24, 80, 24, 0}, // PUL|PU|PUR
{-26, 29, 0, 29, 31, 5 } // PUL|PU|PUR|PL {-104,116, 0,116} // PUL|PU|PUR|PL
}; };
/* This table shows which types of blocks can use other blocks for /* This table shows which types of blocks can use other blocks for
...@@ -1445,32 +1440,32 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, ...@@ -1445,32 +1440,32 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
current_frame_type = current_frame_type =
compatible_frame[s->all_fragments[i].coding_method]; compatible_frame[s->all_fragments[i].coding_method];
debug_dc_pred(" frag %d: group %d, orig DC = %d, ", debug_dc_pred(" frag %d: orig DC = %d, ",
i, -1, DC_COEFF(i)); i, DC_COEFF(i));
transform= 0; transform= 0;
if(x){ if(x){
l= i-1; l= i-1;
vl = DC_COEFF(l); vl = DC_COEFF(l);
fl = FRAME_CODED(l) && COMPATIBLE_FRAME(l); if(FRAME_CODED(l) && COMPATIBLE_FRAME(l))
transform |= fl*PL; transform |= PL;
} }
if(y){ if(y){
u= i-fragment_width; u= i-fragment_width;
vu = DC_COEFF(u); vu = DC_COEFF(u);
fu = FRAME_CODED(u) && COMPATIBLE_FRAME(u); if(FRAME_CODED(u) && COMPATIBLE_FRAME(u))
transform |= fu*PU; transform |= PU;
if(x){ if(x){
ul= i-fragment_width-1; ul= i-fragment_width-1;
vul = DC_COEFF(ul); vul = DC_COEFF(ul);
ful = FRAME_CODED(ul) && COMPATIBLE_FRAME(ul); if(FRAME_CODED(ul) && COMPATIBLE_FRAME(ul))
transform |= ful*PUL; transform |= PUL;
} }
if(x + 1 < fragment_width){ if(x + 1 < fragment_width){
ur= i-fragment_width+1; ur= i-fragment_width+1;
vur = DC_COEFF(ur); vur = DC_COEFF(ur);
fur = FRAME_CODED(ur) && COMPATIBLE_FRAME(ur); if(FRAME_CODED(ur) && COMPATIBLE_FRAME(ur))
transform |= fur*PUR; transform |= PUR;
} }
} }
...@@ -1493,13 +1488,8 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, ...@@ -1493,13 +1488,8 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
(predictor_transform[transform][2] * vur) + (predictor_transform[transform][2] * vur) +
(predictor_transform[transform][3] * vl); (predictor_transform[transform][3] * vl);
/* if there is a shift value in the transform, add predicted_dc += (predicted_dc >> 15) & 127;
* the sign bit before the shift */ predicted_dc >>= 7;
if (predictor_transform[transform][5] != 0) {
predicted_dc += ((predicted_dc >> 15) &
predictor_transform[transform][4]);
predicted_dc >>= predictor_transform[transform][5];
}
/* check for outranging on the [ul u l] and /* check for outranging on the [ul u l] and
* [ul u ur l] predictors */ * [ul u ur l] predictors */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment