• James Zern's avatar
    update vp9_thread.c · 8701ed02
    James Zern authored
    pull the latest from libwebp.
    
    Original source:
     http://git.chromium.org/webm/libwebp.git
     100644 blob 264210ba2807e4da47eb5d18c04cf869d89b9784 src/utils/thread.c
    
    commit 46fd44c1042c9903b2f1ab87e9f200a13c7e702d
    Author: James Zern <jzern@google.com>
    Date:   Tue Jul 8 19:53:28 2014 -0700
    
        thread: remove harmless race on status_ in End()
    
        if a thread was still doing work when End() was called there'd be a race
        on worker->status_. in these cases, however, the specific value is
        meaningless as it would be >= OK and the thread would have been shut
        down properly, but we'll check 'impl_' instead to avoid any potential
        TSan/DRD reports.
    
        Change-Id: Ib93cbc226a099f07761f7bad765549dffb8054b1
    
    Change-Id: Ib0ef25737b3c6d017fa74822e21ed58508230b91
    8701ed02
vp9_bitstream.c 49.99 KiB
/*
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */
#include <assert.h>
#include <stdio.h>
#include <limits.h>
#include "vpx/vpx_encoder.h"
#include "vpx_mem/vpx_mem.h"
#include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_entropymv.h"
#include "vp9/common/vp9_findnearmv.h"
#include "vp9/common/vp9_tile_common.h"
#include "vp9/common/vp9_seg_common.h"
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_mvref_common.h"
#include "vp9/common/vp9_treecoder.h"
#include "vp9/common/vp9_systemdependent.h"
#include "vp9/common/vp9_pragmas.h"
#include "vp9/encoder/vp9_mcomp.h"
#include "vp9/encoder/vp9_encodemv.h"
#include "vp9/encoder/vp9_bitstream.h"
#include "vp9/encoder/vp9_segmentation.h"
#include "vp9/encoder/vp9_subexp.h"
#include "vp9/encoder/vp9_write_bit_buffer.h"
#if defined(SECTIONBITS_OUTPUT)
unsigned __int64 Sectionbits[500];
#endif
#ifdef ENTROPY_STATS
int intra_mode_stats[INTRA_MODES]
                    [INTRA_MODES]
                    [INTRA_MODES];
vp9_coeff_stats tree_update_hist[TX_SIZES][BLOCK_TYPES];
extern unsigned int active_section;
#endif
#ifdef MODE_STATS
int64_t tx_count_32x32p_stats[TX_SIZE_CONTEXTS][TX_SIZES];
int64_t tx_count_16x16p_stats[TX_SIZE_CONTEXTS][TX_SIZES - 1];
int64_t tx_count_8x8p_stats[TX_SIZE_CONTEXTS][TX_SIZES - 2];
int64_t switchable_interp_stats[SWITCHABLE_FILTERS+1]
                               [SWITCHABLE_FILTERS];
void init_tx_count_stats() {
  vp9_zero(tx_count_32x32p_stats);
  vp9_zero(tx_count_16x16p_stats);
  vp9_zero(tx_count_8x8p_stats);
void init_switchable_interp_stats() {
  vp9_zero(switchable_interp_stats);
static void update_tx_count_stats(VP9_COMMON *cm) {
  int i, j;