summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authorsaintdev <[email protected]>2008-03-21 03:06:02 +0000
committersaintdev <[email protected]>2008-03-21 03:06:02 +0000
commit9880cbfd5b0db35bff71efa524e11c6c4dcfbe68 (patch)
tree9cd9efb3b8e283637bb16441e365b6fa658c8847 /libhb/hb.c
parent121258c9e4e2c3502e9a6c635d9b87ea92495cb7 (diff)
libswscale accurate rounding is now re-enabled for all arches except x86_64.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1353 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index 62fe9c4f5..b2a67119f 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -318,11 +318,16 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
char filename[1024];
FILE * file;
uint8_t * buf1, * buf2, * buf3, * buf4, * pen;
- uint32_t * p32;
+ uint32_t * p32, swsflags;
AVPicture pic_in, pic_preview, pic_deint, pic_crop, pic_scale;
struct SwsContext * context;
int i;
+ swsflags = SWS_LANCZOS;
+#ifndef __x86_64__
+ swsflags |= SWS_ACCURATE_RND;
+#endif /* __x86_64__ */
+
buf1 = malloc( title->width * title->height * 3 / 2 );
buf2 = malloc( title->width * title->height * 3 / 2 );
buf3 = malloc( title->width * title->height * 3 / 2 );
@@ -370,7 +375,7 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
title->height - (job->crop[0] + job->crop[1]),
PIX_FMT_YUV420P,
job->width, job->height, PIX_FMT_YUV420P,
- (uint16_t)(SWS_LANCZOS|SWS_ACCURATE_RND), NULL, NULL, NULL);
+ swsflags, NULL, NULL, NULL);
// Scale
sws_scale(context,
@@ -383,8 +388,8 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
// Get preview context
context = sws_getContext(job->width, job->height, PIX_FMT_YUV420P,
- job->width, job->height, PIX_FMT_RGBA32,
- (uint16_t)(SWS_LANCZOS|SWS_ACCURATE_RND), NULL, NULL, NULL);
+ job->width, job->height, PIX_FMT_RGBA32,
+ swsflags, NULL, NULL, NULL);
// Create preview
sws_scale(context,