From b1c72b633ef633a1ee6e83c3556393b6fe9068c4 Mon Sep 17 00:00:00 2001 From: Frank Galligan Date: Thu, 23 Jan 2014 14:59:00 -0800 Subject: Revert external frame buffer code. A future CL will add external frame buffers differently. Squash commit of four revert commits: Revert "Increase required number of external frame buffers" This reverts commit 9e41d569d7c84dd9ca8f0047c15377a883945685. Revert "Add external constants." This reverts commit bbf53047b03106e3c2e24b28cb836cc838db5ee8. Revert "Add frame buffer lru cache." This reverts commit fbada948fa345e67acf9aa41a8f9a78f5dfe8648. Conflicts: vpxdec.c Change-Id: I76fe42419923a6ea6c75d9997cbbf941d73d3005 Revert "Add support to pass in external frame buffers." This reverts commit 10f891696bc4c972c13cc9fde2c53470501a03e2. Conflicts: test/external_frame_buffer_test.cc vp9/common/vp9_alloccommon.c vp9/common/vp9_reconinter.c vp9/decoder/vp9_decodeframe.c vp9/encoder/vp9_onyx_if.c vp9/vp9_dx_iface.c vpx/vpx_decoder.h vpx/vpx_external_frame_buffer.h vpx_scale/generic/yv12config.c vpxdec.c Change-Id: I7434cf590f1c852b38569980e4247fad0d939c2e --- vpxdec.c | 66 +--------------------------------------------------------------- 1 file changed, 1 insertion(+), 65 deletions(-) (limited to 'vpxdec.c') diff --git a/vpxdec.c b/vpxdec.c index fc344a162..8a6c676e5 100644 --- a/vpxdec.c +++ b/vpxdec.c @@ -87,10 +87,6 @@ static const arg_def_t error_concealment = ARG_DEF(NULL, "error-concealment", 0, "Enable decoder error-concealment"); static const arg_def_t scalearg = ARG_DEF("S", "scale", 0, "Scale output frames uniformly"); -static const arg_def_t fb_arg = - ARG_DEF(NULL, "frame-buffers", 1, "Number of frame buffers to use"); -static const arg_def_t fb_lru_arg = - ARG_DEF(NULL, "frame-buffers-lru", 1, "Turn on/off frame buffer lru"); static const arg_def_t md5arg = ARG_DEF(NULL, "md5", 0, @@ -99,7 +95,7 @@ static const arg_def_t md5arg = ARG_DEF(NULL, "md5", 0, static const arg_def_t *all_args[] = { &codecarg, &use_yv12, &use_i420, &flipuvarg, &noblitarg, &progressarg, &limitarg, &skiparg, &postprocarg, &summaryarg, &outputfile, - &threadsarg, &verbosearg, &scalearg, &fb_arg, &fb_lru_arg, + &threadsarg, &verbosearg, &scalearg, &md5arg, &error_concealment, NULL @@ -329,31 +325,6 @@ void show_progress(int frame_in, int frame_out, unsigned long dx_time) { (float)frame_out * 1000000.0 / (float)dx_time); } -// Called by libvpx if the frame buffer size needs to increase. -// -// Parameters: -// user_priv Data passed into libvpx. -// new_size Minimum size needed by libvpx to decompress the next frame. -// fb Pointer to the frame buffer to update. -// -// Returns 0 on success. Returns < 0 on failure. -int realloc_vp9_frame_buffer(void *user_priv, size_t new_size, - vpx_codec_frame_buffer_t *fb) { - (void)user_priv; - if (!fb) - return -1; - - free(fb->data); - fb->data = (uint8_t*)malloc(new_size); - if (!fb->data) { - fb->size = 0; - return -1; - } - - fb->size = new_size; - return 0; -} - void generate_filename(const char *pattern, char *out, size_t q_len, unsigned int d_w, unsigned int d_h, unsigned int frame_in) { @@ -499,9 +470,6 @@ int main_loop(int argc, const char **argv_) { int do_scale = 0; vpx_image_t *scaled_img = NULL; int frame_avail, got_data; - int num_external_frame_buffers = 0; - int fb_lru_cache = 0; - vpx_codec_frame_buffer_t *frame_buffers = NULL; const char *outfile_pattern = NULL; char outfile_name[PATH_MAX] = {0}; @@ -568,10 +536,6 @@ int main_loop(int argc, const char **argv_) { quiet = 0; else if (arg_match(&arg, &scalearg, argi)) do_scale = 1; - else if (arg_match(&arg, &fb_arg, argi)) - num_external_frame_buffers = arg_parse_uint(&arg); - else if (arg_match(&arg, &fb_lru_arg, argi)) - fb_lru_cache = arg_parse_uint(&arg); #if CONFIG_VP8_DECODER else if (arg_match(&arg, &addnoise_level, argi)) { @@ -762,30 +726,6 @@ int main_loop(int argc, const char **argv_) { arg_skip--; } - if (num_external_frame_buffers > 0) { - // Allocate the frame buffer list, setting all of the values to 0. - // Including the size of frame buffers. Libvpx will request the - // application to realloc the frame buffer data if the size is too small. - frame_buffers = (vpx_codec_frame_buffer_t*)calloc( - num_external_frame_buffers, sizeof(*frame_buffers)); - if (vpx_codec_set_frame_buffers(&decoder, frame_buffers, - num_external_frame_buffers, - realloc_vp9_frame_buffer, - NULL)) { - fprintf(stderr, "Failed to configure external frame buffers: %s\n", - vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } - } - - if (fb_lru_cache > 0 && - vpx_codec_control(&decoder, VP9D_SET_FRAME_BUFFER_LRU_CACHE, - fb_lru_cache)) { - fprintf(stderr, "Failed to set frame buffer lru cache: %s\n", - vpx_codec_error(&decoder)); - return EXIT_FAILURE; - } - frame_avail = 1; got_data = 0; @@ -942,10 +882,6 @@ fail: free(buf); if (scaled_img) vpx_img_free(scaled_img); - for (i = 0; i < num_external_frame_buffers; ++i) { - free(frame_buffers[i].data); - } - free(frame_buffers); fclose(infile); free(argv); -- cgit v1.2.3