mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-07 11:13:41 +02:00
11a1033c9f
* qatar/master: (23 commits) build: cosmetics: Reorder some lists in a more logical fashion x86: pngdsp: Fix assembly for OS/2 fate: add test for RTjpeg in nuv with frameheader rtmp: send check_bw as notification g723_1: clip argument for 15-bit version of normalize_bits() g723_1: use all LPC vectors in formant postfilter id3v2: Support v2.2 PIC avplay: fix build with lavfi disabled. avconv: split configuring filter configuration to a separate file. avconv: split option parsing into a separate file. mpc8: do not leave padding after last frame in buffer for the next decode call mpegaudioenc: list supported channel layouts. mpegaudiodec: don't print an error on > 1 frame in a packet. api-example: update to new audio encoding API. configure: add --enable/disable-random option doc: cygwin: Update list of FATE package requirements build: Remove all installed headers and header directories on uninstall build: change checkheaders to use regular build rules rtmp: Add a new option 'rtmp_subscribe' rtmp: Add support for subscribing live streams ... Conflicts: Makefile common.mak configure doc/examples/decoding_encoding.c ffmpeg.c libavcodec/g723_1.c libavcodec/mpegaudiodec.c libavcodec/x86/pngdsp.asm libavformat/version.h library.mak tests/fate/video.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
120 lines
3.2 KiB
C
120 lines
3.2 KiB
C
/*
|
|
* Copyright (c) 2010 Mans Rullgard <mans@mansr.com>
|
|
*
|
|
* This file is part of FFmpeg.
|
|
*
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#ifndef AVUTIL_ARM_INTMATH_H
|
|
#define AVUTIL_ARM_INTMATH_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "config.h"
|
|
#include "libavutil/attributes.h"
|
|
|
|
#if HAVE_INLINE_ASM
|
|
|
|
#if HAVE_ARMV6
|
|
|
|
#define FASTDIV FASTDIV
|
|
static av_always_inline av_const int FASTDIV(int a, int b)
|
|
{
|
|
int r;
|
|
__asm__ ("cmp %2, #2 \n\t"
|
|
"ldr %0, [%3, %2, lsl #2] \n\t"
|
|
"ite le \n\t"
|
|
"lsrle %0, %1, #1 \n\t"
|
|
"smmulgt %0, %0, %1 \n\t"
|
|
: "=&r"(r) : "r"(a), "r"(b), "r"(ff_inverse) : "cc");
|
|
return r;
|
|
}
|
|
|
|
#define av_clip_uint8 av_clip_uint8_arm
|
|
static av_always_inline av_const uint8_t av_clip_uint8_arm(int a)
|
|
{
|
|
unsigned x;
|
|
__asm__ ("usat %0, #8, %1" : "=r"(x) : "r"(a));
|
|
return x;
|
|
}
|
|
|
|
#define av_clip_int8 av_clip_int8_arm
|
|
static av_always_inline av_const uint8_t av_clip_int8_arm(int a)
|
|
{
|
|
unsigned x;
|
|
__asm__ ("ssat %0, #8, %1" : "=r"(x) : "r"(a));
|
|
return x;
|
|
}
|
|
|
|
#define av_clip_uint16 av_clip_uint16_arm
|
|
static av_always_inline av_const uint16_t av_clip_uint16_arm(int a)
|
|
{
|
|
unsigned x;
|
|
__asm__ ("usat %0, #16, %1" : "=r"(x) : "r"(a));
|
|
return x;
|
|
}
|
|
|
|
#define av_clip_int16 av_clip_int16_arm
|
|
static av_always_inline av_const int16_t av_clip_int16_arm(int a)
|
|
{
|
|
int x;
|
|
__asm__ ("ssat %0, #16, %1" : "=r"(x) : "r"(a));
|
|
return x;
|
|
}
|
|
|
|
#define av_clip_uintp2 av_clip_uintp2_arm
|
|
static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
|
|
{
|
|
unsigned x;
|
|
__asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
|
|
return x;
|
|
}
|
|
|
|
|
|
#else /* HAVE_ARMV6 */
|
|
|
|
#define FASTDIV FASTDIV
|
|
static av_always_inline av_const int FASTDIV(int a, int b)
|
|
{
|
|
int r, t;
|
|
__asm__ ("umull %1, %0, %2, %3"
|
|
: "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b]));
|
|
return r;
|
|
}
|
|
|
|
#endif /* HAVE_ARMV6 */
|
|
|
|
#if HAVE_ASM_MOD_Q
|
|
|
|
#define av_clipl_int32 av_clipl_int32_arm
|
|
static av_always_inline av_const int32_t av_clipl_int32_arm(int64_t a)
|
|
{
|
|
int x, y;
|
|
__asm__ ("adds %1, %R2, %Q2, lsr #31 \n\t"
|
|
"itet ne \n\t"
|
|
"mvnne %1, #1<<31 \n\t"
|
|
"moveq %0, %Q2 \n\t"
|
|
"eorne %0, %1, %R2, asr #31 \n\t"
|
|
: "=r"(x), "=&r"(y) : "r"(a):"cc");
|
|
return x;
|
|
}
|
|
|
|
#endif /* HAVE_ASM_MOD_Q */
|
|
|
|
#endif /* HAVE_INLINE_ASM */
|
|
|
|
#endif /* AVUTIL_ARM_INTMATH_H */
|