Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / source / libvpx / vp8 / encoder / onyx_int.h
1 /*
2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  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.
9  */
10
11
12 #ifndef VP8_ENCODER_ONYX_INT_H_
13 #define VP8_ENCODER_ONYX_INT_H_
14
15 #include <stdio.h>
16 #include "vpx_config.h"
17 #include "vp8/common/onyx.h"
18 #include "treewriter.h"
19 #include "tokenize.h"
20 #include "vp8/common/onyxc_int.h"
21 #include "vp8/common/variance.h"
22 #include "encodemb.h"
23 #include "quantize.h"
24 #include "vp8/common/entropy.h"
25 #include "vp8/common/threading.h"
26 #include "vpx_ports/mem.h"
27 #include "vpx/internal/vpx_codec_internal.h"
28 #include "vpx/vp8.h"
29 #include "mcomp.h"
30 #include "vp8/common/findnearmv.h"
31 #include "lookahead.h"
32 #if CONFIG_TEMPORAL_DENOISING
33 #include "vp8/encoder/denoising.h"
34 #endif
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #define MIN_GF_INTERVAL             4
41 #define DEFAULT_GF_INTERVAL         7
42
43 #define KEY_FRAME_CONTEXT 5
44
45 #define MAX_LAG_BUFFERS (CONFIG_REALTIME_ONLY? 1 : 25)
46
47 #define AF_THRESH   25
48 #define AF_THRESH2  100
49 #define ARF_DECAY_THRESH 12
50
51
52 #define MIN_THRESHMULT  32
53 #define MAX_THRESHMULT  512
54
55 #define GF_ZEROMV_ZBIN_BOOST 12
56 #define LF_ZEROMV_ZBIN_BOOST 6
57 #define MV_ZBIN_BOOST        4
58 #define ZBIN_OQ_MAX 192
59
60 #if !(CONFIG_REALTIME_ONLY)
61 #define VP8_TEMPORAL_ALT_REF 1
62 #endif
63
64 typedef struct
65 {
66     int kf_indicated;
67     unsigned int frames_since_key;
68     unsigned int frames_since_golden;
69     int filter_level;
70     int frames_till_gf_update_due;
71     int recent_ref_frame_usage[MAX_REF_FRAMES];
72
73     MV_CONTEXT mvc[2];
74     int mvcosts[2][MVvals+1];
75
76 #ifdef MODE_STATS
77     int y_modes[5];
78     int uv_modes[4];
79     int b_modes[10];
80     int inter_y_modes[10];
81     int inter_uv_modes[4];
82     int inter_b_modes[10];
83 #endif
84
85     vp8_prob ymode_prob[4], uv_mode_prob[3];   /* interframe intra mode probs */
86     vp8_prob kf_ymode_prob[4], kf_uv_mode_prob[3];   /* keyframe "" */
87
88     int ymode_count[5], uv_mode_count[4];  /* intra MB type cts this frame */
89
90     int count_mb_ref_frame_usage[MAX_REF_FRAMES];
91
92     int this_frame_percent_intra;
93     int last_frame_percent_intra;
94
95
96 } CODING_CONTEXT;
97
98 typedef struct
99 {
100     double frame;
101     double intra_error;
102     double coded_error;
103     double ssim_weighted_pred_err;
104     double pcnt_inter;
105     double pcnt_motion;
106     double pcnt_second_ref;
107     double pcnt_neutral;
108     double MVr;
109     double mvr_abs;
110     double MVc;
111     double mvc_abs;
112     double MVrv;
113     double MVcv;
114     double mv_in_out_count;
115     double new_mv_count;
116     double duration;
117     double count;
118 }
119 FIRSTPASS_STATS;
120
121 typedef struct
122 {
123     int frames_so_far;
124     double frame_intra_error;
125     double frame_coded_error;
126     double frame_pcnt_inter;
127     double frame_pcnt_motion;
128     double frame_mvr;
129     double frame_mvr_abs;
130     double frame_mvc;
131     double frame_mvc_abs;
132
133 } ONEPASS_FRAMESTATS;
134
135
136 typedef enum
137 {
138     THR_ZERO1          = 0,
139     THR_DC             = 1,
140
141     THR_NEAREST1       = 2,
142     THR_NEAR1          = 3,
143
144     THR_ZERO2          = 4,
145     THR_NEAREST2       = 5,
146
147     THR_ZERO3          = 6,
148     THR_NEAREST3       = 7,
149
150     THR_NEAR2          = 8,
151     THR_NEAR3          = 9,
152
153     THR_V_PRED         = 10,
154     THR_H_PRED         = 11,
155     THR_TM             = 12,
156
157     THR_NEW1           = 13,
158     THR_NEW2           = 14,
159     THR_NEW3           = 15,
160
161     THR_SPLIT1         = 16,
162     THR_SPLIT2         = 17,
163     THR_SPLIT3         = 18,
164
165     THR_B_PRED         = 19
166 }
167 THR_MODES;
168
169 typedef enum
170 {
171     DIAMOND = 0,
172     NSTEP = 1,
173     HEX = 2
174 } SEARCH_METHODS;
175
176 typedef struct
177 {
178     int RD;
179     SEARCH_METHODS search_method;
180     int improved_quant;
181     int improved_dct;
182     int auto_filter;
183     int recode_loop;
184     int iterative_sub_pixel;
185     int half_pixel_search;
186     int quarter_pixel_search;
187     int thresh_mult[MAX_MODES];
188     int max_step_search_steps;
189     int first_step;
190     int optimize_coefficients;
191
192     int use_fastquant_for_pick;
193     int no_skip_block4x4_search;
194     int improved_mv_pred;
195
196 } SPEED_FEATURES;
197
198 typedef struct
199 {
200     MACROBLOCK  mb;
201     int segment_counts[MAX_MB_SEGMENTS];
202     int totalrate;
203 } MB_ROW_COMP;
204
205 typedef struct
206 {
207     TOKENEXTRA *start;
208     TOKENEXTRA *stop;
209 } TOKENLIST;
210
211 typedef struct
212 {
213     int ithread;
214     void *ptr1;
215     void *ptr2;
216 } ENCODETHREAD_DATA;
217 typedef struct
218 {
219     int ithread;
220     void *ptr1;
221 } LPFTHREAD_DATA;
222
223 enum
224 {
225     BLOCK_16X8,
226     BLOCK_8X16,
227     BLOCK_8X8,
228     BLOCK_4X4,
229     BLOCK_16X16,
230     BLOCK_MAX_SEGMENTS
231 };
232
233 typedef struct
234 {
235     /* Layer configuration */
236     double framerate;
237     int target_bandwidth;
238
239     /* Layer specific coding parameters */
240     int64_t starting_buffer_level;
241     int64_t optimal_buffer_level;
242     int64_t maximum_buffer_size;
243     int64_t starting_buffer_level_in_ms;
244     int64_t optimal_buffer_level_in_ms;
245     int64_t maximum_buffer_size_in_ms;
246
247     int avg_frame_size_for_layer;
248
249     int64_t buffer_level;
250     int64_t bits_off_target;
251
252     int64_t total_actual_bits;
253     int total_target_vs_actual;
254
255     int worst_quality;
256     int active_worst_quality;
257     int best_quality;
258     int active_best_quality;
259
260     int ni_av_qi;
261     int ni_tot_qi;
262     int ni_frames;
263     int avg_frame_qindex;
264
265     double rate_correction_factor;
266     double key_frame_rate_correction_factor;
267     double gf_rate_correction_factor;
268
269     int zbin_over_quant;
270
271     int inter_frame_target;
272     int64_t total_byte_count;
273
274     int filter_level;
275
276     int last_frame_percent_intra;
277
278     int count_mb_ref_frame_usage[MAX_REF_FRAMES];
279
280 } LAYER_CONTEXT;
281
282 typedef struct VP8_COMP
283 {
284
285     DECLARE_ALIGNED(16, short, Y1quant[QINDEX_RANGE][16]);
286     DECLARE_ALIGNED(16, short, Y1quant_shift[QINDEX_RANGE][16]);
287     DECLARE_ALIGNED(16, short, Y1zbin[QINDEX_RANGE][16]);
288     DECLARE_ALIGNED(16, short, Y1round[QINDEX_RANGE][16]);
289
290     DECLARE_ALIGNED(16, short, Y2quant[QINDEX_RANGE][16]);
291     DECLARE_ALIGNED(16, short, Y2quant_shift[QINDEX_RANGE][16]);
292     DECLARE_ALIGNED(16, short, Y2zbin[QINDEX_RANGE][16]);
293     DECLARE_ALIGNED(16, short, Y2round[QINDEX_RANGE][16]);
294
295     DECLARE_ALIGNED(16, short, UVquant[QINDEX_RANGE][16]);
296     DECLARE_ALIGNED(16, short, UVquant_shift[QINDEX_RANGE][16]);
297     DECLARE_ALIGNED(16, short, UVzbin[QINDEX_RANGE][16]);
298     DECLARE_ALIGNED(16, short, UVround[QINDEX_RANGE][16]);
299
300     DECLARE_ALIGNED(16, short, zrun_zbin_boost_y1[QINDEX_RANGE][16]);
301     DECLARE_ALIGNED(16, short, zrun_zbin_boost_y2[QINDEX_RANGE][16]);
302     DECLARE_ALIGNED(16, short, zrun_zbin_boost_uv[QINDEX_RANGE][16]);
303     DECLARE_ALIGNED(16, short, Y1quant_fast[QINDEX_RANGE][16]);
304     DECLARE_ALIGNED(16, short, Y2quant_fast[QINDEX_RANGE][16]);
305     DECLARE_ALIGNED(16, short, UVquant_fast[QINDEX_RANGE][16]);
306
307
308     MACROBLOCK mb;
309     VP8_COMMON common;
310     vp8_writer bc[9]; /* one boolcoder for each partition */
311
312     VP8_CONFIG oxcf;
313
314     struct lookahead_ctx    *lookahead;
315     struct lookahead_entry  *source;
316     struct lookahead_entry  *alt_ref_source;
317     struct lookahead_entry  *last_source;
318
319     YV12_BUFFER_CONFIG *Source;
320     YV12_BUFFER_CONFIG *un_scaled_source;
321     YV12_BUFFER_CONFIG scaled_source;
322     YV12_BUFFER_CONFIG *last_frame_unscaled_source;
323
324     unsigned int frames_till_alt_ref_frame;
325     /* frame in src_buffers has been identified to be encoded as an alt ref */
326     int source_alt_ref_pending;
327     /* an alt ref frame has been encoded and is usable */
328     int source_alt_ref_active;
329     /* source of frame to encode is an exact copy of an alt ref frame */
330     int is_src_frame_alt_ref;
331
332     /* golden frame same as last frame ( short circuit gold searches) */
333     int gold_is_last;
334     /* Alt reference frame same as last ( short circuit altref search) */
335     int alt_is_last;
336     /* don't do both alt and gold search ( just do gold). */
337     int gold_is_alt;
338
339     YV12_BUFFER_CONFIG pick_lf_lvl_frame;
340
341     TOKENEXTRA *tok;
342     unsigned int tok_count;
343
344
345     unsigned int frames_since_key;
346     unsigned int key_frame_frequency;
347     unsigned int this_key_frame_forced;
348     unsigned int next_key_frame_forced;
349
350     /* Ambient reconstruction err target for force key frames */
351     int ambient_err;
352
353     unsigned int mode_check_freq[MAX_MODES];
354
355     int rd_baseline_thresh[MAX_MODES];
356
357     int RDMULT;
358     int RDDIV ;
359
360     CODING_CONTEXT coding_context;
361
362     /* Rate targetting variables */
363     int64_t last_prediction_error;
364     int64_t last_intra_error;
365
366     int this_frame_target;
367     int projected_frame_size;
368     int last_q[2];                   /* Separate values for Intra/Inter */
369
370     double rate_correction_factor;
371     double key_frame_rate_correction_factor;
372     double gf_rate_correction_factor;
373
374     unsigned int frames_since_golden;
375     /* Count down till next GF */
376     int frames_till_gf_update_due;
377
378     /* GF interval chosen when we coded the last GF */
379     int current_gf_interval;
380
381     /* Total bits overspent becasue of GF boost (cumulative) */
382     int gf_overspend_bits;
383
384     /* Used in the few frames following a GF to recover the extra bits
385      * spent in that GF
386      */
387     int non_gf_bitrate_adjustment;
388
389     /* Extra bits spent on key frames that need to be recovered */
390     int kf_overspend_bits;
391
392     /* Current number of bit s to try and recover on each inter frame. */
393     int kf_bitrate_adjustment;
394     int max_gf_interval;
395     int baseline_gf_interval;
396     int active_arnr_frames;
397
398     int64_t key_frame_count;
399     int prior_key_frame_distance[KEY_FRAME_CONTEXT];
400     /* Current section per frame bandwidth target */
401     int per_frame_bandwidth;
402     /* Average frame size target for clip */
403     int av_per_frame_bandwidth;
404     /* Minimum allocation that should be used for any frame */
405     int min_frame_bandwidth;
406     int inter_frame_target;
407     double output_framerate;
408     int64_t last_time_stamp_seen;
409     int64_t last_end_time_stamp_seen;
410     int64_t first_time_stamp_ever;
411
412     int ni_av_qi;
413     int ni_tot_qi;
414     int ni_frames;
415     int avg_frame_qindex;
416
417     int64_t total_byte_count;
418
419     int buffered_mode;
420
421     double framerate;
422     double ref_framerate;
423     int64_t buffer_level;
424     int64_t bits_off_target;
425
426     int rolling_target_bits;
427     int rolling_actual_bits;
428
429     int long_rolling_target_bits;
430     int long_rolling_actual_bits;
431
432     int64_t total_actual_bits;
433     int total_target_vs_actual; /* debug stats */
434
435     int worst_quality;
436     int active_worst_quality;
437     int best_quality;
438     int active_best_quality;
439
440     int cq_target_quality;
441
442     int drop_frames_allowed; /* Are we permitted to drop frames? */
443     int drop_frame;          /* Drop this frame? */
444
445     vp8_prob frame_coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
446     char update_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
447
448     unsigned int frame_branch_ct [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES][2];
449
450     int gfu_boost;
451     int kf_boost;
452     int last_boost;
453
454     int target_bandwidth;
455     struct vpx_codec_pkt_list  *output_pkt_list;
456
457 #if 0
458     /* Experimental code for lagged and one pass */
459     ONEPASS_FRAMESTATS one_pass_frame_stats[MAX_LAG_BUFFERS];
460     int one_pass_frame_index;
461 #endif
462
463     int decimation_factor;
464     int decimation_count;
465
466     /* for real time encoding */
467     int avg_encode_time;     /* microsecond */
468     int avg_pick_mode_time;  /* microsecond */
469     int Speed;
470     int compressor_speed;
471
472     int auto_gold;
473     int auto_adjust_gold_quantizer;
474     int auto_worst_q;
475     int cpu_used;
476     int pass;
477
478
479     int prob_intra_coded;
480     int prob_last_coded;
481     int prob_gf_coded;
482     int prob_skip_false;
483     int last_skip_false_probs[3];
484     int last_skip_probs_q[3];
485     int recent_ref_frame_usage[MAX_REF_FRAMES];
486
487     int this_frame_percent_intra;
488     int last_frame_percent_intra;
489
490     int ref_frame_flags;
491
492     SPEED_FEATURES sf;
493
494     /* Count ZEROMV on all reference frames. */
495     int zeromv_count;
496     int lf_zeromv_pct;
497
498     unsigned char *segmentation_map;
499     signed char segment_feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS];
500     int  segment_encode_breakout[MAX_MB_SEGMENTS];
501
502     unsigned char *active_map;
503     unsigned int active_map_enabled;
504
505     /* Video conferencing cyclic refresh mode flags. This is a mode
506      * designed to clean up the background over time in live encoding
507      * scenarious. It uses segmentation.
508      */
509     int cyclic_refresh_mode_enabled;
510     int cyclic_refresh_mode_max_mbs_perframe;
511     int cyclic_refresh_mode_index;
512     int cyclic_refresh_q;
513     signed char *cyclic_refresh_map;
514
515     // Frame counter for the temporal pattern. Counter is rest when the temporal
516     // layers are changed dynamically (run-time change).
517     unsigned int temporal_pattern_counter;
518
519 #if CONFIG_MULTITHREAD
520     /* multithread data */
521     int * mt_current_mb_col;
522     int mt_sync_range;
523     int b_multi_threaded;
524     int encoding_thread_count;
525     int b_lpf_running;
526
527     pthread_t *h_encoding_thread;
528     pthread_t h_filter_thread;
529
530     MB_ROW_COMP *mb_row_ei;
531     ENCODETHREAD_DATA *en_thread_data;
532     LPFTHREAD_DATA lpf_thread_data;
533
534     /* events */
535     sem_t *h_event_start_encoding;
536     sem_t h_event_end_encoding;
537     sem_t h_event_start_lpf;
538     sem_t h_event_end_lpf;
539 #endif
540
541     TOKENLIST *tplist;
542     unsigned int partition_sz[MAX_PARTITIONS];
543     unsigned char *partition_d[MAX_PARTITIONS];
544     unsigned char *partition_d_end[MAX_PARTITIONS];
545
546
547     fractional_mv_step_fp *find_fractional_mv_step;
548     vp8_full_search_fn_t full_search_sad;
549     vp8_refining_search_fn_t refining_search_sad;
550     vp8_diamond_search_fn_t diamond_search_sad;
551     vp8_variance_fn_ptr_t fn_ptr[BLOCK_MAX_SEGMENTS];
552     uint64_t time_receive_data;
553     uint64_t time_compress_data;
554     uint64_t time_pick_lpf;
555     uint64_t time_encode_mb_row;
556
557     int base_skip_false_prob[128];
558
559     FRAME_CONTEXT lfc_n; /* last frame entropy */
560     FRAME_CONTEXT lfc_a; /* last alt ref entropy */
561     FRAME_CONTEXT lfc_g; /* last gold ref entropy */
562
563
564     struct twopass_rc
565     {
566         unsigned int section_intra_rating;
567         double section_max_qfactor;
568         unsigned int next_iiratio;
569         unsigned int this_iiratio;
570         FIRSTPASS_STATS total_stats;
571         FIRSTPASS_STATS this_frame_stats;
572         FIRSTPASS_STATS *stats_in, *stats_in_end, *stats_in_start;
573         FIRSTPASS_STATS total_left_stats;
574         int first_pass_done;
575         int64_t bits_left;
576         int64_t clip_bits_total;
577         double avg_iiratio;
578         double modified_error_total;
579         double modified_error_used;
580         double modified_error_left;
581         double kf_intra_err_min;
582         double gf_intra_err_min;
583         int frames_to_key;
584         int maxq_max_limit;
585         int maxq_min_limit;
586         int gf_decay_rate;
587         int static_scene_max_gf_interval;
588         int kf_bits;
589         /* Remaining error from uncoded frames in a gf group. */
590         int gf_group_error_left;
591         /* Projected total bits available for a key frame group of frames */
592         int64_t kf_group_bits;
593         /* Error score of frames still to be coded in kf group */
594         int64_t kf_group_error_left;
595         /* Projected Bits available for a group including 1 GF or ARF */
596         int64_t gf_group_bits;
597         /* Bits for the golden frame or ARF */
598         int gf_bits;
599         int alt_extra_bits;
600         double est_max_qcorrection_factor;
601     } twopass;
602
603 #if VP8_TEMPORAL_ALT_REF
604     YV12_BUFFER_CONFIG alt_ref_buffer;
605     YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS];
606     int fixed_divide[512];
607 #endif
608
609 #if CONFIG_INTERNAL_STATS
610     int    count;
611     double total_y;
612     double total_u;
613     double total_v;
614     double total ;
615     double total_sq_error;
616     double totalp_y;
617     double totalp_u;
618     double totalp_v;
619     double totalp;
620     double total_sq_error2;
621     int    bytes;
622     double summed_quality;
623     double summed_weights;
624     unsigned int tot_recode_hits;
625
626
627     double total_ssimg_y;
628     double total_ssimg_u;
629     double total_ssimg_v;
630     double total_ssimg_all;
631
632     int b_calculate_ssimg;
633 #endif
634     int b_calculate_psnr;
635
636     /* Per MB activity measurement */
637     unsigned int activity_avg;
638     unsigned int * mb_activity_map;
639
640     /* Record of which MBs still refer to last golden frame either
641      * directly or through 0,0
642      */
643     unsigned char *gf_active_flags;
644     int gf_active_count;
645
646     int output_partition;
647
648     /* Store last frame's MV info for next frame MV prediction */
649     int_mv *lfmv;
650     int *lf_ref_frame_sign_bias;
651     int *lf_ref_frame;
652
653     /* force next frame to intra when kf_auto says so */
654     int force_next_frame_intra;
655
656     int droppable;
657
658 #if CONFIG_TEMPORAL_DENOISING
659     VP8_DENOISER denoiser;
660 #endif
661
662     /* Coding layer state variables */
663     unsigned int current_layer;
664     LAYER_CONTEXT layer_context[VPX_TS_MAX_LAYERS];
665
666     int64_t frames_in_layer[VPX_TS_MAX_LAYERS];
667     int64_t bytes_in_layer[VPX_TS_MAX_LAYERS];
668     double sum_psnr[VPX_TS_MAX_LAYERS];
669     double sum_psnr_p[VPX_TS_MAX_LAYERS];
670     double total_error2[VPX_TS_MAX_LAYERS];
671     double total_error2_p[VPX_TS_MAX_LAYERS];
672     double sum_ssim[VPX_TS_MAX_LAYERS];
673     double sum_weights[VPX_TS_MAX_LAYERS];
674
675     double total_ssimg_y_in_layer[VPX_TS_MAX_LAYERS];
676     double total_ssimg_u_in_layer[VPX_TS_MAX_LAYERS];
677     double total_ssimg_v_in_layer[VPX_TS_MAX_LAYERS];
678     double total_ssimg_all_in_layer[VPX_TS_MAX_LAYERS];
679
680 #if CONFIG_MULTI_RES_ENCODING
681     /* Number of MBs per row at lower-resolution level */
682     int    mr_low_res_mb_cols;
683     /* Indicate if lower-res mv info is available */
684     unsigned char  mr_low_res_mv_avail;
685     /* The frame number of each reference frames */
686     unsigned int current_ref_frames[MAX_REF_FRAMES];
687 #endif
688
689     struct rd_costs_struct
690     {
691         int mvcosts[2][MVvals+1];
692         int mvsadcosts[2][MVfpvals+1];
693         int mbmode_cost[2][MB_MODE_COUNT];
694         int intra_uv_mode_cost[2][MB_MODE_COUNT];
695         int bmode_costs[10][10][10];
696         int inter_bmode_costs[B_MODE_COUNT];
697         int token_costs[BLOCK_TYPES][COEF_BANDS]
698         [PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS];
699     } rd_costs;
700 } VP8_COMP;
701
702 void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest,
703                         unsigned char *dest_end, unsigned long *size);
704
705 void vp8_tokenize_mb(VP8_COMP *, MACROBLOCK *, TOKENEXTRA **);
706
707 void vp8_set_speed_features(VP8_COMP *cpi);
708
709 #if CONFIG_DEBUG
710 #define CHECK_MEM_ERROR(lval,expr) do {\
711         lval = (expr); \
712         if(!lval) \
713             vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,\
714                                "Failed to allocate "#lval" at %s:%d", \
715                                __FILE__,__LINE__);\
716     } while(0)
717 #else
718 #define CHECK_MEM_ERROR(lval,expr) do {\
719         lval = (expr); \
720         if(!lval) \
721             vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,\
722                                "Failed to allocate "#lval);\
723     } while(0)
724 #endif
725 #ifdef __cplusplus
726 }  // extern "C"
727 #endif
728
729 #endif  // VP8_ENCODER_ONYX_INT_H_