vp9_onyxd_if.c 11.8 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5
6
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
7
 *  in the file PATENTS.  All contributing project authors may
8
 *  be found in the AUTHORS file in the root of the source tree.
John Koleszar's avatar
John Koleszar committed
9
10
11
 */


12
#include "vp9/common/vp9_onyxc_int.h"
John Koleszar's avatar
John Koleszar committed
13
#if CONFIG_POSTPROC
14
#include "vp9/common/vp9_postproc.h"
John Koleszar's avatar
John Koleszar committed
15
#endif
16
#include "vp9/common/vp9_onyxd.h"
17
#include "vp9/decoder/vp9_onyxd_int.h"
John Koleszar's avatar
John Koleszar committed
18
#include "vpx_mem/vpx_mem.h"
19
20
21
#include "vp9/common/vp9_alloccommon.h"
#include "vp9/common/vp9_loopfilter.h"
#include "vp9/common/vp9_swapyv12buffer.h"
John Koleszar's avatar
John Koleszar committed
22
#include <stdio.h>
Henrik Lundin's avatar
Henrik Lundin committed
23
#include <assert.h>
24

25
#include "vp9/common/vp9_quant_common.h"
Johann's avatar
Johann committed
26
#include "vpx_scale/vpx_scale.h"
27
#include "vp9/common/vp9_systemdependent.h"
John Koleszar's avatar
John Koleszar committed
28
#include "vpx_ports/vpx_timer.h"
29
#include "vp9/decoder/vp9_decodframe.h"
30
#include "vp9/decoder/vp9_detokenize.h"
31
#include "./vpx_scale_rtcd.h"
John Koleszar's avatar
John Koleszar committed
32

33
static int get_free_fb(VP9_COMMON *cm);
John Koleszar's avatar
John Koleszar committed
34
static void ref_cnt_fb(int *buf, int *idx, int new_idx);
John Koleszar's avatar
John Koleszar committed
35

36
37
#define WRITE_RECON_BUFFER 0
#if WRITE_RECON_BUFFER == 1
38
static void recon_write_yuv_frame(char *name, YV12_BUFFER_CONFIG *s) {
John Koleszar's avatar
John Koleszar committed
39
40
41
  FILE *yuv_file = fopen((char *)name, "ab");
  unsigned char *src = s->y_buffer;
  int h = s->y_height;
42

John Koleszar's avatar
John Koleszar committed
43
44
45
46
  do {
    fwrite(src, s->y_width, 1,  yuv_file);
    src += s->y_stride;
  } while (--h);
47

John Koleszar's avatar
John Koleszar committed
48
49
  src = s->u_buffer;
  h = s->uv_height;
50

John Koleszar's avatar
John Koleszar committed
51
52
53
54
  do {
    fwrite(src, s->uv_width, 1,  yuv_file);
    src += s->uv_stride;
  } while (--h);
55

John Koleszar's avatar
John Koleszar committed
56
57
  src = s->v_buffer;
  h = s->uv_height;
58

John Koleszar's avatar
John Koleszar committed
59
60
61
62
  do {
    fwrite(src, s->uv_width, 1, yuv_file);
    src += s->uv_stride;
  } while (--h);
63

John Koleszar's avatar
John Koleszar committed
64
  fclose(yuv_file);
65
66
}
#endif
67
#if WRITE_RECON_BUFFER == 2
John Koleszar's avatar
John Koleszar committed
68
void write_dx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame) {
69

John Koleszar's avatar
John Koleszar committed
70
71
72
73
  // write the frame
  FILE *yframe;
  int i;
  char filename[255];
74

John Koleszar's avatar
John Koleszar committed
75
76
  sprintf(filename, "dx\\y%04d.raw", this_frame);
  yframe = fopen(filename, "wb");
77

John Koleszar's avatar
John Koleszar committed
78
79
80
  for (i = 0; i < frame->y_height; i++)
    fwrite(frame->y_buffer + i * frame->y_stride,
           frame->y_width, 1, yframe);
81

John Koleszar's avatar
John Koleszar committed
82
83
84
  fclose(yframe);
  sprintf(filename, "dx\\u%04d.raw", this_frame);
  yframe = fopen(filename, "wb");
85

John Koleszar's avatar
John Koleszar committed
86
87
88
  for (i = 0; i < frame->uv_height; i++)
    fwrite(frame->u_buffer + i * frame->uv_stride,
           frame->uv_width, 1, yframe);
89

John Koleszar's avatar
John Koleszar committed
90
91
92
  fclose(yframe);
  sprintf(filename, "dx\\v%04d.raw", this_frame);
  yframe = fopen(filename, "wb");
93

John Koleszar's avatar
John Koleszar committed
94
95
96
  for (i = 0; i < frame->uv_height; i++)
    fwrite(frame->v_buffer + i * frame->uv_stride,
           frame->uv_width, 1, yframe);
97

John Koleszar's avatar
John Koleszar committed
98
  fclose(yframe);
99
100
101
}
#endif

