summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavutil/common.h
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-10-01 15:25:44 +0200
committerGitHub <noreply@github.com>2018-10-01 15:25:44 +0200
commit8e8fcee4a55de171303ebe526d3cf051522111bf (patch)
treefef75d382fc6216a093eeaf80560473dff19d883 /media/ffvpx/libavutil/common.h
parent79b00fc33b5cb6d56d29b50efac6d62ce3a89018 (diff)
parent45c24f05d023a2cd8289ed40a13708392ce2e6a4 (diff)
downloadUXP-8e8fcee4a55de171303ebe526d3cf051522111bf.tar
UXP-8e8fcee4a55de171303ebe526d3cf051522111bf.tar.gz
UXP-8e8fcee4a55de171303ebe526d3cf051522111bf.tar.lz
UXP-8e8fcee4a55de171303ebe526d3cf051522111bf.tar.xz
UXP-8e8fcee4a55de171303ebe526d3cf051522111bf.zip
Merge pull request #805 from MoonchildProductions/revert-801-update-from-upstream
Revert "Update ffvpx code to 4.0.2"
Diffstat (limited to 'media/ffvpx/libavutil/common.h')
-rw-r--r--media/ffvpx/libavutil/common.h38
1 files changed, 4 insertions, 34 deletions
diff --git a/media/ffvpx/libavutil/common.h b/media/ffvpx/libavutil/common.h
index 8db029117..8142b31fd 100644
--- a/media/ffvpx/libavutil/common.h
+++ b/media/ffvpx/libavutil/common.h
@@ -158,7 +158,7 @@ static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, in
*/
static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
{
- if (a&(~0xFF)) return (~a)>>31;
+ if (a&(~0xFF)) return (-a)>>31;
else return a;
}
@@ -180,7 +180,7 @@ static av_always_inline av_const int8_t av_clip_int8_c(int a)
*/
static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
{
- if (a&(~0xFFFF)) return (~a)>>31;
+ if (a&(~0xFFFF)) return (-a)>>31;
else return a;
}
@@ -228,7 +228,7 @@ static av_always_inline av_const int av_clip_intp2_c(int a, int p)
*/
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
{
- if (a & ~((1<<p) - 1)) return (~a) >> 31 & ((1<<p) - 1);
+ if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
else return a;
}
@@ -260,7 +260,7 @@ static av_always_inline int av_sat_add32_c(int a, int b)
*
* @param a first value
* @param b value doubled and added to a
- * @return sum sat(a + sat(2*b)) with signed saturation
+ * @return sum with signed saturation
*/
static av_always_inline int av_sat_dadd32_c(int a, int b)
{
@@ -268,30 +268,6 @@ static av_always_inline int av_sat_dadd32_c(int a, int b)
}
/**
- * Subtract two signed 32-bit values with saturation.
- *
- * @param a one value
- * @param b another value
- * @return difference with signed saturation
- */
-static av_always_inline int av_sat_sub32_c(int a, int b)
-{
- return av_clipl_int32((int64_t)a - b);
-}
-
-/**
- * Subtract a doubled value from another value with saturation at both stages.
- *
- * @param a first value
- * @param b value doubled and subtracted from a
- * @return difference sat(a - sat(2*b)) with signed saturation
- */
-static av_always_inline int av_sat_dsub32_c(int a, int b)
-{
- return av_sat_sub32(a, av_sat_add32(b, b));
-}
-
-/**
* Clip a float value into the amin-amax range.
* @param a value to clip
* @param amin minimum value of the clip range
@@ -537,12 +513,6 @@ static av_always_inline av_const int av_parity_c(uint32_t v)
#ifndef av_sat_dadd32
# define av_sat_dadd32 av_sat_dadd32_c
#endif
-#ifndef av_sat_sub32
-# define av_sat_sub32 av_sat_sub32_c
-#endif
-#ifndef av_sat_dsub32
-# define av_sat_dsub32 av_sat_dsub32_c
-#endif
#ifndef av_clipf
# define av_clipf av_clipf_c
#endif