Write only visible area (for better comparison with rec.yuv).
Change-Id: I32bf4ee532a15af78619cbcd8a193224029fab50
This commit is contained in:
Родитель
5a9da2d906
Коммит
2f6fce3e5a
|
@ -32,29 +32,32 @@
|
||||||
|
|
||||||
#define WRITE_RECON_BUFFER 0
|
#define WRITE_RECON_BUFFER 0
|
||||||
#if WRITE_RECON_BUFFER == 1
|
#if WRITE_RECON_BUFFER == 1
|
||||||
static void recon_write_yuv_frame(char *name, YV12_BUFFER_CONFIG *s) {
|
static void recon_write_yuv_frame(const char *name,
|
||||||
|
const YV12_BUFFER_CONFIG *s,
|
||||||
|
int w, int _h) {
|
||||||
FILE *yuv_file = fopen((char *)name, "ab");
|
FILE *yuv_file = fopen((char *)name, "ab");
|
||||||
uint8_t *src = s->y_buffer;
|
const uint8_t *src = s->y_buffer;
|
||||||
int h = s->y_height;
|
int h = _h;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
fwrite(src, s->y_width, 1, yuv_file);
|
fwrite(src, w, 1, yuv_file);
|
||||||
src += s->y_stride;
|
src += s->y_stride;
|
||||||
} while (--h);
|
} while (--h);
|
||||||
|
|
||||||
src = s->u_buffer;
|
src = s->u_buffer;
|
||||||
h = s->uv_height;
|
h = (_h + 1) >> 1;
|
||||||
|
w = (w + 1) >> 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
fwrite(src, s->uv_width, 1, yuv_file);
|
fwrite(src, w, 1, yuv_file);
|
||||||
src += s->uv_stride;
|
src += s->uv_stride;
|
||||||
} while (--h);
|
} while (--h);
|
||||||
|
|
||||||
src = s->v_buffer;
|
src = s->v_buffer;
|
||||||
h = s->uv_height;
|
h = (_h + 1) >> 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
fwrite(src, s->uv_width, 1, yuv_file);
|
fwrite(src, w, 1, yuv_file);
|
||||||
src += s->uv_stride;
|
src += s->uv_stride;
|
||||||
} while (--h);
|
} while (--h);
|
||||||
|
|
||||||
|
@ -344,7 +347,8 @@ int vp9_receive_compressed_data(VP9D_PTR ptr, unsigned long size,
|
||||||
|
|
||||||
#if WRITE_RECON_BUFFER == 1
|
#if WRITE_RECON_BUFFER == 1
|
||||||
if (cm->show_frame)
|
if (cm->show_frame)
|
||||||
recon_write_yuv_frame("recon.yuv", cm->frame_to_show);
|
recon_write_yuv_frame("recon.yuv", cm->frame_to_show,
|
||||||
|
cm->Width, cm->Height);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vp9_clear_system_state();
|
vp9_clear_system_state();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче