vp9_encodeintra.c 1.15 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5
6
 *  that can be found in the LICENSE file in the root of the source
 *  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.
John Koleszar's avatar
John Koleszar committed
9
10
 */

11
#include "./vpx_config.h"
12
#include "vp9_rtcd.h"
13
#include "vp9/encoder/vp9_quantize.h"
14
#include "vp9/common/vp9_reconintra.h"
15
#include "vp9/encoder/vp9_encodemb.h"
16
#include "vp9/common/vp9_invtrans.h"
17
#include "vp9/encoder/vp9_encodeintra.h"
John Koleszar's avatar
John Koleszar committed
18

19
int vp9_encode_intra(VP9_COMP *cpi, MACROBLOCK *x, int use_16x16_pred) {
Paul Wilkins's avatar
Paul Wilkins committed
20
  MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi;
John Koleszar's avatar
John Koleszar committed
21
  (void) cpi;
22
  mbmi->mode = DC_PRED;
Ronald S. Bultje's avatar
Ronald S. Bultje committed
23
  mbmi->ref_frame[0] = INTRA_FRAME;
John Koleszar's avatar
John Koleszar committed
24
  if (use_16x16_pred) {
25
26
    mbmi->txfm_size = mbmi->sb_type >= BLOCK_SIZE_MB16X16 ? TX_16X16 : TX_8X8;
    vp9_encode_intra_block_y(&cpi->common, x, mbmi->sb_type);
John Koleszar's avatar
John Koleszar committed
27
  } else {
28
    mbmi->txfm_size = TX_4X4;
29
    vp9_encode_intra_block_y(&cpi->common, x, mbmi->sb_type);
John Koleszar's avatar
John Koleszar committed
30
  }
Tero Rintaluoma's avatar
Tero Rintaluoma committed
31

32
  return vp9_get_mb_ss(x->plane[0].src_diff);
Tero Rintaluoma's avatar
Tero Rintaluoma committed
33
}