Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-19 12:02:05 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-19 12:02:05 +0400
commit83c91bb22d9e0dcd1c4ce8e0d4243f39b9287c8d (patch)
tree2b0eb17055091d6eef58ad0e67899adcb8053ad6 /source
parentcc90116c5a4be64fe55b86aad9fc9f47185690d8 (diff)
parent69ee17f0b6121ab63f0a7712c9563295eda88d39 (diff)
Proxies: FFmpeg proxy builder wasn't taking image quality into account at all
which made it using default quality settings which are really bad for camera tracking (and perhaps for CSE too). haven't found Jpeg quality setting for FFmpeg which will behave in the same way as quality setting for image sequence, but seems that mapping image quality from 1..100 UI range to 31..1 range of qmin/qmax gives expected result. -- svn merge -r44228:44230 ^/branches/soc-2011-tomato
Diffstat (limited to 'source')
-rw-r--r--source/blender/imbuf/intern/indexer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index e1481d2a08f..ade63aa1e9c 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -459,12 +459,13 @@ static int round_up(int x, int mod)
static struct proxy_output_ctx * alloc_proxy_output_ffmpeg(
struct anim * anim,
AVStream * st, int proxy_size, int width, int height,
- int UNUSED(quality))
+ int quality)
{
struct proxy_output_ctx * rv = MEM_callocN(
sizeof(struct proxy_output_ctx), "alloc_proxy_output");
char fname[FILE_MAX];
+ int ffmpeg_quality;
// JPEG requires this
width = round_up(width, 8);
@@ -514,6 +515,12 @@ static struct proxy_output_ctx * alloc_proxy_output_ffmpeg(
rv->c->time_base.num = 1;
rv->st->time_base = rv->c->time_base;
+ /* there's no way to set JPEG quality in the same way as in AVI JPEG and image sequence,
+ * but this seems to be giving expected quality result */
+ ffmpeg_quality = (int)(1.0f + 30.0f * (1.0f - (float)quality / 100.0f) + 0.5f);
+ av_set_int(rv->c, "qmin", ffmpeg_quality);
+ av_set_int(rv->c, "qmax", ffmpeg_quality);
+
if (rv->of->flags & AVFMT_GLOBALHEADER) {
rv->c->flags |= CODEC_FLAG_GLOBAL_HEADER;
}