/* * Copyright (c) 2012 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.
*/
/* MFQE: Multiframe Quality Enhancement * In rate limited situations keyframes may cause significant visual artifacts * commonly referred to as "popping." This file implements a postproccesing * algorithm which blends data from the preceeding frame when there is no * motion and the q from the previous frame is lower which indicates that it is * higher quality.
*/
staticvoid filter_by_weight(unsignedchar *src, int src_stride, unsignedchar *dst, int dst_stride, int block_size, int src_weight) { int dst_weight = (1 << MFQE_PRECISION) - src_weight; int rounding_bit = 1 << (MFQE_PRECISION - 1); int r, c;
for (r = 0; r < block_size; ++r) { for (c = 0; c < block_size; ++c) {
dst[c] = (src[c] * src_weight + dst[c] * dst_weight + rounding_bit) >>
MFQE_PRECISION;
}
src += src_stride;
dst += dst_stride;
}
}
void vp8_filter_by_weight16x16_c(unsignedchar *src, int src_stride, unsignedchar *dst, int dst_stride, int src_weight) {
filter_by_weight(src, src_stride, dst, dst_stride, 16, src_weight);
}
void vp8_filter_by_weight8x8_c(unsignedchar *src, int src_stride, unsignedchar *dst, int dst_stride, int src_weight) {
filter_by_weight(src, src_stride, dst, dst_stride, 8, src_weight);
}
void vp8_filter_by_weight4x4_c(unsignedchar *src, int src_stride, unsignedchar *dst, int dst_stride, int src_weight) {
filter_by_weight(src, src_stride, dst, dst_stride, 4, src_weight);
}
staticvoid apply_ifactor(unsignedchar *y_src, int y_src_stride, unsignedchar *y_dst, int y_dst_stride, unsignedchar *u_src, unsignedchar *v_src, int uv_src_stride, unsignedchar *u_dst, unsignedchar *v_dst, int uv_dst_stride, int block_size, int src_weight) { if (block_size == 16) {
vp8_filter_by_weight16x16(y_src, y_src_stride, y_dst, y_dst_stride,
src_weight);
vp8_filter_by_weight8x8(u_src, uv_src_stride, u_dst, uv_dst_stride,
src_weight);
vp8_filter_by_weight8x8(v_src, uv_src_stride, v_dst, uv_dst_stride,
src_weight);
} else {
vp8_filter_by_weight8x8(y_src, y_src_stride, y_dst, y_dst_stride,
src_weight);
vp8_filter_by_weight4x4(u_src, uv_src_stride, u_dst, uv_dst_stride,
src_weight);
vp8_filter_by_weight4x4(v_src, uv_src_stride, v_dst, uv_dst_stride,
src_weight);
}
}
staticunsignedint int_sqrt(unsignedint x) { unsignedint y = x; unsignedint guess; int p = 1; while (y >>= 1) p++;
p >>= 1;
FRAME_TYPE frame_type = cm->frame_type; /* Point at base of Mb MODE_INFO list has motion vectors etc */ const MODE_INFO *mode_info_context = cm->mi; int mb_row; int mb_col; int totmap, map[4]; int qcurr = cm->base_qindex; int qprev = cm->postproc_state.last_base_qindex;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.