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