102
void vp9_initialize_dec(void) {
John Koleszar's avatar
John Koleszar committed
103
  static int init_done = 0;
John Koleszar's avatar
John Koleszar committed
104

John Koleszar's avatar
John Koleszar committed
105
  if (!init_done) {
106
107
    vp9_initialize_common();
    vp9_init_quant_tables();
John Koleszar's avatar
John Koleszar committed
108
109
    init_done = 1;
  }
John Koleszar's avatar
John Koleszar committed
110
111
}

112
VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf) {
113
  VP9D_COMP *pbi = vpx_memalign(32, sizeof(VP9D_COMP));
John Koleszar's avatar
John Koleszar committed
114

John Koleszar's avatar
John Koleszar committed
115
116
  if (!pbi)
    return NULL;
John Koleszar's avatar
John Koleszar committed
117

118
  vpx_memset(pbi, 0, sizeof(VP9D_COMP));
John Koleszar's avatar
John Koleszar committed
119

John Koleszar's avatar
John Koleszar committed
120
121
  if (setjmp(pbi->common.error.jmp)) {
    pbi->common.error.setjmp = 0;
122
    vp9_remove_decompressor(pbi);
John Koleszar's avatar
John Koleszar committed
123
124
    return 0;
  }
John Koleszar's avatar
John Koleszar committed
125

John Koleszar's avatar
John Koleszar committed
126
  pbi->common.error.setjmp = 1;
127
  vp9_initialize_dec();
John Koleszar's avatar
John Koleszar committed
128

129
  vp9_create_common(&pbi->common);
John Koleszar's avatar
John Koleszar committed
130

John Koleszar's avatar
John Koleszar committed
131
132
  pbi->common.current_video_frame = 0;
  pbi->ready_for_new_data = 1;
John Koleszar's avatar
John Koleszar committed
133

134
135
136
  /* vp9_init_de_quantizer() is first called here. Add check in
   * frame_init_dequantizer() to avoid unnecessary calling of
   * vp9_init_de_quantizer() for every frame.
John Koleszar's avatar
John Koleszar committed
137
   */
138
  vp9_init_de_quantizer(pbi);
John Koleszar's avatar
John Koleszar committed
139

140
  vp9_loop_filter_init(&pbi->common);
John Koleszar's avatar
John Koleszar committed
141

John Koleszar's avatar
John Koleszar committed
142
  pbi->common.error.setjmp = 0;
143

John Koleszar's avatar
John Koleszar committed
144
  pbi->decoded_key_frame = 0;
145

146
  return (VP9D_PTR) pbi;
John Koleszar's avatar
John Koleszar committed
147
148
}

149
void vp9_remove_decompressor(VP9D_PTR ptr) {
150
  VP9D_COMP *pbi = (VP9D_COMP *) ptr;
John Koleszar's avatar
John Koleszar committed
151

John Koleszar's avatar
John Koleszar committed
152
153
  if (!pbi)
    return;
154

John Koleszar's avatar
John Koleszar committed
155
156
157
  // Delete sementation map
  if (pbi->common.last_frame_seg_map != 0)
    vpx_free(pbi->common.last_frame_seg_map);
John Koleszar's avatar
John Koleszar committed
158

159
  vp9_remove_common(&pbi->common);
John Koleszar's avatar
John Koleszar committed
160
161
  vpx_free(pbi->mbc);
  vpx_free(pbi);
John Koleszar's avatar
John Koleszar committed
162
163
164
}


165
vpx_codec_err_t vp9_get_reference_dec(VP9D_PTR ptr, VP9_REFFRAME ref_frame_flag,
166
                                      YV12_BUFFER_CONFIG *sd) {
167
168
  VP9D_COMP *pbi = (VP9D_COMP *) ptr;
  VP9_COMMON *cm = &pbi->common;
John Koleszar's avatar
John Koleszar committed
169
170
  int ref_fb_idx;

171
  if (ref_frame_flag == VP9_LAST_FLAG)
John Koleszar's avatar
John Koleszar committed
172
    ref_fb_idx = cm->lst_fb_idx;
173
  else if (ref_frame_flag == VP9_GOLD_FLAG)
John Koleszar's avatar
John Koleszar committed
174
    ref_fb_idx = cm->gld_fb_idx;
175
  else if (ref_frame_flag == VP9_ALT_FLAG)
John Koleszar's avatar
John Koleszar committed
176
177
178
179
180
181
    ref_fb_idx = cm->alt_fb_idx;
  else {
    vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR,
                       "Invalid reference frame");
    return pbi->common.error.error_code;
  }
John Koleszar's avatar
John Koleszar committed
182

John Koleszar's avatar
John Koleszar committed
183
184
185
186
187
188
189
  if (cm->yv12_fb[ref_fb_idx].y_height != sd->y_height ||
      cm->yv12_fb[ref_fb_idx].y_width != sd->y_width ||
      cm->yv12_fb[ref_fb_idx].uv_height != sd->uv_height ||
      cm->yv12_fb[ref_fb_idx].uv_width != sd->uv_width) {
    vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR,
                       "Incorrect buffer dimensions");
  } else
John Koleszar's avatar
John Koleszar committed
190
    vp8_yv12_copy_frame(&cm->yv12_fb[ref_fb_idx], sd);
191

John Koleszar's avatar
John Koleszar committed
192
  return pbi->common.error.error_code;
John Koleszar's avatar
John Koleszar committed
193
}
194
195


196
vpx_codec_err_t vp9_set_reference_dec(VP9D_PTR ptr, VP9_REFFRAME ref_frame_flag,
197
                                      YV12_BUFFER_CONFIG *sd) {
198
199
  VP9D_COMP *pbi = (VP9D_COMP *) ptr;
  VP9_COMMON *cm = &pbi->common;
John Koleszar's avatar
John Koleszar committed
200
201
202
  int *ref_fb_ptr = NULL;
  int free_fb;

203
  if (ref_frame_flag == VP9_LAST_FLAG)
John Koleszar's avatar
John Koleszar committed
204
    ref_fb_ptr = &cm->lst_fb_idx;
205
  else if (ref_frame_flag == VP9_GOLD_FLAG)
John Koleszar's avatar
John Koleszar committed
206
    ref_fb_ptr = &cm->gld_fb_idx;
207
  else if (ref_frame_flag == VP9_ALT_FLAG)
John Koleszar's avatar
John Koleszar committed
208
209
210
211
212
213
    ref_fb_ptr = &cm->alt_fb_idx;
  else {
    vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR,
                       "Invalid reference frame");
    return pbi->common.error.error_code;
  }
214

