OSDN Git Service

libswscale accurate rounding is now re-enabled for all arches except x86_64.
authorsaintdev <saintdev@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 21 Mar 2008 03:06:02 +0000 (03:06 +0000)
committersaintdev <saintdev@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 21 Mar 2008 03:06:02 +0000 (03:06 +0000)
git-svn-id: svn://localhost/HandBrake/trunk@1353 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/hb.c
libhb/render.c

index 62fe9c4..b2a6711 100644 (file)
@@ -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,
index 43a156b..275d055 100644 (file)
@@ -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 */