add a 'last_y' field to WebPDecParams

this allows to keep an exact track of the last displayable pixel row

Change-Id: I590306735a82b9249e7bc9fe64eeb3e5bea3376b
This commit is contained in:
Pascal Massimino 2011-03-23 17:24:31 -07:00
parent 2654c3dadc
commit b2c3575c8f
2 changed files with 5 additions and 0 deletions

View File

@ -186,6 +186,7 @@ static int CustomPut(const VP8Io* io) {
return 0; return 0;
} }
p->last_y = io->mb_y + io->mb_h; // a priori guess
if (p->mode == MODE_YUV) { if (p->mode == MODE_YUV) {
uint8_t* const y_dst = p->output + io->mb_y * p->stride; uint8_t* const y_dst = p->output + io->mb_y * p->stride;
uint8_t* const u_dst = p->u + (io->mb_y >> 1) * p->u_stride; uint8_t* const u_dst = p->u + (io->mb_y >> 1) * p->u_stride;
@ -237,6 +238,9 @@ static int CustomPut(const VP8Io* io) {
memcpy(p->top_y, cur_y, w * sizeof(*p->top_y)); memcpy(p->top_y, cur_y, w * sizeof(*p->top_y));
memcpy(p->top_u, cur_u, uv_w * sizeof(*p->top_u)); memcpy(p->top_u, cur_u, uv_w * sizeof(*p->top_u));
memcpy(p->top_v, cur_v, uv_w * sizeof(*p->top_v)); memcpy(p->top_v, cur_v, uv_w * sizeof(*p->top_v));
// The fancy upscaler leaves a row unfinished behind
// (except for the very last row)
p->last_y -= 1;
} else { } else {
// Process the very last row of even-sized picture // Process the very last row of even-sized picture
if (!(y_end & 1)) { if (!(y_end & 1)) {

View File

@ -31,6 +31,7 @@ typedef struct {
int u_stride; int u_stride;
int v_stride; int v_stride;
WEBP_CSP_MODE mode; WEBP_CSP_MODE mode;
int last_y; // coordinate of the line that was last output
} WebPDecParams; } WebPDecParams;
// If a RIFF container is detected, validate it and skip over it. Returns // If a RIFF container is detected, validate it and skip over it. Returns