Merge "Removing unnecessary casts from quantization code."
This commit is contained in:
@@ -374,10 +374,10 @@ static void separate_arf_mbs(VP9_COMP *cpi) {
|
|||||||
cpi->static_mb_pct = 0;
|
cpi->static_mb_pct = 0;
|
||||||
|
|
||||||
cpi->seg0_cnt = ncnt[0];
|
cpi->seg0_cnt = ncnt[0];
|
||||||
vp9_enable_segmentation((VP9_PTR)cpi);
|
vp9_enable_segmentation(&cm->seg);
|
||||||
} else {
|
} else {
|
||||||
cpi->static_mb_pct = 0;
|
cpi->static_mb_pct = 0;
|
||||||
vp9_disable_segmentation((VP9_PTR)cpi);
|
vp9_disable_segmentation(&cm->seg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free localy allocated storage
|
// Free localy allocated storage
|
||||||
|
@@ -263,7 +263,7 @@ static void setup_in_frame_q_adj(VP9_COMP *cpi) {
|
|||||||
// Clear down the complexity map used for rd
|
// Clear down the complexity map used for rd
|
||||||
vpx_memset(cpi->complexity_map, 0, cm->mi_rows * cm->mi_cols);
|
vpx_memset(cpi->complexity_map, 0, cm->mi_rows * cm->mi_cols);
|
||||||
|
|
||||||
vp9_enable_segmentation((VP9_PTR)cpi);
|
vp9_enable_segmentation(seg);
|
||||||
vp9_clearall_segfeatures(seg);
|
vp9_clearall_segfeatures(seg);
|
||||||
|
|
||||||
// Select delta coding method
|
// Select delta coding method
|
||||||
@@ -297,7 +297,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
|
|||||||
cpi->static_mb_pct = 0;
|
cpi->static_mb_pct = 0;
|
||||||
|
|
||||||
// Disable segmentation
|
// Disable segmentation
|
||||||
vp9_disable_segmentation((VP9_PTR)cpi);
|
vp9_disable_segmentation(seg);
|
||||||
|
|
||||||
// Clear down the segment features.
|
// Clear down the segment features.
|
||||||
vp9_clearall_segfeatures(seg);
|
vp9_clearall_segfeatures(seg);
|
||||||
@@ -310,7 +310,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
|
|||||||
cpi->static_mb_pct = 0;
|
cpi->static_mb_pct = 0;
|
||||||
|
|
||||||
// Disable segmentation and individual segment features by default
|
// Disable segmentation and individual segment features by default
|
||||||
vp9_disable_segmentation((VP9_PTR)cpi);
|
vp9_disable_segmentation(seg);
|
||||||
vp9_clearall_segfeatures(seg);
|
vp9_clearall_segfeatures(seg);
|
||||||
|
|
||||||
// Scan frames from current to arf frame.
|
// Scan frames from current to arf frame.
|
||||||
@@ -363,7 +363,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
|
|||||||
// Disable segmentation and clear down features if alt ref
|
// Disable segmentation and clear down features if alt ref
|
||||||
// is not active for this group
|
// is not active for this group
|
||||||
|
|
||||||
vp9_disable_segmentation((VP9_PTR)cpi);
|
vp9_disable_segmentation(seg);
|
||||||
|
|
||||||
vpx_memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols);
|
vpx_memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols);
|
||||||
|
|
||||||
@@ -3895,15 +3895,15 @@ int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!map) {
|
if (!map) {
|
||||||
vp9_disable_segmentation((VP9_PTR)cpi);
|
vp9_disable_segmentation(seg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the segmentation Map
|
// Set the segmentation Map
|
||||||
vp9_set_segmentation_map((VP9_PTR)cpi, map);
|
vp9_set_segmentation_map(cpi, map);
|
||||||
|
|
||||||
// Activate segmentation.
|
// Activate segmentation.
|
||||||
vp9_enable_segmentation((VP9_PTR)cpi);
|
vp9_enable_segmentation(seg);
|
||||||
|
|
||||||
// Set up the quant, LF and breakout threshold segment data
|
// Set up the quant, LF and breakout threshold segment data
|
||||||
for (i = 0; i < MAX_SEGMENTS; i++) {
|
for (i = 0; i < MAX_SEGMENTS; i++) {
|
||||||
@@ -3927,7 +3927,7 @@ int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows,
|
|||||||
|
|
||||||
// Initialize the feature data structure
|
// Initialize the feature data structure
|
||||||
// SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1
|
// SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1
|
||||||
vp9_set_segment_data((VP9_PTR)cpi, &feature_data[0][0], SEGMENT_DELTADATA);
|
vp9_set_segment_data(seg, &feature_data[0][0], SEGMENT_DELTADATA);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -10,29 +10,25 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
#include "vp9/encoder/vp9_segmentation.h"
|
|
||||||
#include "vp9/common/vp9_pred_common.h"
|
#include "vp9/common/vp9_pred_common.h"
|
||||||
#include "vp9/common/vp9_tile_common.h"
|
#include "vp9/common/vp9_tile_common.h"
|
||||||
|
|
||||||
void vp9_enable_segmentation(VP9_PTR ptr) {
|
#include "vp9/encoder/vp9_segmentation.h"
|
||||||
VP9_COMP *cpi = (VP9_COMP *)ptr;
|
|
||||||
struct segmentation *const seg = &cpi->common.seg;
|
|
||||||
|
|
||||||
|
void vp9_enable_segmentation(struct segmentation *seg) {
|
||||||
seg->enabled = 1;
|
seg->enabled = 1;
|
||||||
seg->update_map = 1;
|
seg->update_map = 1;
|
||||||
seg->update_data = 1;
|
seg->update_data = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vp9_disable_segmentation(VP9_PTR ptr) {
|
void vp9_disable_segmentation(struct segmentation *seg) {
|
||||||
VP9_COMP *cpi = (VP9_COMP *)ptr;
|
|
||||||
struct segmentation *const seg = &cpi->common.seg;
|
|
||||||
seg->enabled = 0;
|
seg->enabled = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vp9_set_segmentation_map(VP9_PTR ptr,
|
void vp9_set_segmentation_map(VP9_COMP *cpi, unsigned char *segmentation_map) {
|
||||||
unsigned char *segmentation_map) {
|
|
||||||
VP9_COMP *cpi = (VP9_COMP *)ptr;
|
|
||||||
struct segmentation *const seg = &cpi->common.seg;
|
struct segmentation *const seg = &cpi->common.seg;
|
||||||
|
|
||||||
// Copy in the new segmentation map
|
// Copy in the new segmentation map
|
||||||
@@ -44,12 +40,9 @@ void vp9_set_segmentation_map(VP9_PTR ptr,
|
|||||||
seg->update_data = 1;
|
seg->update_data = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vp9_set_segment_data(VP9_PTR ptr,
|
void vp9_set_segment_data(struct segmentation *seg,
|
||||||
signed char *feature_data,
|
signed char *feature_data,
|
||||||
unsigned char abs_delta) {
|
unsigned char abs_delta) {
|
||||||
VP9_COMP *cpi = (VP9_COMP *)ptr;
|
|
||||||
struct segmentation *const seg = &cpi->common.seg;
|
|
||||||
|
|
||||||
seg->abs_delta = abs_delta;
|
seg->abs_delta = abs_delta;
|
||||||
|
|
||||||
vpx_memcpy(seg->feature_data, feature_data, sizeof(seg->feature_data));
|
vpx_memcpy(seg->feature_data, feature_data, sizeof(seg->feature_data));
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void vp9_enable_segmentation(VP9_PTR ptr);
|
void vp9_enable_segmentation(struct segmentation *seg);
|
||||||
void vp9_disable_segmentation(VP9_PTR ptr);
|
void vp9_disable_segmentation(struct segmentation *seg);
|
||||||
|
|
||||||
void vp9_disable_segfeature(struct segmentation *seg,
|
void vp9_disable_segfeature(struct segmentation *seg,
|
||||||
int segment_id,
|
int segment_id,
|
||||||
@@ -30,7 +30,7 @@ void vp9_clear_segdata(struct segmentation *seg,
|
|||||||
SEG_LVL_FEATURES feature_id);
|
SEG_LVL_FEATURES feature_id);
|
||||||
// Valid values for a segment are 0 to 3
|
// Valid values for a segment are 0 to 3
|
||||||
// Segmentation map is arrange as [Rows][Columns]
|
// Segmentation map is arrange as [Rows][Columns]
|
||||||
void vp9_set_segmentation_map(VP9_PTR ptr, unsigned char *segmentation_map);
|
void vp9_set_segmentation_map(VP9_COMP *cpi, unsigned char *segmentation_map);
|
||||||
|
|
||||||
// The values given for each segment can be either deltas (from the default
|
// The values given for each segment can be either deltas (from the default
|
||||||
// value chosen for the frame) or absolute values.
|
// value chosen for the frame) or absolute values.
|
||||||
@@ -42,7 +42,7 @@ void vp9_set_segmentation_map(VP9_PTR ptr, unsigned char *segmentation_map);
|
|||||||
//
|
//
|
||||||
// abs_delta = SEGMENT_DELTADATA (deltas) abs_delta = SEGMENT_ABSDATA (use
|
// abs_delta = SEGMENT_DELTADATA (deltas) abs_delta = SEGMENT_ABSDATA (use
|
||||||
// the absolute values given).
|
// the absolute values given).
|
||||||
void vp9_set_segment_data(VP9_PTR ptr, signed char *feature_data,
|
void vp9_set_segment_data(struct segmentation *seg, signed char *feature_data,
|
||||||
unsigned char abs_delta);
|
unsigned char abs_delta);
|
||||||
|
|
||||||
void vp9_choose_segmap_coding_method(VP9_COMP *cpi);
|
void vp9_choose_segmap_coding_method(VP9_COMP *cpi);
|
||||||
|
@@ -83,7 +83,7 @@ void vp9_vaq_frame_setup(VP9_COMP *cpi) {
|
|||||||
if (cm->frame_type == KEY_FRAME ||
|
if (cm->frame_type == KEY_FRAME ||
|
||||||
cpi->refresh_alt_ref_frame ||
|
cpi->refresh_alt_ref_frame ||
|
||||||
(cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
|
(cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
|
||||||
vp9_enable_segmentation((VP9_PTR)cpi);
|
vp9_enable_segmentation(seg);
|
||||||
vp9_clearall_segfeatures(seg);
|
vp9_clearall_segfeatures(seg);
|
||||||
|
|
||||||
seg->abs_delta = SEGMENT_DELTADATA;
|
seg->abs_delta = SEGMENT_DELTADATA;
|
||||||
|
Reference in New Issue
Block a user