summaryrefslogtreecommitdiffstats
path: root/screenshot.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-01-18 02:09:43 +0100
committerwm4 <wm4@mplayer2.org>2012-01-18 02:53:30 +0100
commit4e76c7514f847648cdc9740d6ef997d1653effa8 (patch)
treef0b16dbb9f98d30bfee4281fcaf2840b4262b148 /screenshot.c
parent2e0bae181f155541922278d681185a5b84f602b4 (diff)
downloadmpv-4e76c7514f847648cdc9740d6ef997d1653effa8.tar.bz2
mpv-4e76c7514f847648cdc9740d6ef997d1653effa8.tar.xz
screenshot: improve quality by using additional swscale flags
Adding these flags improves the quality of the YUV->RGB conversion when screenshots are taken. It trades precision for performance. This doesn't affect any other swscale uses, such as vf_scale or vo_x11. Based on a patch by cantabile. Fixes #140.
Diffstat (limited to 'screenshot.c')
-rw-r--r--screenshot.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/screenshot.c b/screenshot.c
index 9b8c67a89a..5ebe2e647f 100644
--- a/screenshot.c
+++ b/screenshot.c
@@ -41,7 +41,7 @@
#include "fmt-conversion.h"
-//for sws_getContextFromCmdLine and mp_sws_set_colorspace
+//for sws_getContextFromCmdLine_hq and mp_sws_set_colorspace
#include "libmpcodecs/vf_scale.h"
#include "libvo/csputils.h"
@@ -147,12 +147,12 @@ void screenshot_save(struct MPContext *mpctx, struct mp_image *image)
screenshot_ctx *ctx = screenshot_get_ctx(mpctx);
struct mp_image *dst = alloc_mpi(image->w, image->h, IMGFMT_RGB24);
- struct SwsContext *sws = sws_getContextFromCmdLine(image->width,
- image->height,
- image->imgfmt,
- dst->width,
- dst->height,
- dst->imgfmt);
+ struct SwsContext *sws = sws_getContextFromCmdLine_hq(image->width,
+ image->height,
+ image->imgfmt,
+ dst->width,
+ dst->height,
+ dst->imgfmt);
struct mp_csp_details colorspace;
get_detected_video_colorspace(mpctx->sh_video, &colorspace);