Signed-off-by: Marton Balint <cus@passwd.hu>
Marton Balint authored on 2013/10/03 05:23:54... | ... |
@@ -183,15 +183,15 @@ static void gen_waveform(HistogramContext *h, AVFrame *inpicref, AVFrame *outpic |
183 | 183 |
int component, int intensity, int offset, int col_mode) |
184 | 184 |
{ |
185 | 185 |
const int plane = h->desc->comp[component].plane; |
186 |
+ const int is_chroma = (component == 1 || component == 2); |
|
187 |
+ const int shift_w = (is_chroma ? h->desc->log2_chroma_w : 0); |
|
188 |
+ const int shift_h = (is_chroma ? h->desc->log2_chroma_h : 0); |
|
186 | 189 |
const int src_linesize = inpicref->linesize[plane]; |
187 | 190 |
const int dst_linesize = outpicref->linesize[plane]; |
188 | 191 |
uint8_t *src_data = inpicref->data[plane]; |
189 |
- uint8_t *dst_data = outpicref->data[plane] + (col_mode ? offset * dst_linesize : offset); |
|
192 |
+ uint8_t *dst_data = outpicref->data[plane] + (col_mode ? (offset >> shift_h) * dst_linesize : offset >> shift_w); |
|
190 | 193 |
uint8_t * const dst_line = dst_data; |
191 | 194 |
const uint8_t max = 255 - intensity; |
192 |
- const int is_chroma = (component == 1 || component == 2); |
|
193 |
- const int shift_w = (is_chroma ? h->desc->log2_chroma_w : 0); |
|
194 |
- const int shift_h = (is_chroma ? h->desc->log2_chroma_h : 0); |
|
195 | 195 |
const int src_h = FF_CEIL_RSHIFT(inpicref->height, shift_h); |
196 | 196 |
const int src_w = FF_CEIL_RSHIFT(inpicref->width, shift_w); |
197 | 197 |
uint8_t *dst, *p; |