Cleanup: Remove deprecated movie formats code

This patch removes code handling the now-deprecated movie formats.

Pull Request: https://projects.blender.org/blender/blender/pulls/144188
This commit is contained in:
Omar Emara
2025-08-08 10:28:19 +02:00
committed by Omar Emara
parent e72e049c84
commit a252ebb531
6 changed files with 18 additions and 82 deletions

View File

@@ -303,26 +303,12 @@ bool BKE_imtype_is_image(const char imtype)
bool BKE_imtype_is_multi_layer_image(const char imtype)
{
switch (imtype) {
case R_IMF_IMTYPE_MULTILAYER:
return true;
}
return false;
return imtype == R_IMF_IMTYPE_MULTILAYER;
}
bool BKE_imtype_is_movie(const char imtype)
{
switch (imtype) {
case R_IMF_IMTYPE_AVIRAW:
case R_IMF_IMTYPE_AVIJPEG:
case R_IMF_IMTYPE_FFMPEG:
case R_IMF_IMTYPE_H264:
case R_IMF_IMTYPE_THEORA:
case R_IMF_IMTYPE_XVID:
case R_IMF_IMTYPE_AV1:
return true;
}
return false;
return imtype == R_IMF_IMTYPE_FFMPEG;
}
bool BKE_imtype_supports_compress(const char imtype)
@@ -339,7 +325,6 @@ bool BKE_imtype_supports_quality(const char imtype)
switch (imtype) {
case R_IMF_IMTYPE_JPEG90:
case R_IMF_IMTYPE_JP2:
case R_IMF_IMTYPE_AVIJPEG:
case R_IMF_IMTYPE_WEBP:
return true;
}
@@ -475,12 +460,6 @@ char BKE_imtype_from_arg(const char *imtype_arg)
if (STREQ(imtype_arg, "RAWTGA")) {
return R_IMF_IMTYPE_RAWTGA;
}
if (STREQ(imtype_arg, "AVIRAW")) {
return R_IMF_IMTYPE_AVIRAW;
}
if (STREQ(imtype_arg, "AVIJPEG")) {
return R_IMF_IMTYPE_AVIJPEG;
}
if (STREQ(imtype_arg, "PNG")) {
return R_IMF_IMTYPE_PNG;
}
@@ -552,14 +531,7 @@ static int image_path_ext_from_imformat_impl(const char imtype,
else if (imtype == R_IMF_IMTYPE_RADHDR) {
r_ext[ext_num++] = ".hdr";
}
else if (ELEM(imtype,
R_IMF_IMTYPE_PNG,
R_IMF_IMTYPE_FFMPEG,
R_IMF_IMTYPE_H264,
R_IMF_IMTYPE_THEORA,
R_IMF_IMTYPE_XVID,
R_IMF_IMTYPE_AV1))
{
else if (ELEM(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG)) {
r_ext[ext_num++] = ".png";
}
else if (imtype == R_IMF_IMTYPE_DDS) {
@@ -615,7 +587,7 @@ static int image_path_ext_from_imformat_impl(const char imtype,
}
#endif
else {
/* Handles: #R_IMF_IMTYPE_AVIRAW, #R_IMF_IMTYPE_AVIJPEG, #R_IMF_IMTYPE_JPEG90 etc. */
/* Handles: #R_IMF_IMTYPE_JPEG90 etc. */
r_ext[ext_num++] = ".jpg";
r_ext[ext_num++] = ".jpeg";
}
@@ -775,14 +747,7 @@ void BKE_image_format_to_imbuf(ImBuf *ibuf, const ImageFormatData *imf)
else if (imtype == R_IMF_IMTYPE_RADHDR) {
ibuf->ftype = IMB_FTYPE_RADHDR;
}
else if (ELEM(imtype,
R_IMF_IMTYPE_PNG,
R_IMF_IMTYPE_FFMPEG,
R_IMF_IMTYPE_H264,
R_IMF_IMTYPE_THEORA,
R_IMF_IMTYPE_XVID,
R_IMF_IMTYPE_AV1))
{
else if (ELEM(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG)) {
ibuf->ftype = IMB_FTYPE_PNG;
if (imtype == R_IMF_IMTYPE_PNG) {

View File

@@ -586,7 +586,10 @@ void do_versions_after_linking_420(FileData *fd, Main *bmain)
static void image_settings_avi_to_ffmpeg(Scene *scene)
{
if (ELEM(scene->r.im_format.imtype, R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG)) {
/* R_IMF_IMTYPE_AVIRAW and R_IMF_IMTYPE_AVIJPEG. */
constexpr char deprecated_avi_raw_imtype = 15;
constexpr char deprecated_avi_jpeg_imtype = 16;
if (ELEM(scene->r.im_format.imtype, deprecated_avi_raw_imtype, deprecated_avi_jpeg_imtype)) {
scene->r.im_format.imtype = R_IMF_IMTYPE_FFMPEG;
}
}

View File

@@ -547,26 +547,6 @@ void MOV_validate_output_settings(RenderData *rd, const ImageFormatData *imf)
rd->ffcodecdata.type = FFMPEG_MPEG2;
}
}
else if (imf->imtype == R_IMF_IMTYPE_H264) {
if (rd->ffcodecdata.codec_id_get() != FFMPEG_CODEC_ID_H264) {
ffmpeg_preset_set(rd, FFMPEG_PRESET_H264);
}
}
else if (imf->imtype == R_IMF_IMTYPE_XVID) {
if (rd->ffcodecdata.codec_id_get() != FFMPEG_CODEC_ID_MPEG4) {
ffmpeg_preset_set(rd, FFMPEG_PRESET_XVID);
}
}
else if (imf->imtype == R_IMF_IMTYPE_THEORA) {
if (rd->ffcodecdata.codec_id_get() != FFMPEG_CODEC_ID_THEORA) {
ffmpeg_preset_set(rd, FFMPEG_PRESET_THEORA);
}
}
else if (imf->imtype == R_IMF_IMTYPE_AV1) {
if (rd->ffcodecdata.codec_id_get() != FFMPEG_CODEC_ID_AV1) {
ffmpeg_preset_set(rd, FFMPEG_PRESET_AV1);
}
}
#else
UNUSED_VARS(rd, imf);
#endif

View File

@@ -1728,18 +1728,6 @@ static void ffmpeg_movie_close(MovieWriter *context)
#endif /* WITH_FFMPEG */
static bool is_imtype_ffmpeg(const char imtype)
{
return ELEM(imtype,
R_IMF_IMTYPE_AVIRAW,
R_IMF_IMTYPE_AVIJPEG,
R_IMF_IMTYPE_FFMPEG,
R_IMF_IMTYPE_H264,
R_IMF_IMTYPE_XVID,
R_IMF_IMTYPE_THEORA,
R_IMF_IMTYPE_AV1);
}
MovieWriter *MOV_write_begin(const char imtype,
const Scene *scene,
const RenderData *rd,
@@ -1749,7 +1737,7 @@ MovieWriter *MOV_write_begin(const char imtype,
bool preview,
const char *suffix)
{
if (!is_imtype_ffmpeg(imtype)) {
if (imtype != R_IMF_IMTYPE_FFMPEG) {
BKE_report(reports, RPT_ERROR, "Image format is not a movie format");
return nullptr;
}
@@ -1804,7 +1792,7 @@ void MOV_filepath_from_settings(char filepath[/*FILE_MAX*/ 1024],
ReportList *reports)
{
#ifdef WITH_FFMPEG
if (is_imtype_ffmpeg(rd->im_format.imtype)) {
if (rd->im_format.imtype == R_IMF_IMTYPE_FFMPEG) {
ffmpeg_get_filepath(filepath, scene, rd, preview, suffix, reports);
return;
}

View File

@@ -533,8 +533,8 @@ enum {
// R_MOVIE = 5, /* DEPRECATED */
R_IMF_IMTYPE_IRIZ = 7,
R_IMF_IMTYPE_RAWTGA = 14,
R_IMF_IMTYPE_AVIRAW = 15,
R_IMF_IMTYPE_AVIJPEG = 16,
/* R_IMF_IMTYPE_AVIRAW = 15, DEPRECATED */
/* R_IMF_IMTYPE_AVIJPEG = 16, DEPRECATED */
R_IMF_IMTYPE_PNG = 17,
// R_IMF_IMTYPE_AVICODEC = 18, /* DEPRECATED */
// R_IMF_IMTYPE_QUICKTIME = 19, /* DEPRECATED */
@@ -549,12 +549,12 @@ enum {
R_IMF_IMTYPE_MULTILAYER = 28,
R_IMF_IMTYPE_DDS = 29,
R_IMF_IMTYPE_JP2 = 30,
R_IMF_IMTYPE_H264 = 31,
R_IMF_IMTYPE_XVID = 32,
R_IMF_IMTYPE_THEORA = 33,
/* R_IMF_IMTYPE_H264 = 31, DEPRECATED */
/* R_IMF_IMTYPE_XVID = 32, DEPRECATED */
/* R_IMF_IMTYPE_THEORA = 33, DEPRECATED */
R_IMF_IMTYPE_PSD = 34,
R_IMF_IMTYPE_WEBP = 35,
R_IMF_IMTYPE_AV1 = 36,
/* R_IMF_IMTYPE_AV1 = 36, DEPRECATED */
R_IMF_IMTYPE_INVALID = 255,
};

View File

@@ -2026,7 +2026,7 @@ static const char arg_handle_image_type_set_doc[] =
"<format>\n"
"\tSet the render format.\n"
"\tValid options are:\n"
"\t'TGA' 'RAWTGA' 'JPEG' 'IRIS' 'AVIRAW' 'AVIJPEG' 'PNG' 'BMP' 'HDR' 'TIFF'.\n"
"\t'TGA' 'RAWTGA' 'JPEG' 'IRIS' 'PNG' 'BMP' 'HDR' 'TIFF'.\n"
"\n"
"\tFormats that can be compiled into Blender, not available on all systems:\n"
"\t'OPEN_EXR' 'OPEN_EXR_MULTILAYER' 'FFMPEG' 'CINEON' 'DPX' 'JP2' 'WEBP'.";