Merge "Fix odd-sized image support in decoder examples"
This commit is contained in:
Коммит
e47306eb7a
|
@ -34,8 +34,8 @@ MD5Init(&md5);
|
||||||
for(plane=0; plane < 3; plane++) {
|
for(plane=0; plane < 3; plane++) {
|
||||||
unsigned char *buf =img->planes[plane];
|
unsigned char *buf =img->planes[plane];
|
||||||
|
|
||||||
for(y=0; y<img->d_h >> (plane?1:0); y++) {
|
for(y=0; y < (plane ? (img->d_h + 1) >> 1 : img->d_h); y++) {
|
||||||
MD5Update(&md5, buf, img->d_w >> (plane?1:0));
|
MD5Update(&md5, buf, (plane ? (img->d_w + 1) >> 1 : img->d_w));
|
||||||
buf += img->stride[plane];
|
buf += img->stride[plane];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,9 @@ while((img = vpx_codec_get_frame(&codec, &iter))) {
|
||||||
for(plane=0; plane < 3; plane++) {
|
for(plane=0; plane < 3; plane++) {
|
||||||
unsigned char *buf =img->planes[plane];
|
unsigned char *buf =img->planes[plane];
|
||||||
|
|
||||||
for(y=0; y<img->d_h >> (plane?1:0); y++) {
|
for(y=0; y < (plane ? (img->d_h + 1) >> 1 : img->d_h); y++) {
|
||||||
if(fwrite(buf, 1, img->d_w >> (plane?1:0), outfile));
|
if(fwrite(buf, 1, (plane ? (img->d_w + 1) >> 1 : img->d_w),
|
||||||
|
outfile));
|
||||||
buf += img->stride[plane];
|
buf += img->stride[plane];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче