8fd3f9a2fb
For key frame at speed 6: enable the non-rd mode selection in speed setting and use the (non-rd) variance_based partition. Adjust some logic/thresholds in variance partition selection for key frame only (no change to delta frames), mainly to bias to selecting smaller prediction blocks, and also set max tx size of 16x16. Loss in key frame quality (~0.6-0.7dB) compared to rd coding, but speeds up key frame encoding by at least 6x. Average PNSR/SSIM metrics over RTC clips go down by ~1-2% for speed 6. Change-Id: Ie4845e0127e876337b9c105aa37e93b286193405
54 lines
1.4 KiB
C
54 lines
1.4 KiB
C
/*
|
|
* Copyright (c) 2014 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 "vp9/common/vp9_common.h"
|
|
#include "vpx_ports/mem.h"
|
|
|
|
unsigned int vp9_avg_8x8_c(const uint8_t *s, int p) {
|
|
int i, j;
|
|
int sum = 0;
|
|
for (i = 0; i < 8; ++i, s+=p)
|
|
for (j = 0; j < 8; sum += s[j], ++j) {}
|
|
|
|
return (sum + 32) >> 6;
|
|
}
|
|
|
|
unsigned int vp9_avg_4x4_c(const uint8_t *s, int p) {
|
|
int i, j;
|
|
int sum = 0;
|
|
for (i = 0; i < 4; ++i, s+=p)
|
|
for (j = 0; j < 4; sum += s[j], ++j) {}
|
|
|
|
return (sum + 8) >> 4;
|
|
}
|
|
|
|
#if CONFIG_VP9_HIGHBITDEPTH
|
|
unsigned int vp9_highbd_avg_8x8_c(const uint8_t *s8, int p) {
|
|
int i, j;
|
|
int sum = 0;
|
|
const uint16_t* s = CONVERT_TO_SHORTPTR(s8);
|
|
for (i = 0; i < 8; ++i, s+=p)
|
|
for (j = 0; j < 8; sum += s[j], ++j) {}
|
|
|
|
return (sum + 32) >> 6;
|
|
}
|
|
|
|
unsigned int vp9_highbd_avg_4x4_c(const uint8_t *s8, int p) {
|
|
int i, j;
|
|
int sum = 0;
|
|
const uint16_t* s = CONVERT_TO_SHORTPTR(s8);
|
|
for (i = 0; i < 4; ++i, s+=p)
|
|
for (j = 0; j < 4; sum += s[j], ++j) {}
|
|
|
|
return (sum + 8) >> 4;
|
|
}
|
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
|
|
|
|