Commit 45a73d2b authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'c011ceef'

* commit 'c011ceef':
  swscale: ppc: Remove commented-out define cruft
  nsvdec: Remove commented-out debug cruft
  cpu: Restructure code to avoid pointless ret variable indirection

Conflicts:
	libavutil/cpu.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 7cb5467a c011ceef
...@@ -28,10 +28,6 @@ ...@@ -28,10 +28,6 @@
#include "libavutil/dict.h" #include "libavutil/dict.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
//#define DEBUG_DUMP_INDEX // XXX dumbdriving-271.nsv breaks with it commented!!
#define CHECK_SUBSEQUENT_NSVS
//#define DISABLE_AUDIO
/* max bytes to crawl for trying to resync /* max bytes to crawl for trying to resync
* stupid streaming servers don't start at chunk boundaries... * stupid streaming servers don't start at chunk boundaries...
*/ */
...@@ -370,25 +366,6 @@ static int nsv_parse_NSVf_header(AVFormatContext *s) ...@@ -370,25 +366,6 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
av_dlog(s, "NSV got index; filepos %"PRId64"\n", avio_tell(pb)); av_dlog(s, "NSV got index; filepos %"PRId64"\n", avio_tell(pb));
#ifdef DEBUG_DUMP_INDEX
#define V(v) ((v<0x20 || v > 127)?'.':v)
/* dump index */
av_dlog(s, "NSV %d INDEX ENTRIES:\n", table_entries);
av_dlog(s, "NSV [dataoffset][fileoffset]\n", table_entries);
for (i = 0; i < table_entries; i++) {
unsigned char b[8];
avio_seek(pb, size + nsv->nsvs_file_offset[i], SEEK_SET);
avio_read(pb, b, 8);
av_dlog(s, "NSV [0x%08lx][0x%08lx]: %02x %02x %02x %02x %02x %02x %02x %02x"
"%c%c%c%c%c%c%c%c\n",
nsv->nsvs_file_offset[i], size + nsv->nsvs_file_offset[i],
b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],
V(b[0]), V(b[1]), V(b[2]), V(b[3]), V(b[4]), V(b[5]), V(b[6]), V(b[7]) );
}
//avio_seek(pb, size, SEEK_SET); /* go back to end of header */
#undef V
#endif
avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */ avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
if (url_feof(pb)) if (url_feof(pb))
...@@ -479,7 +456,6 @@ static int nsv_parse_NSVs_header(AVFormatContext *s) ...@@ -479,7 +456,6 @@ static int nsv_parse_NSVs_header(AVFormatContext *s)
} }
} }
if (atag != T_NONE) { if (atag != T_NONE) {
#ifndef DISABLE_AUDIO
st = avformat_new_stream(s, NULL); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
goto fail; goto fail;
...@@ -499,15 +475,12 @@ static int nsv_parse_NSVs_header(AVFormatContext *s) ...@@ -499,15 +475,12 @@ static int nsv_parse_NSVs_header(AVFormatContext *s)
avpriv_set_pts_info(st, 64, 1, framerate.num*1000); avpriv_set_pts_info(st, 64, 1, framerate.num*1000);
st->start_time = 0; st->start_time = 0;
st->duration = (int64_t)nsv->duration * framerate.num; st->duration = (int64_t)nsv->duration * framerate.num;
#endif
} }
#ifdef CHECK_SUBSEQUENT_NSVS
} else { } else {
if (nsv->vtag != vtag || nsv->atag != atag || nsv->vwidth != vwidth || nsv->vheight != vwidth) { if (nsv->vtag != vtag || nsv->atag != atag || nsv->vwidth != vwidth || nsv->vheight != vwidth) {
av_dlog(s, "NSV NSVs header values differ from the first one!!!\n"); av_dlog(s, "NSV NSVs header values differ from the first one!!!\n");
//return -1; //return -1;
} }
#endif /* CHECK_SUBSEQUENT_NSVS */
} }
nsv->state = NSV_HAS_READ_NSVS; nsv->state = NSV_HAS_READ_NSVS;
......
...@@ -200,27 +200,23 @@ int av_cpu_count(void) ...@@ -200,27 +200,23 @@ int av_cpu_count(void)
{ {
static volatile int printed; static volatile int printed;
int ret, nb_cpus = 1; int nb_cpus = 1;
#if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT) #if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT)
cpu_set_t cpuset; cpu_set_t cpuset;
CPU_ZERO(&cpuset); CPU_ZERO(&cpuset);
ret = sched_getaffinity(0, sizeof(cpuset), &cpuset); if (!sched_getaffinity(0, sizeof(cpuset), &cpuset))
if (!ret) {
nb_cpus = CPU_COUNT(&cpuset); nb_cpus = CPU_COUNT(&cpuset);
}
#elif HAVE_GETPROCESSAFFINITYMASK #elif HAVE_GETPROCESSAFFINITYMASK
DWORD_PTR proc_aff, sys_aff; DWORD_PTR proc_aff, sys_aff;
ret = GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff); if (GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff))
if (ret)
nb_cpus = av_popcount64(proc_aff); nb_cpus = av_popcount64(proc_aff);
#elif HAVE_SYSCTL && defined(HW_NCPU) #elif HAVE_SYSCTL && defined(HW_NCPU)
int mib[2] = { CTL_HW, HW_NCPU }; int mib[2] = { CTL_HW, HW_NCPU };
size_t len = sizeof(nb_cpus); size_t len = sizeof(nb_cpus);
ret = sysctl(mib, 2, &nb_cpus, &len, NULL, 0); if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1)
if (ret == -1)
nb_cpus = 0; nb_cpus = 0;
#elif HAVE_SYSCONF && defined(_SC_NPROC_ONLN) #elif HAVE_SYSCONF && defined(_SC_NPROC_ONLN)
nb_cpus = sysconf(_SC_NPROC_ONLN); nb_cpus = sysconf(_SC_NPROC_ONLN);
......
...@@ -246,8 +246,6 @@ static const vector unsigned char ...@@ -246,8 +246,6 @@ static const vector unsigned char
(vector unsigned short) \ (vector unsigned short) \
vec_max(y, ((vector signed short) { 0 }))) vec_max(y, ((vector signed short) { 0 })))
//#define out_pixels(a, b, c, ptr) vec_mstrgb32(__typeof__(a), ((__typeof__(a)) { 255 }), a, a, a, ptr)
static inline void cvtyuvtoRGB(SwsContext *c, vector signed short Y, static inline void cvtyuvtoRGB(SwsContext *c, vector signed short Y,
vector signed short U, vector signed short V, vector signed short U, vector signed short V,
vector signed short *R, vector signed short *G, vector signed short *R, vector signed short *G,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment