mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
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:
parent
2654c3dadc
commit
b2c3575c8f
@ -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)) {
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user