Sequencer: Made subsampling a transform option.

There are cases where automatic selection of subsampling doesn't work
This patch move adds a filtering option that
can enable this.
This commit is contained in:
Jeroen Bakker 2023-01-26 15:03:19 +01:00
parent f210842a72
commit 3b17d6c619
4 changed files with 22 additions and 8 deletions

@ -1 +1 @@
Subproject commit d887a4ea6b2a9d64b926034d4e78ecf7a48ca979
Subproject commit 9958ddb879934718cc2b379b556f0bc3b861bee5

View File

@ -795,6 +795,7 @@ typedef enum SequenceColorTag {
enum {
SEQ_TRANSFORM_FILTER_NEAREST = 0,
SEQ_TRANSFORM_FILTER_BILINEAR = 1,
SEQ_TRANSFORM_FILTER_NEAREST_3x3 = 2,
};
typedef enum eSeqChannelFlag {

View File

@ -1510,6 +1510,11 @@ static void rna_def_strip_crop(BlenderRNA *brna)
static const EnumPropertyItem transform_filter_items[] = {
{SEQ_TRANSFORM_FILTER_NEAREST, "NEAREST", 0, "Nearest", ""},
{SEQ_TRANSFORM_FILTER_BILINEAR, "BILINEAR", 0, "Bilinear", ""},
{SEQ_TRANSFORM_FILTER_NEAREST_3x3,
"SUBSAMPLING_3x3",
0,
"Subsampling (3x3)",
"Use nearest with 3x3 subsamples during rendering"},
{0, NULL, 0, NULL, NULL},
};

View File

@ -515,16 +515,24 @@ static void sequencer_preprocess_transform_crop(
const float crop_scale_factor = do_scale_to_render_size ? preview_scale_factor : 1.0f;
sequencer_image_crop_init(seq, in, crop_scale_factor, &source_crop);
eIMBInterpolationFilterMode filter;
const StripTransform *transform = seq->strip->transform;
if (transform->filter == SEQ_TRANSFORM_FILTER_NEAREST) {
filter = IMB_FILTER_NEAREST;
}
else {
filter = IMB_FILTER_BILINEAR;
eIMBInterpolationFilterMode filter;
int num_subsamples = 1;
switch (transform->filter) {
case SEQ_TRANSFORM_FILTER_NEAREST:
filter = IMB_FILTER_NEAREST;
num_subsamples = 1;
break;
case SEQ_TRANSFORM_FILTER_BILINEAR:
filter = IMB_FILTER_BILINEAR;
num_subsamples = 1;
break;
case SEQ_TRANSFORM_FILTER_NEAREST_3x3:
filter = IMB_FILTER_NEAREST;
num_subsamples = G.is_rendering ? 3 : 1;
break;
}
const int num_subsamples = G.is_rendering ? 3 : 1;
IMB_transform(in,
out,
IMB_TRANSFORM_MODE_CROP_SRC,