John Koleszar's avatar
John Koleszar committed
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
  if (cm->yv12_fb[*ref_fb_ptr].y_height != sd->y_height ||
      cm->yv12_fb[*ref_fb_ptr].y_width != sd->y_width ||
      cm->yv12_fb[*ref_fb_ptr].uv_height != sd->uv_height ||
      cm->yv12_fb[*ref_fb_ptr].uv_width != sd->uv_width) {
    vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR,
                       "Incorrect buffer dimensions");
  } else {
    /* Find an empty frame buffer. */
    free_fb = get_free_fb(cm);
    /* Decrease fb_idx_ref_cnt since it will be increased again in
     * ref_cnt_fb() below. */
    cm->fb_idx_ref_cnt[free_fb]--;

    /* Manage the reference counters and copy image. */
    ref_cnt_fb(cm->fb_idx_ref_cnt, ref_fb_ptr, free_fb);
John Koleszar's avatar
John Koleszar committed
230
    vp8_yv12_copy_frame(sd, &cm->yv12_fb[*ref_fb_ptr]);
John Koleszar's avatar
John Koleszar committed
231
  }
232

John Koleszar's avatar
John Koleszar committed
233
  return pbi->common.error.error_code;
John Koleszar's avatar
John Koleszar committed
234
235
}

236

237
static int get_free_fb(VP9_COMMON *cm) {
John Koleszar's avatar
John Koleszar committed
238
239
240
241
  int i;
  for (i = 0; i < NUM_YV12_BUFFERS; i++)
    if (cm->fb_idx_ref_cnt[i] == 0)
      break;
242

John Koleszar's avatar
John Koleszar committed
243
244
245
  assert(i < NUM_YV12_BUFFERS);
  cm->fb_idx_ref_cnt[i] = 1;
  return i;
246
247
}

John Koleszar's avatar
John Koleszar committed
248
249
250
static void ref_cnt_fb(int *buf, int *idx, int new_idx) {
  if (buf[*idx] > 0)
    buf[*idx]--;
251

John Koleszar's avatar
John Koleszar committed
252
  *idx = new_idx;
253

John Koleszar's avatar
John Koleszar committed
254
  buf[new_idx]++;
255
256
}

257
/* If any buffer copy / swapping is signalled it should be done here. */
258
static int swap_frame_buffers(VP9_COMMON *cm) {
John Koleszar's avatar
John Koleszar committed
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
  int err = 0;

  /* The alternate reference frame or golden frame can be updated
   *  using the new, last, or golden/alt ref frame.  If it
   *  is updated using the newly decoded frame it is a refresh.
   *  An update using the last or golden/alt ref frame is a copy.
   */
  if (cm->copy_buffer_to_arf) {
    int new_fb = 0;

    if (cm->copy_buffer_to_arf == 1)
      new_fb = cm->lst_fb_idx;
    else if (cm->copy_buffer_to_arf == 2)
      new_fb = cm->gld_fb_idx;
    else
      err = -1;
275

John Koleszar's avatar
John Koleszar committed
276
277
    ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->alt_fb_idx, new_fb);
  }
278

John Koleszar's avatar
John Koleszar committed
279
280
  if (cm->copy_buffer_to_gf) {
    int new_fb = 0;
281

John Koleszar's avatar
John Koleszar committed
282
283
284
285
286
287
    if (cm->copy_buffer_to_gf == 1)
      new_fb = cm->lst_fb_idx;
    else if (cm->copy_buffer_to_gf == 2)
      new_fb = cm->alt_fb_idx;
    else
      err = -1;
288

John Koleszar's avatar
John Koleszar committed
289
290
    ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->gld_fb_idx, new_fb);
  }
291

John Koleszar's avatar
John Koleszar committed
292
293
  if (cm->refresh_golden_frame)
    ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->gld_fb_idx, cm->new_fb_idx);
294

John Koleszar's avatar
John Koleszar committed
295
296
  if (cm->refresh_alt_ref_frame)
    ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->alt_fb_idx, cm->new_fb_idx);
297

John Koleszar's avatar
John Koleszar committed
298
299
  if (cm->refresh_last_frame) {
    ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->lst_fb_idx, cm->new_fb_idx);
300

John Koleszar's avatar
John Koleszar committed
301
302
303
    cm->frame_to_show = &cm->yv12_fb[cm->lst_fb_idx];
  } else
    cm->frame_to_show = &cm->yv12_fb[cm->new_fb_idx];
304

John Koleszar's avatar
John Koleszar committed
305
  cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
