shithub: openh264

Download patch

ref: 8ffacf0918c7a2c9a9c68920483451062ff6d3ce
parent: 0e9541247a88fea6605a5a3530390fd12a2e3dc2
author: Martin Storsjö <martin@martin.st>
date: Mon Nov 3 06:02:27 EST 2014

Add casts to avoid warnings about comparison between signed and unsigned

This fixes warnings with gcc and msvc.

--- a/codec/decoder/core/src/decode_slice.cpp
+++ b/codec/decoder/core/src/decode_slice.cpp
@@ -418,7 +418,7 @@
         iBestMode = kiPredMode;
       } else {
         WELS_READ_VERIFY (BsGetBits (pBs, 3, &uiCode));
-        iBestMode = uiCode + (uiCode >= kiPredMode);
+        iBestMode = uiCode + ((int32_t) uiCode >= kiPredMode);
       }
     }
 
--- a/codec/encoder/core/src/svc_enc_slice_segment.cpp
+++ b/codec/encoder/core/src/svc_enc_slice_segment.cpp
@@ -236,7 +236,7 @@
     iGomSize = kiMbWidth * GOM_ROW_MODE0_720P;
 
   while (true) {
-    if (kiCountNumMb < iGomSize * iSliceNum) {
+    if (kiCountNumMb < iGomSize * (int32_t) iSliceNum) {
       -- iSliceNum;
       iSliceNum = iSliceNum - (iSliceNum & 0x01);	// verfiy even num for multiple slices case
       if (iSliceNum < 2)	// for safe