Merge commit 'f919cc7df6ab844bc12f89fe7bef4fb915a47725'
* commit 'f919cc7df6ab844bc12f89fe7bef4fb915a47725': fate: fix acodec/vsynth tests for make 3.81 pcm_mpeg: fix number of consumed bytes to include the header. avfilter: include required header file avfilter.h in video.h x86: Avoid movs on BUTTERFLYPS when in AVX mode x86: use new schema for ASM macros fate: convert codec-regression.sh to makefile rules fate: allow tests to specify unit size for psnr comparison fate: teach videogen/rotozoom to output a single raw video stream http: Add support for reusing the http socket for subsequent requests http: Add support for using persistent connections Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@ -117,20 +117,37 @@ static void pgmyuv_save(const char *filename, int w, int h,
|
||||
|
||||
rgb24_to_yuv420p(lum_tab, cb_tab, cr_tab, rgb_tab, w, h);
|
||||
|
||||
f = fopen(filename, "wb");
|
||||
fprintf(f, "P5\n%d %d\n%d\n", w, h * 3 / 2, 255);
|
||||
if (filename) {
|
||||
f = fopen(filename, "wb");
|
||||
fprintf(f, "P5\n%d %d\n%d\n", w, h * 3 / 2, 255);
|
||||
} else {
|
||||
f = stdout;
|
||||
}
|
||||
|
||||
err_if(fwrite(lum_tab, 1, w * h, f) != w * h);
|
||||
h2 = h / 2;
|
||||
w2 = w / 2;
|
||||
cb = cb_tab;
|
||||
cr = cr_tab;
|
||||
for (i = 0; i < h2; i++) {
|
||||
err_if(fwrite(cb, 1, w2, f) != w2);
|
||||
err_if(fwrite(cr, 1, w2, f) != w2);
|
||||
cb += w2;
|
||||
cr += w2;
|
||||
|
||||
if (filename) {
|
||||
for (i = 0; i < h2; i++) {
|
||||
err_if(fwrite(cb, 1, w2, f) != w2);
|
||||
err_if(fwrite(cr, 1, w2, f) != w2);
|
||||
cb += w2;
|
||||
cr += w2;
|
||||
}
|
||||
fclose(f);
|
||||
} else {
|
||||
for (i = 0; i < h2; i++) {
|
||||
err_if(fwrite(cb, 1, w2, f) != w2);
|
||||
cb += w2;
|
||||
}
|
||||
for (i = 0; i < h2; i++) {
|
||||
err_if(fwrite(cr, 1, w2, f) != w2);
|
||||
cr += w2;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
free(lum_tab);
|
||||
free(cb_tab);
|
||||
|
Reference in New Issue
Block a user