306

John Koleszar's avatar
John Koleszar committed
307
  return err;
308
309
}

310
int vp9_receive_compressed_data(VP9D_PTR ptr, unsigned long size,
311
                                const unsigned char **psource,
312
                                int64_t time_stamp) {
313
314
  VP9D_COMP *pbi = (VP9D_COMP *) ptr;
  VP9_COMMON *cm = &pbi->common;
315
  const unsigned char *source = *psource;
John Koleszar's avatar
John Koleszar committed
316
  int retcode = 0;
John Koleszar's avatar
John Koleszar committed
317

John Koleszar's avatar
John Koleszar committed
318
319
  /*if(pbi->ready_for_new_data == 0)
      return -1;*/
John Koleszar's avatar
John Koleszar committed
320

John Koleszar's avatar
John Koleszar committed
321
322
323
  if (ptr == 0) {
    return -1;
  }
John Koleszar's avatar
John Koleszar committed
324

John Koleszar's avatar
John Koleszar committed
325
  pbi->common.error.error_code = VPX_CODEC_OK;
John Koleszar's avatar
John Koleszar committed
326

John Koleszar's avatar
John Koleszar committed
327
328
  pbi->Source = source;
  pbi->source_sz = size;
Paul Wilkins's avatar
Paul Wilkins committed
329

John Koleszar's avatar
John Koleszar committed
330
331
332
333
334
335
336
337
  if (pbi->source_sz == 0) {
    /* This is used to signal that we are missing frames.
     * We do not know if the missing frame(s) was supposed to update
     * any of the reference buffers, but we act conservative and
     * mark only the last buffer as corrupted.
     */
    cm->yv12_fb[cm->lst_fb_idx].corrupted = 1;
  }
338

John Koleszar's avatar
John Koleszar committed
339
  cm->new_fb_idx = get_free_fb(cm);
340

John Koleszar's avatar
John Koleszar committed
341
342
  if (setjmp(pbi->common.error.jmp)) {
    pbi->common.error.setjmp = 0;
John Koleszar's avatar
John Koleszar committed
343

John Koleszar's avatar
John Koleszar committed
344
345
346
347
348
    /* We do not know if the missing frame(s) was supposed to update
     * any of the reference buffers, but we act conservative and
     * mark only the last buffer as corrupted.
     */
    cm->yv12_fb[cm->lst_fb_idx].corrupted = 1;
John Koleszar's avatar
John Koleszar committed
349

John Koleszar's avatar
John Koleszar committed
350
351
352
353
    if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0)
      cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
    return -1;
  }
John Koleszar's avatar
John Koleszar committed
354

John Koleszar's avatar
John Koleszar committed
355
  pbi->common.error.setjmp = 1;
Paul Wilkins's avatar
Paul Wilkins committed
356

357
  retcode = vp9_decode_frame(pbi, psource);
John Koleszar's avatar
John Koleszar committed
358

John Koleszar's avatar
John Koleszar committed
359
360
361
362
363
364
365
  if (retcode < 0) {
    pbi->common.error.error_code = VPX_CODEC_ERROR;
    pbi->common.error.setjmp = 0;
    if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0)
      cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
    return retcode;
  }
John Koleszar's avatar
John Koleszar committed
366

John Koleszar's avatar
John Koleszar committed
367
368
369
370
371
372
  {
    if (swap_frame_buffers(cm)) {
      pbi->common.error.error_code = VPX_CODEC_ERROR;
      pbi->common.error.setjmp = 0;
      return -1;
    }
John Koleszar's avatar
John Koleszar committed
373

374
#if WRITE_RECON_BUFFER == 2
John Koleszar's avatar
John Koleszar committed
375
376
377
378
379
380
    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);
381
382
#endif

John Koleszar's avatar
John Koleszar committed
383
384
    if (cm->filter_level) {
      /* Apply the loop filter if appropriate. */
385
      vp9_loop_filter_frame(cm, &pbi->mb);
John Koleszar's avatar
John Koleszar committed
386
    }
