From 9880cbfd5b0db35bff71efa524e11c6c4dcfbe68 Mon Sep 17 00:00:00 2001 From: saintdev Date: Fri, 21 Mar 2008 03:06:02 +0000 Subject: 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 --- libhb/hb.c | 13 +++++++++---- libhb/render.c | 8 +++++++- 2 files changed, 16 insertions(+), 5 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, diff --git a/libhb/render.c b/libhb/render.c index 43a156b3c..275d05589 100644 --- a/libhb/render.c +++ b/libhb/render.c @@ -528,6 +528,12 @@ int renderInit( hb_work_object_t * w, hb_job_t * job ) hb_work_private_t * pv = calloc( 1, sizeof( hb_work_private_t ) ); pv->job = job; w->private_data = pv; + uint32_t swsflags; + + swsflags = SWS_LANCZOS; +#ifndef __x86_64__ + swsflags |= SWS_ACCURATE_RND; +#endif /* __x86_64__ */ /* Get title and title size */ hb_title_t * title = job->title; @@ -540,7 +546,7 @@ int renderInit( hb_work_object_t * w, hb_job_t * job ) 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); } /* Setup FIFO queue for subtitle cache */ -- cgit v1.2.3