OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
(...skipping 12 matching lines...) Expand all Loading... |
23 const int num_blk = (num_4x4_blk < 4 ? 4 : num_4x4_blk); | 23 const int num_blk = (num_4x4_blk < 4 ? 4 : num_4x4_blk); |
24 const int num_pix = num_blk << 4; | 24 const int num_pix = num_blk << 4; |
25 int i, k; | 25 int i, k; |
26 ctx->num_4x4_blk = num_blk; | 26 ctx->num_4x4_blk = num_blk; |
27 | 27 |
28 CHECK_MEM_ERROR(cm, ctx->zcoeff_blk, | 28 CHECK_MEM_ERROR(cm, ctx->zcoeff_blk, |
29 vpx_calloc(num_4x4_blk, sizeof(uint8_t))); | 29 vpx_calloc(num_4x4_blk, sizeof(uint8_t))); |
30 for (i = 0; i < MAX_MB_PLANE; ++i) { | 30 for (i = 0; i < MAX_MB_PLANE; ++i) { |
31 for (k = 0; k < 3; ++k) { | 31 for (k = 0; k < 3; ++k) { |
32 CHECK_MEM_ERROR(cm, ctx->coeff[i][k], | 32 CHECK_MEM_ERROR(cm, ctx->coeff[i][k], |
33 vpx_memalign(16, num_pix * sizeof(int16_t))); | 33 vpx_memalign(16, num_pix * sizeof(*ctx->coeff[i][k]))); |
34 CHECK_MEM_ERROR(cm, ctx->qcoeff[i][k], | 34 CHECK_MEM_ERROR(cm, ctx->qcoeff[i][k], |
35 vpx_memalign(16, num_pix * sizeof(int16_t))); | 35 vpx_memalign(16, num_pix * sizeof(*ctx->qcoeff[i][k]))); |
36 CHECK_MEM_ERROR(cm, ctx->dqcoeff[i][k], | 36 CHECK_MEM_ERROR(cm, ctx->dqcoeff[i][k], |
37 vpx_memalign(16, num_pix * sizeof(int16_t))); | 37 vpx_memalign(16, num_pix * sizeof(*ctx->dqcoeff[i][k]))); |
38 CHECK_MEM_ERROR(cm, ctx->eobs[i][k], | 38 CHECK_MEM_ERROR(cm, ctx->eobs[i][k], |
39 vpx_memalign(16, num_pix * sizeof(uint16_t))); | 39 vpx_memalign(16, num_pix * sizeof(*ctx->eobs[i][k]))); |
40 ctx->coeff_pbuf[i][k] = ctx->coeff[i][k]; | 40 ctx->coeff_pbuf[i][k] = ctx->coeff[i][k]; |
41 ctx->qcoeff_pbuf[i][k] = ctx->qcoeff[i][k]; | 41 ctx->qcoeff_pbuf[i][k] = ctx->qcoeff[i][k]; |
42 ctx->dqcoeff_pbuf[i][k] = ctx->dqcoeff[i][k]; | 42 ctx->dqcoeff_pbuf[i][k] = ctx->dqcoeff[i][k]; |
43 ctx->eobs_pbuf[i][k] = ctx->eobs[i][k]; | 43 ctx->eobs_pbuf[i][k] = ctx->eobs[i][k]; |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 static void free_mode_context(PICK_MODE_CONTEXT *ctx) { | 48 static void free_mode_context(PICK_MODE_CONTEXT *ctx) { |
49 int i, k; | 49 int i, k; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 // Sets up all the leaf nodes in the tree. | 150 // Sets up all the leaf nodes in the tree. |
151 for (i = 0; i < tree_nodes; ++i) | 151 for (i = 0; i < tree_nodes; ++i) |
152 free_tree_contexts(&cpi->pc_tree[i]); | 152 free_tree_contexts(&cpi->pc_tree[i]); |
153 | 153 |
154 vpx_free(cpi->pc_tree); | 154 vpx_free(cpi->pc_tree); |
155 cpi->pc_tree = NULL; | 155 cpi->pc_tree = NULL; |
156 vpx_free(cpi->leaf_tree); | 156 vpx_free(cpi->leaf_tree); |
157 cpi->leaf_tree = NULL; | 157 cpi->leaf_tree = NULL; |
158 } | 158 } |
OLD | NEW |