John Koleszar's avatar
John Koleszar committed
387
    vp8_yv12_extend_frame_borders(cm->frame_to_show);
John Koleszar's avatar
John Koleszar committed
388
  }
John Koleszar's avatar
John Koleszar committed
389

390
#if WRITE_RECON_BUFFER == 1
John Koleszar's avatar
John Koleszar committed
391
  if (cm->show_frame)
392
    recon_write_yuv_frame("recon.yuv", cm->frame_to_show);
393
#endif
394

395
  vp9_clear_system_state();
John Koleszar's avatar
John Koleszar committed
396

John Koleszar's avatar
John Koleszar committed
397
398
399
400
401
402
403
  if (cm->show_frame) {
    vpx_memcpy(cm->prev_mip, cm->mip,
               (cm->mb_cols + 1) * (cm->mb_rows + 1)* sizeof(MODE_INFO));
  } else {
    vpx_memset(cm->prev_mip, 0,
               (cm->mb_cols + 1) * (cm->mb_rows + 1)* sizeof(MODE_INFO));
  }
404

405
  /*vp9_print_modes_and_motion_vectors(cm->mi, cm->mb_rows,cm->mb_cols,
406
                                       cm->current_video_frame);*/
John Koleszar's avatar
John Koleszar committed
407

John Koleszar's avatar
John Koleszar committed
408
409
  if (cm->show_frame)
    cm->current_video_frame++;
John Koleszar's avatar
John Koleszar committed
410

John Koleszar's avatar
John Koleszar committed
411
412
413
  pbi->ready_for_new_data = 0;
  pbi->last_time_stamp = time_stamp;
  pbi->source_sz = 0;
John Koleszar's avatar
John Koleszar committed
414

John Koleszar's avatar
John Koleszar committed
415
416
  pbi->common.error.setjmp = 0;
  return retcode;
John Koleszar's avatar
John Koleszar committed
417
}
418

419
int vp9_get_raw_frame(VP9D_PTR ptr, YV12_BUFFER_CONFIG *sd,
420
                      int64_t *time_stamp, int64_t *time_end_stamp,
421
                      vp9_ppflags_t *flags) {
John Koleszar's avatar
John Koleszar committed
422
  int ret = -1;
423
  VP9D_COMP *pbi = (VP9D_COMP *) ptr;
John Koleszar's avatar
John Koleszar committed
424

John Koleszar's avatar
John Koleszar committed
425
426
  if (pbi->ready_for_new_data == 1)
    return ret;
John Koleszar's avatar
John Koleszar committed
427

John Koleszar's avatar
John Koleszar committed
428
429
430
  /* ie no raw frame to show!!! */
  if (pbi->common.show_frame == 0)
    return ret;
John Koleszar's avatar
John Koleszar committed
431

John Koleszar's avatar
John Koleszar committed
432
433
434
  pbi->ready_for_new_data = 1;
  *time_stamp = pbi->last_time_stamp;
  *time_end_stamp = 0;
John Koleszar's avatar
John Koleszar committed
435

John Koleszar's avatar
John Koleszar committed
436
  sd->clrtype = pbi->common.clr_type;
John Koleszar's avatar
John Koleszar committed
437
#if CONFIG_POSTPROC
438
  ret = vp9_post_proc_frame(&pbi->common, sd, flags);
John Koleszar's avatar
John Koleszar committed
439
440
#else

John Koleszar's avatar
John Koleszar committed
441
442
443
444
445
446
447
448
449
  if (pbi->common.frame_to_show) {
    *sd = *pbi->common.frame_to_show;
    sd->y_width = pbi->common.Width;
    sd->y_height = pbi->common.Height;
    sd->uv_height = pbi->common.Height / 2;
    ret = 0;
  } else {
    ret = -1;
  }
John Koleszar's avatar
John Koleszar committed
450

451
#endif /*!CONFIG_POSTPROC*/
452
  vp9_clear_system_state();
John Koleszar's avatar
John Koleszar committed
453
  return ret;
John Koleszar's avatar
John Koleszar committed
454
}