summaryrefslogtreecommitdiffstats
path: root/k9vamps
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 23:37:00 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 23:37:00 +0000
commitb0e912c8b3d02a518fedda28c3180eb4794a7520 (patch)
tree07d344862562fab58cbe2df39d13d16f2e4d2bea /k9vamps
parent4d695ec81fe4d4335ee82c7a9346ad9c9e144ecc (diff)
downloadk9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.tar.gz
k9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.zip
TQt4 convert k9copy
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1233843 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'k9vamps')
-rw-r--r--k9vamps/getvlc.h16
-rw-r--r--k9vamps/k9fifo.h4
-rw-r--r--k9vamps/k9requant.cpp22
-rw-r--r--k9vamps/k9requant.h20
-rwxr-xr-xk9vamps/k9requant2.h10
-rwxr-xr-xk9vamps/k9vamps.cpp30
-rwxr-xr-xk9vamps/k9vamps.h32
-rw-r--r--k9vamps/tcmemcpy.cpp4
8 files changed, 69 insertions, 69 deletions
diff --git a/k9vamps/getvlc.h b/k9vamps/getvlc.h
index bcf82c0..b35a5a3 100644
--- a/k9vamps/getvlc.h
+++ b/k9vamps/getvlc.h
@@ -4,7 +4,7 @@
#define MACROBLOCK_PATTERN 2
#define MACROBLOCK_MOTION_BACKWARD 4
#define MACROBLOCK_MOTION_FORWARD 8
-#define MACROBLOCK_QUANT 16
+#define MACROBLOCK_TQUANT 16
#define DCT_TYPE_INTERLACED 32
/* motion_type */
@@ -68,17 +68,17 @@ typedef struct {
#define INTRA MACROBLOCK_INTRA
-#define QUANT MACROBLOCK_QUANT
+#define TQUANT MACROBLOCK_TQUANT
static const MBtab MB_I [] = {
- {INTRA|QUANT, 2}, {INTRA, 1}
+ {INTRA|TQUANT, 2}, {INTRA, 1}
};
#define MC MACROBLOCK_MOTION_FORWARD
#define CODED MACROBLOCK_PATTERN
static const MBtab MB_P [] = {
- {INTRA|QUANT, 6}, {CODED|QUANT, 5}, {MC|CODED|QUANT, 5}, {INTRA, 5},
+ {INTRA|TQUANT, 6}, {CODED|TQUANT, 5}, {MC|CODED|TQUANT, 5}, {INTRA, 5},
{MC, 3}, {MC, 3}, {MC, 3}, {MC, 3},
{CODED, 2}, {CODED, 2}, {CODED, 2}, {CODED, 2},
{CODED, 2}, {CODED, 2}, {CODED, 2}, {CODED, 2},
@@ -93,9 +93,9 @@ static const MBtab MB_P [] = {
#define INTER MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD
static const MBtab MB_B [] = {
- {0, 0}, {INTRA|QUANT, 6},
- {BWD|CODED|QUANT, 6}, {FWD|CODED|QUANT, 6},
- {INTER|CODED|QUANT, 5}, {INTER|CODED|QUANT, 5},
+ {0, 0}, {INTRA|TQUANT, 6},
+ {BWD|CODED|TQUANT, 6}, {FWD|CODED|TQUANT, 6},
+ {INTER|CODED|TQUANT, 5}, {INTER|CODED|TQUANT, 5},
{INTRA, 5}, {INTRA, 5},
{FWD, 4}, {FWD, 4}, {FWD, 4}, {FWD, 4},
{FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4},
@@ -114,7 +114,7 @@ static const MBtab MB_B [] = {
};
#undef INTRA
-#undef QUANT
+#undef TQUANT
#undef MC
#undef CODED
#undef FWD
diff --git a/k9vamps/k9fifo.h b/k9vamps/k9fifo.h
index 42fbbef..efb2935 100644
--- a/k9vamps/k9fifo.h
+++ b/k9vamps/k9fifo.h
@@ -13,7 +13,7 @@
#define K9FIFO_H
#include "k9common.h"
-#include <qmutex.h>
+#include <tqmutex.h>
/**
@author Jean-Michel PETIT <[email protected]>
*/
@@ -25,7 +25,7 @@ private:
uint32_t head,queue;
uchar *array;
uint32_t m_count;
- QMutex mutex;
+ TQMutex mutex;
public:
k9fifo () { head=queue=m_count=0;array= new uchar[INPUT_SIZE];};
uint32_t count(); // { return (queue-head)%INPUT_SIZE ;}
diff --git a/k9vamps/k9requant.cpp b/k9vamps/k9requant.cpp
index 009f76c..cf2f381 100644
--- a/k9vamps/k9requant.cpp
+++ b/k9vamps/k9requant.cpp
@@ -1709,7 +1709,7 @@ void k9requant::mpeg2_slice ( const int code )
const MBAtab * mba;
macroblock_modes = get_macroblock_modes ();
- if (macroblock_modes & MACROBLOCK_QUANT) quantizer_scale = get_quantizer_scale ();
+ if (macroblock_modes & MACROBLOCK_TQUANT) quantizer_scale = get_quantizer_scale ();
if (macroblock_modes & MACROBLOCK_INTRA)
{
@@ -1719,12 +1719,12 @@ void k9requant::mpeg2_slice ( const int code )
#endif
new_quantizer_scale = getNewQuant(quantizer_scale, 1);
- if (last_coded_scale == new_quantizer_scale) macroblock_modes &= 0xFFFFFFEF; // remove MACROBLOCK_QUANT
- else macroblock_modes |= MACROBLOCK_QUANT; //add MACROBLOCK_QUANT
+ if (last_coded_scale == new_quantizer_scale) macroblock_modes &= 0xFFFFFFEF; // remove MACROBLOCK_TQUANT
+ else macroblock_modes |= MACROBLOCK_TQUANT; //add MACROBLOCK_TQUANT
putaddrinc(mb_add + mb_skip); mb_skip = 0;
putmbdata(macroblock_modes);
- if (macroblock_modes & MACROBLOCK_QUANT) put_quantiser(new_quantizer_scale);
+ if (macroblock_modes & MACROBLOCK_TQUANT) put_quantiser(new_quantizer_scale);
if (concealment_motion_vectors)
{
@@ -1825,7 +1825,7 @@ void k9requant::mpeg2_slice ( const int code )
#endif
if (!new_coded_block_pattern)
{
- macroblock_modes &= 0xFFFFFFED; // remove MACROBLOCK_PATTERN and MACROBLOCK_QUANT flag
+ macroblock_modes &= 0xFFFFFFED; // remove MACROBLOCK_PATTERN and MACROBLOCK_TQUANT flag
if ( (picture_coding_type == P_TYPE)
&& !(macroblock_modes & MACROBLOCK_MOTION_FORWARD))
{
@@ -1855,13 +1855,13 @@ void k9requant::mpeg2_slice ( const int code )
}
}
- if (last_coded_scale == new_quantizer_scale) macroblock_modes &= 0xFFFFFFEF; // remove MACROBLOCK_QUANT
- else if (macroblock_modes & MACROBLOCK_PATTERN) macroblock_modes |= MACROBLOCK_QUANT; //add MACROBLOCK_QUANT
- assert( (macroblock_modes & MACROBLOCK_PATTERN) || !(macroblock_modes & MACROBLOCK_QUANT) );
+ if (last_coded_scale == new_quantizer_scale) macroblock_modes &= 0xFFFFFFEF; // remove MACROBLOCK_TQUANT
+ else if (macroblock_modes & MACROBLOCK_PATTERN) macroblock_modes |= MACROBLOCK_TQUANT; //add MACROBLOCK_TQUANT
+ assert( (macroblock_modes & MACROBLOCK_PATTERN) || !(macroblock_modes & MACROBLOCK_TQUANT) );
putaddrinc(mb_add + mb_skip); mb_skip = 0;
putmbdata(macroblock_modes);
- if (macroblock_modes & MACROBLOCK_QUANT) put_quantiser(new_quantizer_scale);
+ if (macroblock_modes & MACROBLOCK_TQUANT) put_quantiser(new_quantizer_scale);
// put saved motion data...
for (batb = 0; batb < (n_wbuf - n_owbuf); batb++) putbits(n_owbuf[batb], 8);
@@ -2440,14 +2440,14 @@ bool k9requant::lock( int64 x) {
{
if (likely (wbuf))
{
- QMutexLocker locker( &mutw );
+ TQMutexLocker locker( &mutw );
//mutw.lock();
rqt_wcnt = wbuf - owbuf;
condw.wakeAll();
//mutw.unlock();
}
//mutr.lock();
- QMutexLocker locker( &mutr );
+ TQMutexLocker locker( &mutr );
while (!rqt_rcnt)
{
condr.wait( &mutr);
diff --git a/k9vamps/k9requant.h b/k9vamps/k9requant.h
index 2832c06..7cdc711 100644
--- a/k9vamps/k9requant.h
+++ b/k9vamps/k9requant.h
@@ -9,14 +9,14 @@
// Copyright: See COPYING file that comes with this distribution
//
//
-#ifndef K9REQUANT_H
-#define K9REQUANT_H
+#ifndef K9RETQUANT_H
+#define K9RETQUANT_H
#include "k9common.h"
-#include <qthread.h>
-#include <qmutex.h>
-#include <qwaitcondition.h>
+#include <tqthread.h>
+#include <tqmutex.h>
+#include <tqwaitcondition.h>
// user defined types
@@ -86,7 +86,7 @@ RunLevel;
/**
@author Jean-Michel PETIT <[email protected]>
*/
-class k9requant : public QThread {
+class k9requant : public TQThread {
private:
int inbitcnt, outbitcnt;
@@ -260,10 +260,10 @@ public:
uint64_t rqt_visize;
uchar *rqt_rptr;
uchar *rqt_wptr;
- QWaitCondition condr;
- QWaitCondition condw;
- QMutex mutr;
- QMutex mutw;
+ TQWaitCondition condr;
+ TQWaitCondition condw;
+ TQMutex mutr;
+ TQMutex mutw;
bool rqt_stop;
bool rqt_run;
diff --git a/k9vamps/k9requant2.h b/k9vamps/k9requant2.h
index e28336f..f85c8bd 100755
--- a/k9vamps/k9requant2.h
+++ b/k9vamps/k9requant2.h
@@ -1,8 +1,8 @@
-#include <qbuffer.h>
+#include <tqbuffer.h>
#include "k9fifo.h"
-#ifndef K9REQUANT2_H
-#define K9REQUANT2_H
+#ifndef K9RETQUANT2_H
+#define K9RETQUANT2_H
class k9Requant2
@@ -16,8 +16,8 @@ public:
k9Requant2();
~k9Requant2();
private:
- QBuffer m_buffIn,m_buffOut;
- QByteArray m_baIn,m_baOut;
+ TQBuffer m_buffIn,m_buffOut;
+ TQByteArray m_baIn,m_baOut;
char *m_dataIn,*m_dataOut;
int m_sizeIn,m_sizeOut;
diff --git a/k9vamps/k9vamps.cpp b/k9vamps/k9vamps.cpp
index b077fb8..f5e537a 100755
--- a/k9vamps/k9vamps.cpp
+++ b/k9vamps/k9vamps.cpp
@@ -11,7 +11,7 @@
//
#include "k9vamps.h"
-#include <qapplication.h>
+#include <tqapplication.h>
#include "ac.h"
@@ -163,7 +163,7 @@ k9vamps::k9vamps(k9DVDBackup *dvdbackup) {
void k9vamps::setPreserve(bool _value) {
m_preserve = _value;
}
-void k9vamps::setOutput(QFile *_output) {
+void k9vamps::setOutput(TQFile *_output) {
m_output=_output;
}
@@ -185,7 +185,7 @@ void k9vamps::run () {
vobuf = (uchar*) malloc (vbuf_size);
if (vibuf == NULL || vobuf == NULL)
- fatal (QString("Allocation of video buffers failed: %1").arg(strerror (errno)));
+ fatal (TQString("Allocation of video buffers failed: %1").tqarg(strerror (errno)));
// actually do vaporization
@@ -357,18 +357,18 @@ int k9vamps::check_video_packet (uchar *ptr) {
vid_packet_start_code |= (uint32_t) (ptr [3]);
if (vid_packet_start_code != 0x000001e0)
- fatal(QString ("Bad video packet start code at %1: %2").arg(rtell(ptr)).arg(vid_packet_start_code,0,16));
+ fatal(TQString ("Bad video packet start code at %1: %2").tqarg(rtell(ptr)).tqarg(vid_packet_start_code,0,16));
vid_packet_length = ptr [4] << 8;
vid_packet_length |= ptr [5];
vid_packet_length += 6;
if ((ptr [6] & 0xc0) != 0x80)
- fatal (QString("Not an MPEG2 video packet at %1").arg(rtell (ptr)));
+ fatal (TQString("Not an MPEG2 video packet at %1").tqarg(rtell (ptr)));
if (ptr [7]) {
if ((ptr [7] & 0xc0) != 0xc0)
- qDebug (QString("First video packet in sequence starting at %1 misses PTS or DTS, flags=%2").arg(rtell (ptr)).arg(ptr [7]));
+ qDebug (TQString("First video packet in sequence starting at %1 misses PTS or DTS, flags=%2").tqarg(rtell (ptr)).tqarg(ptr [7]));
else {
sequence_header_code = (uint32_t) (ptr [6 + 3 + ptr [8] + 0]) << 24;
sequence_header_code |= (uint32_t) (ptr [6 + 3 + ptr [8] + 1]) << 16;
@@ -399,7 +399,7 @@ int k9vamps::check_video_packet (uchar *ptr) {
pad_packet_start_code |= (uint32_t) (ptr [3]);
if (pad_packet_start_code != 0x000001be)
- qDebug (QString("Bad padding packet start code at %1: %2").arg(rtell (ptr + vid_packet_length)).arg(pad_packet_start_code));
+ qDebug (TQString("Bad padding packet start code at %1: %2").tqarg(rtell (ptr + vid_packet_length)).tqarg(pad_packet_start_code));
else {
pad_packet_length = ptr [4] << 8;
pad_packet_length |= ptr [5];
@@ -409,7 +409,7 @@ int k9vamps::check_video_packet (uchar *ptr) {
// length of video packet plus padding packet must always match sector size
if (14 + vid_packet_length + pad_packet_length != SECT_SIZE)
- qDebug (QString("Bad video packet length at %1: %2").arg(rtell (ptr)).arg(vid_packet_length));
+ qDebug (TQString("Bad video packet length at %1: %2").tqarg(rtell (ptr)).tqarg(vid_packet_length));
return rc;
}
@@ -479,7 +479,7 @@ int k9vamps::requant (uchar *dst, uchar *src, int n, float fact) {
double realrqtfact=(double)(vin_bytes) / (double)(vout_bytes+rv);
avgdiff = ((m_avgfact) /realrqtfact);
- //qDebug ("factor : " +QString::number(m_avgfact) +" --> " +QString::number((float)n/(float)rv) +" avgdiff : " + QString::number(avgdiff) +" rqt_visize :" +QString::number(m_requant->rqt_visize) +" ps_size :" +QString::number(ps_size) + " vin_bytes :" + QString::number(vin_bytes)) ;
+ //qDebug ("factor : " +TQString::number(m_avgfact) +" --> " +TQString::number((float)n/(float)rv) +" avgdiff : " + TQString::number(avgdiff) +" rqt_visize :" +TQString::number(m_requant->rqt_visize) +" ps_size :" +TQString::number(ps_size) + " vin_bytes :" + TQString::number(vin_bytes)) ;
return rv;
@@ -636,7 +636,7 @@ void k9vamps::vap_leader () {
data_length |= ptr [5];
if (14 + data_length != SECT_SIZE - 6)
- fatal (QString("Bad padding packet length at %1: %2").arg(rtell (ptr)).arg(data_length));
+ fatal (TQString("Bad padding packet length at %1: %2").tqarg(rtell (ptr)).tqarg(data_length));
//JMP:à vérifier
skip (SECT_SIZE);
@@ -681,7 +681,7 @@ void k9vamps::vap_trailer (int length) {
data_length |= ptr [5];
if (14 + data_length != SECT_SIZE - 6)
- fatal (QString("Bad padding packet length at %1: %2").arg(rtell (ptr)).arg(data_length));
+ fatal (TQString("Bad padding packet length at %1: %2").tqarg(rtell (ptr)).tqarg(data_length));
skip (SECT_SIZE);
} else {
copy (SECT_SIZE);
@@ -802,7 +802,7 @@ int k9vamps::vap_phase1 (void) {
data_length |= ptr [5];
if (14 + data_length != SECT_SIZE - 6)
- fatal (QString("Bad padding packet length at %1: %2").arg(rtell (ptr)).arg(data_length));
+ fatal (TQString("Bad padding packet length at %1: %2").tqarg(rtell (ptr)).tqarg(data_length));
break;
@@ -938,7 +938,7 @@ void k9vamps::vap_phase2 (int seq_length) {
data_length |= ptr [5];
if (14 + data_length != SECT_SIZE - 6)
- fatal (QString("Bad padding packet length at %1: %2").arg(rtell (ptr)).arg(data_length));
+ fatal (TQString("Bad padding packet length at %1: %2").tqarg(rtell (ptr)).tqarg(data_length));
//JMP: à vérifier
skip (SECT_SIZE);
break;
@@ -955,7 +955,7 @@ void k9vamps::vap_phase2 (int seq_length) {
}
}
-QString & k9vamps::geterrMsg() {
+TQString & k9vamps::geterrMsg() {
return m_errMsg;
}
@@ -1068,7 +1068,7 @@ void k9vamps::abort() {
// this is a *very* sophisticated kind of error handling :-)
void
-k9vamps::fatal (QString msg) {
+k9vamps::fatal (TQString msg) {
m_errMsg=msg;
m_error=true;
if (m_requant !=NULL)
diff --git a/k9vamps/k9vamps.h b/k9vamps/k9vamps.h
index 8f0b945..b757db7 100755
--- a/k9vamps/k9vamps.h
+++ b/k9vamps/k9vamps.h
@@ -13,9 +13,9 @@
#define K9VAMPS_H
#include "k9common.h"
-#include <qfile.h>
-#include <qthread.h>
-#include <qobject.h>
+#include <tqfile.h>
+#include <tqthread.h>
+#include <tqobject.h>
#include <stdio.h>
#include <errno.h>
#include <stdarg.h>
@@ -25,8 +25,8 @@
#include <getopt.h>
#include <pthread.h>
#include <sys/stat.h>
-#include <qmutex.h>
-#include <qwaitcondition.h>
+#include <tqmutex.h>
+#include <tqwaitcondition.h>
#include "k9dvdbackup.h"
#include "k9requant.h"
#include "k9fifo.h"
@@ -47,13 +47,13 @@
-class k9bgUpdate : public QThread
+class k9bgUpdate : public TQThread
{
private:
uchar * m_buffer;
k9DVDBackup *m_backup;
uint32_t m_size;
- QMutex mutex;
+ TQMutex mutex;
public:
k9bgUpdate(k9DVDBackup * _backup);
void update(uchar *_buffer, uint32_t size);
@@ -65,7 +65,7 @@ protected:
-class k9vamps:public QThread
+class k9vamps:public TQThread
{
private:
uchar *rbuf;// [RBUF_SIZE]; // the PS read buffer
@@ -100,20 +100,20 @@ private:
bool m_preserve; // preserve audio/spu track numbers
float vap_fact; // vaporization factor from cmd line
bool noData;
- QMutex mutex;
+ TQMutex mutex;
k9bgUpdate *m_bgUpdate;
k9fifo m_fifo;
- QString m_errMsg;
+ TQString m_errMsg;
bool m_error;
double avgdiff;
double m_totfact,m_nbfact,m_avgfact;
- QFile *m_output;
+ TQFile *m_output;
private:
// prototypes
void vaporize (void);
- void fatal (QString _msg);
+ void fatal (TQString _msg);
int lock(int size);
void copy(int size);
void skip (int size);
@@ -137,8 +137,8 @@ private:
int readData(uchar *data,uint size);
- QWaitCondition wDataRead;
- QWaitCondition wDataReady;
+ TQWaitCondition wDataRead;
+ TQWaitCondition wDataReady;
k9DVDBackup *m_dvdbackup;
k9requant *m_requant;
k9SaveImage *m_saveImage;
@@ -155,9 +155,9 @@ public:
void setInputSize(uint64_t size);
void setVapFactor(float factor);
void setSaveImage(k9SaveImage*);
- void setOutput(QFile *_output);
+ void setOutput(TQFile *_output);
uint64_t getOutputBytes();
- QString & geterrMsg();
+ TQString & geterrMsg();
bool geterror();
void abort();
void setPreserve(bool _value);
diff --git a/k9vamps/tcmemcpy.cpp b/k9vamps/tcmemcpy.cpp
index ceb7c69..c72cd73 100644
--- a/k9vamps/tcmemcpy.cpp
+++ b/k9vamps/tcmemcpy.cpp
@@ -224,7 +224,7 @@ sse.memcpy_small: # Small block copy routine--no prefetch \n"
jg 1b \n\
\n\
# Then copy--forward, which seems to be faster than reverse for \n\
- # certain alignments \n\
+ # certain tqalignments \n\
xor %%eax, %%eax \n\
2: movq (%%esi,%%eax,8), %%mm0 # Copy 8 bytes and loop \n\
movntq %%mm0, (%%edi,%%eax,8) \n\
@@ -320,7 +320,7 @@ sse.memcpy_end: \n\
jg 1b \n\
\n\
# Then copy--forward, which seems to be faster than reverse for \n\
- # certain alignments \n\
+ # certain tqalignments \n\
xor %%eax, %%eax \n\
2: " #movdq " (%%rsi,%%rax,8), %%xmm0 # Copy 16 bytes and loop \n\
movntdq %%xmm0, (%%rdi,%%rax,8) \n\