[xiph-commits] r11326 - in trunk/xiph-qt: CAVorbis/src
OggImport/src Theora/src
arek at svn.xiph.org
arek at svn.xiph.org
Sun Apr 30 18:42:52 PDT 2006
Author: arek
Date: 2006-04-30 18:42:42 -0700 (Sun, 30 Apr 2006)
New Revision: 11326
Modified:
trunk/xiph-qt/CAVorbis/src/CAOggVorbisDecoder.cpp
trunk/xiph-qt/OggImport/src/stream_theora.c
trunk/xiph-qt/OggImport/src/stream_types_theora.h
trunk/xiph-qt/OggImport/src/utils.h
trunk/xiph-qt/Theora/src/TheoraDecoder.c
trunk/xiph-qt/Theora/src/TheoraDecoder.r
Log:
Small fixes to build on Windows.
Modified: trunk/xiph-qt/CAVorbis/src/CAOggVorbisDecoder.cpp
===================================================================
--- trunk/xiph-qt/CAVorbis/src/CAOggVorbisDecoder.cpp 2006-04-30 22:46:08 UTC (rev 11325)
+++ trunk/xiph-qt/CAVorbis/src/CAOggVorbisDecoder.cpp 2006-05-01 01:42:42 UTC (rev 11326)
@@ -150,7 +150,7 @@
mSOBufferWrapped = vorbis_total_returned_data % mSOBufferSize;
mSOBufferUsed = mSOBufferSize;
} else if (vorbis_total_returned_data < mSOBufferSize) {
- BlockZero(mSOBuffer + mSOBufferUsed, mSOBufferSize - mSOBufferUsed);
+ memset(mSOBuffer + mSOBufferUsed, 0, mSOBufferSize - mSOBufferUsed);
mSOBufferWrapped = mSOBufferUsed;
}
the_data = static_cast<Byte*> (outOutputData);
Modified: trunk/xiph-qt/OggImport/src/stream_theora.c
===================================================================
--- trunk/xiph-qt/OggImport/src/stream_theora.c 2006-04-30 22:46:08 UTC (rev 11325)
+++ trunk/xiph-qt/OggImport/src/stream_theora.c 2006-05-01 01:42:42 UTC (rev 11326)
@@ -29,7 +29,11 @@
#include "stream_theora.h"
+#if defined(__APPLE_CC__)
#include <TheoraExp/theoradec.h>
+#else
+#include <theoradec.h>
+#endif
#include "debug.h"
#define logg_page_last_packet_incomplete(op) (((unsigned char *)(op)->header)[26 + ((unsigned char *)(op)->header)[26]] == 255)
@@ -40,6 +44,17 @@
#include "data_types.h"
+#if TARGET_OS_WIN32
+EXTERN_API_C(SInt32 ) U64Compare(UInt64 left, UInt64 right)
+{
+ if (left < right)
+ return -1;
+ if (left == right)
+ return 0;
+ return 1;
+}
+#endif
+
/*
* Euclid's GCD algorithm
* de-recursified, with input check suitable for Theora fps a/b
@@ -153,7 +168,6 @@
ComponentResult create_track__theora(OggImportGlobals *globals, StreamInfo *si)
{
ComponentResult ret = noErr;
- dbg_printf("! -T calling => NewMovieTrack()\n");
UInt32 frame_width = si->si_theora.ti.frame_width;
UInt32 frame_width_fraction = 0;
@@ -161,6 +175,7 @@
frame_width_fraction = (frame_width * si->si_theora.ti.aspect_numerator % si->si_theora.ti.aspect_denominator) * 0x10000 / si->si_theora.ti.aspect_denominator;
frame_width = frame_width * si->si_theora.ti.aspect_numerator / si->si_theora.ti.aspect_denominator;
}
+ dbg_printf("! -T calling => NewMovieTrack()\n");
si->theTrack = NewMovieTrack(globals->theMovie,
frame_width << 16 | (frame_width_fraction & 0xffff),
si->si_theora.ti.frame_height << 16, 0);
@@ -332,6 +347,7 @@
int i, segments;
Boolean continued = ogg_page_continued(opg);
SampleReference64Record sampleRec;
+ SInt64 tmp = 0;
ogg_int64_t last_packet_pos = si->lastGranulePos >> si->si_theora.granulepos_shift;
last_packet_pos += si->lastGranulePos - (last_packet_pos << si->si_theora.granulepos_shift);
@@ -382,7 +398,8 @@
if ((opg->body[poffset] & 0x40) != 0)
smp_flags |= mediaSampleNotSync;
memset(&sampleRec, 0, sizeof(sampleRec));
- sampleRec.dataOffset = SInt64ToWide(globals->dataOffset + S64Set(poffset + opg->header_len));
+ tmp = globals->dataOffset + S64Set(poffset + opg->header_len);
+ sampleRec.dataOffset = SInt64ToWide(tmp);
sampleRec.dataSize = psize;
sampleRec.sampleFlags = smp_flags;
sampleRec.durationPerSample = pduration;
Modified: trunk/xiph-qt/OggImport/src/stream_types_theora.h
===================================================================
--- trunk/xiph-qt/OggImport/src/stream_types_theora.h 2006-04-30 22:46:08 UTC (rev 11325)
+++ trunk/xiph-qt/OggImport/src/stream_types_theora.h 2006-05-01 01:42:42 UTC (rev 11326)
@@ -33,7 +33,11 @@
#if !defined(_NO_THEORA_SUPPORT)
+#if defined(__APPLE_CC__)
#include <TheoraExp/theoradec.h>
+#else
+#include <theoradec.h>
+#endif
typedef enum TheoraImportStates {
kTStateInitial,
Modified: trunk/xiph-qt/OggImport/src/utils.h
===================================================================
--- trunk/xiph-qt/OggImport/src/utils.h 2006-04-30 22:46:08 UTC (rev 11325)
+++ trunk/xiph-qt/OggImport/src/utils.h 2006-05-01 01:42:42 UTC (rev 11326)
@@ -31,6 +31,7 @@
#if !defined(__ogg_utils_h__)
#define __ogg_utils_h__
+#include "config.h"
#include <Vorbis/codec.h>
extern int unpack_vorbis_comments(vorbis_comment *vc, const void *data, UInt32 data_size);
Modified: trunk/xiph-qt/Theora/src/TheoraDecoder.c
===================================================================
--- trunk/xiph-qt/Theora/src/TheoraDecoder.c 2006-04-30 22:46:08 UTC (rev 11325)
+++ trunk/xiph-qt/Theora/src/TheoraDecoder.c 2006-05-01 01:42:42 UTC (rev 11326)
@@ -49,6 +49,10 @@
#include "TheoraDecoder.h"
#include "debug.h"
+#if !TARGET_OS_MAC
+#undef pascal
+#define pascal
+#endif
static OSStatus CopyPlanarYCbCr420ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy);
static OSStatus CopyPlanarYCbCr422ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy);
@@ -546,15 +550,16 @@
OSStatus CopyPlanarYCbCr420ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy)
{
- dbg_printf("BLIT: Yw: %d, Yh: %d, Ys: %d; w: %ld, h: %ld; stride: %ld\n", pb[0].width, pb[0].height, pb[0].ystride, width, height, rowBytes_2vuy);
- dbg_printf("BLIT: Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d; Rs: %d\n", pb[1].width, pb[1].height, pb[1].ystride,
- pb[2].width, pb[2].height, pb[2].ystride);
-
size_t x, y;
const UInt8 *lineBase_Y = pb[0].data;
const UInt8 *lineBase_Cb = pb[1].data;
const UInt8 *lineBase_Cr = pb[2].data;
UInt8 *lineBase_2vuy = baseAddr_2vuy;
+
+ dbg_printf("BLIT: Yw: %d, Yh: %d, Ys: %d; w: %ld, h: %ld; stride: %ld\n", pb[0].width, pb[0].height, pb[0].ystride, width, height, rowBytes_2vuy);
+ dbg_printf("BLIT: Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d; Rs: %d\n", pb[1].width, pb[1].height, pb[1].ystride,
+ pb[2].width, pb[2].height, pb[2].ystride);
+
for( y = 0; y < height; y += 2 ) {
// Take two lines at a time.
const UInt8 *pixelPtr_Y_top = lineBase_Y;
@@ -583,15 +588,16 @@
OSStatus CopyPlanarYCbCr422ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy)
{
- dbg_printf("BLIT> Yw: %d, Yh: %d, Ys: %d; w: %ld, h: %ld; stride: %ld\n", pb[0].width, pb[0].height, pb[0].ystride, width, height, rowBytes_2vuy);
- dbg_printf("BLIT> Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d; Rs: %d\n", pb[1].width, pb[1].height, pb[1].ystride,
- pb[2].width, pb[2].height, pb[2].ystride);
-
size_t x, y;
const UInt8 *lineBase_Y = pb[0].data;
const UInt8 *lineBase_Cb = pb[1].data;
const UInt8 *lineBase_Cr = pb[2].data;
UInt8 *lineBase_2vuy = baseAddr_2vuy;
+
+ dbg_printf("BLIT> Yw: %d, Yh: %d, Ys: %d; w: %ld, h: %ld; stride: %ld\n", pb[0].width, pb[0].height, pb[0].ystride, width, height, rowBytes_2vuy);
+ dbg_printf("BLIT> Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d; Rs: %d\n", pb[1].width, pb[1].height, pb[1].ystride,
+ pb[2].width, pb[2].height, pb[2].ystride);
+
for( y = 0; y < height; y += 2 ) {
// Take two lines at a time.
const UInt8 *pixelPtr_Y_top = lineBase_Y;
@@ -627,15 +633,16 @@
TODO: proper subsampling? */
OSStatus CopyPlanarYCbCr444ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy)
{
- dbg_printf("BLIT? Yw: %d, Yh: %d, Ys: %d; w: %ld, h: %ld; stride: %ld\n", pb[0].width, pb[0].height, pb[0].ystride, width, height, rowBytes_2vuy);
- dbg_printf("BLIT? Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d; Rs: %d\n", pb[1].width, pb[1].height, pb[1].ystride,
- pb[2].width, pb[2].height, pb[2].ystride);
-
size_t x, y;
const UInt8 *lineBase_Y = pb[0].data;
const UInt8 *lineBase_Cb = pb[1].data;
const UInt8 *lineBase_Cr = pb[2].data;
UInt8 *lineBase_2vuy = baseAddr_2vuy;
+
+ dbg_printf("BLIT? Yw: %d, Yh: %d, Ys: %d; w: %ld, h: %ld; stride: %ld\n", pb[0].width, pb[0].height, pb[0].ystride, width, height, rowBytes_2vuy);
+ dbg_printf("BLIT? Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d; Rs: %d\n", pb[1].width, pb[1].height, pb[1].ystride,
+ pb[2].width, pb[2].height, pb[2].ystride);
+
for( y = 0; y < height; y += 2 ) {
// Take two lines at a time.
const UInt8 *pixelPtr_Y_top = lineBase_Y;
Modified: trunk/xiph-qt/Theora/src/TheoraDecoder.r
===================================================================
--- trunk/xiph-qt/Theora/src/TheoraDecoder.r 2006-04-30 22:46:08 UTC (rev 11325)
+++ trunk/xiph-qt/Theora/src/TheoraDecoder.r 2006-05-01 01:42:42 UTC (rev 11326)
@@ -51,11 +51,6 @@
//#undef __COMPONENTS_R__ //??
#endif /* TARGET_REZ_MAC_PPC */
-#define TARGET_REZ_CARBON_MACHO 1
-#define TARGET_REZ_MAC_PPC 1
-#define TARGET_REZ_MAC_X86 0
-#define TARGET_REZ_WIN32 0
-
#include "TheoraDecoder.h"
More information about the commits
mailing list