Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: source/libvpx/vp9/common/vp9_entropymode.c

Issue 232133009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp9/common/vp9_entropymode.h ('k') | source/libvpx/vp9/common/vp9_entropymv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "vpx_mem/vpx_mem.h" 11 #include "vpx_mem/vpx_mem.h"
12 12
13 #include "vp9/common/vp9_alloccommon.h"
14 #include "vp9/common/vp9_onyxc_int.h" 13 #include "vp9/common/vp9_onyxc_int.h"
15 #include "vp9/common/vp9_seg_common.h" 14 #include "vp9/common/vp9_seg_common.h"
16 15
17 const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = { 16 const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = {
18 { // above = dc 17 { // above = dc
19 { 137, 30, 42, 148, 151, 207, 70, 52, 91 }, // left = dc 18 { 137, 30, 42, 148, 151, 207, 70, 52, 91 }, // left = dc
20 { 92, 45, 102, 136, 116, 180, 74, 90, 100 }, // left = v 19 { 92, 45, 102, 136, 116, 180, 74, 90, 100 }, // left = v
21 { 73, 32, 19, 187, 222, 215, 46, 34, 100 }, // left = h 20 { 73, 32, 19, 187, 222, 215, 46, 34, 100 }, // left = h
22 { 91, 30, 32, 116, 121, 186, 93, 86, 94 }, // left = d45 21 { 91, 30, 32, 116, 121, 186, 93, 86, 94 }, // left = d45
23 { 72, 35, 36, 149, 68, 206, 68, 63, 105 }, // left = d135 22 { 72, 35, 36, 149, 68, 206, 68, 63, 105 }, // left = d135
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 }; 307 };
309 308
310 static const vp9_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS] 309 static const vp9_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
311 [SWITCHABLE_FILTERS - 1] = { 310 [SWITCHABLE_FILTERS - 1] = {
312 { 235, 162, }, 311 { 235, 162, },
313 { 36, 255, }, 312 { 36, 255, },
314 { 34, 3, }, 313 { 34, 3, },
315 { 149, 144, }, 314 { 149, 144, },
316 }; 315 };
317 316
318 void vp9_init_mbmode_probs(VP9_COMMON *cm) { 317 void vp9_init_mode_probs(FRAME_CONTEXT *fc) {
319 vp9_copy(cm->fc.uv_mode_prob, default_if_uv_probs); 318 vp9_copy(fc->uv_mode_prob, default_if_uv_probs);
320 vp9_copy(cm->fc.y_mode_prob, default_if_y_probs); 319 vp9_copy(fc->y_mode_prob, default_if_y_probs);
321 vp9_copy(cm->fc.switchable_interp_prob, default_switchable_interp_prob); 320 vp9_copy(fc->switchable_interp_prob, default_switchable_interp_prob);
322 vp9_copy(cm->fc.partition_prob, default_partition_probs); 321 vp9_copy(fc->partition_prob, default_partition_probs);
323 vp9_copy(cm->fc.intra_inter_prob, default_intra_inter_p); 322 vp9_copy(fc->intra_inter_prob, default_intra_inter_p);
324 vp9_copy(cm->fc.comp_inter_prob, default_comp_inter_p); 323 vp9_copy(fc->comp_inter_prob, default_comp_inter_p);
325 vp9_copy(cm->fc.comp_ref_prob, default_comp_ref_p); 324 vp9_copy(fc->comp_ref_prob, default_comp_ref_p);
326 vp9_copy(cm->fc.single_ref_prob, default_single_ref_p); 325 vp9_copy(fc->single_ref_prob, default_single_ref_p);
327 cm->fc.tx_probs = default_tx_probs; 326 fc->tx_probs = default_tx_probs;
328 vp9_copy(cm->fc.skip_probs, default_skip_probs); 327 vp9_copy(fc->skip_probs, default_skip_probs);
329 vp9_copy(cm->fc.inter_mode_probs, default_inter_mode_probs); 328 vp9_copy(fc->inter_mode_probs, default_inter_mode_probs);
330 } 329 }
331 330
332 const vp9_tree_index vp9_switchable_interp_tree 331 const vp9_tree_index vp9_switchable_interp_tree
333 [TREE_SIZE(SWITCHABLE_FILTERS)] = { 332 [TREE_SIZE(SWITCHABLE_FILTERS)] = {
334 -EIGHTTAP, 2, 333 -EIGHTTAP, 2,
335 -EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP 334 -EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP
336 }; 335 };
337 336
338 #define COUNT_SAT 20 337 #define COUNT_SAT 20
339 #define MAX_UPDATE_FACTOR 128 338 #define MAX_UPDATE_FACTOR 128
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 444
446 // Reset the mode ref deltas for loop filter 445 // Reset the mode ref deltas for loop filter
447 vp9_zero(lf->last_ref_deltas); 446 vp9_zero(lf->last_ref_deltas);
448 vp9_zero(lf->last_mode_deltas); 447 vp9_zero(lf->last_mode_deltas);
449 set_default_lf_deltas(lf); 448 set_default_lf_deltas(lf);
450 449
451 // To force update of the sharpness 450 // To force update of the sharpness
452 lf->last_sharpness_level = -1; 451 lf->last_sharpness_level = -1;
453 452
454 vp9_default_coef_probs(cm); 453 vp9_default_coef_probs(cm);
455 vp9_init_mbmode_probs(cm); 454 vp9_init_mode_probs(&cm->fc);
456 vp9_init_mv_probs(cm); 455 vp9_init_mv_probs(cm);
457 456
458 if (cm->frame_type == KEY_FRAME || 457 if (cm->frame_type == KEY_FRAME ||
459 cm->error_resilient_mode || cm->reset_frame_context == 3) { 458 cm->error_resilient_mode || cm->reset_frame_context == 3) {
460 // Reset all frame contexts. 459 // Reset all frame contexts.
461 for (i = 0; i < FRAME_CONTEXTS; ++i) 460 for (i = 0; i < FRAME_CONTEXTS; ++i)
462 cm->frame_contexts[i] = cm->fc; 461 cm->frame_contexts[i] = cm->fc;
463 } else if (cm->reset_frame_context == 2) { 462 } else if (cm->reset_frame_context == 2) {
464 // Reset only the frame context specified in the frame header. 463 // Reset only the frame context specified in the frame header.
465 cm->frame_contexts[cm->frame_context_idx] = cm->fc; 464 cm->frame_contexts[cm->frame_context_idx] = cm->fc;
466 } 465 }
467 466
468 if (frame_is_intra_only(cm)) 467 if (frame_is_intra_only(cm))
469 vpx_memset(cm->prev_mip, 0, 468 vpx_memset(cm->prev_mip, 0, cm->mi_stride * (cm->mi_rows + 1) *
470 cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO)); 469 sizeof(*cm->prev_mip));
471 470
472 vpx_memset(cm->mip, 0, 471 vpx_memset(cm->mip, 0, cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip));
473 cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
474 472
475 vp9_zero(cm->ref_frame_sign_bias); 473 vp9_zero(cm->ref_frame_sign_bias);
476 474
477 cm->frame_context_idx = 0; 475 cm->frame_context_idx = 0;
478 } 476 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_entropymode.h ('k') | source/libvpx/vp9/common/vp9_entropymv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698