fix rescaling-with-alpha inaccuracy

(still missing YUVA decoding case for now)

https://code.google.com/p/webp/issues/detail?id=160

Change-Id: If723b4a5c0a303d0853ec9d839f995adce056095
This commit is contained in:
Pascal Massimino
2013-07-26 12:05:42 -07:00
committed by skal
parent 11249abfc7
commit 8dcae8b3cf
10 changed files with 342 additions and 37 deletions

View File

@ -38,7 +38,8 @@ typedef struct {
} WebPRescaler;
// Initialize a rescaler given scratch area 'work' and dimensions of src & dst.
void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height,
void WebPRescalerInit(WebPRescaler* const rescaler,
int src_width, int src_height,
uint8_t* const dst,
int dst_width, int dst_height, int dst_stride,
int num_channels,
@ -46,6 +47,11 @@ void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height,
int y_add, int y_sub,
int32_t* const work);
// Returns the number of input lines needed next to produce one output line,
// considering that the maximum available input lines are 'max_num_lines'.
int WebPRescaleNeededLines(const WebPRescaler* const rescaler,
int max_num_lines);
// Import a row of data and save its contribution in the rescaler.
// 'channel' denotes the channel number to be imported.
void WebPRescalerImportRow(WebPRescaler* const rescaler,
@ -64,10 +70,10 @@ int WebPRescalerHasPendingOutput(const WebPRescaler* const rescaler) {
// Export one row from rescaler. Returns the pointer where output was written,
// or NULL if no row was pending.
uint8_t* WebPRescalerExportRow(WebPRescaler* const wrk);
uint8_t* WebPRescalerExportRow(WebPRescaler* const rescaler);
// Export as many rows as possible. Return the numbers of rows written.
int WebPRescalerExport(WebPRescaler* const wrk);
int WebPRescalerExport(WebPRescaler* const rescaler);
//------------------------------------------------------------------------------