/* * 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.
*/
/* Note: The first row & first column in mip are outside the frame, which * were initialized to all 0.(ref_frame, mode, mv...) * Their ref_frame = 0 means they won't be counted in the following * calculation.
*/ if (cpi->oxcf.mr_total_resolutions > 1 &&
cpi->oxcf.mr_encoder_id < (cpi->oxcf.mr_total_resolutions - 1)) { /* Store info for show/no-show frames for supporting alt_ref. * If parent frame is alt_ref, child has one too.
*/
LOWER_RES_FRAME_INFO *store_info =
(LOWER_RES_FRAME_INFO *)cpi->oxcf.mr_low_res_mode_info;
store_info->frame_type = cm->frame_type;
if (cm->frame_type != KEY_FRAME) { int i;
store_info->is_frame_dropped = 0; for (i = 1; i < MAX_REF_FRAMES; ++i)
store_info->low_res_ref_frames[i] = cpi->current_ref_frames[i];
}
if (cm->frame_type != KEY_FRAME) { int mb_row; int mb_col; /* Point to beginning of allocated MODE_INFO arrays. */
MODE_INFO *tmp = cm->mip + cm->mode_info_stride;
LOWER_RES_MB_INFO *store_mode_info = store_info->mb_info;
for (mb_row = 0; mb_row < cm->mb_rows; ++mb_row) {
tmp++; for (mb_col = 0; mb_col < cm->mb_cols; ++mb_col) { int dissim = INT_MAX;
if (tmp->mbmi.ref_frame != INTRA_FRAME) { int mvx[8]; int mvy[8]; int mmvx; int mmvy; int cnt = 0; const MODE_INFO *here = tmp; const MODE_INFO *above = here - cm->mode_info_stride; const MODE_INFO *left = here - 1; const MODE_INFO *aboveleft = above - 1; const MODE_INFO *aboveright = NULL; const MODE_INFO *right = NULL; const MODE_INFO *belowleft = NULL; const MODE_INFO *below = NULL; const MODE_INFO *belowright = NULL;
/* If alternate reference frame is used, we have to
* check sign of MV. */ if (cpi->oxcf.play_alternate) { /* Gather mv of neighboring MBs */
GET_MV_SIGN(above)
GET_MV_SIGN(left)
GET_MV_SIGN(aboveleft)
if (mb_col < (cm->mb_cols - 1)) {
right = here + 1;
aboveright = above + 1;
GET_MV_SIGN(right)
GET_MV_SIGN(aboveright)
}
if (mb_row < (cm->mb_rows - 1)) {
below = here + cm->mode_info_stride;
belowleft = below - 1;
GET_MV_SIGN(below)
GET_MV_SIGN(belowleft)
}
if (mb_col < (cm->mb_cols - 1) && mb_row < (cm->mb_rows - 1)) {
belowright = below + 1;
GET_MV_SIGN(belowright)
}
} else { /* No alt_ref and gather mv of neighboring MBs */
GET_MV(above)
GET_MV(left)
GET_MV(aboveleft)
if (mb_col < (cm->mb_cols - 1)) {
right = here + 1;
aboveright = above + 1;
GET_MV(right)
GET_MV(aboveright)
}
if (mb_row < (cm->mb_rows - 1)) {
below = here + cm->mode_info_stride;
belowleft = below - 1;
GET_MV(below)
GET_MV(belowleft)
}
/* Store mode info for next resolution encoding */
store_mode_info->mode = tmp->mbmi.mode;
store_mode_info->ref_frame = tmp->mbmi.ref_frame;
store_mode_info->mv.as_int = tmp->mbmi.mv.as_int;
store_mode_info->dissim = dissim;
tmp++;
store_mode_info++;
}
}
}
}
}
/* This function is called only when this frame is dropped at current
resolution level. */ void vp8_store_drop_frame_info(VP8_COMP *cpi) { /* If the frame is dropped in lower-resolution encoding, this information is passed to higher resolution level so that the encoder knows there is no mode & motion info available.
*/ if (cpi->oxcf.mr_total_resolutions > 1 &&
cpi->oxcf.mr_encoder_id < (cpi->oxcf.mr_total_resolutions - 1)) { /* Store info for show/no-show frames for supporting alt_ref. * If parent frame is alt_ref, child has one too.
*/
LOWER_RES_FRAME_INFO *store_info =
(LOWER_RES_FRAME_INFO *)cpi->oxcf.mr_low_res_mode_info;
/* Set frame_type to be INTER_FRAME since we won't drop key frame. */
store_info->frame_type = INTER_FRAME;
store_info->is_frame_dropped = 1;
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
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.