Removing WRITE_RECON_BUFFER related code.

That code is not used, we could easily return it back using vpx_img_write()
function.

Change-Id: Id107875c6feab6ad245a518f6b437b6ed4b1246d
This commit is contained in:
Dmitry Kovalev 2014-04-25 16:43:58 -07:00
Родитель fae988dc3b
Коммит 571c70e554
1 изменённых файлов: 0 добавлений и 92 удалений

Просмотреть файл

@ -32,74 +32,6 @@
#include "vp9/decoder/vp9_detokenize.h"
#include "vp9/decoder/vp9_dthread.h"
#define WRITE_RECON_BUFFER 0
#if WRITE_RECON_BUFFER == 1
static void recon_write_yuv_frame(const char *name,
const YV12_BUFFER_CONFIG *s,
int w, int _h) {
FILE *yuv_file = fopen(name, "ab");
const uint8_t *src = s->y_buffer;
int h = _h;
do {
fwrite(src, w, 1, yuv_file);
src += s->y_stride;
} while (--h);
src = s->u_buffer;
h = (_h + 1) >> 1;
w = (w + 1) >> 1;
do {
fwrite(src, w, 1, yuv_file);
src += s->uv_stride;
} while (--h);
src = s->v_buffer;
h = (_h + 1) >> 1;
do {
fwrite(src, w, 1, yuv_file);
src += s->uv_stride;
} while (--h);
fclose(yuv_file);
}
#endif
#if WRITE_RECON_BUFFER == 2
void write_dx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame) {
// write the frame
FILE *yframe;
int i;
char filename[255];
snprintf(filename, sizeof(filename)-1, "dx\\y%04d.raw", this_frame);
yframe = fopen(filename, "wb");
for (i = 0; i < frame->y_height; i++)
fwrite(frame->y_buffer + i * frame->y_stride,
frame->y_width, 1, yframe);
fclose(yframe);
snprintf(filename, sizeof(filename)-1, "dx\\u%04d.raw", this_frame);
yframe = fopen(filename, "wb");
for (i = 0; i < frame->uv_height; i++)
fwrite(frame->u_buffer + i * frame->uv_stride,
frame->uv_width, 1, yframe);
fclose(yframe);
snprintf(filename, sizeof(filename)-1, "dx\\v%04d.raw", this_frame);
yframe = fopen(filename, "wb");
for (i = 0; i < frame->uv_height; i++)
fwrite(frame->v_buffer + i * frame->uv_stride,
frame->uv_width, 1, yframe);
fclose(yframe);
}
#endif
void vp9_initialize_dec() {
static int init_done = 0;
@ -348,15 +280,6 @@ int vp9_receive_compressed_data(VP9Decoder *pbi,
swap_frame_buffers(pbi);
#if WRITE_RECON_BUFFER == 2
if (cm->show_frame)
write_dx_frame_to_file(cm->frame_to_show,
cm->current_video_frame);
else
write_dx_frame_to_file(cm->frame_to_show,
cm->current_video_frame + 1000);
#endif
if (!pbi->do_loopfilter_inline) {
// If multiple threads are used to decode tiles, then we use those threads
// to do parallel loopfiltering.
@ -367,21 +290,6 @@ int vp9_receive_compressed_data(VP9Decoder *pbi,
}
}
#if WRITE_RECON_BUFFER == 2
if (cm->show_frame)
write_dx_frame_to_file(cm->frame_to_show,
cm->current_video_frame + 2000);
else
write_dx_frame_to_file(cm->frame_to_show,
cm->current_video_frame + 3000);
#endif
#if WRITE_RECON_BUFFER == 1
if (cm->show_frame)
recon_write_yuv_frame("recon.yuv", cm->frame_to_show,
cm->width, cm->height);
#endif
vp9_clear_system_state();
cm->last_width = cm->width;