diff -C2 -r -N bcast-2000c/Changes bcast-2000c-mf3/Changes *** bcast-2000c/Changes Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/Changes Mon Jun 10 10:31:06 2002 *************** *** 0 **** --- 1,24 ---- + // added 2001-12-30 by Moritz Franosch + + mf3: + - compiles with gcc 3.0.4 + - Window -> Double size / Half size added + - audio playback fixes, playback crash fixes (Johan Evenhuis) + - loop playback didn't work in all cases, caused crashes + + mf2: + - supports Quicktime OpenDivx video compression + - supports Vorbis audio compression + - rendering from YUV 4:2:0 to JPEG Photo is possible + - recording > 2 GB files with JPEG Photo compression is possible + - update to quicktime4linux 1.5 + - video device is closed after doing scripted recording, so that another + recording process can be started (e.g. by at) + - sound of video card is muted correctly when recording is done + + mf1: + - Enable drawing of tracks by default. + - Quoted ("") encodings in recording scripts are read correctly. + - Error message 'Unrecognized video compression ...' is printed if the + encoding given in a recording script is wrong. + - 'make clean' works. diff -C2 -r -N bcast-2000c/INSTALL bcast-2000c-mf3/INSTALL *** bcast-2000c/INSTALL Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/INSTALL Sun Apr 7 11:44:11 2002 *************** *** 0 **** --- 1,4 ---- + // added 2002-04-07 by Moritz Franosch + + For new versions see http://Franosch.org/download.html. + diff -C2 -r -N bcast-2000c/Makefile bcast-2000c-mf3/Makefile *** bcast-2000c/Makefile Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/Makefile Mon Jun 10 10:30:43 2002 *************** *** 1,3 **** --- 1,4 ---- #### THE MASTER MAKEFILE + # changed 2001-12-30 by Moritz Franosch DIRS = libmpeg3 \ *************** *** 41,45 **** clean: rm -f *.o ipcclear soundtest ! make -C cinelerra clean make -C plugins clean @ for i in $(DIRS) ; \ --- 42,46 ---- clean: rm -f *.o ipcclear soundtest ! # make -C cinelerra clean make -C plugins clean @ for i in $(DIRS) ; \ *************** *** 55,71 **** done # From make_packages install: ! mkdir -p /usr/local/bcast/plugins ! mkdir -p /usr/local/bin ! cp bcast/bcast2000 /usr/local/bcast ! cp bcbase/libbcbase.so /usr/local/bcast ! cp guicast/libguicast.so /usr/local/bcast strip plugins/*.plugin ! cp plugins/*.plugin /usr/local/bcast/plugins ! cp bcast2000.sh /usr/local/bcast ! cp record_script /usr/local/bcast ! cp -rd docs /usr/local/bcast ! cd /usr/local/bin ! ln -sf ../bcast/bcast2000.sh bcast ! --- 56,74 ---- done + PREFIX = /usr/local + # PREFIX = /lscratch2/bcast2000/local + # From make_packages install: ! @if test -e $(PREFIX)/bcast ; then echo "Installation directory $(PREFIX)/bcast/ already exists." ; exit 1 ; fi ! mkdir -p $(PREFIX)/bcast/plugins ! mkdir -p $(PREFIX)/bin ! cp bcast/bcast2000 $(PREFIX)/bcast ! cp bcbase/libbcbase.so $(PREFIX)/bcast ! cp guicast/libguicast.so $(PREFIX)/bcast strip plugins/*.plugin ! cp plugins/*.plugin $(PREFIX)/bcast/plugins ! cp bcast2000.sh $(PREFIX)/bcast ! cp record_script $(PREFIX)/bcast ! cp -rd docs $(PREFIX)/bcast ! cd $(PREFIX)/bin ; ln -sf ../bcast/bcast2000.sh bcast diff -C2 -r -N bcast-2000c/TODO bcast-2000c-mf3/TODO *** bcast-2000c/TODO Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/TODO Sun Apr 7 14:09:35 2002 *************** *** 0 **** --- 1,8 ---- + KNOWN BUGS: + - recording YUV 4:2:2 is broken (introduced in -mf2) + - crashes when doing playback and soundcard is busy + + Features: + - better build system (dependencies are wrong) + - video output drops frames sometimes when reading from DVD-RAM + - better keyboard control (fast forward, faster forward etc.) diff -C2 -r -N bcast-2000c/bcast/Makefile bcast-2000c-mf3/bcast/Makefile *** bcast-2000c/bcast/Makefile Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/Makefile Mon Dec 31 15:17:52 2001 *************** *** 213,217 **** .C.o: ! $(CC) -c `./c_flags` $*.C clean: --- 213,217 ---- .C.o: ! $(CC) -c $(CFLAGS) $*.C clean: diff -C2 -r -N bcast-2000c/bcast/assetmanager.h bcast-2000c-mf3/bcast/assetmanager.h *** bcast-2000c/bcast/assetmanager.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/assetmanager.h Sun Jun 9 09:58:14 2002 *************** *** 48,52 **** ~AssetManagerThread(); ! friend AssetManagerIndex; int create_objects(); --- 48,52 ---- ~AssetManagerThread(); ! friend class AssetManagerIndex; int create_objects(); diff -C2 -r -N bcast-2000c/bcast/audiodevice.C bcast-2000c-mf3/bcast/audiodevice.C *** bcast-2000c/bcast/audiodevice.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/audiodevice.C Sun Mar 3 14:33:29 2002 *************** *** 157,160 **** --- 157,161 ---- int AudioDevice::close_all() { + Thread::end(); if(lowlevel_in) lowlevel_in->close_all(); if(lowlevel_out) lowlevel_out->close_all(); *************** *** 239,243 **** { if(w) return lowlevel_out; ! else if(d) return lowlevel_duplex; return 0; } --- 240,246 ---- { if(w) return lowlevel_out; ! if(d) return lowlevel_duplex; ! ! printf ("warning from AudioDevice::get_lowlevel_out: Couldn't get lowlevel-output!\n"); return 0; } *************** *** 246,250 **** { if(r) return lowlevel_in; ! else if(d) return lowlevel_duplex; return 0; } --- 249,255 ---- { if(r) return lowlevel_in; ! if(d) return lowlevel_duplex; ! ! printf ("warning from AudioDevice::get_lowlevel_in: Couldn't get lowlevel-input!\n"); return 0; } diff -C2 -r -N bcast-2000c/bcast/audiodevice.C.orig bcast-2000c-mf3/bcast/audiodevice.C.orig *** bcast-2000c/bcast/audiodevice.C.orig Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/bcast/audiodevice.C.orig Mon Jan 22 21:55:45 2001 *************** *** 0 **** --- 1,263 ---- + #include + #include "audio1394.h" + #include "audioconfig.h" + #include "audiodevice.h" + #include "audioalsa.h" + #include "audioesound.h" + #include "audiooss.h" + #include "dcoffset.h" + + + + + AudioLowLevel::AudioLowLevel(AudioDevice *device) + { + this->device = device; + } + + AudioLowLevel::~AudioLowLevel() + { + } + + + + + + + AudioDevice::AudioDevice() + : Thread() + { + this->config = new AudioConfig; + initialize(); + } + + AudioDevice::~AudioDevice() + { + delete config; + } + + int AudioDevice::initialize() + { + record_before_play = 0; + r = w = d = 0; + + for(int i = 0; i < TOTAL_BUFFERS; i++) + { + buffer[i] = 0; + buffer_size[i] = 0; + play_mutex[i].lock(); + last_buffer[i] = 0; + } + + input_buffer = 0; + duplex_init = 0; + rec_dither = play_dither = 0; + software_position_info = 0; + arm_buffer_num = 0; + is_playing_back = 0; + is_recording = 0; + last_buffer_size = total_samples = position_correction = 0; + last_position = 0; + dc_offset_thread = new DC_Offset; + interrupt = 0; + lowlevel_in = lowlevel_out = lowlevel_duplex = 0; + vdevice = 0; + sharing = 0; + total_samples_read = 0; + return 0; + return 0; + } + + int AudioDevice::create_lowlevel(AudioLowLevel* &lowlevel, int driver) + { + if(!lowlevel) + { + switch(driver) + { + #ifdef HAVE_OSS + case AUDIO_OSS: + lowlevel = new AudioOSS(this); + break; + #endif + + #ifdef HAVE_ESOUND + case AUDIO_ESOUND: + lowlevel = new AudioESound(this); + break; + #endif + case AUDIO_NAS: + break; + + #ifdef HAVE_ALSA + case AUDIO_ALSA: + lowlevel = new AudioALSA(this); + break; + #endif + + #ifdef HAVE_FIREWIRE + case AUDIO_1394: + lowlevel = new Audio1394(this); + break; + #endif + } + } + return 0; + return 0; + } + + int AudioDevice::open_input(AudioConfig *config, int rate, int samples) + { + r = 1; + duplex_init = 0; + *this->config = *config; + in_samplerate = rate; + in_samples = samples; + create_lowlevel(lowlevel_in, config->audio_in_driver); + lowlevel_in->open_input(); + return 0; + return 0; + } + + int AudioDevice::open_output(AudioConfig *config, int rate, int samples) + { + w = 1; + duplex_init = 0; + *this->config = *config; + out_samplerate = rate; + out_samples = samples; + create_lowlevel(lowlevel_out, config->audio_out_driver); + lowlevel_out->open_output(); + return 0; + return 0; + } + + int AudioDevice::open_duplex(AudioConfig *config, int rate, int samples) + { + d = 1; + duplex_init = 1; // notify playback routines to test the duplex lock + *this->config = *config; + duplex_samplerate = rate; + duplex_samples = samples; + duplex_lock.lock(); // prevent playback until recording starts + create_lowlevel(lowlevel_duplex, config->audio_duplex_driver); + lowlevel_duplex->open_duplex(); + return 0; + return 0; + } + + + int AudioDevice::interrupt_crash() + { + if(lowlevel_in) return lowlevel_in->interrupt_crash(); + return 0; + return 0; + } + + + int AudioDevice::close_all() + { + if(lowlevel_in) lowlevel_in->close_all(); + if(lowlevel_out) lowlevel_out->close_all(); + if(lowlevel_duplex) lowlevel_duplex->close_all(); + + reset_output(); + if(input_buffer) + { + delete [] input_buffer; + input_buffer = 0; + } + + is_recording = 0; + rec_dither = play_dither = 0; + software_position_info = position_correction = last_buffer_size = 0; + r = w = d = 0; + duplex_init = 0; + vdevice = 0; + sharing = 0; + + if(lowlevel_in) + { + delete lowlevel_in; + lowlevel_in = 0; + } + if(lowlevel_out) + { + delete lowlevel_out; + lowlevel_out = 0; + } + if(lowlevel_duplex) + { + delete lowlevel_duplex; + lowlevel_duplex = 0; + } + return 0; + return 0; + } + + int AudioDevice::set_vdevice(VideoDevice *vdevice) + { + this->vdevice = vdevice; + return 0; + return 0; + } + + + int AudioDevice::get_ichannels() + { + if(r) return in_channels; + else if(d) return duplex_channels; + else return 0; + return 0; + } + + int AudioDevice::get_ibits() + { + if(r) return in_bits; + else if(d) return duplex_bits; + return 0; + return 0; + } + + + int AudioDevice::get_obits() + { + if(w) return out_bits; + else if(d) return duplex_bits; + return 0; + return 0; + } + + int AudioDevice::get_ochannels() + { + if(w) return out_channels; + else if(d) return duplex_channels; + return 0; + return 0; + } + + AudioLowLevel* AudioDevice::get_lowlevel_out() + { + if(w) return lowlevel_out; + else if(d) return lowlevel_duplex; + return 0; + } + + AudioLowLevel* AudioDevice::get_lowlevel_in() + { + if(r) return lowlevel_in; + else if(d) return lowlevel_duplex; + return 0; + } + + long AudioDevice::get_orate() + { + if(w) return out_samplerate; + else if(d) return duplex_samplerate; + return 0; + } + + int AudioDevice::get_interrupted() + { + return interrupt; + return 0; + } diff -C2 -r -N bcast-2000c/bcast/audiodevice.h bcast-2000c-mf3/bcast/audiodevice.h *** bcast-2000c/bcast/audiodevice.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/audiodevice.h Sun Jun 9 09:55:56 2002 *************** *** 50,57 **** ~AudioDevice(); ! friend AudioOSS; ! friend AudioESound; ! friend Audio1394; ! friend VDevice1394; int open_input(AudioConfig *config, int rate, int samples); --- 50,57 ---- ~AudioDevice(); ! friend class AudioOSS; ! friend class AudioESound; ! friend class Audio1394; ! friend class VDevice1394; int open_input(AudioConfig *config, int rate, int samples); diff -C2 -r -N bcast-2000c/bcast/audioodevice.C bcast-2000c-mf3/bcast/audioodevice.C *** bcast-2000c/bcast/audioodevice.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/audioodevice.C Sun Mar 3 14:33:29 2002 *************** *** 227,233 **** { // end thread forcefully - is_playing_back = 0; - get_lowlevel_out()->interrupt_playback(); Thread::end(); wait_for_completion(); } --- 227,233 ---- { // end thread forcefully Thread::end(); + get_lowlevel_out()->interrupt_playback(); + is_playing_back = 0; wait_for_completion(); } *************** *** 272,294 **** // get hardware position ! if(!software_position_info) { - hardware_result = get_lowlevel_out()->device_position(); - } - // get software position - if(hardware_result < 0 || software_position_info) - { timer_lock.lock(); ! software_result = total_samples - last_buffer_size - ! device_buffer / frame / get_ochannels(); software_result += buffer_timer.get_scaled_difference(get_orate()); timer_lock.unlock(); ! if(software_result < last_position) ! software_result = last_position; else ! last_position = software_result; } } else --- 272,292 ---- // get hardware position ! if(software_position_info || (hardware_result = get_lowlevel_out()->device_position()) < 0) { // get software position timer_lock.lock(); ! software_result = total_samples - last_buffer_size - device_buffer / frame / get_ochannels(); software_result += buffer_timer.get_scaled_difference(get_orate()); timer_lock.unlock(); ! if(software_result < last_position) ! software_result = last_position; else ! last_position = software_result; ! ! return software_result; } + + return hardware_result; } else *************** *** 297,305 **** return total_samples_read; } ! ! if(hardware_result < 0 || software_position_info) ! return software_result; ! else ! return hardware_result; } --- 295,299 ---- return total_samples_read; } ! return -1; } *************** *** 311,321 **** buffer_timer.update(); ! while(is_playing_back && !interrupt && !last_buffer[thread_buffer_num]) ! { // wait for buffer to become available ! play_mutex[thread_buffer_num].lock(); - if(is_playing_back && !last_buffer[thread_buffer_num]) - { if(duplex_init) { --- 305,317 ---- buffer_timer.update(); ! if (is_playing_back) ! { while(! last_buffer[thread_buffer_num]) ! { // wait for buffer to become available ! play_mutex[thread_buffer_num].lock(); ! ! if(last_buffer[thread_buffer_num]) ! break; if(duplex_init) { *************** *** 358,369 **** } - // test for last buffer - if(!interrupt && last_buffer[thread_buffer_num]) - { - // no more buffers - is_playing_back = 0; // flush the audio device ! get_lowlevel_out()->flush_device(); ! } } } --- 354,360 ---- } // flush the audio device ! get_lowlevel_out()->flush_device(); ! is_playing_back = 0; } } diff -C2 -r -N bcast-2000c/bcast/audiooss.C bcast-2000c-mf3/bcast/audiooss.C *** bcast-2000c/bcast/audiooss.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/audiooss.C Sun Mar 3 14:33:29 2002 *************** *** 159,166 **** { count_info info; ! if(!ioctl(get_output(), SNDCTL_DSP_GETOPTR, &info)) ! { ! return info.bytes / (device->get_obits() / 8) / device->get_ochannels(); } } --- 159,174 ---- { count_info info; ! int output = get_output(); ! ! if (output < 0) ! { printf ("error from AudioOSS::device_position: Couldn't get output!\n"); ! return -1; ! } ! if(ioctl(output, SNDCTL_DSP_GETOPTR, &info) < 0) ! { perror("in AudioOSS::device_position:"); ! return -1; } + + return info.bytes / ((device->get_obits() * device->get_ochannels()) / 8); } *************** *** 193,198 **** if(device->w) return dsp_out; else if(device->d) return dsp_duplex; ! return 0; ! return 0; } --- 201,207 ---- if(device->w) return dsp_out; else if(device->d) return dsp_duplex; ! ! printf ("warning from AudioOSS::get_output: Couldn't get output!\n"); ! return -1; } diff -C2 -r -N bcast-2000c/bcast/bitspopup.C bcast-2000c-mf3/bcast/bitspopup.C *** bcast-2000c/bcast/bitspopup.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/bitspopup.C Mon Dec 31 13:45:43 2001 *************** *** 31,34 **** --- 31,35 ---- add_item(bits_items[total_items++] = new BitsPopupItem(file.bitstostr(BITSIMA4))); add_item(bits_items[total_items++] = new BitsPopupItem(file.bitstostr(BITSWMX2))); + add_item(bits_items[total_items++] = new BitsPopupItem(file.bitstostr(BITSVORBIS))); } diff -C2 -r -N bcast-2000c/bcast/buttonbar.C bcast-2000c-mf3/bcast/buttonbar.C *** bcast-2000c/bcast/buttonbar.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/buttonbar.C Sun Mar 3 14:33:29 2002 *************** *** 322,328 **** { // same button pressed or space so pause ! mwindow->stop_playback(); ! mwindow->arm_playback(1, 1, 0, 0); // keeps the previous range ! if(active_button) active_button->update(0); } break; --- 322,330 ---- { // same button pressed or space so pause ! if (! mwindow->playback_engine->ending_playback) ! { mwindow->stop_playback(); ! mwindow->arm_playback(1, 1, 0, 0); // keeps the previous range ! if(active_button) active_button->update(0); ! } } break; diff -C2 -r -N bcast-2000c/bcast/compresspopup.C bcast-2000c-mf3/bcast/compresspopup.C *** bcast-2000c/bcast/compresspopup.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/compresspopup.C Mon Dec 31 12:44:27 2001 *************** *** 23,26 **** --- 23,27 ---- add_item(format_items[item++] = new CompressPopupItem(File::compressiontostr(QUICKTIME_YUV420))); add_item(format_items[item++] = new CompressPopupItem(File::compressiontostr(QUICKTIME_YUV422))); + add_item(format_items[item++] = new CompressPopupItem(File::compressiontostr(QUICKTIME_DIVX))); compress_items = item; return 0; diff -C2 -r -N bcast-2000c/bcast/file.C bcast-2000c-mf3/bcast/file.C *** bcast-2000c/bcast/file.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/file.C Mon Dec 31 13:38:38 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include #include "assets.h" *************** *** 725,728 **** --- 727,731 ---- if(!strcmp(bits, "IMA4")) return BITSIMA4; if(!strcmp(bits, "WMX2")) return BITSWMX2; + if(!strcmp(bits, "Vorbis")) return BITSVORBIS; return 0; return 0; *************** *** 749,752 **** --- 752,758 ---- return "IMA4"; break; + case BITSVORBIS: + return "Vorbis"; + break; case BITSWMX2: return "WMX2"; *************** *** 769,772 **** --- 775,779 ---- #define QTJPEG_NAME "JPEG Photo" #define MJPA_NAME "Motion JPEG A" + #define DIVX_NAME "OpenDivx" *************** *** 782,785 **** --- 789,794 ---- if(!strcmp(string, QTJPEG_NAME)) return QUICKTIME_JPEG; if(!strcmp(string, MJPA_NAME)) return QUICKTIME_MJPA; + if(!strcmp(string, DIVX_NAME)) return QUICKTIME_DIVX; + printf("Unrecognized video compression: '%s'. Defaulting to '%s'.\n",string,RGB_NAME); return QUICKTIME_RAW; } *************** *** 797,800 **** --- 806,810 ---- if(!strcmp(string, QUICKTIME_MJPA)) return MJPA_NAME; if(!strcmp(string, QUICKTIME_DV)) return DV_NAME; + if(!strcmp(string, QUICKTIME_DIVX)) return DIVX_NAME; return "RGB"; } *************** *** 819,822 **** --- 829,835 ---- return 1; break; + case BITSVORBIS: + return 1; //// ?? + break; case BITSWMX2: return 1; diff -C2 -r -N bcast-2000c/bcast/file.inc bcast-2000c-mf3/bcast/file.inc *** bcast-2000c/bcast/file.inc Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/file.inc Mon Dec 31 13:54:51 2001 *************** *** 21,24 **** --- 21,25 ---- #define BITSLINEAR16 16 #define BITSLINEAR24 24 + #define BITSVORBIS 252 #define BITSWMX2 253 #define BITSULAW 254 diff -C2 -r -N bcast-2000c/bcast/filemov.C bcast-2000c-mf3/bcast/filemov.C *** bcast-2000c/bcast/filemov.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/filemov.C Sat Jan 19 17:29:19 2002 *************** *** 7,10 **** --- 7,11 ---- #include "vframe.h" + // #include *************** *** 84,87 **** --- 85,92 ---- strcpy(audio_codec, QUICKTIME_IMA4); } + if(asset->bits == BITSVORBIS) + { + strcpy(audio_codec, QUICKTIME_VORBIS); + } else if(asset->bits == BITSLINEAR16 || asset->bits == BITSLINEAR24) *************** *** 135,138 **** --- 140,145 ---- // set the compression parameters if there are any quicktime_set_jpeg(file, asset->quality, 0); + int bitrate=int(2000000*(double(asset->quality)/100)); + quicktime_set_parameter(file,"divx_bitrate",&bitrate); return 0; return 0; *************** *** 278,283 **** else if(match4(compressor, QUICKTIME_IMA4)) asset->bits = BITSIMA4; ! //else ! //printf("FileMOV::read_header: unsupported audio codec\n"); } --- 285,292 ---- else if(match4(compressor, QUICKTIME_IMA4)) asset->bits = BITSIMA4; ! else ! if(match4(compressor, QUICKTIME_VORBIS)) asset->bits = BITSVORBIS; ! else ! printf("FileMOV::read_header: unsupported audio codec\n"); } *************** *** 684,689 **** int FileMOV::read_raw_frame(VFrame *frame, PluginBuffer *buffer, long byte_offset) { ! int result = 0; ! if(!file) return 0; quicktime_set_video_position(file, video_position, video_layer); --- 693,708 ---- int FileMOV::read_raw_frame(VFrame *frame, PluginBuffer *buffer, long byte_offset) { ! int result = 0; ! // static long old_video_position=0; ! ! if(!file) return 0; ! ! /* ! if (video_position!=old_video_position+1) { ! cerr << " " << video_position-old_video_position-1 << " frames lost *********************************************************" << endl; ! } ! old_video_position=video_position; ! */ ! quicktime_set_video_position(file, video_position, video_layer); diff -C2 -r -N bcast-2000c/bcast/filemov.C.orig bcast-2000c-mf3/bcast/filemov.C.orig *** bcast-2000c/bcast/filemov.C.orig Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/bcast/filemov.C.orig Mon Dec 31 14:48:30 2001 *************** *** 0 **** --- 1,984 ---- + #include + #include "assets.h" + #include "colormodels.h" + #include "file.h" + #include "filemov.h" + #include "pluginbuffer.h" + #include "vframe.h" + + + + FileMOV::FileMOV(Asset *asset, File *file) + : FileBase(asset, file) + { + reset_parameters(); + asset->format = MOV; + asset->byte_order = 0; + suffix_number = 0; + } + + FileMOV::~FileMOV() + { + close_file(); + } + + int FileMOV::reset_parameters_derived() + { + file = 0; + prev_track = 0; + data = 0; + quicktime_atracks = 0; + quicktime_vtracks = 0; + use_bcast_audio = 0; + depth = 24; + threads = 0; + frames_correction = 0; + samples_correction = 0; + return 0; + } + + + // Just create the Quicktime objects since this routine is also called + // for reopening. + int FileMOV::open_file(int rd, int wr) + { + this->rd = rd; + this->wr = wr; + if(suffix_number == 0) strcpy(prefix_path, asset->path); + + if(!(file = quicktime_open(asset->path, rd, wr))) + { + perror("FileMOV::open_file"); + return 1; + } + + quicktime_set_cpus(file, FileBase::file->cpus); + if(!wr && rd) read_header(); + + if(wr) + { + char audio_codec[5]; + // Fix up the Quicktime file. + quicktime_set_copyright(file, "Made with Broadcast 2000 for Linux"); + quicktime_set_info(file, "Quicktime for Linux"); + + if(!asset->signed_ && asset->bits == BITSLINEAR8) + { + strcpy(audio_codec, QUICKTIME_RAW); + use_bcast_audio = 1; + } + else + if(asset->signed_ && asset->bits == BITSLINEAR8) + { + strcpy(audio_codec, QUICKTIME_TWOS); + use_bcast_audio = 1; + } + else + if(asset->bits == BITSULAW) + { + strcpy(audio_codec, QUICKTIME_ULAW); + } + else + if(asset->bits == BITSIMA4) + { + strcpy(audio_codec, QUICKTIME_IMA4); + } + if(asset->bits == BITSVORBIS) + { + strcpy(audio_codec, QUICKTIME_VORBIS); + } + else + if(asset->bits == BITSLINEAR16 || asset->bits == BITSLINEAR24) + { + strcpy(audio_codec, QUICKTIME_TWOS); + asset->signed_ = 1; + use_bcast_audio = 1; + } + + if(asset->video_data) + { + char string[16]; + // Set up the alpha channel compressors + if(!strcmp(asset->compression, MOV_RGBA)) + { + strcpy(string, QUICKTIME_RAW); + depth = 32; + } + else + if(!strcmp(asset->compression, MOV_PNGA)) + { + strcpy(string, QUICKTIME_PNG); + depth = 32; + } + else + { + strcpy(string, asset->compression); + depth = 24; + } + + quicktime_vtracks = quicktime_set_video(file, + asset->layers, + asset->width, + asset->height, + asset->frame_rate, + string); + for(int i = 0; i < asset->layers; i++) + quicktime_set_depth(file, depth, i); + } + + if(asset->audio_data) + { + quicktime_atracks = quicktime_set_audio(file, + asset->channels, + asset->rate, + asset->bits, + audio_codec); + } + } + + // set the compression parameters if there are any + quicktime_set_jpeg(file, asset->quality, 0); + int bitrate=int(2000000*(double(asset->quality)/100)); + quicktime_set_parameter(file,"divx_bitrate",&bitrate); + return 0; + return 0; + } + + int FileMOV::close_file_derived() + { + if(file) + { + quicktime_set_framerate(file, asset->frame_rate); + quicktime_close(file); + } + + if(data) + { + delete data; + } + + if(threads) + { + for(int i = 0; i < FileBase::file->cpus; i++) + { + threads[i]->stop_encoding(); + delete threads[i]; + } + delete [] threads; + threads = 0; + } + file = 0; + data = 0; + return 0; + return 0; + } + + int FileMOV::reopen_file() + { + FILE *test; + int i, result = 0; + int attempts = 0; + + // Unfortunately the compression threads currently running need Quicktime + // for the compression. + for(i = 0; i < FileBase::file->cpus && threads; i++) + { + threads[i]->quicktime_lock.lock(); + } + + // Just want to close the Quicktime file but keep the frame buffers and threads. + if(file) + { + quicktime_set_framerate(file, asset->frame_rate); + quicktime_close(file); + file = 0; + } + + frames_correction += video_position; + samples_correction += audio_position; + video_position = 0; + audio_position = 0; + suffix_number++; + sprintf(asset->path, "%s%03d", prefix_path, suffix_number); + + do{ + result = 0; + if((test = fopen(asset->path, "r"))) + { + // file = 0; + // printf("FileMOV::reopen_file: %s existed when trying to defeat 32 bit overflow", asset->path); + // result = 1; + fclose(test); + remove(asset->path); + } + + if(!result) result = open_file(rd, wr); + + if(result) + { + printf("FileMOV::reopen_file: Failed to open new file.\n"); + } + else + { + printf("FileMOV::reopen_file: Opened a new file.\n"); + } + }while(result && attempts++ < 10); + + for(i = 0; i < FileBase::file->cpus && threads; i++) + { + threads[i]->quicktime_lock.unlock(); + } + return result; + return 0; + } + + int FileMOV::test_length(int result) + { + if(!file) return 1; + int result2 = 0; + + // result2 = quicktime_test_position(file); + // if(result2) + // { + // return reopen_file(); + // } + return result; + return 0; + } + + + int FileMOV::read_header() + { + if(!file) return 0; + asset->audio_data = quicktime_has_audio(file); + if(asset->audio_data) + { + asset->channels = 0; + int qt_tracks = quicktime_audio_tracks(file); + for(int i = 0; i < qt_tracks; i++) + asset->channels += quicktime_track_channels(file, i); + + asset->rate = quicktime_sample_rate(file, 0); + asset->bits = quicktime_audio_bits(file, 0); + char *compressor = quicktime_audio_compressor(file, 0); + + if(quicktime_supported_audio(file, 0)) + { + asset->signed_ = 1; + } + + if(match4(compressor, QUICKTIME_RAW)) + { + asset->signed_ = 0; + use_bcast_audio = 1; + } + else + if(match4(compressor, QUICKTIME_TWOS)) + { + use_bcast_audio = 1; + asset->signed_ = 1; + } + else + // Fake the bits parameter for some codecs + if(match4(compressor, QUICKTIME_ULAW)) asset->bits = BITSULAW; + else + if(match4(compressor, QUICKTIME_IMA4)) asset->bits = BITSIMA4; + else + if(match4(compressor, QUICKTIME_VORBIS)) asset->bits = BITSVORBIS; + else + printf("FileMOV::read_header: unsupported audio codec\n"); + } + + // determine if the video can be read before declaring video data + if(quicktime_has_video(file)) + if(quicktime_supported_video(file, 0)) + { + asset->video_data = 1; + } + //else + // printf("FileMOV::read_header: unsupported video codec\n"); + + if(asset->video_data) + { + depth = quicktime_video_depth(file, 0); + asset->layers = quicktime_video_tracks(file); + asset->width = quicktime_video_width(file, 0); + asset->height = quicktime_video_height(file, 0); + // Don't want a user configured frame rate to get destroyed + if(!asset->frame_rate) + asset->frame_rate = quicktime_frame_rate(file, 0); + + char *compressor = quicktime_video_compressor(file, 0); + asset->compression[0] = compressor[0]; + asset->compression[1] = compressor[1]; + asset->compression[2] = compressor[2]; + asset->compression[3] = compressor[3]; + } + return 0; + } + + int FileMOV::can_copy_from(Asset *asset) + { + if(!file) return 0; + if(asset->format == JPEG_LIST && match4(this->asset->compression, QUICKTIME_JPEG)) + return 1; + else + if(asset->format == MOV && + (match4(asset->compression, this->asset->compression))) + return 1; + + return 0; + return 0; + } + + int FileMOV::read_raw_frame_possible() + { + if(depth == 24) return 1; + else return 0; + return 0; + } + + int FileMOV::get_render_strategy(ArrayList* render_strategies) + { + // Fastest + if(search_render_strategies(render_strategies, VRENDER_MJPG) && + match4(asset->compression, QUICKTIME_MJPA)) + return VRENDER_MJPG; + + // Slower + // if(search_render_strategies(render_strategies, VRENDER_BGR8880) && + // quicktime_test_colormodel(file, + // BC_BGR8888, + // video_layer)) + // return VRENDER_BGR8880; + + // Slowest + if(search_render_strategies(render_strategies, VRENDER_RGB888)) + return VRENDER_RGB888; + + return VRENDER_VPIXEL; + return 0; + } + + long FileMOV::get_audio_length() + { + if(!file) return 0; + long result = quicktime_audio_length(file, 0) + samples_correction; + + return result; + } + + long FileMOV::get_video_length() + { + if(!file) return 0; + long result = quicktime_video_length(file, 0) + frames_correction; + return result; + } + + int FileMOV::seek_end() + { + if(!file) return 0; + audio_position = get_audio_length() - samples_correction; + video_position = get_video_length() - frames_correction; + quicktime_seek_end(file); + return 0; + } + + int FileMOV::seek_start() + { + if(!file) return 0; + audio_position = 0; + video_position = 0; + quicktime_seek_start(file); + return 0; + } + + long FileMOV::get_audio_position() + { + if(!file) return 0; + return quicktime_audio_position(file, 0) + samples_correction; + } + + int FileMOV::set_audio_position(long x) + { + if(!file) return 0; + audio_position = x - samples_correction; + // quicktime sets positions for each track seperately so store position in audio_position + if(audio_position >= 0 && audio_position < quicktime_audio_length(file, 0)) + return quicktime_set_audio_position(file, x, 0); + else + return 1; + return 0; + } + + long FileMOV::get_video_position() + { + if(!file) return 0; + return quicktime_video_position(file, video_layer) + frames_correction; + } + + int FileMOV::set_video_position(long x) + { + if(!file) return 0; + video_position = x - frames_correction; + + if(video_position < quicktime_video_length(file, video_layer)) + { + return quicktime_set_video_position(file, x, video_layer); + } + else + { + video_position = quicktime_video_length(file, video_layer) - 1; + return quicktime_set_video_position(file, video_position, video_layer); + return 1; + } + return 0; + } + + int FileMOV::set_channel(int channel) + { + if(!file) return 0; + this->audio_channel = channel; + return 0; + } + + int FileMOV::set_layer(int layer) + { + if(!file) return 0; + this->video_layer = layer; + return 0; + } + + int FileMOV::write_samples(float **buffer, + PluginBuffer *audio_ram, + long byte_offset, + long allocated_samples, + long len) + { + int i, j; + long bytes; + int result = 0, track_channels = 0; + int chunk_size; + + if(!file) return 0; + if(quicktime_supported_audio(file, 0) && !use_bcast_audio) + { + // Use Quicktime's compressor. (Always used) + // Because of the way Quicktime's compressors work we want to limit the chunk + // size to speed up decompression but not create too many chunks. + float **fake_buffer; + + fake_buffer = new float*[asset->channels]; + for(j = 0; j < len && !result; ) + { + chunk_size = asset->rate; + if(j + chunk_size * 2 > len) chunk_size = len - j; + + for(i = 0; i < asset->channels; i++) + { + fake_buffer[i] = &buffer[i][j]; + } + + result |= quicktime_encode_audio(FileMOV::file, 0, fake_buffer, chunk_size); + result = test_length(result); + j += chunk_size; + } + delete [] fake_buffer; + } + else + { + // Use our own compressor. (Not used) + // Originally intended to match the channels to track organization but + // today all channels are written to track 0. + for(int i = 0, j = 0, track = 0; i < asset->channels && result == 0; i += track_channels, track++) + { + track_channels = quicktime_track_channels(file, track); + + get_audio_buffer(&audio_buffer_out, len, asset->bits, track_channels); + + bytes = samples_to_raw(audio_buffer_out, + buffer, + len, + asset->bits, + track_channels, + asset->byte_order, + asset->signed_); // signed_ + + result = quicktime_write_audio(file, audio_buffer_out, len, track); + } + } + audio_position += len; + return result; + return 0; + } + + int FileMOV::write_frames(VFrame ***frames, + PluginBuffer *video_ram, + int len, + int use_alpha, + int use_float) + { + long bytes; + int i, j, k, result = 0; + + if(!file) return 0; + + // Frames use alpha + if(frames[0][0]->get_color_model() == VFRAME_VPIXEL) + { + get_video_buffer(&video_buffer_out, depth); + get_row_pointers(video_buffer_out, &row_pointers_out, depth); + } + else + { + // Frame from a video capture uses no alpha + } + + + for(i = 0; i < asset->layers && !result; i++) + { + if((match4(asset->compression, QUICKTIME_JPEG) || + match4(asset->compression, QUICKTIME_MJPA)) && + file->cpus > 1 && + !frames[0][0]->get_color_model() == VFRAME_VPIXEL) + { + // Compress symmetrically on an SMP system. + ThreadStruct *threadframe; + int interlaced = match4(asset->compression, QUICKTIME_MJPA); + + // Set up threads for symmetric compression. + if(!threads) + { + threads = new FileMOVThread*[FileBase::file->cpus]; + for(j = 0; j < FileBase::file->cpus; j++) + { + threads[j] = new FileMOVThread(this, interlaced + 1); + threads[j]->start_encoding(); + } + } + + // Set up the frame structures for each frame + while(threadframes.total < len) + { + threadframes.append(threadframe = new ThreadStruct); + } + + // Load thread frame structures with new frames. + for(j = 0; j < len; j++) + { + threadframes.values[j]->input = frames[i][j]; + threadframes.values[j]->completion_lock.lock(); + } + total_threadframes = len; + current_threadframe = 0; + + // Start the threads compressing + for(j = 0; j < FileBase::file->cpus; j++) + { + threads[j]->encode_buffer(); + } + + // Write the frames as they're finished + for(j = 0; j < len; j++) + { + threadframes.values[j]->completion_lock.lock(); + threadframes.values[j]->completion_lock.unlock(); + if(!result) + { + quicktime_write_frame(file, + threadframes.values[j]->output, + threadframes.values[j]->output_size, + i); + } + } + } + else + for(j = 0; j < len && !result; j++) + { + // Compress one at a time using the library. + if(frames[i][j]->get_color_model() == VFRAME_VPIXEL) + { + bytes = frame_to_raw(video_buffer_out, + frames[i][j], + asset->width, + asset->height, + use_alpha, + use_float, + depth == 24 ? FILEBASE_RAW : FILEBASE_RGBA); + } + else + { + // Use no frame_to_raw transformation for captured video. Encode the data directly. + if(row_pointers_out) delete row_pointers_out; + row_pointers_out = 0; + get_row_pointers(frames[i][j]->get_data(), &row_pointers_out, depth); + } + + result |= quicktime_encode_video(file, row_pointers_out, i); + result = test_length(result); + } + } + + video_position += len; + return result; + return 0; + } + + int FileMOV::read_frame(VFrame *frame, PluginBuffer *buffer, long byte_offset, + float in_x1, float in_y1, float in_x2, float in_y2, + float out_x1, float out_y1, float out_x2, float out_y2, + int alpha, int use_alpha, int use_float, int interpolate) + { + if(!file) return 0; + + // forces read directly into frame + read_raw(frame, in_x1, in_y1, in_x2, in_y2, + out_x1, out_y1, out_x2, out_y2, alpha, use_alpha, + use_float, interpolate); + + video_position++; + return 0; + return 0; + } + + VFrame* FileMOV::read_frame(int use_alpha, int use_float) + { + if(!file) return 0; + + // don't use alpha + // forces read into a temporary buffer + read_raw(0, + 0, 0, (float)asset->width, (float)asset->height, + 0, 0, (float)asset->width, (float)asset->height, + VMAX, 0, use_float, 0); + + video_position++; + return data; + } + + long FileMOV::compressed_frame_size() + { + if(!file) return 0; + return quicktime_frame_size(file, video_position, video_layer); + } + + int FileMOV::read_compressed_frame(VFrame *buffer) + { + long result; + if(!file) return 0; + + result = quicktime_read_frame(file, buffer->get_data(), video_layer); + buffer->set_compressed_size(result); + result = !result; + video_position++; + return result; + return 0; + } + + int FileMOV::write_compressed_frame(VFrame *buffer) + { + int result = 0; + if(!file) return 0; + + result |= quicktime_write_frame(file, buffer->get_data(), buffer->get_compressed_size(), video_layer); + result = test_length(result); + + video_position++; + return result; + return 0; + } + + + int FileMOV::read_raw_frame(VFrame *frame, PluginBuffer *buffer, long byte_offset) + { + int result = 0; + if(!file) return 0; + quicktime_set_video_position(file, video_position, video_layer); + + result = quicktime_decode_video(file, frame->get_rows(), video_layer); + return result; + } + + + int FileMOV::read_raw(VFrame *frame, + float in_x1, float in_y1, float in_x2, float in_y2, + float out_x1, float out_y1, float out_x2, float out_y2, + int alpha, int use_alpha, int use_float, int interpolate) + { + long i, color_channels, bytes; + + if(!file) return 0; + + // want to return a pointer to a temporary buffer for drawing on a timeline + if(!frame && !data) + { + // user wants frame stored in file handler's frame but data hasn't been created yet. + frame = data = new VFrame(0, asset->width, asset->height); + } + if(!frame) + { + // user wants frame stored in file handler's frame and data has been created. + frame = data; + } + + prev_layer = video_layer; + prev_frame_position = video_position; + + get_video_buffer(&video_buffer_in, depth); + get_row_pointers(video_buffer_in, &row_pointers_in, depth); + + quicktime_set_video_position(file, video_position, video_layer); + quicktime_decode_video(file, row_pointers_in, video_layer); + raw_to_frame(video_buffer_in, frame, + in_x1, in_y1, in_x2, in_y2, + out_x1, out_y1, out_x2, out_y2, alpha, + use_alpha, use_float, depth == 24 ? OVERLAY_RGB : OVERLAY_RGBA, + interpolate, asset->width, asset->height); + return 0; + } + + // Overlay samples + int FileMOV::read_samples(PluginBuffer *shared_buffer, long offset, long len, int feather, + long lfeather_len, float lfeather_gain, float lfeather_slope) + { + int qt_track, qt_channel; + float *buffer = (float*)shared_buffer->get_data() + offset; + + if(!file) return 0; + + if(quicktime_supported_audio(file, 0) && !use_bcast_audio) + { + // Use Quicktime's decoder. + if(feather) + { + get_float_buffer(&float_buffer, len); + if(quicktime_decode_audio(file, NULL, float_buffer, len, audio_channel)) + { + printf("FileMOV::read_samples: quicktime_decode_audio failed\n"); + return 1; + } + + // Feather the buffer. + overlay_float_buffer(buffer, float_buffer, len, + lfeather_len, lfeather_gain, lfeather_slope); + } + else + // Don't feather the buffer. + if(quicktime_decode_audio(file, 0, buffer, len, audio_channel)) + { + printf("FileMOV::read_samples: quicktime_decode_audio failed\n"); + return 1; + } + } + else + { + // Use our own decoder. + quicktime_channel_location(file, &qt_track, &qt_channel, audio_channel); + get_audio_buffer(&audio_buffer_in, len, asset->bits, quicktime_track_channels(file, qt_track)); + + if(read_raw(audio_buffer_in, len, qt_track)) + { + printf("FileMOV::read_samples: read_raw failed\n"); + return 1; + } + + raw_to_samples(buffer, + audio_buffer_in, + len, + asset->bits, + quicktime_track_channels(file, qt_track), + qt_channel, + feather, + lfeather_len, + lfeather_gain, + lfeather_slope); + } + + audio_position += len; + prev_len = len; + return 0; + return 0; + } + + // Read raw samples + int FileMOV::read_raw(char *buffer, long samples, int track) + { + int result; + + if(!file) return 0; + + // only load if position has changed or this is the first buffer + if(prev_buffer_position == -1 || + prev_buffer_position != audio_position || + prev_len != samples || + track != prev_track) + { + long bytes = samples * quicktime_track_channels(file, track) * (FileBase::file->bytes_per_sample(asset->bits)); + prev_buffer_position = audio_position; + prev_len = samples; + prev_track = track; + result = quicktime_read_audio(file, buffer, samples, track); + + if(!result) return 1; + + if(asset->bits == BITSLINEAR8 && !asset->signed_) // fix the unsigned numbers to signed + { // change unsigned to signed + int i = 0, len_ = bytes - 4; + while(i < len_) + { + buffer[i++] ^= 128; + buffer[i++] ^= 128; + buffer[i++] ^= 128; + buffer[i++] ^= 128; + } + while(i < bytes) + { + buffer[i++] ^= 128; + } + } + + //printf("FileMOV::read_raw internal_byte_order %d asset->byte_order %d\n", internal_byte_order, asset->byte_order); + if((!internal_byte_order && asset->byte_order) || + (internal_byte_order && !asset->byte_order)) + { // swap bytes if not intel + swap_bytes(FileBase::file->bytes_per_sample(asset->bits), (unsigned char*)buffer, bytes); + } + } + + return 0; + return 0; + } + + long FileMOV::get_memory_usage() + { + int result = 4096; + if(!file) return 0; + + if(data) result += asset->width * asset->height * sizeof(VPixel); + if(video_buffer_in) result += asset->width * asset->height * 3; + if(video_buffer_out) result += asset->width * asset->height * 3; + if(audio_buffer_in) result += prev_bytes; + if(audio_buffer_out) result += prev_bytes; + return result; + } + + + + // Parallel JPEG encoding + + ThreadStruct::ThreadStruct() + { + input = 0; + output = 0; + output_allocated = 0; + output_size = 0; + } + + ThreadStruct::~ThreadStruct() + { + if(output) delete [] output; + } + + void ThreadStruct::load_output(mjpeg_t *mjpeg) + { + if(output_allocated < mjpeg_output_size(mjpeg)) + { + delete [] output; + output = 0; + } + if(!output) + { + output_allocated = mjpeg_output_size(mjpeg); + output = new unsigned char[output_allocated]; + } + + output_size = mjpeg_output_size(mjpeg); + memcpy(output, mjpeg_output_buffer(mjpeg), output_size); + } + + + FileMOVThread::FileMOVThread(FileMOV *filemov, int fields) : Thread() + { + this->filemov = filemov; + this->fields = fields; + mjpeg = 0; + } + FileMOVThread::~FileMOVThread() + { + } + + int FileMOVThread::start_encoding() + { + //printf("FileMOVThread::start_encoding 1 %d\n", fields); + mjpeg = mjpeg_new(filemov->asset->width, + filemov->asset->height, + fields); + mjpeg_set_quality(mjpeg, filemov->asset->quality); + mjpeg_set_float(mjpeg, 0); + done = 0; + Thread::synchronous = 1; + input_lock.lock(); + start(); + } + + int FileMOVThread::stop_encoding() + { + done = 1; + input_lock.unlock(); + join(); + if(mjpeg) mjpeg_delete(mjpeg); + } + + int FileMOVThread::encode_buffer() + { + input_lock.unlock(); + } + + void FileMOVThread::run() + { + while(!done) + { + input_lock.lock(); + + if(!done) + { + // Get a frame to compress. + filemov->threadframe_lock.lock(); + if(filemov->current_threadframe < filemov->total_threadframes) + { + // Frame is available to process. + input_lock.unlock(); + threadframe = filemov->threadframes.values[filemov->current_threadframe]; + filemov->current_threadframe++; + filemov->threadframe_lock.unlock(); + + //printf("FileMOVThread 1 %d\n", threadframe->input->get_color_model()); + mjpeg_compress(mjpeg, + threadframe->input->get_rows(), + 0, + 0, + 0, + BC_RGB888, + 1); + + //printf("FileMOVThread 1\n"); + if(fields > 1) + { + long field2_offset; + mjpeg_insert_quicktime_markers(&mjpeg->output_data, + &mjpeg->output_size, + &mjpeg->output_allocated, + fields, + &field2_offset); + } + threadframe->load_output(mjpeg); + + //printf("FileMOVThread 2\n"); + threadframe->completion_lock.unlock(); + } + else + filemov->threadframe_lock.unlock(); + } + } + } + diff -C2 -r -N bcast-2000c/bcast/filemov.h bcast-2000c-mf3/bcast/filemov.h *** bcast-2000c/bcast/filemov.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/filemov.h Sun Jun 9 10:10:11 2002 *************** *** 35,39 **** ~FileMOV(); ! friend FileMOVThread; int open_file(int rd, int wr); --- 35,39 ---- ~FileMOV(); ! friend class FileMOVThread; int open_file(int rd, int wr); diff -C2 -r -N bcast-2000c/bcast/fileplugin.C bcast-2000c-mf3/bcast/fileplugin.C *** bcast-2000c/bcast/fileplugin.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/fileplugin.C Sat Jan 19 16:22:37 2002 *************** *** 206,210 **** int result = plugin->read_raw_frame(frame, buffer, byte_offset); return result; - return 0; } --- 206,209 ---- *************** *** 218,222 **** lfeather_len, lfeather_gain, lfeather_slope); return result; - return 0; } --- 217,220 ---- *************** *** 231,235 **** int result = plugin->read_raw_frame_possible(); return result; - return 0; } --- 229,232 ---- diff -C2 -r -N bcast-2000c/bcast/formatcheck.C bcast-2000c-mf3/bcast/formatcheck.C *** bcast-2000c/bcast/formatcheck.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/formatcheck.C Mon Dec 31 13:35:38 2001 *************** *** 48,51 **** --- 48,59 ---- } + if(!result && asset->bits == BITSVORBIS && asset->format != MOV) + { + ErrorBox error; + error.create_objects("Vorbis compression is only available in Quicktime movies."); + error.run_window(); + result = 1; + } + if(!result && asset->bits == BITSULAW && asset->format != MOV && diff -C2 -r -N bcast-2000c/bcast/indexthread.h bcast-2000c-mf3/bcast/indexthread.h *** bcast-2000c/bcast/indexthread.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/indexthread.h Sun Jun 9 10:11:44 2002 *************** *** 23,27 **** ~IndexThread(); ! friend IndexFile; int start_build(); --- 23,27 ---- ~IndexThread(); ! friend class IndexFile; int start_build(); diff -C2 -r -N bcast-2000c/bcast/main.C bcast-2000c-mf3/bcast/main.C *** bcast-2000c/bcast/main.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/main.C Sat Jan 19 16:22:37 2002 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include "arraylist.h" #include "filehtal.h" *************** *** 75,79 **** int main(int argc, char *argv[]) { ! fprintf(stderr, "Broadcast 2000c (C)2001 Adam Williams\n"); if(sizeof(VWORD) == 2) printf("16 bits per channel enabled.\n"); --- 77,81 ---- int main(int argc, char *argv[]) { ! fprintf(stderr, "Broadcast 2000c-mf3 based on version 2000c (C)2001 Adam Williams\n"); if(sizeof(VWORD) == 2) printf("16 bits per channel enabled.\n"); *************** *** 292,298 **** { // on first pass use global dir ! case 0: if(strlen(global_plugin_dir)) printf("Couldn't open global plugin directory.\n"); break; // on second pass use local dir ! case 1: if(strlen(local_plugin_dir)) printf("Couldn't open local plugin directory.\n"); break; } } --- 294,300 ---- { // on first pass use global dir ! case 0: if(strlen(global_plugin_dir)) printf("Couldn't open global plugin directory '%s'.\n",global_plugin_dir); break; // on second pass use local dir ! case 1: if(strlen(local_plugin_dir)) printf("Couldn't open local plugin directory '%s'.\n",local_plugin_dir); break; } } diff -C2 -r -N bcast-2000c/bcast/mainmenu.C bcast-2000c-mf3/bcast/mainmenu.C *** bcast-2000c/bcast/mainmenu.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/mainmenu.C Sun Mar 3 16:13:35 2002 *************** *** 1,2 **** --- 1,4 ---- + // changed 2002-03-03 by Moritz Franosch + #include #include "assets.h" *************** *** 149,152 **** --- 151,156 ---- windowmenu->add_menuitem(show_video = new ShowVideo(mwindow)); windowmenu->add_menuitem(new OriginalSize(mwindow)); + windowmenu->add_menuitem(new DoubleSize(mwindow)); + windowmenu->add_menuitem(new HalfSize(mwindow)); windowmenu->add_menuitem(new VerticalTracks(mwindow)); //windowmenu->add_menuitem(new InverseAutomation(0)); *************** *** 929,933 **** int LoopPlayback::handle_event() { ! mwindow->set_loop_boundaries(); set_checked(mwindow->loop_playback); return 0; --- 933,937 ---- int LoopPlayback::handle_event() { ! mwindow->set_loop_boundaries(!mwindow->loop_playback); set_checked(mwindow->loop_playback); return 0; *************** *** 1060,1063 **** --- 1064,1068 ---- } + OriginalSize::OriginalSize(MainWindow *mwindow) : BC_MenuItem("Original size") *************** *** 1075,1078 **** --- 1080,1111 ---- + DoubleSize::DoubleSize(MainWindow *mwindow) + : BC_MenuItem("Double size") + { + this->mwindow = mwindow; + } + + int DoubleSize::handle_event() + { + mwindow->video_window->gui->lock_window(); + mwindow->video_window->magnify(2); + mwindow->video_window->gui->unlock_window(); + return 0; + } + + + HalfSize::HalfSize(MainWindow *mwindow) + : BC_MenuItem("Half size") + { + this->mwindow = mwindow; + } + + int HalfSize::handle_event() + { + mwindow->video_window->gui->lock_window(); + mwindow->video_window->magnify(0.5); + mwindow->video_window->gui->unlock_window(); + return 0; + } diff -C2 -r -N bcast-2000c/bcast/mainmenu.h bcast-2000c-mf3/bcast/mainmenu.h *** bcast-2000c/bcast/mainmenu.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/mainmenu.h Sat Jan 19 16:22:37 2002 *************** *** 423,426 **** --- 423,442 ---- }; + class DoubleSize : public BC_MenuItem + { + public: + DoubleSize(MainWindow *mwindow); + int handle_event(); + MainWindow *mwindow; + }; + + class HalfSize : public BC_MenuItem + { + public: + HalfSize(MainWindow *mwindow); + int handle_event(); + MainWindow *mwindow; + }; + class ShowTitles : public BC_MenuItem { diff -C2 -r -N bcast-2000c/bcast/mainwindow.C bcast-2000c-mf3/bcast/mainwindow.C *** bcast-2000c/bcast/mainwindow.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/mainwindow.C Sun Mar 3 17:44:35 2002 *************** *** 1,2 **** --- 1,4 ---- + // changed 2002-03-03 by Moritz Franosch + #include #include "assetmanager.h" *************** *** 1001,1004 **** --- 1003,1007 ---- int MainWindow::get_affected_range(long *start, long *end, int reverse) { + set_loop_boundaries(loop_playback); if(selectionstart == selectionend) { *************** *** 1023,1027 **** ! int MainWindow::set_loop_boundaries() { long start, end; --- 1026,1030 ---- ! int MainWindow::set_loop_boundaries(const int loop) { long start, end; *************** *** 1043,1057 **** } ! if(!loop_playback && start != end) { loop_start = start; loop_end = end; loop_playback = 1; ! if(gui) tracks->draw_loop_points(1); } else ! if(loop_playback) { ! if(gui) tracks->draw_loop_points(1); loop_playback = 0; } --- 1046,1060 ---- } ! if(loop && start != end) { loop_start = start; loop_end = end; loop_playback = 1; ! // if(gui) tracks->draw_loop_points(1); } else ! if(!loop) { ! // if(gui) tracks->draw_loop_points(1); loop_playback = 0; } *************** *** 1185,1191 **** int MainWindow::arm_playback(int follow_loop, ! int use_buttons, ! int infinite, ! AudioDevice *audio) { if(!is_playing_back) --- 1188,1194 ---- int MainWindow::arm_playback(int follow_loop, ! int use_buttons, ! int infinite, ! AudioDevice *audio) { if(!is_playing_back) *************** *** 1194,1200 **** //printf("MainWindow::arm_playback 1\n"); playback_engine->arm_playback(follow_loop, ! use_buttons, ! infinite, ! audio); //printf("MainWindow::arm_playback 2\n"); } --- 1197,1203 ---- //printf("MainWindow::arm_playback 1\n"); playback_engine->arm_playback(follow_loop, ! use_buttons, ! infinite, ! audio); //printf("MainWindow::arm_playback 2\n"); } diff -C2 -r -N bcast-2000c/bcast/mainwindow.h bcast-2000c-mf3/bcast/mainwindow.h *** bcast-2000c/bcast/mainwindow.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/mainwindow.h Sun Mar 3 16:20:38 2002 *************** *** 118,131 **** int cut(long start, long end); int paste_output(long startproject, ! long endproject, ! long startsource_sample, ! long endsource_sample, ! long startsource_frame, ! long endsource_frame, ! Asset *asset, ! RecordLabels *new_labels); int paste_transition(long startproject, ! long endproject, ! Transition *transition); int clear(long start, long end); int feather_edits(long feather_samples, int audio, int video); --- 118,131 ---- int cut(long start, long end); int paste_output(long startproject, ! long endproject, ! long startsource_sample, ! long endsource_sample, ! long startsource_frame, ! long endsource_frame, ! Asset *asset, ! RecordLabels *new_labels); int paste_transition(long startproject, ! long endproject, ! Transition *transition); int clear(long start, long end); int feather_edits(long feather_samples, int audio, int video); *************** *** 157,175 **** // start a cursor selection int init_selection(long cursor_position, ! int cursor_x, ! int cursor_y, ! int ¤t_end, ! long &selection_midpoint1, ! long &selection_midpoint2, ! int &selection_type); int update_selection(long cursor_position, ! int cursor_x, ! int cursor_y, ! int ¤t_end, ! long selection_midpoint1, ! long selection_midpoint2, ! int selection_type); int end_selection(); ! int set_loop_boundaries(); // toggle loop playback and set boundaries for loop playback // ================================ handle selection ======================= --- 157,175 ---- // start a cursor selection int init_selection(long cursor_position, ! int cursor_x, ! int cursor_y, ! int ¤t_end, ! long &selection_midpoint1, ! long &selection_midpoint2, ! int &selection_type); int update_selection(long cursor_position, ! int cursor_x, ! int cursor_y, ! int ¤t_end, ! long selection_midpoint1, ! long selection_midpoint2, ! int selection_type); int end_selection(); ! int set_loop_boundaries(const int loop); // set loop playback and set boundaries for loop playback // ================================ handle selection ======================= *************** *** 206,212 **** // need playbutton to update when playback finishes int arm_playback(int follow_loop, ! int use_buttons, ! int infinite, ! AudioDevice *audio); int pause_playback(); // stop and arm playback int start_playback(); // start instantly --- 206,212 ---- // need playbutton to update when playback finishes int arm_playback(int follow_loop, ! int use_buttons, ! int infinite, ! AudioDevice *audio); int pause_playback(); // stop and arm playback int start_playback(); // start instantly diff -C2 -r -N bcast-2000c/bcast/patch.C bcast-2000c-mf3/bcast/patch.C *** bcast-2000c/bcast/patch.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/patch.C Mon Dec 31 11:12:36 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include #include "console.h" *************** *** 14,18 **** this->data_type = data_type; record = play = automate = 1; ! draw = 0; title[0] = 0; } --- 16,20 ---- this->data_type = data_type; record = play = automate = 1; ! draw = 1; title[0] = 0; } diff -C2 -r -N bcast-2000c/bcast/playbackengine.C bcast-2000c-mf3/bcast/playbackengine.C *** bcast-2000c/bcast/playbackengine.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/playbackengine.C Sun Mar 3 17:24:43 2002 *************** *** 1,2 **** --- 1,4 ---- + // changed 2002-03-03 by Moritz Franosch + #include #include "audiodevice.h" *************** *** 15,18 **** --- 17,22 ---- #include "vrender.h" + #include + PlaybackEngine::PlaybackEngine(MainWindow *mwindow) : Thread() *************** *** 32,35 **** --- 36,40 ---- // called before every playback is_playing_back = 0; + ending_playback = 0; follow_loop = 0; speed = 1; *************** *** 147,153 **** int PlaybackEngine::arm_playback(int follow_loop, ! int use_buttons, ! int infinite, ! AudioDevice *audio) { this->follow_loop = follow_loop; --- 152,158 ---- int PlaybackEngine::arm_playback(int follow_loop, ! int use_buttons, ! int infinite, ! AudioDevice *audio) { this->follow_loop = follow_loop; *************** *** 269,278 **** this->update_button = update_button; - //printf("PlaybackEngine::stop_playback 1\n"); if(is_playing_back == 2) { // output device is running ! new_position = get_position(0); ! //printf("PlaybackEngine::stop_playback 1\n"); // interrupt audio driver forcefully --- 274,295 ---- this->update_button = update_button; if(is_playing_back == 2) { + if (ending_playback) + { printf ("warning from PlaybackEngine::stop_playback: playback-process is already ending\n"); + wait_for_completion(); + + if(reverse) + last_position = playback_end = playback_start; + else + playback_start = last_position = playback_end; + + return 0; + } // output device is running ! if ((new_position = get_position(0)) < 0) ! { printf ("warning from PlaybackEngine::stop_playback: Couldn't get position. Using last_position in stead.\n"); ! new_position = last_position; ! } // interrupt audio driver forcefully *************** *** 344,348 **** if(audio) { ! result = audio->current_position(); } else --- 361,369 ---- if(audio) { ! if ((result = audio->current_position()) < 0) ! { ! result = timer.get_scaled_difference(mwindow->sample_rate); ! printf ("warning from PlaybackEngine::absolute_position: couldn't get position from audio. Using timer-value in stead.\n"); ! } } else *************** *** 396,399 **** --- 417,425 ---- loop_adjustment += mwindow->loop_end - mwindow->loop_start; } + + if (result < playback_start) + { result = playback_start; + //printf ("in PlaybackEngine::get_position: positioning-returnvalue would become to low. Setting it to playback_start.\n"); + } } else *************** *** 401,406 **** result += playback_start; result -= loop_adjustment; ! ! while(mwindow->loop_playback && follow_loop && result > mwindow->loop_end) { --- 427,440 ---- result += playback_start; result -= loop_adjustment; ! ! /* ! clog << "result=" << result << endl; ! clog << "mwindow->loop_start=" ! << mwindow->loop_start << endl; ! clog << "mwindow->loop_end=" ! << mwindow->loop_end << endl; ! */ ! ! while(mwindow->loop_playback && follow_loop && result > mwindow->loop_end) { *************** *** 408,411 **** --- 442,450 ---- loop_adjustment += mwindow->loop_end - mwindow->loop_start; } + + if (result > playback_end) + { result = playback_end; + //printf ("in PlaybackEngine::get_position: positioning-returnvalue would become to high. Setting it to playback_end.\n"); + } } break; *************** *** 472,502 **** - - void PlaybackEngine::run() { - //printf("PlaybackEngine::run 1\n");fflush(stdout); startup_lock.unlock(); - //printf("PlaybackEngine::run 1\n");fflush(stdout); render_engine->wait_for_completion(); ! //printf("PlaybackEngine::run 1\n");fflush(stdout); reset_buttons(); // change the playbutton to play if there is one - //printf("PlaybackEngine::run 1\n");fflush(stdout); if(cursor) cursor->stop_playback(); // kill cursor - //printf("PlaybackEngine::run 1\n");fflush(stdout); - if(!shared_audio && audio) // delete audio objects if not shared - { - audio->close_all(); - } - //printf("PlaybackEngine::run 1\n");fflush(stdout); - if(video) video->close_all(); - //printf("PlaybackEngine::run 1\n");fflush(stdout); // delete more objects ! cleanup(); complete.unlock(); // signal blocking threads to continue - //printf("PlaybackEngine::run 2\n");fflush(stdout); } --- 511,537 ---- void PlaybackEngine::run() { startup_lock.unlock(); render_engine->wait_for_completion(); ! ! if (audio) ! { audio->wait_for_completion(); ! ending_playback = 1; ! ! if(!shared_audio) // delete audio objects if not shared ! audio->close_all(); ! } ! else ! ending_playback = 1; reset_buttons(); // change the playbutton to play if there is one if(cursor) cursor->stop_playback(); // kill cursor if(video) video->close_all(); // delete more objects ! cleanup(); ! ending_playback = 0; complete.unlock(); // signal blocking threads to continue } diff -C2 -r -N bcast-2000c/bcast/playbackengine.h bcast-2000c-mf3/bcast/playbackengine.h *** bcast-2000c/bcast/playbackengine.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/playbackengine.h Sun Mar 3 14:33:29 2002 *************** *** 74,77 **** --- 74,78 ---- int infinite; // for infinite playback int follow_loop; // 1 if mwindow's looping setting is followed + unsigned char ending_playback; int is_playing_back; // 0 - no playback 1 - armed but stopped 2 - playing back int reconfigure_status; // 0 - no playback 1 - armed but stopped 2 - playing back diff -C2 -r -N bcast-2000c/bcast/record.C bcast-2000c-mf3/bcast/record.C *** bcast-2000c/bcast/record.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/record.C Mon Dec 31 11:12:35 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include #include "assets.h" *************** *** 297,301 **** // create the GUI RecordGUI gui(this, &engine, string, ! 300 + (do_audio ? 25 + asset.channels * 25 : 0)); gui.create_objects(); --- 299,303 ---- // create the GUI RecordGUI gui(this, &engine, string, ! 300 + (do_audio ? 25 + asset.channels * 25 : 0),script!=0); gui.create_objects(); diff -C2 -r -N bcast-2000c/bcast/recordgui.C bcast-2000c-mf3/bcast/recordgui.C *** bcast-2000c/bcast/recordgui.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/recordgui.C Mon Dec 31 12:22:56 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include #include "file.h" *************** *** 10,18 **** #include "videodevice.h" ! RecordGUI::RecordGUI(Record *record, RecordEngine *engine, char *string, int height) : BC_Window("", MEGREY, string, 500, height, 500, height) { this->engine = engine; this->record = record; } --- 12,21 ---- #include "videodevice.h" ! RecordGUI::RecordGUI(Record *record, RecordEngine *engine, char *string, int height, int script) : BC_Window("", MEGREY, string, 500, height, 500, height) { this->engine = engine; this->record = record; + this->script = script; } *************** *** 307,310 **** --- 310,331 ---- } + int RecordGUI::timed_recording_done() { + if (script) { + lock_window(); + save=1; + set_done(0); + unlock_window(); + } + return 0; + } + + void RecordGUI::done_event_hook() + { + if (save) { + engine->stop_operation(1); + engine->stop_monitor(); + } + } + diff -C2 -r -N bcast-2000c/bcast/recordgui.h bcast-2000c-mf3/bcast/recordgui.h *** bcast-2000c/bcast/recordgui.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/recordgui.h Mon Dec 31 11:12:34 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #ifndef RECORDGUI_H #define RECORDGUI_H *************** *** 28,33 **** { public: ! RecordGUI(Record *record, RecordEngine *engine, char *string, int height); ! ~RecordGUI(); int create_objects(); --- 30,35 ---- { public: ! RecordGUI(Record *record, RecordEngine *engine, char *string, int height, int script); ! virtual ~RecordGUI(); int create_objects(); *************** *** 55,60 **** long total_dropped_frames; long total_clipped_samples; ! ! char* get_path(); --- 57,62 ---- long total_dropped_frames; long total_clipped_samples; ! int save; ! int script; char* get_path(); *************** *** 93,96 **** --- 95,102 ---- int goto_next_label(); int toggle_label(); + + int timed_recording_done(); + virtual void done_event_hook(); + Record *record; }; diff -C2 -r -N bcast-2000c/bcast/recordvideo.C bcast-2000c-mf3/bcast/recordvideo.C *** bcast-2000c/bcast/recordvideo.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/recordvideo.C Mon Dec 31 11:12:34 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include #include "errorbox.h" *************** *** 107,110 **** --- 109,114 ---- grab_result = 0; + int timed_done=0; + // Thread out the I/O if(file) *************** *** 253,256 **** --- 257,261 ---- // Signal the audio thread to stop since it is required for shared devices. if(record->do_audio) record_thread->record_audio->done = 1; + timed_done=1; } } *************** *** 271,274 **** --- 276,284 ---- cleanup_recording(); + + if (timed_done) { + gui->timed_recording_done(); + } + } diff -C2 -r -N bcast-2000c/bcast/testobject.h bcast-2000c-mf3/bcast/testobject.h *** bcast-2000c/bcast/testobject.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/testobject.h Sun Jun 9 10:14:56 2002 *************** *** 14,16 **** ! #endif; --- 14,16 ---- ! #endif diff -C2 -r -N bcast-2000c/bcast/videodevice.C bcast-2000c-mf3/bcast/videodevice.C *** bcast-2000c/bcast/videodevice.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/videodevice.C Mon Dec 31 11:12:34 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + // V4L2 is incompatible with large file support #undef _FILE_OFFSET_BITS *************** *** 103,106 **** --- 105,109 ---- in_config = new VideoConfig; out_config = new VideoConfig; + is_unmuted = 0; initialize(); } *************** *** 111,114 **** --- 114,118 ---- in_config = new VideoConfig; out_config = new VideoConfig; + is_unmuted = 0; initialize(); } *************** *** 116,119 **** --- 120,133 ---- VideoDevice::~VideoDevice() { + if (is_unmuted) { + if (input_fd!=-1) close(input_fd); + input_fd = open(in_config->v4l_in_device, O_RDWR); + if (input_fd!=-1) { + set_mute(1); + } else { + perror("VideoDevice::~VideoDevice()"); + } + if (input_fd!=-1) close(input_fd); + } for(int i = 0; i < input_sources.total; i++) delete input_sources.values[i]; *************** *** 413,418 **** audio.audio = 1; ! if(-1 == ioctl(input_fd, VIDIOCGAUDIO, &audio)) ! perror("VideoDevice::ioctl VIDIOCGAUDIO"); audio.volume = 65535; --- 427,434 ---- audio.audio = 1; ! if(-1 == ioctl(input_fd, VIDIOCGAUDIO, &audio)) { ! perror("VideoDevice::ioctl VIDIOCGAUDIO"); ! return 0; ! } audio.volume = 65535; *************** *** 424,429 **** audio.flags &= ~VIDEO_AUDIO_MUTE; ! if (-1 == ioctl(input_fd, VIDIOCSAUDIO, &audio)) ! perror("VideoDevice::ioctl VIDIOCSAUDIO"); return 0; } --- 440,449 ---- audio.flags &= ~VIDEO_AUDIO_MUTE; ! if (-1 == ioctl(input_fd, VIDIOCSAUDIO, &audio)) { ! perror("VideoDevice::ioctl VIDIOCSAUDIO"); ! return 0; ! } ! ! is_unmuted=!muted; return 0; } diff -C2 -r -N bcast-2000c/bcast/videodevice.h bcast-2000c-mf3/bcast/videodevice.h *** bcast-2000c/bcast/videodevice.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/videodevice.h Sun Jun 9 10:05:46 2002 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #ifndef VIDEODEVICE_H #define VIDEODEVICE_H *************** *** 68,75 **** ~VideoDevice(); ! friend VDeviceLML; ! friend VDeviceX11; ! friend VDevice1394; ! friend Audio1394; int close_all(); --- 70,77 ---- ~VideoDevice(); ! friend class VDeviceLML; ! friend class VDeviceX11; ! friend class VDevice1394; ! friend class Audio1394; int close_all(); *************** *** 142,146 **** ArrayList input_sources; int odd_field_first; ! // ================================== Playback --- 144,149 ---- ArrayList input_sources; int odd_field_first; ! // To mute device in destructor if it's unmuted. ! int is_unmuted; // ================================== Playback diff -C2 -r -N bcast-2000c/bcast/videowindow.C bcast-2000c-mf3/bcast/videowindow.C *** bcast-2000c/bcast/videowindow.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/videowindow.C Sat Jan 19 16:22:37 2002 *************** *** 124,127 **** --- 124,137 ---- } + + int VideoWindow::magnify(const double& factor) { + int w, h; + get_full_sizes(w, h); + video_window_w = int(factor*w); + resize_window(); + return 0; + } + + int VideoWindow::get_full_sizes(int &w, int &h) { diff -C2 -r -N bcast-2000c/bcast/videowindow.h bcast-2000c-mf3/bcast/videowindow.h *** bcast-2000c/bcast/videowindow.h Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/videowindow.h Sat Jan 19 16:22:37 2002 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #ifndef VIDEOWINDOW_H #define VIDEOWINDOW_H *************** *** 29,32 **** --- 31,35 ---- int resize_window(); int original_size(); // Put the window at its original size + int magnify(const double& factor); // Put the window at its original size*factor int reset(); int init_video(); diff -C2 -r -N bcast-2000c/bcast/videowindowgui.C bcast-2000c-mf3/bcast/videowindowgui.C *** bcast-2000c/bcast/videowindowgui.C Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast/videowindowgui.C Sat Jan 19 16:22:37 2002 *************** *** 46,49 **** --- 46,56 ---- thread->mwindow->gui->unlock_window(); } + else + if(get_keypress() == 'f') + { + thread->mwindow->gui->lock_window(); + // go to full screen + thread->mwindow->gui->unlock_window(); + } // make it look like mwindow is handling the event diff -C2 -r -N bcast-2000c/bcast2000.sh bcast-2000c-mf3/bcast2000.sh *** bcast-2000c/bcast2000.sh Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/bcast2000.sh Mon Mar 4 09:27:18 2002 *************** *** 1,4 **** --- 1,6 ---- #!/bin/sh + # changed 2001-12-30 by Moritz Franosch + # BCASTDIR=/lscratch/bcast2000/local/bcast BCASTDIR=/usr/local/bcast diff -C2 -r -N bcast-2000c/bcbase/bcfilebox.h bcast-2000c-mf3/bcbase/bcfilebox.h *** bcast-2000c/bcbase/bcfilebox.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/bcbase/bcfilebox.h Sun Jun 9 09:51:54 2002 *************** *** 30,37 **** virtual ~BC_FileBox(); ! friend BC_FileBoxListBox; ! friend BC_FileBoxOK; ! friend BC_FileBoxCancel; ! friend BC_FileBoxUseThis; int create_objects(); --- 30,37 ---- virtual ~BC_FileBox(); ! friend class BC_FileBoxListBox; ! friend class BC_FileBoxOK; ! friend class BC_FileBoxCancel; ! friend class BC_FileBoxUseThis; int create_objects(); diff -C2 -r -N bcast-2000c/bcbase/bclistbox.h bcast-2000c-mf3/bcbase/bclistbox.h *** bcast-2000c/bcbase/bclistbox.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/bcbase/bclistbox.h Sun Jun 9 09:51:54 2002 *************** *** 40,44 **** virtual ~BC_ListBoxItem(); ! friend BC_ListBox; BC_ListBoxItem& operator=(BC_ListBoxItem& item); --- 40,44 ---- virtual ~BC_ListBoxItem(); ! friend class BC_ListBox; BC_ListBoxItem& operator=(BC_ListBoxItem& item); *************** *** 64,69 **** virtual ~BC_ListBox(); ! friend BC_ListBoxXScroll; ! friend BC_ListBoxYScroll; // user event handler for new selections --- 64,69 ---- virtual ~BC_ListBox(); ! friend class BC_ListBoxXScroll; ! friend class BC_ListBoxYScroll; // user event handler for new selections diff -C2 -r -N bcast-2000c/bcbase/bcpopupmenu.h bcast-2000c-mf3/bcbase/bcpopupmenu.h *** bcast-2000c/bcbase/bcpopupmenu.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/bcbase/bcpopupmenu.h Sun Jun 9 09:51:54 2002 *************** *** 83,88 **** virtual ~BC_MenuPopup(); ! friend BC_PopupItem; ! friend BC_MenuItem; int add_item(BC_MenuItem *item); --- 83,88 ---- virtual ~BC_MenuPopup(); ! friend class BC_PopupItem; ! friend class BC_MenuItem; int add_item(BC_MenuItem *item); diff -C2 -r -N bcast-2000c/bcbase/bcscrollbar.h bcast-2000c-mf3/bcbase/bcscrollbar.h *** bcast-2000c/bcbase/bcscrollbar.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/bcbase/bcscrollbar.h Sun Jun 9 09:51:55 2002 *************** *** 20,25 **** virtual ~BC_ScrollBar() { }; ! friend BC_XScrollBar; ! friend BC_YScrollBar; int create_tool_objects(); --- 20,25 ---- virtual ~BC_ScrollBar() { }; ! friend class BC_XScrollBar; ! friend class BC_YScrollBar; int create_tool_objects(); diff -C2 -r -N bcast-2000c/bcbase/bcwindow.C bcast-2000c-mf3/bcbase/bcwindow.C *** bcast-2000c/bcbase/bcwindow.C Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/bcbase/bcwindow.C Mon Dec 31 11:12:33 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include #include *************** *** 498,501 **** --- 500,505 ---- } + done_event_hook(); + unlock_window(); return return_value; *************** *** 990,993 **** --- 994,1002 ---- // ================================== repeating + int BC_Window::repeat_event_dispatch(long repeat_id) + { + return BC_WindowBase::repeat_event_dispatch(repeat_id); + } + int BC_Window::repeat_event_dispatch(long repeat_id, int interrupt_now) { *************** *** 1016,1020 **** if(active_menubar) result = active_menubar->repeat_event_dispatch(repeat_id); if(!result && active_tool) result = active_tool->repeat_event_dispatch(repeat_id); ! if(!result) BC_WindowBase::repeat_event_dispatch(repeat_id); repeater->repeat_mutex.unlock(); --- 1025,1030 ---- if(active_menubar) result = active_menubar->repeat_event_dispatch(repeat_id); if(!result && active_tool) result = active_tool->repeat_event_dispatch(repeat_id); ! // if(!result) BC_WindowBase::repeat_event_dispatch(repeat_id); Why? (Moritz) ! if(!result) result = repeat_event_dispatch(repeat_id); repeater->repeat_mutex.unlock(); *************** *** 1023,1028 **** } } ! return result; ! return 0; } --- 1033,1041 ---- } } ! return result; ! } ! ! void BC_Window::done_event_hook() ! { } *************** *** 1043,1048 **** repeaters.append(repeater); ! repeater->start_repeating(); ! return 0; return 0; } --- 1056,1060 ---- repeaters.append(repeater); ! repeater->start_repeating(); return 0; } diff -C2 -r -N bcast-2000c/bcbase/bcwindow.h bcast-2000c-mf3/bcbase/bcwindow.h *** bcast-2000c/bcbase/bcwindow.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/bcbase/bcwindow.h Sun Jun 9 09:51:53 2002 *************** *** 46,56 **** virtual ~BC_Window(); ! friend BC_Bitmap; ! friend BC_Popup; ! friend BC_Resources; ! friend BC_SubWindow; ! friend BC_Tool; ! friend BC_WindowBase; ! friend BC_Repeater; // =============================== initialization --- 46,56 ---- virtual ~BC_Window(); ! friend class BC_Bitmap; ! friend class BC_Popup; ! friend class BC_Resources; ! friend class BC_SubWindow; ! friend class BC_Tool; ! friend class BC_WindowBase; ! friend class BC_Repeater; // =============================== initialization *************** *** 91,94 **** --- 91,96 ---- virtual int keypress_event() { return 0; }; // handle a key press virtual int close_event() { return 0; }; // close box pressed + virtual int repeat_event_dispatch(long repeat_id); // for repeats + virtual void done_event_hook(); int shift_down(); // flags for certain keys int ctrl_down(); diff -C2 -r -N bcast-2000c/bcbase/bcwindowbase.C bcast-2000c-mf3/bcbase/bcwindowbase.C *** bcast-2000c/bcbase/bcwindowbase.C Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/bcbase/bcwindowbase.C Mon Dec 31 12:56:49 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include #include "bcbitmap.h" diff -C2 -r -N bcast-2000c/bcbase/bcwindowbase.h bcast-2000c-mf3/bcbase/bcwindowbase.h *** bcast-2000c/bcbase/bcwindowbase.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/bcbase/bcwindowbase.h Sun Jun 9 09:51:57 2002 *************** *** 31,36 **** virtual ~BC_WindowBase(); ! friend BC_SubWindow; ! friend BC_Window; // affect this window and all its subwindows --- 31,36 ---- virtual ~BC_WindowBase(); ! friend class BC_SubWindow; ! friend class BC_Window; // affect this window and all its subwindows diff -C2 -r -N bcast-2000c/bcbase/colormodels.h bcast-2000c-mf3/bcbase/colormodels.h *** bcast-2000c/bcbase/colormodels.h Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/bcbase/colormodels.h Fri Nov 30 14:29:04 2001 *************** *** 1,2 **** --- 1,20 ---- + /* + * This library 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 of the License, or + * (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + + #ifndef COLORMODELS_H #define COLORMODELS_H *************** *** 13,16 **** --- 31,36 ---- #define BC_RGB888 9 #define BC_RGBA8888 10 + #define BC_ARGB8888 20 + #define BC_ABGR8888 21 #define BC_RGB161616 11 #define BC_RGBA16161616 12 *************** *** 19,28 **** #define BC_YUV161616 15 #define BC_YUVA16161616 16 // Planar #define BC_YUV420P 7 #define BC_YUV422P 17 - #define BC_YUV422 19 #define BC_YUV411P 18 // For communication with the X Server #define FOURCC_YV12 0x32315659 /* YV12 YUV420P */ --- 39,55 ---- #define BC_YUV161616 15 #define BC_YUVA16161616 16 + #define BC_YUV422 19 + #define BC_A8 22 + #define BC_A16 23 + #define BC_YUV101010 24 + #define BC_VYU888 25 + #define BC_UYVA8888 26 // Planar #define BC_YUV420P 7 #define BC_YUV422P 17 #define BC_YUV411P 18 + // Colormodels purely used by Quicktime are done in Quicktime. + // For communication with the X Server #define FOURCC_YV12 0x32315659 /* YV12 YUV420P */ *************** *** 39,66 **** typedef struct { ! long rtoy_tab[256], gtoy_tab[256], btoy_tab[256]; ! long rtou_tab[256], gtou_tab[256], btou_tab[256]; ! long rtov_tab[256], gtov_tab[256], btov_tab[256]; ! ! long vtor_tab[256], vtog_tab[256]; ! long utog_tab[256], utob_tab[256]; ! long *vtor, *vtog, *utog, *utob; } cmodel_yuv_t; int cmodel_calculate_pixelsize(int colormodel); ! void cmodel_transfer(unsigned char **output_rows, unsigned char **input_rows, ! unsigned char *out_y_plane, unsigned char *out_u_plane, unsigned char *out_v_plane, ! unsigned char *in_y_plane, unsigned char *in_u_plane, unsigned char *in_v_plane, ! int in_x, int in_y, int in_w, int in_h, ! int out_x, int out_y, int out_w, --- 66,107 ---- typedef struct { ! int rtoy_tab[0x100], gtoy_tab[0x100], btoy_tab[0x100]; ! int rtou_tab[0x100], gtou_tab[0x100], btou_tab[0x100]; ! int rtov_tab[0x100], gtov_tab[0x100], btov_tab[0x100]; ! ! int vtor_tab[0x100], vtog_tab[0x100]; ! int utog_tab[0x100], utob_tab[0x100]; ! int *vtor, *vtog, *utog, *utob; ! ! int rtoy_tab16[0x10000], gtoy_tab16[0x10000], btoy_tab16[0x10000]; ! int rtou_tab16[0x10000], gtou_tab16[0x10000], btou_tab16[0x10000]; ! int rtov_tab16[0x10000], gtov_tab16[0x10000], btov_tab16[0x10000]; ! ! int vtor_tab16[0x10000], vtog_tab16[0x10000]; ! int utog_tab16[0x10000], utob_tab16[0x10000]; ! int *vtor16, *vtog16, *utog16, *utob16; } cmodel_yuv_t; + extern cmodel_yuv_t *yuv_table; + int cmodel_calculate_pixelsize(int colormodel); + int cmodel_calculate_datasize(int w, int h, int bytes_per_line, int color_model); + int cmodel_calculate_max(int colormodel); + int cmodel_components(int colormodel); + int cmodel_is_yuv(int colormodel); ! void cmodel_transfer(unsigned char **output_rows, /* Leave NULL if non existent */ unsigned char **input_rows, ! unsigned char *out_y_plane, /* Leave NULL if non existent */ unsigned char *out_u_plane, unsigned char *out_v_plane, ! unsigned char *in_y_plane, /* Leave NULL if non existent */ unsigned char *in_u_plane, unsigned char *in_v_plane, ! int in_x, /* Dimensions to capture from input frame */ int in_y, int in_w, int in_h, ! int out_x, /* Dimensions to project on output frame */ int out_y, int out_w, *************** *** 68,74 **** int in_colormodel, int out_colormodel, ! int bg_color, ! int total_in_w, ! int total_out_w); void cmodel_init_yuv(cmodel_yuv_t *yuv_table); --- 109,115 ---- int in_colormodel, int out_colormodel, ! int bg_color, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ ! int in_rowspan, /* For planar use the luma rowspan */ ! int out_rowspan); /* For planar use the luma rowspan */ void cmodel_init_yuv(cmodel_yuv_t *yuv_table); diff -C2 -r -N bcast-2000c/configure bcast-2000c-mf3/configure *** bcast-2000c/configure Mon Jan 22 21:55:45 2001 --- bcast-2000c-mf3/configure Mon Dec 31 12:12:24 2001 *************** *** 1,3 **** --- 1,4 ---- #!/bin/sh + # changed 2001-12-30 by Moritz Franosch USE_MMX=1 *************** *** 44,51 **** if test -z "$CFLAGS"; then ! echo >> global_config "CFLAGS = -O2 -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -march=i486 -I/usr/local/include" fi ! echo >> global_config "CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" ########################## DEVICE DRIVERS --- 45,53 ---- if test -z "$CFLAGS"; then ! echo >> global_config "CFLAGS = -O3 -fomit-frame-pointer -march=i586 -I/usr/local/include" ! ## echo >> global_config "CFLAGS = -g -I/usr/local/include" fi ! echo >> global_config "CFLAGS += -D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" ########################## DEVICE DRIVERS *************** *** 182,187 **** ! cd quicktime ! ./configure $ac_option ! cd .. ! --- 184,188 ---- ! # cd quicktime ! # ./configure $ac_option ! # cd .. diff -C2 -r -N bcast-2000c/docs/formats.html bcast-2000c-mf3/docs/formats.html *** bcast-2000c/docs/formats.html Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/docs/formats.html Mon Dec 31 15:04:03 2001 *************** *** 21,29 **** Quicktime movies with video in MJPA, JPEG Photo, PNG, YUV ! 422, YUV 420, or RGB, and audio in IMA4, ULAW, 8, 16, or 24 bit linear ! PCM. Loading these gives you seperate video and audio tracks depending on the data in the file. The project is reconfigured to fit the movie. For PNG video, the compression is fixed to 9. If you want no ! compression use RGB.

Still frame PNG, JPEG, and TIFF images. Loading these gives --- 21,30 ---- Quicktime movies with video in MJPA, JPEG Photo, PNG, YUV ! 422, YUV 420, RGB or OpenDivx, and audio in IMA4, ULAW, 8, 16, 24 bit linear ! PCM or Vorbis. Loading these gives you seperate video and audio tracks depending on the data in the file. The project is reconfigured to fit the movie. For PNG video, the compression is fixed to 9. If you want no ! compression use RGB. The quality parameter for the OpenDivx format ! controls the bit rate, quality 100 means 2000000 bits per second.

Still frame PNG, JPEG, and TIFF images. Loading these gives diff -C2 -r -N bcast-2000c/docs/troubleshooting.html bcast-2000c-mf3/docs/troubleshooting.html *** bcast-2000c/docs/troubleshooting.html Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/docs/troubleshooting.html Sat Jan 19 16:57:06 2002 *************** *** 241,244 **** --- 241,254 ---- + FRAMES ARE DROPED DURING PLAYBACK + +

+ + although CPU load is far less than 100%. The number of samples to + read from disk at a time in settings->preferences->audio + out is set too high. Set it to 16284 or lower. + +
+ Binary files bcast-2000c/esound/libesound.a and bcast-2000c-mf3/esound/libesound.a differ diff -C2 -r -N bcast-2000c/global_config bcast-2000c-mf3/global_config *** bcast-2000c/global_config Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/global_config Mon Dec 31 12:10:24 2001 *************** *** 0 **** --- 1,38 ---- + # DO NOT EDIT. EDIT ./configure INSTEAD AND RERUN IT. + ############################# C++ and C COMPILERS + + CC = g++ + GCC = gcc + + ############################# FINAL DESTINATION FOR INSTALLATION BINARIES + + PREFIX = /usr/local + LIBPREFIX = $(PREFIX)/lib + + ########################## COMPILER + CFLAGS = -O3 -fomit-frame-pointer -march=i586 -I/usr/local/include + CFLAGS += -D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + CFLAGS += -I. + CFLAGS += -DHAVE_OSS + CFLAGS += -DHAVE_ESOUND + #CFLAGS += -DHAVE_ALSA + CFLAGS += -DHAVE_FIREWIRE + + + ########################## LINKER + + LFLAGS = -L/usr/X11R6/lib + PLUGINLFLAGS = -L../../bcbase -L/usr/X11R6/lib + LDLINKER = g++ -shared + + ########################## LIBRARIES + + XLIBS = -lX11 -lXext -lXv -lpthread -lm + LIBS = $(XLIBS) + //ALPHAOBJS = cxx_repository/*.o + + ############### MAKEFILE MACROS + + LOOP_BEGIN = @ for i in $(DIRS) ; do + + LOOP_END = done diff -C2 -r -N bcast-2000c/guicast/bcbutton.h bcast-2000c-mf3/guicast/bcbutton.h *** bcast-2000c/guicast/bcbutton.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcbutton.h Sun Jun 9 09:51:57 2002 *************** *** 15,19 **** virtual ~BC_Button(); ! friend BC_GenericButton; virtual int handle_event() { return 0; }; --- 15,19 ---- virtual ~BC_Button(); ! friend class BC_GenericButton; virtual int handle_event() { return 0; }; diff -C2 -r -N bcast-2000c/guicast/bcfilebox.h bcast-2000c-mf3/guicast/bcfilebox.h *** bcast-2000c/guicast/bcfilebox.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcfilebox.h Sun Jun 9 09:55:54 2002 *************** *** 168,183 **** virtual ~BC_FileBox(); ! friend BC_FileBoxCancel; ! friend BC_FileBoxListBox; ! friend BC_FileBoxTextBox; ! friend BC_FileBoxText; ! friend BC_FileBoxIcons; ! friend BC_FileBoxNewfolder; ! friend BC_FileBoxOK; ! friend BC_NewFolderThread; ! friend BC_FileBoxUpdir; ! friend BC_FileBoxFilterText; ! friend BC_FileBoxFilterMenu; ! friend BC_FileBoxUseThis; virtual int create_objects(); --- 168,183 ---- virtual ~BC_FileBox(); ! friend class BC_FileBoxCancel; ! friend class BC_FileBoxListBox; ! friend class BC_FileBoxTextBox; ! friend class BC_FileBoxText; ! friend class BC_FileBoxIcons; ! friend class BC_FileBoxNewfolder; ! friend class BC_FileBoxOK; ! friend class BC_NewFolderThread; ! friend class BC_FileBoxUpdir; ! friend class BC_FileBoxFilterText; ! friend class BC_FileBoxFilterMenu; ! friend class BC_FileBoxUseThis; virtual int create_objects(); diff -C2 -r -N bcast-2000c/guicast/bclistbox.h bcast-2000c-mf3/guicast/bclistbox.h *** bcast-2000c/guicast/bclistbox.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bclistbox.h Sun Jun 9 09:58:13 2002 *************** *** 28,32 **** virtual ~BC_ListBoxItem(); ! friend BC_ListBox; BC_ListBoxItem& operator=(BC_ListBoxItem& item); --- 28,32 ---- virtual ~BC_ListBoxItem(); ! friend class BC_ListBox; BC_ListBoxItem& operator=(BC_ListBoxItem& item); *************** *** 97,101 **** virtual ~BC_ListBox(); ! friend BC_PopupListBox; int initialize(); --- 97,101 ---- virtual ~BC_ListBox(); ! friend class BC_PopupListBox; int initialize(); diff -C2 -r -N bcast-2000c/guicast/bcmenubar.h bcast-2000c-mf3/guicast/bcmenubar.h *** bcast-2000c/guicast/bcmenubar.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcmenubar.h Sun Jun 9 10:04:39 2002 *************** *** 12,16 **** virtual ~BC_MenuBar(); ! friend BC_Menu; int add_menu(BC_Menu* menu); --- 12,16 ---- virtual ~BC_MenuBar(); ! friend class BC_Menu; int add_menu(BC_Menu* menu); *************** *** 45,49 **** virtual ~BC_Menu(); ! friend BC_MenuBar; // Called by user --- 45,49 ---- virtual ~BC_Menu(); ! friend class BC_MenuBar; // Called by user *************** *** 86,90 **** virtual ~BC_MenuItem(); ! friend BC_MenuPopup; int add_submenu(BC_SubMenu *submenu); --- 86,90 ---- virtual ~BC_MenuItem(); ! friend class BC_MenuPopup; int add_submenu(BC_SubMenu *submenu); *************** *** 142,146 **** virtual ~BC_MenuPopup(); ! friend BC_MenuItem; int initialize(BC_WindowBase *top_level, --- 142,146 ---- virtual ~BC_MenuPopup(); ! friend class BC_MenuItem; int initialize(BC_WindowBase *top_level, diff -C2 -r -N bcast-2000c/guicast/bcpixmap.h bcast-2000c-mf3/guicast/bcpixmap.h *** bcast-2000c/guicast/bcpixmap.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcpixmap.h Sun Jun 9 09:51:56 2002 *************** *** 20,24 **** ~BC_Pixmap(); ! friend BC_WindowBase; void resize(int w, int h); --- 20,24 ---- ~BC_Pixmap(); ! friend class BC_WindowBase; void resize(int w, int h); diff -C2 -r -N bcast-2000c/guicast/bcpot.h bcast-2000c-mf3/guicast/bcpot.h *** bcast-2000c/guicast/bcpot.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcpot.h Sun Jun 9 09:55:53 2002 *************** *** 21,27 **** virtual ~BC_Pot(); ! friend BC_FPot; ! friend BC_IPot; ! friend BC_PercentagePot; int initialize(); --- 21,27 ---- virtual ~BC_Pot(); ! friend class BC_FPot; ! friend class BC_IPot; ! friend class BC_PercentagePot; int initialize(); diff -C2 -r -N bcast-2000c/guicast/bcprogressbox.h bcast-2000c-mf3/guicast/bcprogressbox.h *** bcast-2000c/guicast/bcprogressbox.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcprogressbox.h Sun Jun 9 10:05:46 2002 *************** *** 14,18 **** virtual ~BC_ProgressBox(); ! friend BC_ProgressWindow; void run(); --- 14,18 ---- virtual ~BC_ProgressBox(); ! friend class BC_ProgressWindow; void run(); diff -C2 -r -N bcast-2000c/guicast/bcscrollbar.h bcast-2000c-mf3/guicast/bcscrollbar.h *** bcast-2000c/guicast/bcscrollbar.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcscrollbar.h Sun Jun 9 09:55:55 2002 *************** *** 31,35 **** virtual ~BC_ScrollBar(); ! friend BC_ListBox; virtual int handle_event() { return 0; }; --- 31,35 ---- virtual ~BC_ScrollBar(); ! friend class BC_ListBox; virtual int handle_event() { return 0; }; diff -C2 -r -N bcast-2000c/guicast/bcslider.h bcast-2000c-mf3/guicast/bcslider.h *** bcast-2000c/guicast/bcslider.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcslider.h Sun Jun 9 09:58:12 2002 *************** *** 22,28 **** virtual ~BC_Slider(); ! friend BC_ISlider; ! friend BC_FSlider; ! friend BC_PercentageSlider; virtual int handle_event() { return 0; }; --- 22,28 ---- virtual ~BC_Slider(); ! friend class BC_ISlider; ! friend class BC_FSlider; ! friend class BC_PercentageSlider; virtual int handle_event() { return 0; }; *************** *** 112,116 **** VFrame **data = 0); ! friend BC_PercentageSlider; int update(float value); --- 112,116 ---- VFrame **data = 0); ! friend class BC_PercentageSlider; int update(float value); diff -C2 -r -N bcast-2000c/guicast/bctextbox.h bcast-2000c-mf3/guicast/bctextbox.h *** bcast-2000c/guicast/bctextbox.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bctextbox.h Sun Jun 9 09:55:54 2002 *************** *** 101,106 **** void update_list(ArrayList *data); ! friend BC_PopupTextBoxText; ! friend BC_PopupTextBoxList; private: --- 101,106 ---- void update_list(ArrayList *data); ! friend class BC_PopupTextBoxText; ! friend class BC_PopupTextBoxList; private: *************** *** 151,156 **** void set_boundaries(long min, long max); ! friend BC_TumbleTextBoxText; ! friend BC_TumbleTextBoxTumble; private: --- 151,156 ---- void set_boundaries(long min, long max); ! friend class BC_TumbleTextBoxText; ! friend class BC_TumbleTextBoxTumble; private: diff -C2 -r -N bcast-2000c/guicast/bcwindowbase.C bcast-2000c-mf3/guicast/bcwindowbase.C *** bcast-2000c/guicast/bcwindowbase.C Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcwindowbase.C Mon Dec 31 12:57:18 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include "bcbitmap.h" #include "bcclipboard.h" *************** *** 980,984 **** repeaters.append(repeater); ! repeater->start_repeating(); return 0; } --- 982,986 ---- repeaters.append(repeater); ! repeater->start_repeating(); return 0; } diff -C2 -r -N bcast-2000c/guicast/bcwindowbase.h bcast-2000c-mf3/guicast/bcwindowbase.h *** bcast-2000c/guicast/bcwindowbase.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/bcwindowbase.h Sun Jun 9 09:51:56 2002 *************** *** 63,95 **** virtual ~BC_WindowBase(); ! friend BC_Bitmap; ! friend BC_Button; ! friend BC_GenericButton; ! friend BC_Capture; ! friend BC_Clipboard; ! friend BC_DragWindow; ! friend BC_FileBox; ! friend BC_ListBox; ! friend BC_Menu; ! friend BC_MenuBar; ! friend BC_MenuItem; ! friend BC_MenuPopup; ! friend BC_Meter; ! friend BC_Pan; ! friend BC_Pixmap; ! friend BC_Popup; ! friend BC_PopupMenu; ! friend BC_Pot; ! friend BC_ProgressBar; ! friend BC_Repeater; ! friend BC_Resources; ! friend BC_ScrollBar; ! friend BC_Slider; ! friend BC_SubWindow; ! friend BC_TextBox; ! friend BC_Title; ! friend BC_Toggle; ! friend BC_Tumbler; ! friend BC_Window; // Main loop --- 63,95 ---- virtual ~BC_WindowBase(); ! friend class BC_Bitmap; ! friend class BC_Button; ! friend class BC_GenericButton; ! friend class BC_Capture; ! friend class BC_Clipboard; ! friend class BC_DragWindow; ! friend class BC_FileBox; ! friend class BC_ListBox; ! friend class BC_Menu; ! friend class BC_MenuBar; ! friend class BC_MenuItem; ! friend class BC_MenuPopup; ! friend class BC_Meter; ! friend class BC_Pan; ! friend class BC_Pixmap; ! friend class BC_Popup; ! friend class BC_PopupMenu; ! friend class BC_Pot; ! friend class BC_ProgressBar; ! friend class BC_Repeater; ! friend class BC_Resources; ! friend class BC_ScrollBar; ! friend class BC_Slider; ! friend class BC_SubWindow; ! friend class BC_TextBox; ! friend class BC_Title; ! friend class BC_Toggle; ! friend class BC_Tumbler; ! friend class BC_Window; // Main loop diff -C2 -r -N bcast-2000c/guicast/colormodels.c bcast-2000c-mf3/guicast/colormodels.c *** bcast-2000c/guicast/colormodels.c Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/guicast/colormodels.c Mon Dec 17 15:45:47 2001 *************** *** 1,40 **** #include "colormodels.h" - #include #include ! static cmodel_yuv_t *yuv_table = 0; void cmodel_init_yuv(cmodel_yuv_t *yuv_table) { int i; ! for(i = 0; i < 256; i++) { /* compression */ ! yuv_table->rtoy_tab[i] = (long)( 0.2990 * 65536 * i); ! yuv_table->rtou_tab[i] = (long)(-0.1687 * 65536 * i); ! yuv_table->rtov_tab[i] = (long)( 0.5000 * 65536 * i); ! ! yuv_table->gtoy_tab[i] = (long)( 0.5870 * 65536 * i); ! yuv_table->gtou_tab[i] = (long)(-0.3320 * 65536 * i); ! yuv_table->gtov_tab[i] = (long)(-0.4187 * 65536 * i); ! ! yuv_table->btoy_tab[i] = (long)( 0.1140 * 65536 * i); ! yuv_table->btou_tab[i] = (long)( 0.5000 * 65536 * i) + 0x800000; ! yuv_table->btov_tab[i] = (long)(-0.0813 * 65536 * i) + 0x800000; } ! yuv_table->vtor = &(yuv_table->vtor_tab[128]); ! yuv_table->vtog = &(yuv_table->vtog_tab[128]); ! yuv_table->utog = &(yuv_table->utog_tab[128]); ! yuv_table->utob = &(yuv_table->utob_tab[128]); ! for(i = -128; i < 128; i++) { /* decompression */ ! yuv_table->vtor[i] = (long)( 1.4020 * 65536 * i); ! yuv_table->vtog[i] = (long)(-0.7141 * 65536 * i); ! yuv_table->utog[i] = (long)(-0.3441 * 65536 * i); ! yuv_table->utob[i] = (long)( 1.7720 * 65536 * i); } } --- 1,85 ---- + /* + * This library 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 of the License, or + * (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ #include "colormodels.h" #include ! cmodel_yuv_t *yuv_table = 0; void cmodel_init_yuv(cmodel_yuv_t *yuv_table) { int i; ! for(i = 0; i < 0x100; i++) { /* compression */ ! yuv_table->rtoy_tab[i] = (int)( 0.2990 * 0x10000 * i); ! yuv_table->rtou_tab[i] = (int)(-0.1687 * 0x10000 * i); ! yuv_table->rtov_tab[i] = (int)( 0.5000 * 0x10000 * i); ! ! yuv_table->gtoy_tab[i] = (int)( 0.5870 * 0x10000 * i); ! yuv_table->gtou_tab[i] = (int)(-0.3320 * 0x10000 * i); ! yuv_table->gtov_tab[i] = (int)(-0.4187 * 0x10000 * i); ! ! yuv_table->btoy_tab[i] = (int)( 0.1140 * 0x10000 * i); ! yuv_table->btou_tab[i] = (int)( 0.5000 * 0x10000 * i) + 0x800000; ! yuv_table->btov_tab[i] = (int)(-0.0813 * 0x10000 * i) + 0x800000; ! } ! ! yuv_table->vtor = &(yuv_table->vtor_tab[0x80]); ! yuv_table->vtog = &(yuv_table->vtog_tab[0x80]); ! yuv_table->utog = &(yuv_table->utog_tab[0x80]); ! yuv_table->utob = &(yuv_table->utob_tab[0x80]); ! for(i = -0x80; i < 0x80; i++) ! { ! /* decompression */ ! yuv_table->vtor[i] = (int)( 1.4020 * 0x10000 * i); ! yuv_table->vtog[i] = (int)(-0.7141 * 0x10000 * i); ! ! yuv_table->utog[i] = (int)(-0.3441 * 0x10000 * i); ! yuv_table->utob[i] = (int)( 1.7720 * 0x10000 * i); } ! for(i = 0; i < 0x10000; i++) ! { ! /* compression */ ! yuv_table->rtoy_tab16[i] = (int)( 0.2990 * 0x100 * i); ! yuv_table->rtou_tab16[i] = (int)(-0.1687 * 0x100 * i); ! yuv_table->rtov_tab16[i] = (int)( 0.5000 * 0x100 * i); ! ! yuv_table->gtoy_tab16[i] = (int)( 0.5870 * 0x100 * i); ! yuv_table->gtou_tab16[i] = (int)(-0.3320 * 0x100 * i); ! yuv_table->gtov_tab16[i] = (int)(-0.4187 * 0x100 * i); ! ! yuv_table->btoy_tab16[i] = (int)( 0.1140 * 0x100 * i); ! yuv_table->btou_tab16[i] = (int)( 0.5000 * 0x100 * i) + 0x800000; ! yuv_table->btov_tab16[i] = (int)(-0.0813 * 0x100 * i) + 0x800000; ! } ! ! yuv_table->vtor16 = &(yuv_table->vtor_tab16[0x8000]); ! yuv_table->vtog16 = &(yuv_table->vtog_tab16[0x8000]); ! yuv_table->utog16 = &(yuv_table->utog_tab16[0x8000]); ! yuv_table->utob16 = &(yuv_table->utob_tab16[0x8000]); ! for(i = -0x8000; i < 0x8000; i++) { /* decompression */ ! yuv_table->vtor16[i] = (int)( 1.4020 * 0x100 * i); ! yuv_table->vtog16[i] = (int)(-0.7141 * 0x100 * i); ! yuv_table->utog16[i] = (int)(-0.3441 * 0x100 * i); ! yuv_table->utob16[i] = (int)( 1.7720 * 0x100 * i); } } *************** *** 56,63 **** --- 101,128 ---- } + int cmodel_components(int colormodel) + { + switch(colormodel) + { + case BC_A8: return 1; break; + case BC_A16: return 1; break; + case BC_RGB888: return 3; break; + case BC_RGBA8888: return 4; break; + case BC_RGB161616: return 3; break; + case BC_RGBA16161616: return 4; break; + case BC_YUV888: return 3; break; + case BC_YUVA8888: return 4; break; + case BC_YUV161616: return 3; break; + case BC_YUVA16161616: return 4; break; + case BC_YUV101010: return 3; break; + } + } + int cmodel_calculate_pixelsize(int colormodel) { switch(colormodel) { + case BC_A8: return 1; break; + case BC_A16: return 2; break; case BC_TRANSPARENCY: return 1; break; case BC_COMPRESSED: return 1; break; *************** *** 69,72 **** --- 134,139 ---- // Working bitmaps are packed to simplify processing case BC_RGB888: return 3; break; + case BC_ARGB8888: return 4; break; + case BC_ABGR8888: return 4; break; case BC_RGBA8888: return 4; break; case BC_RGB161616: return 6; break; *************** *** 76,79 **** --- 143,149 ---- case BC_YUV161616: return 6; break; case BC_YUVA16161616: return 8; break; + case BC_YUV101010: return 4; break; + case BC_VYU888: return 3; break; + case BC_UYVA8888: return 4; break; // Planar case BC_YUV420P: return 1; break; *************** *** 85,1135 **** } ! #define RGB_TO_YUV(y, u, v, r, g, b) \ ! { \ ! y = ((yuv_table->rtoy_tab[r] + yuv_table->gtoy_tab[g] + yuv_table->btoy_tab[b]) >> 16); \ ! u = ((yuv_table->rtou_tab[r] + yuv_table->gtou_tab[g] + yuv_table->btou_tab[b]) >> 16); \ ! v = ((yuv_table->rtov_tab[r] + yuv_table->gtov_tab[g] + yuv_table->btov_tab[b]) >> 16); \ ! RECLIP(y, 0, 255); \ ! RECLIP(u, 0, 255); \ ! RECLIP(v, 0, 255); \ ! } ! ! ! ! ! // Pixel transfers ! static inline void transfer_RGBA16161616_to_RGB8(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = ((guint16*)input)[3] >> 8; ! r = (unsigned int)((guint16*)input)[0] * a; ! g = (unsigned int)((guint16*)input)[1] * a; ! b = (unsigned int)((guint16*)input)[2] * a; ! ! *(*output) = (unsigned char)(((r & 0xc00000) >> 16) + ! ((g & 0xe00000) >> 18) + ! ((b & 0xe00000) >> 21)); ! (*output)++; ! } ! ! static inline void transfer_RGBA16161616_to_RGB565(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = ((guint16*)input)[3] >> 8; ! r = (unsigned int)((guint16*)input)[0] * a; ! g = (unsigned int)((guint16*)input)[1] * a; ! b = (unsigned int)((guint16*)input)[2] * a; ! ! *(guint16*)(*output) = (guint16)(((r & 0xf80000) >> 8) + ! ((g & 0xfc0000) >> 13) + ! ((b & 0xf80000) >> 19)); ! (*output) += 2; ! } ! ! static inline void transfer_RGBA16161616_to_BGR888(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = ((guint16*)input)[3] >> 8; ! r = (unsigned int)((guint16*)input)[0] * a; ! g = (unsigned int)((guint16*)input)[1] * a; ! b = (unsigned int)((guint16*)input)[2] * a; ! ! (*output)[0] = (unsigned char)(b >> 16); ! (*output)[1] = (unsigned char)(g >> 16); ! (*output)[2] = (unsigned char)(r >> 16); ! (*output) += 3; ! } ! ! static inline void transfer_RGBA16161616_to_BGR8888(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = ((guint16*)input)[3] >> 8; ! r = ((guint16*)input)[0] * a; ! g = ((guint16*)input)[1] * a; ! b = ((guint16*)input)[2] * a; ! ! (*output)[0] = (unsigned char)(b >> 16); ! (*output)[1] = (unsigned char)(g >> 16); ! (*output)[2] = (unsigned char)(r >> 16); ! (*output) += 4; ! } ! ! ! ! ! ! ! ! ! ! static inline void transfer_RGBA8888_to_TRANSPARENCY(unsigned char *(*output), unsigned char *input, int (*bit_counter)) { ! if((*bit_counter) == 7) *(*output) = 0; ! ! if(input[3] < 127) ! { ! *(*output) |= (unsigned char)1 << (7 - (*bit_counter)); ! } ! ! if((*bit_counter) == 0) { ! (*output)++; ! (*bit_counter) = 7; } ! else ! (*bit_counter)--; ! } ! ! // These routines blend in a background color since they should be ! // exclusively used for widgets. ! ! static inline void transfer_RGBA8888_to_RGB8bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) ! { ! unsigned int r, g, b, a, anti_a; ! a = input[3]; ! anti_a = 255 - a; ! r = (unsigned int)input[0] * a + bg_r * anti_a; ! g = (unsigned int)input[1] * a + bg_g * anti_a; ! b = (unsigned int)input[2] * a + bg_b * anti_a; ! *(*output) = (unsigned char)(((r & 0xc000) >> 8) + ! ((g & 0xe000) >> 10) + ! ((b & 0xe000) >> 13)); ! (*output)++; ! } ! ! static inline void transfer_RGBA8888_to_RGB565bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) ! { ! unsigned int r, g, b, a, anti_a; ! a = input[3]; ! anti_a = 255 - a; ! r = (unsigned int)input[0] * a + bg_r * anti_a; ! g = (unsigned int)input[1] * a + bg_g * anti_a; ! b = (unsigned int)input[2] * a + bg_b * anti_a; ! *(guint16*)(*output) = (guint16)((r & 0xf800) + ! ((g & 0xfc00) >> 5) + ! ((b & 0xf800) >> 11)); ! (*output) += 2; ! } ! ! static inline void transfer_RGBA8888_to_BGR888bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) ! { ! unsigned int r, g, b, a, anti_a; ! a = input[3]; ! anti_a = 255 - a; ! r = (unsigned int)input[0] * a + bg_r * anti_a; ! g = (unsigned int)input[1] * a + bg_g * anti_a; ! b = (unsigned int)input[2] * a + bg_b * anti_a; ! (*output)[0] = (b >> 8) + 1; ! (*output)[1] = (g >> 8) + 1; ! (*output)[2] = (r >> 8) + 1; ! (*output) += 3; ! } ! ! static inline void transfer_RGBA8888_to_BGR8888bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) ! { ! unsigned int r, g, b, a, anti_a; ! a = input[3]; ! anti_a = 255 - a; ! ! r = (unsigned int)input[0] * a + bg_r * anti_a; ! g = (unsigned int)input[1] * a + bg_g * anti_a; ! b = (unsigned int)input[2] * a + bg_b * anti_a; ! ! (*output)[0] = (b >> 8) + 1; ! (*output)[1] = (g >> 8) + 1; ! (*output)[2] = (r >> 8) + 1; ! (*output) += 4; ! } ! ! ! ! ! ! ! ! // These routines blend in a black background ! ! static inline void transfer_RGBA8888_to_RGB8(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = input[3]; ! r = (unsigned int)input[0] * a; ! g = (unsigned int)input[1] * a; ! b = (unsigned int)input[2] * a; ! *(*output) = (unsigned char)(((r & 0xc000) >> 8) + ! ((g & 0xe000) >> 10) + ! ((b & 0xe000) >> 13)); ! (*output)++; ! } ! ! static inline void transfer_RGBA8888_to_RGB565(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = input[3]; ! r = (unsigned int)input[0] * a; ! g = (unsigned int)input[1] * a; ! b = (unsigned int)input[2] * a; ! *(guint16*)(*output) = (guint16)((r & 0xf800) + ! ((g & 0xfc00) >> 5) + ! ((b & 0xf800) >> 11)); ! (*output) += 2; ! } ! ! static inline void transfer_RGBA8888_to_BGR888(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = input[3]; ! r = (unsigned int)input[0] * a; ! g = (unsigned int)input[1] * a; ! b = (unsigned int)input[2] * a; ! (*output)[0] = (b >> 8) + 1; ! (*output)[1] = (g >> 8) + 1; ! (*output)[2] = (r >> 8) + 1; ! (*output) += 3; ! } ! ! static inline void transfer_RGBA8888_to_BGR8888(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = input[3]; ! r = (unsigned int)input[0] * a; ! g = (unsigned int)input[1] * a; ! b = (unsigned int)input[2] * a; ! (*output)[0] = (b >> 8) + 1; ! (*output)[1] = (g >> 8) + 1; ! (*output)[2] = (r >> 8) + 1; ! (*output) += 4; ! } ! ! ! ! ! ! ! ! ! ! static inline void transfer_RGB888_to_RGB8(unsigned char *(*output), unsigned char *input) ! { ! *(*output) = (unsigned char)((input[0] & 0xc0) + ! ((input[1] & 0xe0) >> 2) + ! ((input[2] & 0xe0) >> 5)); ! (*output)++; ! } ! ! static inline void transfer_RGB888_to_RGB565(unsigned char *(*output), unsigned char *input) ! { ! guint16 r, g, b; ! r = *input++; ! g = *input++; ! b = *input; ! *(guint16*)(*output) = ((r & 0xf8) << 8) ! + ((g & 0xfc) << 3) ! + ((b & 0xf8) >> 3); ! (*output) += 2; ! } ! ! static inline void transfer_RGB888_to_BGR888(unsigned char *(*output), unsigned char *input) ! { ! (*output)[0] = input[2]; ! (*output)[1] = input[1]; ! (*output)[2] = input[0]; ! (*output) += 3; ! } ! ! static inline void transfer_RGB888_to_BGR8888(unsigned char *(*output), unsigned char *input) ! { ! (*output)[0] = input[2]; ! (*output)[1] = input[1]; ! (*output)[2] = input[0]; ! (*output) += 4; ! } ! ! static inline void transfer_BGR8888_to_RGB888(unsigned char *(*output), unsigned char *input) ! { ! (*output)[0] = input[2]; ! (*output)[1] = input[1]; ! (*output)[2] = input[0]; ! (*output) += 3; ! } ! ! static inline void transfer_BGR888_to_RGB888(unsigned char *(*output), unsigned char *input) ! { ! (*output)[0] = input[2]; ! (*output)[1] = input[1]; ! (*output)[2] = input[0]; ! (*output) += 3; ! } ! ! static inline void transfer_RGB888_to_YUV420P_YUV422P(unsigned char *output_y, ! unsigned char *output_u, ! unsigned char *output_v, ! unsigned char *input, ! int output_column) ! { ! int y, u, v; ! ! RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); ! ! output_y[output_column] = y; ! output_u[output_column / 2] = u; ! output_v[output_column / 2] = v; ! } ! ! ! ! ! ! ! ! ! ! ! ! #define YUV_TO_RGB(y, u, v, r, g, b) \ ! { \ ! r = ((y + yuv_table->vtor_tab[v]) >> 16); \ ! g = ((y + yuv_table->utog_tab[u] + yuv_table->vtog_tab[v]) >> 16); \ ! b = ((y + yuv_table->utob_tab[u]) >> 16); \ ! RECLIP(r, 0, 255); \ ! RECLIP(g, 0, 255); \ ! RECLIP(b, 0, 255); \ ! } ! ! static inline void transfer_YUV420P_to_RGB8(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! *(*output) = (unsigned char)((r & 0xc0) + ! ((g & 0xe0) >> 2) + ! ((b & 0xe0) >> 5)); ! (*output)++; ! } ! ! static inline void transfer_YUV420P_to_RGB565(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! *(guint16*)(*output) = ((r & 0xf8) << 8) ! + ((g & 0xfc) << 3) ! + ((b & 0xf8) >> 3); ! (*output) += 2; ! } ! ! static inline void transfer_YUV420P_to_BGR888(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = b; ! (*output)[1] = g; ! (*output)[2] = r; ! (*output) += 3; ! } ! ! static inline void transfer_YUV420P_to_RGB888(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = r; ! (*output)[1] = g; ! (*output)[2] = b; ! (*output) += 3; ! } ! ! static inline void transfer_YUV420P_to_BGR8888(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = b; ! (*output)[1] = g; ! (*output)[2] = r; ! (*output) += 4; ! } ! ! ! ! ! ! ! ! ! ! ! ! static inline void transfer_YUV422P_to_YUV888(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! (*output)[0] = *input_y; ! (*output)[1] = *input_u; ! (*output)[2] = *input_v; ! (*output) += 3; } ! static inline void transfer_YUV422P_to_YUV422(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v, ! int j) { ! // Store U and V for even pixels only ! if(!(j & 1)) ! { ! (*output)[1] = *input_u; ! (*output)[3] = *input_v; ! (*output)[0] = *input_y; ! } ! else ! // Store Y and advance output for odd pixels only { ! (*output)[2] = *input_y; ! (*output) += 4; ! } ! } ! ! ! ! ! ! ! ! ! ! ! ! static inline void transfer_YUV422_to_RGB8(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! ! u = input[1]; ! v = input[3]; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! *(*output) = (unsigned char)((r & 0xc0) + ! ((g & 0xe0) >> 2) + ! ((b & 0xe0) >> 5)); ! (*output)++; ! } ! ! static inline void transfer_YUV422_to_RGB565(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! u = input[1]; ! v = input[3]; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! *(guint16*)(*output) = ((r & 0xf8) << 8) ! + ((g & 0xfc) << 3) ! + ((b & 0xf8) >> 3); ! (*output) += 2; ! } ! ! static inline void transfer_YUV422_to_BGR888(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! u = input[1]; ! v = input[3]; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = b; ! (*output)[1] = g; ! (*output)[2] = r; ! (*output) += 3; ! } ! ! static inline void transfer_YUV422_to_RGB888(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! u = input[1]; ! v = input[3]; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = r; ! (*output)[1] = g; ! (*output)[2] = b; ! (*output) += 3; ! } ! ! static inline void transfer_YUV422_to_YUV888(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! // Even pixel ! if(!(column & 1)) ! (*output)[0] = input[0]; ! else ! // Odd pixel ! (*output)[0] = input[2]; ! ! (*output)[1] = input[1]; ! (*output)[2] = input[3]; ! (*output) += 3; ! } ! ! static inline void transfer_YUV422_to_BGR8888(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! u = input[1]; ! v = input[3]; ! ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = b; ! (*output)[1] = g; ! (*output)[2] = r; ! (*output) += 4; ! } ! ! static inline void transfer_YUV422_to_YUV422P(unsigned char *output_y, ! unsigned char *output_u, ! unsigned char *output_v, ! unsigned char *input, ! int output_column) ! { ! // Store U and V for even pixels only ! if(!(output_column & 1)) ! { ! output_y[output_column] = input[0]; ! output_u[output_column / 2] = input[1]; ! output_v[output_column / 2] = input[3]; ! } ! else ! // Store Y and advance output for odd pixels only ! { ! output_y[output_column] = input[2]; ! } ! } ! static inline void transfer_YUV422_to_YUV420P(unsigned char *output_y, ! unsigned char *output_u, ! unsigned char *output_v, ! unsigned char *input, ! int output_column, ! int output_row) ! { ! // Store U and V for even pixels only ! if(!(output_column & 1) && !(output_row & 1)) ! { ! output_y[output_column] = input[0]; ! output_u[output_column / 2] = input[1]; ! output_v[output_column / 2] = input[3]; ! } ! else ! // Store Y and advance output for odd pixels only ! { ! output_y[output_column] = input[2]; } } - - - - - - - - - #define TRANSFER_FRAME_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *output_row = output_rows[i + out_y] + out_x * out_pixelsize; \ - unsigned char *input_row = input_rows[row_table[i]]; \ - int bit_counter = 7; \ - for(j = 0; j < out_w; j++) \ - { - - #define TRANSFER_FRAME_TAIL \ - } \ - } - - #define TRANSFER_YUV420P_OUT_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *input_row = input_rows[row_table[i]]; \ - unsigned char *output_y = out_y_plane + row_table[i] * total_out_w + out_x; \ - unsigned char *output_u = out_u_plane + i / 2 * total_out_w / 2 + out_x / 2; \ - unsigned char *output_v = out_v_plane + i / 2 * total_out_w / 2 + out_x / 2; \ - for(j = 0; j < out_w; j++) \ - { - - #define TRANSFER_YUV422P_OUT_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *input_row = input_rows[row_table[i]]; \ - unsigned char *output_y = out_y_plane + row_table[i] * total_out_w + out_x; \ - unsigned char *output_u = out_u_plane + i * total_out_w / 2 + out_x / 2; \ - unsigned char *output_v = out_v_plane + i * total_out_w / 2 + out_x / 2; \ - for(j = 0; j < out_w; j++) \ - { - - #define TRANSFER_YUV420P_IN_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *output_row = output_rows[i + out_y] + out_x * out_pixelsize; \ - unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ - unsigned char *input_u = in_u_plane + (row_table[i] / 2) * (total_in_w / 2); \ - unsigned char *input_v = in_v_plane + (row_table[i] / 2) * (total_in_w / 2); \ - for(j = 0; j < out_w; j++) \ - { - - - #define TRANSFER_YUV422P_IN_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *output_row = output_rows[i + out_y] + out_x * out_pixelsize; \ - unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ - unsigned char *input_u = in_u_plane + row_table[i] * (total_in_w / 2); \ - unsigned char *input_v = in_v_plane + row_table[i] * (total_in_w / 2); \ - for(j = 0; j < out_w; j++) \ - { - - - #define TRANSFER_YUV422_IN_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *output_row = output_rows[i + out_y] + ((out_x * out_pixelsize) & 0xfffffffc); \ - unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ - unsigned char *input_u = in_u_plane + row_table[i] * (total_in_w / 2); \ - unsigned char *input_v = in_v_plane + row_table[i] * (total_in_w / 2); \ - for(j = 0; j < out_w; j++) \ - { - - - - - - - - #define TRANSFER_FRAME_PERMUTATION2(output, \ - input, \ - y_in_offset, \ - u_in_offset, \ - v_in_offset, \ - input_column) \ - { \ - register int i, j; \ - switch(in_colormodel) \ - { \ - case BC_YUV420P: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_RGB8((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_RGB565((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_RGB888: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_RGB888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_BGR888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_BGR8888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV888: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV422P_to_YUV888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_YUV422P: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_RGB8((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_RGB565((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_RGB888: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_RGB888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_BGR888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_BGR8888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV888: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV422P_to_YUV888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV422: \ - TRANSFER_YUV422_IN_HEAD \ - transfer_YUV422P_to_YUV422((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset), \ - j); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_YUV422: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_RGB8((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_RGB565((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_RGB888: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_RGB888((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV888: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_YUV888((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_BGR888((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_BGR8888((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV422P: \ - TRANSFER_YUV422P_OUT_HEAD \ - transfer_YUV422_to_YUV422P(output_y, \ - output_u, \ - output_v, \ - (input), \ - j); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV420P: \ - TRANSFER_YUV420P_OUT_HEAD \ - transfer_YUV422_to_YUV420P(output_y, \ - output_u, \ - output_v, \ - (input), \ - j, \ - i); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_RGBA16161616: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA16161616_to_RGB8((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA16161616_to_RGB565((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA16161616_to_BGR888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA16161616_to_BGR8888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_RGBA8888: \ - switch(out_colormodel) \ - { \ - case BC_TRANSPARENCY: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_TRANSPARENCY((output), (input), &bit_counter); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_RGB8: \ - if(bg_color > 0) \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_RGB8bg((output), (input), bg_r, bg_g, bg_b); \ - TRANSFER_FRAME_TAIL \ - else \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_RGB8((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - if(bg_color > 0) \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_RGB565bg((output), (input), bg_r, bg_g, bg_b); \ - TRANSFER_FRAME_TAIL \ - else \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_RGB565((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - if(bg_color > 0) \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_BGR888bg((output), (input), bg_r, bg_g, bg_b); \ - TRANSFER_FRAME_TAIL \ - else \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_BGR888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - if(bg_color > 0) \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_BGR8888bg((output), (input), bg_r, bg_g, bg_b); \ - TRANSFER_FRAME_TAIL \ - else \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_BGR8888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_RGB888: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_FRAME_HEAD \ - transfer_RGB888_to_RGB8((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_FRAME_HEAD \ - transfer_RGB888_to_RGB565((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_FRAME_HEAD \ - transfer_RGB888_to_BGR888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_FRAME_HEAD \ - transfer_RGB888_to_BGR8888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV420P: \ - TRANSFER_YUV420P_OUT_HEAD \ - transfer_RGB888_to_YUV420P_YUV422P(output_y, \ - output_u, \ - output_v, \ - (input), \ - j); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV422P: \ - TRANSFER_YUV422P_OUT_HEAD \ - transfer_RGB888_to_YUV420P_YUV422P(output_y, \ - output_u, \ - output_v, \ - (input), \ - j); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_BGR8888: \ - switch(out_colormodel) \ - { \ - case BC_RGB888: \ - TRANSFER_FRAME_HEAD \ - transfer_BGR8888_to_RGB888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_BGR888: \ - switch(out_colormodel) \ - { \ - case BC_RGB888: \ - TRANSFER_FRAME_HEAD \ - transfer_BGR888_to_RGB888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - } \ - } - static void get_scale_tables(int **column_table, int **row_table, --- 155,199 ---- } ! int cmodel_calculate_max(int colormodel) { ! switch(colormodel) { ! // Working bitmaps are packed to simplify processing ! case BC_A8: return 0xff; break; ! case BC_A16: return 0xffff; break; ! case BC_RGB888: return 0xff; break; ! case BC_RGBA8888: return 0xff; break; ! case BC_RGB161616: return 0xffff; break; ! case BC_RGBA16161616: return 0xffff; break; ! case BC_YUV888: return 0xff; break; ! case BC_YUVA8888: return 0xff; break; ! case BC_YUV161616: return 0xffff; break; ! case BC_YUVA16161616: return 0xffff; break; } ! return 0; } ! int cmodel_calculate_datasize(int w, int h, int bytes_per_line, int color_model) { ! if(bytes_per_line < 0) bytes_per_line = w * cmodel_calculate_pixelsize(color_model); ! switch(color_model) { ! case BC_YUV420P: ! case BC_YUV411P: ! return w * h + w * h / 2 + 4; ! break; ! case BC_YUV422P: ! return w * h * 2 + 4; ! break; ! default: ! return h * bytes_per_line + 4; ! break; } + return 0; } static void get_scale_tables(int **column_table, int **row_table, *************** *** 1185,1194 **** int out_colormodel, int bg_color, ! int total_in_w, ! int total_out_w) { int *column_table; int *row_table; ! int scale_x, scale; int bg_r, bg_g, bg_b; int in_pixelsize = cmodel_calculate_pixelsize(in_colormodel); --- 249,258 ---- int out_colormodel, int bg_color, ! int in_rowspan, ! int out_rowspan) { int *column_table; int *row_table; ! int scale; int bg_r, bg_g, bg_b; int in_pixelsize = cmodel_calculate_pixelsize(in_colormodel); *************** *** 1207,1281 **** // Get scaling ! scale = scale_x = (out_w != in_w); get_scale_tables(&column_table, &row_table, in_x, in_y, in_x + in_w, in_y + in_h, out_x, out_y, out_x + out_w, out_y + out_h); ! //printf("cmodel_transfer %d %d\n", in_colormodel, out_colormodel); switch(in_colormodel) { case BC_YUV420P: case BC_YUV422P: ! if(scale) ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + column_table[j] * in_pixelsize, ! column_table[j], ! column_table[j] / 2, ! column_table[j] / 2, ! 0); ! } ! else ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + j * in_pixelsize, ! j, ! j / 2, ! j / 2, ! 0); ! } break; case BC_YUV422: ! if(scale) ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + ((column_table[j] * in_pixelsize) & 0xfffffffc), ! 0, ! 0, ! 0, ! column_table[j]); ! } ! else ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + ((j * in_pixelsize) & 0xfffffffc), ! 0, ! 0, ! 0, ! j); ! } break; default: ! if(scale) ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + column_table[j] * in_pixelsize, ! 0, ! 0, ! 0, ! 0); ! } ! else ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + j * in_pixelsize, ! 0, ! 0, ! 0, ! 0); ! } break; } --- 271,380 ---- // Get scaling ! scale = (out_w != in_w) || (in_x != 0); get_scale_tables(&column_table, &row_table, in_x, in_y, in_x + in_w, in_y + in_h, out_x, out_y, out_x + out_w, out_y + out_h); ! //printf("cmodel_transfer %d %d %d %d %d %d\n", ! // in_colormodel, out_colormodel, out_x, out_y, out_w, out_h); + // Handle planar cmodels separately switch(in_colormodel) { case BC_YUV420P: case BC_YUV422P: ! cmodel_yuv420p(output_rows, \ ! input_rows, \ ! out_y_plane, \ ! out_u_plane, \ ! out_v_plane, \ ! in_y_plane, \ ! in_u_plane, \ ! in_v_plane, \ ! in_x, \ ! in_y, \ ! in_w, \ ! in_h, \ ! out_x, \ ! out_y, \ ! out_w, \ ! out_h, \ ! in_colormodel, \ ! out_colormodel, \ ! bg_color, \ ! in_rowspan, \ ! out_rowspan, \ ! scale, \ ! out_pixelsize, \ ! in_pixelsize, \ ! row_table, \ ! column_table, \ ! bg_r, \ ! bg_g, \ ! bg_b); break; case BC_YUV422: ! cmodel_yuv422(output_rows, \ ! input_rows, \ ! out_y_plane, \ ! out_u_plane, \ ! out_v_plane, \ ! in_y_plane, \ ! in_u_plane, \ ! in_v_plane, \ ! in_x, \ ! in_y, \ ! in_w, \ ! in_h, \ ! out_x, \ ! out_y, \ ! out_w, \ ! out_h, \ ! in_colormodel, \ ! out_colormodel, \ ! bg_color, \ ! in_rowspan, \ ! out_rowspan, \ ! scale, \ ! out_pixelsize, \ ! in_pixelsize, \ ! row_table, \ ! column_table, \ ! bg_r, \ ! bg_g, \ ! bg_b); break; default: ! cmodel_default(output_rows, \ ! input_rows, \ ! out_y_plane, \ ! out_u_plane, \ ! out_v_plane, \ ! in_y_plane, \ ! in_u_plane, \ ! in_v_plane, \ ! in_x, \ ! in_y, \ ! in_w, \ ! in_h, \ ! out_x, \ ! out_y, \ ! out_w, \ ! out_h, \ ! in_colormodel, \ ! out_colormodel, \ ! bg_color, \ ! in_rowspan, \ ! out_rowspan, \ ! scale, \ ! out_pixelsize, \ ! in_pixelsize, \ ! row_table, \ ! column_table, \ ! bg_r, \ ! bg_g, \ ! bg_b); break; } *************** *** 1328,1329 **** --- 427,453 ---- } + int cmodel_is_yuv(int colormodel) + { + switch(colormodel) + { + case BC_YUV888: + case BC_YUVA8888: + case BC_YUV161616: + case BC_YUVA16161616: + case BC_YUV422: + case BC_YUV420P: + case BC_YUV422P: + case BC_YUV411P: + return 1; + break; + + default: + return 0; + break; + } + } + + + + + diff -C2 -r -N bcast-2000c/guicast/colormodels.h bcast-2000c-mf3/guicast/colormodels.h *** bcast-2000c/guicast/colormodels.h Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/guicast/colormodels.h Fri Nov 30 14:29:04 2001 *************** *** 1,2 **** --- 1,20 ---- + /* + * This library 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 of the License, or + * (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + + #ifndef COLORMODELS_H #define COLORMODELS_H *************** *** 13,16 **** --- 31,36 ---- #define BC_RGB888 9 #define BC_RGBA8888 10 + #define BC_ARGB8888 20 + #define BC_ABGR8888 21 #define BC_RGB161616 11 #define BC_RGBA16161616 12 *************** *** 19,28 **** #define BC_YUV161616 15 #define BC_YUVA16161616 16 // Planar #define BC_YUV420P 7 #define BC_YUV422P 17 - #define BC_YUV422 19 #define BC_YUV411P 18 // For communication with the X Server #define FOURCC_YV12 0x32315659 /* YV12 YUV420P */ --- 39,55 ---- #define BC_YUV161616 15 #define BC_YUVA16161616 16 + #define BC_YUV422 19 + #define BC_A8 22 + #define BC_A16 23 + #define BC_YUV101010 24 + #define BC_VYU888 25 + #define BC_UYVA8888 26 // Planar #define BC_YUV420P 7 #define BC_YUV422P 17 #define BC_YUV411P 18 + // Colormodels purely used by Quicktime are done in Quicktime. + // For communication with the X Server #define FOURCC_YV12 0x32315659 /* YV12 YUV420P */ *************** *** 39,66 **** typedef struct { ! long rtoy_tab[256], gtoy_tab[256], btoy_tab[256]; ! long rtou_tab[256], gtou_tab[256], btou_tab[256]; ! long rtov_tab[256], gtov_tab[256], btov_tab[256]; ! ! long vtor_tab[256], vtog_tab[256]; ! long utog_tab[256], utob_tab[256]; ! long *vtor, *vtog, *utog, *utob; } cmodel_yuv_t; int cmodel_calculate_pixelsize(int colormodel); ! void cmodel_transfer(unsigned char **output_rows, unsigned char **input_rows, ! unsigned char *out_y_plane, unsigned char *out_u_plane, unsigned char *out_v_plane, ! unsigned char *in_y_plane, unsigned char *in_u_plane, unsigned char *in_v_plane, ! int in_x, int in_y, int in_w, int in_h, ! int out_x, int out_y, int out_w, --- 66,107 ---- typedef struct { ! int rtoy_tab[0x100], gtoy_tab[0x100], btoy_tab[0x100]; ! int rtou_tab[0x100], gtou_tab[0x100], btou_tab[0x100]; ! int rtov_tab[0x100], gtov_tab[0x100], btov_tab[0x100]; ! ! int vtor_tab[0x100], vtog_tab[0x100]; ! int utog_tab[0x100], utob_tab[0x100]; ! int *vtor, *vtog, *utog, *utob; ! ! int rtoy_tab16[0x10000], gtoy_tab16[0x10000], btoy_tab16[0x10000]; ! int rtou_tab16[0x10000], gtou_tab16[0x10000], btou_tab16[0x10000]; ! int rtov_tab16[0x10000], gtov_tab16[0x10000], btov_tab16[0x10000]; ! ! int vtor_tab16[0x10000], vtog_tab16[0x10000]; ! int utog_tab16[0x10000], utob_tab16[0x10000]; ! int *vtor16, *vtog16, *utog16, *utob16; } cmodel_yuv_t; + extern cmodel_yuv_t *yuv_table; + int cmodel_calculate_pixelsize(int colormodel); + int cmodel_calculate_datasize(int w, int h, int bytes_per_line, int color_model); + int cmodel_calculate_max(int colormodel); + int cmodel_components(int colormodel); + int cmodel_is_yuv(int colormodel); ! void cmodel_transfer(unsigned char **output_rows, /* Leave NULL if non existent */ unsigned char **input_rows, ! unsigned char *out_y_plane, /* Leave NULL if non existent */ unsigned char *out_u_plane, unsigned char *out_v_plane, ! unsigned char *in_y_plane, /* Leave NULL if non existent */ unsigned char *in_u_plane, unsigned char *in_v_plane, ! int in_x, /* Dimensions to capture from input frame */ int in_y, int in_w, int in_h, ! int out_x, /* Dimensions to project on output frame */ int out_y, int out_w, *************** *** 68,74 **** int in_colormodel, int out_colormodel, ! int bg_color, ! int total_in_w, ! int total_out_w); void cmodel_init_yuv(cmodel_yuv_t *yuv_table); --- 109,115 ---- int in_colormodel, int out_colormodel, ! int bg_color, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ ! int in_rowspan, /* For planar use the luma rowspan */ ! int out_rowspan); /* For planar use the luma rowspan */ void cmodel_init_yuv(cmodel_yuv_t *yuv_table); diff -C2 -r -N bcast-2000c/guicast/vframe.h bcast-2000c-mf3/guicast/vframe.h *** bcast-2000c/guicast/vframe.h Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/guicast/vframe.h Sun Jun 9 09:51:55 2002 *************** *** 33,37 **** ~VFrame(); ! friend PngReadFunction; // Reallocate a frame without deleting the class --- 33,37 ---- ~VFrame(); ! friend class PngReadFunction; // Reallocate a frame without deleting the class diff -C2 -r -N bcast-2000c/libmpeg3/global_config bcast-2000c-mf3/libmpeg3/global_config *** bcast-2000c/libmpeg3/global_config Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/libmpeg3/global_config Mon Dec 31 12:10:24 2001 *************** *** 1,3 **** --- 1,4 ---- # DO NOT EDIT. EDIT ./configure INSTEAD AND RERUN IT. + CFLAGS = -O2 -D_FILE_OFFSET_BITS=64 -funroll-loops -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -march=i486 -I/usr/local/include CC = gcc NASM = nasm diff -C2 -r -N bcast-2000c/plugin_config bcast-2000c-mf3/plugin_config *** bcast-2000c/plugin_config Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/plugin_config Mon Dec 31 12:10:24 2001 *************** *** 0 **** --- 1,23 ---- + CFLAGS += -I../ -I../../pluginpack -I../../bcbase -I/usr/local/include + + export CFLAGS + + PLUGINAUDIOOBJS = -L../../bcbase -lbcbase ../../pluginpack/pluginclient.o ../../pluginpack/pluginaclient.o ../../pluginpack/sharedpluginobjs.a $(XLIBS) + + PLUGINVIDEOOBJS = -L../../bcbase -lbcbase ../../pluginpack/pluginclient.o ../../pluginpack/pluginvclient.o ../../pluginpack/sharedpluginobjs.a $(XLIBS) + + PLUGINIOOBJS = -L../../bcbase -lbcbase ../../pluginpack/pluginclient.o ../../pluginpack/pluginioclient.o ../../pluginpack/sharedpluginobjs.a $(XLIBS) + + install: + cp $(OUTPUT) $(PREFIX)/bin + + .C.o: + $(CC) -c `../c_flags` $*.C + + clean: + rm -f core + rm -f *.o *.a + rm -f $(OUTPUT) + + wc: + cat *.C *.h | wc diff -C2 -r -N bcast-2000c/plugin_config2 bcast-2000c-mf3/plugin_config2 *** bcast-2000c/plugin_config2 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/plugin_config2 Mon Dec 31 12:10:24 2001 *************** *** 0 **** --- 1,25 ---- + # DO NOT EDIT. EDIT ./configure INSTEAD AND RERUN IT. + + CFLAGS += -I../ -I../../pluginpack -I../../guicast -I/usr/local/include + + export CFLAGS + + PLUGINAUDIOOBJS = -L../../guicast -lguicast ../../quicktime/libquicktime.a ../../pluginpack/pluginclient.o ../../pluginpack/pluginaclient.o ../../pluginpack/sharedpluginobjs.a $(XLIBS) -lpng + + PLUGINVIDEOOBJS = ../../pluginpack/pluginclient.o ../../quicktime/libquicktime.a ../../pluginpack/pluginvclient.o ../../pluginpack/sharedpluginobjs.a $(XLIBS) + + PLUGINIOOBJS = ../../pluginpack/pluginclient.o ../../quicktime/libquicktime.a ../../pluginpack/pluginioclient.o ../../pluginpack/sharedpluginobjs.a $(XLIBS) + + install: + cp $(OUTPUT) $(PREFIX)/bin + + .C.o: + $(CC) -c `../c_flags` $*.C + + clean: + rm -f core + rm -f *.o *.a + rm -f $(OUTPUT) + + wc: + cat *.C *.h | wc diff -C2 -r -N bcast-2000c/pluginpack/filehtal.C bcast-2000c-mf3/pluginpack/filehtal.C *** bcast-2000c/pluginpack/filehtal.C Mon Jan 22 21:55:46 2001 --- bcast-2000c-mf3/pluginpack/filehtal.C Mon Dec 31 11:12:32 2001 *************** *** 1,2 **** --- 1,4 ---- + // changed 2001-12-30 by Moritz Franosch + #include #include *************** *** 364,368 **** } tag_title[i] = 0; ! if(position >= length) return 1; --- 366,370 ---- } tag_title[i] = 0; ! if(position >= length) return 1; *************** *** 388,391 **** --- 390,401 ---- position++; + // find the terminating char + if(position < length && input[position] == '\"') + { + terminating_char = '\"'; // use quotes to terminate + if(position < length) position++; // don't store the quote itself + } + else terminating_char = ' '; // use space to terminate + // read the property description for(j = 0; *************** *** 393,397 **** position < length && input[position] != right_delimiter && ! input[position] != ' ' && input[position] != '='; j++, position++) --- 403,407 ---- position < length && input[position] != right_delimiter && ! input[position] != terminating_char && input[position] != '='; j++, position++) *************** *** 401,405 **** string[j] = 0; - // store the description in a property array tag_properties[total_properties] = new char[strlen(string) + 1]; --- 411,414 ---- diff -C2 -r -N bcast-2000c/plugins/mpeg/libmpeg3/global_config bcast-2000c-mf3/plugins/mpeg/libmpeg3/global_config *** bcast-2000c/plugins/mpeg/libmpeg3/global_config Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/plugins/mpeg/libmpeg3/global_config Mon Dec 31 12:10:24 2001 *************** *** 1,3 **** --- 1,4 ---- # DO NOT EDIT. EDIT ./configure INSTEAD AND RERUN IT. + CFLAGS = -O2 -D_FILE_OFFSET_BITS=64 -funroll-loops -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -march=i486 -I/usr/local/include CC = gcc NASM = nasm diff -C2 -r -N bcast-2000c/plugins/rotate/rotate.h bcast-2000c-mf3/plugins/rotate/rotate.h *** bcast-2000c/plugins/rotate/rotate.h Mon Jan 22 21:55:47 2001 --- bcast-2000c-mf3/plugins/rotate/rotate.h Sun Jun 9 09:58:12 2002 *************** *** 46,50 **** ~RotateMain(); ! friend RotateEngine; // required for all realtime plugins --- 46,50 ---- ~RotateMain(); ! friend class RotateEngine; // required for all realtime plugins diff -C2 -r -N bcast-2000c/quicktime/.#Makefile.1.13 bcast-2000c-mf3/quicktime/.#Makefile.1.13 *** bcast-2000c/quicktime/.#Makefile.1.13 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/.#Makefile.1.13 Mon Dec 3 18:37:32 2001 *************** *** 0 **** --- 1,674 ---- + OBJDIR := $(shell uname --machine) + USE_MMX = 0 + CC = gcc + HAVE_CFLAGS := $(shell if [ -n "$CFLAGS" ]; then echo y; fi ) + ENCORE_DIR := encore2/src + #DECORE_DIR := decore2/src + #ENCORE_DIR := encore50 + DECORE_DIR := decore50 + ENCORE_INCLUDE := $(ENCORE_DIR)/encore2.h + DECORE_INCLUDE := $(DECORE_DIR)/decore.h + OGG_DIR := $(shell expr libogg* ) + VORBIS_DIR := $(shell expr libvorbis* ) + + + + + DIRS = $(OBJDIR) \ + $(OBJDIR)/jpeg \ + $(OBJDIR)/libraw1394/src \ + $(OBJDIR)/libdv + + + DIRS += \ + $(OBJDIR)/$(DECORE_DIR) + + DIRS += \ + $(OBJDIR)/$(ENCORE_DIR) \ + $(OBJDIR)/$(ENCORE_DIR)/att_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/mbprediction \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx + + DIRS += \ + $(OBJDIR)/$(OGG_DIR)/src \ + $(OBJDIR)/$(VORBIS_DIR)/lib + + + + + + + + ifeq ($(OBJDIR), i686) + USE_MMX = 1 + endif + + + + + + + + ifeq ($(OBJDIR), alpha) + ifneq ($(HAVE_CFLAGS), y) + CFLAGS = -O4 -arch ev67 -ieee -accept c99_keywords -gcc_messages + endif + endif + + + + + + + + + #CFLAGS += -g + CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + CFLAGS += -DHAVE_FIREWIRE + CFLAGS += -I. -Ijpeg -Ilibdv -Ilibraw1394 $(shell glib-config --cflags) + + ifeq ($(USE_MMX), 1) + + + + + CFLAGS += -DARCH_X86 + + DVMMXOBJ = libdv/asmoff.h + + DVMMXOBJS = \ + $(OBJDIR)/libdv/dct_block_mmx.o \ + $(OBJDIR)/libdv/encode_x86.o \ + $(OBJDIR)/libdv/idct_block_mmx.o \ + $(OBJDIR)/libdv/vlc_x86.o \ + $(OBJDIR)/libdv/quant_x86.o \ + $(OBJDIR)/libdv/transpose_x86.o + + + + + endif + + + + + + + + + OBJS = \ + $(OBJDIR)/atom.o \ + $(OBJDIR)/cmodel_default.o \ + $(OBJDIR)/cmodel_yuv420p.o \ + $(OBJDIR)/cmodel_yuv422.o \ + $(OBJDIR)/codecs.o \ + $(OBJDIR)/colormodels.o \ + $(OBJDIR)/ctab.o \ + $(OBJDIR)/dinf.o \ + $(OBJDIR)/divx.o \ + $(OBJDIR)/dref.o \ + $(OBJDIR)/dv.o \ + $(OBJDIR)/edts.o \ + $(OBJDIR)/elst.o \ + $(OBJDIR)/graphics.o \ + $(OBJDIR)/hdlr.o \ + $(OBJDIR)/ima4.o \ + $(OBJDIR)/jpeg.o \ + $(OBJDIR)/jpeg_old.o \ + $(OBJDIR)/libdv.o \ + $(OBJDIR)/libmjpeg.o \ + $(OBJDIR)/matrix.o \ + $(OBJDIR)/mdat.o \ + $(OBJDIR)/mdhd.o \ + $(OBJDIR)/mdia.o \ + $(OBJDIR)/minf.o \ + $(OBJDIR)/moov.o \ + $(OBJDIR)/mvhd.o \ + $(OBJDIR)/plugin.o \ + $(OBJDIR)/qtpng.o \ + $(OBJDIR)/quicktime.o \ + $(OBJDIR)/raw.o \ + $(OBJDIR)/rawaudio.o \ + $(OBJDIR)/smhd.o \ + $(OBJDIR)/stbl.o \ + $(OBJDIR)/stco.o \ + $(OBJDIR)/stsc.o \ + $(OBJDIR)/stsd.o \ + $(OBJDIR)/stsdtable.o \ + $(OBJDIR)/stss.o \ + $(OBJDIR)/stsz.o \ + $(OBJDIR)/stts.o \ + $(OBJDIR)/tkhd.o \ + $(OBJDIR)/trak.o \ + $(OBJDIR)/twos.o \ + $(OBJDIR)/udta.o \ + $(OBJDIR)/ulaw.o \ + $(OBJDIR)/util.o \ + $(OBJDIR)/v308.o \ + $(OBJDIR)/v408.o \ + $(OBJDIR)/v410.o \ + $(OBJDIR)/vmhd.o \ + $(OBJDIR)/vorbis.o \ + $(OBJDIR)/workarounds.o \ + $(OBJDIR)/yuv2.o \ + $(OBJDIR)/yuv4.o \ + $(OBJDIR)/yv12.o \ + $(OBJDIR)/jpeg/jcapimin.o \ + $(OBJDIR)/jpeg/jcapistd.o \ + $(OBJDIR)/jpeg/jctrans.o \ + $(OBJDIR)/jpeg/jcparam.o \ + $(OBJDIR)/jpeg/jdatadst.o \ + $(OBJDIR)/jpeg/jcinit.o \ + $(OBJDIR)/jpeg/jcmaster.o \ + $(OBJDIR)/jpeg/jcmarker.o \ + $(OBJDIR)/jpeg/jcmainct.o \ + $(OBJDIR)/jpeg/jcprepct.o \ + $(OBJDIR)/jpeg/jccoefct.o \ + $(OBJDIR)/jpeg/jccolor.o \ + $(OBJDIR)/jpeg/jcsample.o \ + $(OBJDIR)/jpeg/jchuff.o \ + $(OBJDIR)/jpeg/jcphuff.o \ + $(OBJDIR)/jpeg/jcdctmgr.o \ + $(OBJDIR)/jpeg/jfdctfst.o \ + $(OBJDIR)/jpeg/jfdctflt.o \ + $(OBJDIR)/jpeg/jfdctint.o \ + $(OBJDIR)/jpeg/jdapimin.o \ + $(OBJDIR)/jpeg/jdapistd.o \ + $(OBJDIR)/jpeg/jdtrans.o \ + $(OBJDIR)/jpeg/jdatasrc.o \ + $(OBJDIR)/jpeg/jdmaster.o \ + $(OBJDIR)/jpeg/jdinput.o \ + $(OBJDIR)/jpeg/jdmarker.o \ + $(OBJDIR)/jpeg/jdhuff.o \ + $(OBJDIR)/jpeg/jdphuff.o \ + $(OBJDIR)/jpeg/jdmainct.o \ + $(OBJDIR)/jpeg/jdcoefct.o \ + $(OBJDIR)/jpeg/jdpostct.o \ + $(OBJDIR)/jpeg/jddctmgr.o \ + $(OBJDIR)/jpeg/jidctfst.o \ + $(OBJDIR)/jpeg/jidctflt.o \ + $(OBJDIR)/jpeg/jidctint.o \ + $(OBJDIR)/jpeg/jidctred.o \ + $(OBJDIR)/jpeg/jdsample.o \ + $(OBJDIR)/jpeg/jdcolor.o \ + $(OBJDIR)/jpeg/jquant1.o \ + $(OBJDIR)/jpeg/jquant2.o \ + $(OBJDIR)/jpeg/jdmerge.o \ + $(OBJDIR)/jpeg/jcomapi.o \ + $(OBJDIR)/jpeg/jutils.o \ + $(OBJDIR)/jpeg/jerror.o \ + $(OBJDIR)/jpeg/jmemmgr.o \ + $(OBJDIR)/jpeg/jmemnobs.o \ + $(OBJDIR)/libdv/YUY2.o \ + $(OBJDIR)/libdv/YV12.o \ + $(OBJDIR)/libdv/audio.o \ + $(OBJDIR)/libdv/bitstream.o \ + $(OBJDIR)/libdv/dct.o \ + $(OBJDIR)/libdv/dv.o \ + $(OBJDIR)/libdv/encode.o \ + $(OBJDIR)/libdv/idct_248.o \ + $(OBJDIR)/libdv/parse.o \ + $(OBJDIR)/libdv/place.o \ + $(OBJDIR)/libdv/quant.o \ + $(OBJDIR)/libdv/rgb.o \ + $(OBJDIR)/libdv/util.o \ + $(OBJDIR)/libdv/vlc.o \ + $(OBJDIR)/libdv/weighting.o \ + $(OBJDIR)/libraw1394/src/eventloop.o \ + $(OBJDIR)/libraw1394/src/fcp.o \ + $(OBJDIR)/libraw1394/src/iso.o \ + $(OBJDIR)/libraw1394/src/main.o \ + $(OBJDIR)/libraw1394/src/readwrite.o + + + # OBJS += \ + # $(OBJDIR)/$(DECORE_DIR)/bitstream.o \ + # $(OBJDIR)/$(DECORE_DIR)/colorspace.o \ + # $(OBJDIR)/$(DECORE_DIR)/decoder.o \ + # $(OBJDIR)/$(DECORE_DIR)/decore2.o \ + # $(OBJDIR)/$(DECORE_DIR)/idct.o \ + # $(OBJDIR)/$(DECORE_DIR)/image.o \ + # $(OBJDIR)/$(DECORE_DIR)/mbcoding.o \ + # $(OBJDIR)/$(DECORE_DIR)/mbprediction.o \ + # $(OBJDIR)/$(DECORE_DIR)/quantize.o \ + # $(OBJDIR)/$(DECORE_DIR)/transfer.o + + OBJS += \ + $(OBJDIR)/$(DECORE_DIR)/debug.o \ + $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o \ + $(OBJDIR)/$(DECORE_DIR)/clearblock.o \ + $(OBJDIR)/$(DECORE_DIR)/decore.o \ + $(OBJDIR)/$(DECORE_DIR)/getbits.o \ + $(OBJDIR)/$(DECORE_DIR)/idct.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_block.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_header.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o \ + $(OBJDIR)/$(DECORE_DIR)/postprocess.o \ + $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o \ + $(OBJDIR)/$(DECORE_DIR)/transferidct.o + + OBJS += \ + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o \ + $(OBJDIR)/$(ENCORE_DIR)/encoder.o \ + $(OBJDIR)/$(ENCORE_DIR)/encore.o \ + $(OBJDIR)/$(ENCORE_DIR)/image.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/halfpel.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mad.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/sad.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o \ + $(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o \ + $(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o \ + $(OBJDIR)/$(ENCORE_DIR)/timer.o + + + + + + ifeq ($(USE_MMX), 1) + + + #CFLAGS += -D_MMX_ + ENCOREMMX_OBJS= \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.o + + + + endif + + + + + OBJS += \ + $(OBJDIR)/$(OGG_DIR)/src/bitwise.o \ + $(OBJDIR)/$(OGG_DIR)/src/framing.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/analysis.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/bitbuffer.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/block.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/codebook.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/envelope.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/floor0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/info.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/lookup.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/lpc.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/lsp.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/mapping0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/mdct.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/psy.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/registry.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/res0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/sharedbook.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/smallft.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/synthesis.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/time0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisenc.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisfile.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/window.o + + + + + + + + + + + OUTPUT = $(OBJDIR)/libquicktime.a + SHAREDOUTPUT = $(OBJDIR)/libquicktime.so + CFLAGS += -Ilibraw1394/src + + CFLAGS += \ + -I$(DECORE_DIR) \ + -I$(ENCORE_DIR) \ + -DDECORE_INCLUDE=\"$(DECORE_INCLUDE)\" \ + -DENCORE_INCLUDE=\"$(ENCORE_INCLUDE)\" \ + -DLINUX \ + -D_DECORE + + CFLAGS += \ + -I$(OGG_DIR)/include \ + -I$(VORBIS_DIR)/include \ + -I$(VORBIS_DIR)/lib/ \ + -DUSE_MEMORY_H \ + -D_REENTRANT \ + -DHAVE_ALLOCA=1 \ + -DHAVE_ALLOCA_H=1 + + $(shell if ! test -d $(OBJDIR) \; then mkdir -p $(OBJDIR) \; fi ) + $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags) + $(shell echo $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) > $(OBJDIR)/objs) + + all: $(DIRS) $(OUTPUT) $(SHAREDOUTPUT) + + $(DIRS): + if ! test -d $@ ; then mkdir -p $@ ; fi + + $(OUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) + ar rcs $(OUTPUT) `cat $(OBJDIR)/objs` + + $(SHAREDOUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) + gcc -shared -o $(SHAREDOUTPUT) `cat $(OBJDIR)/objs` + + $(OBJDIR)/qtdump: $(OBJDIR)/dump.o $(OUTPUT) + $(CC) -o $(OBJDIR)/qtdump $(OBJDIR)/dump.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/make_streamable: $(OBJDIR)/make_streamable.o $(OUTPUT) + $(CC) -o $(OBJDIR)/make_streamable $(OBJDIR)/make_streamable.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/dechunk: $(OBJDIR)/dechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/dechunk $(OBJDIR)/dechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/rechunk: $(OBJDIR)/rechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/rechunk $(OBJDIR)/rechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/recover: $(OBJDIR)/recover.o $(OUTPUT) + $(CC) -o $(OBJDIR)/recover $(OBJDIR)/recover.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/yuv4toyuv: $(OBJDIR)/yuv4toyuv.o $(OUTPUT) + $(CC) -o $(OBJDIR)/yuv4toyuv $(OBJDIR)/yuv4toyuv.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/qtinfo: $(OBJDIR)/qtinfo.o + $(CC) -o $(OBJDIR)/qtinfo $(OBJDIR)/qtinfo.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + util: $(OBJDIR)/qtdump $(OBJDIR)/make_streamable $(OBJDIR)/qtinfo $(OBJDIR)/dechunk $(OBJDIR)/yuv4toyuv $(OBJDIR)/recover $(OBJDIR)/rechunk + + + clean: + rm -rf $(OBJDIR) + rm -rf .deps + + wc: + cat *.c *.h | wc + + backup: clean + cd .. && \ + tar zcvf quicktime.tar.gz quicktime + + install: + cp $(SHAREDOUTPUT) /usr/lib/libquicktime.so.1 + ln -sf /usr/lib/libquicktime.so.1 /usr/lib/libquicktime.so + cp quicktime.h qtprivate.h colormodels.h /usr/include + + $(OBJDIR)/dump.o \ + $(OBJDIR)/make_streamable.o \ + $(OBJDIR)/dechunk.o \ + $(OBJDIR)/recover.o \ + $(OBJDIR)/yuv4toyuv.o \ + $(OBJDIR)/qtinfo.o \ + $(OBJDIR)/rechunk.o \ + $(OBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.c) -o $*.o + + + + $(DVMMXOBJ): + $(CC) `cat $(OBJDIR)/c_flags` libdv/gasmoff.c -o $(OBJDIR)/gasmoff -lm + $(OBJDIR)/gasmoff > libdv/asmoff.h + + $(DVMMXOBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o + + $(ENCOREMMX_OBJS): + nasm -f elf $(subst $(OBJDIR)/,, $*.asm) -o $*.o + + + + + $(OBJDIR)/atom.o: atom.c + $(OBJDIR)/cmodel_default.o: cmodel_default.c + $(OBJDIR)/cmodel_yuv420p.o: cmodel_yuv420p.c + $(OBJDIR)/cmodel_yuv422.o: cmodel_yuv422.c + $(OBJDIR)/codecs.o: codecs.c + $(OBJDIR)/colormodels.o: colormodels.c + $(OBJDIR)/ctab.o: ctab.c + $(OBJDIR)/dechunk.o: dechunk.c + $(OBJDIR)/dinf.o: dinf.c + $(OBJDIR)/divx.o: divx.c + $(OBJDIR)/dref.o: dref.c + $(OBJDIR)/dump.o: dump.c + $(OBJDIR)/dv.o: dv.c + $(OBJDIR)/edts.o: edts.c + $(OBJDIR)/elst.o: elst.c + $(OBJDIR)/graphics.o: graphics.c + $(OBJDIR)/hdlr.o: hdlr.c + $(OBJDIR)/ima4.o: ima4.c + $(OBJDIR)/jpeg.o: jpeg.c + $(OBJDIR)/jpeg_old.o: jpeg_old.c + $(OBJDIR)/libdv.o: libdv.c + $(OBJDIR)/libmjpeg.o: libmjpeg.c + $(OBJDIR)/make_streamable.o: make_streamable.c + $(OBJDIR)/matrix.o: matrix.c + $(OBJDIR)/mdat.o: mdat.c + $(OBJDIR)/mdhd.o: mdhd.c + $(OBJDIR)/mdia.o: mdia.c + $(OBJDIR)/minf.o: minf.c + $(OBJDIR)/moov.o: moov.c + $(OBJDIR)/mvhd.o: mvhd.c + $(OBJDIR)/plugin.o: plugin.c + $(OBJDIR)/qtinfo.o: qtinfo.c + $(OBJDIR)/qtpng.o: qtpng.c + $(OBJDIR)/quicktime.o: quicktime.c + $(OBJDIR)/raw.o: raw.c + $(OBJDIR)/rawaudio.o: rawaudio.c + $(OBJDIR)/rechunk.o: rechunk.c + $(OBJDIR)/recover.o: recover.c + $(OBJDIR)/smhd.o: smhd.c + $(OBJDIR)/stbl.o: stbl.c + $(OBJDIR)/stco.o: stco.c + $(OBJDIR)/stsc.o: stsc.c + $(OBJDIR)/stsd.o: stsd.c + $(OBJDIR)/stsdtable.o: stsdtable.c + $(OBJDIR)/stss.o: stss.c + $(OBJDIR)/stsz.o: stsz.c + $(OBJDIR)/stts.o: stts.c + $(OBJDIR)/tkhd.o: tkhd.c + $(OBJDIR)/trak.o: trak.c + $(OBJDIR)/twos.o: twos.c + $(OBJDIR)/udta.o: udta.c + $(OBJDIR)/ulaw.o: ulaw.c + $(OBJDIR)/util.o: util.c + $(OBJDIR)/v308.o: v308.c + $(OBJDIR)/v408.o: v408.c + $(OBJDIR)/v410.o: v410.c + $(OBJDIR)/vmhd.o: vmhd.c + $(OBJDIR)/vorbis.o: vorbis.c + $(OBJDIR)/workarounds.o: workarounds.c + $(OBJDIR)/yuv2.o: yuv2.c + $(OBJDIR)/yuv4.o: yuv4.c + $(OBJDIR)/yuv4toyuv.o: yuv4toyuv.c + $(OBJDIR)/yv12.o: yv12.c + $(OBJDIR)/jpeg/jcapimin.o: jpeg/jcapimin.c + $(OBJDIR)/jpeg/jcapistd.o: jpeg/jcapistd.c + $(OBJDIR)/jpeg/jctrans.o: jpeg/jctrans.c + $(OBJDIR)/jpeg/jcparam.o: jpeg/jcparam.c + $(OBJDIR)/jpeg/jdatadst.o: jpeg/jdatadst.c + $(OBJDIR)/jpeg/jcinit.o: jpeg/jcinit.c + $(OBJDIR)/jpeg/jcmaster.o: jpeg/jcmaster.c + $(OBJDIR)/jpeg/jcmarker.o: jpeg/jcmarker.c + $(OBJDIR)/jpeg/jcmainct.o: jpeg/jcmainct.c + $(OBJDIR)/jpeg/jcprepct.o: jpeg/jcprepct.c + $(OBJDIR)/jpeg/jccoefct.o: jpeg/jccoefct.c + $(OBJDIR)/jpeg/jccolor.o: jpeg/jccolor.c + $(OBJDIR)/jpeg/jcsample.o: jpeg/jcsample.c + $(OBJDIR)/jpeg/jchuff.o: jpeg/jchuff.c + $(OBJDIR)/jpeg/jcphuff.o: jpeg/jcphuff.c + $(OBJDIR)/jpeg/jcdctmgr.o: jpeg/jcdctmgr.c + $(OBJDIR)/jpeg/jfdctfst.o: jpeg/jfdctfst.c + $(OBJDIR)/jpeg/jfdctflt.o: jpeg/jfdctflt.c + $(OBJDIR)/jpeg/jfdctint.o: jpeg/jfdctint.c + $(OBJDIR)/jpeg/jdapimin.o: jpeg/jdapimin.c + $(OBJDIR)/jpeg/jdapistd.o: jpeg/jdapistd.c + $(OBJDIR)/jpeg/jdtrans.o: jpeg/jdtrans.c + $(OBJDIR)/jpeg/jdatasrc.o: jpeg/jdatasrc.c + $(OBJDIR)/jpeg/jdmaster.o: jpeg/jdmaster.c + $(OBJDIR)/jpeg/jdinput.o: jpeg/jdinput.c + $(OBJDIR)/jpeg/jdmarker.o: jpeg/jdmarker.c + $(OBJDIR)/jpeg/jdhuff.o: jpeg/jdhuff.c + $(OBJDIR)/jpeg/jdphuff.o: jpeg/jdphuff.c + $(OBJDIR)/jpeg/jdmainct.o: jpeg/jdmainct.c + $(OBJDIR)/jpeg/jdcoefct.o: jpeg/jdcoefct.c + $(OBJDIR)/jpeg/jdpostct.o: jpeg/jdpostct.c + $(OBJDIR)/jpeg/jddctmgr.o: jpeg/jddctmgr.c + $(OBJDIR)/jpeg/jidctfst.o: jpeg/jidctfst.c + $(OBJDIR)/jpeg/jidctflt.o: jpeg/jidctflt.c + $(OBJDIR)/jpeg/jidctint.o: jpeg/jidctint.c + $(OBJDIR)/jpeg/jidctred.o: jpeg/jidctred.c + $(OBJDIR)/jpeg/jdsample.o: jpeg/jdsample.c + $(OBJDIR)/jpeg/jdcolor.o: jpeg/jdcolor.c + $(OBJDIR)/jpeg/jquant1.o: jpeg/jquant1.c + $(OBJDIR)/jpeg/jquant2.o: jpeg/jquant2.c + $(OBJDIR)/jpeg/jdmerge.o: jpeg/jdmerge.c + $(OBJDIR)/jpeg/jcomapi.o: jpeg/jcomapi.c + $(OBJDIR)/jpeg/jutils.o: jpeg/jutils.c + $(OBJDIR)/jpeg/jerror.o: jpeg/jerror.c + $(OBJDIR)/jpeg/jmemmgr.o: jpeg/jmemmgr.c + $(OBJDIR)/jpeg/jmemnobs.o: jpeg/jmemnobs.c + $(OBJDIR)/libdv/YUY2.o: libdv/YUY2.c + $(OBJDIR)/libdv/YV12.o: libdv/YV12.c + $(OBJDIR)/libdv/audio.o: libdv/audio.c + $(OBJDIR)/libdv/bitstream.o: libdv/bitstream.c + $(OBJDIR)/libdv/dct.o: libdv/dct.c + $(OBJDIR)/libdv/dv.o: libdv/dv.c + $(OBJDIR)/libdv/encode.o: libdv/encode.c + $(OBJDIR)/libdv/idct_248.o: libdv/idct_248.c + $(OBJDIR)/libdv/parse.o: libdv/parse.c + $(OBJDIR)/libdv/place.o: libdv/place.c + $(OBJDIR)/libdv/quant.o: libdv/quant.c + $(OBJDIR)/libdv/rgb.o: libdv/rgb.c + $(OBJDIR)/libdv/util.o: libdv/util.c + $(OBJDIR)/libdv/vlc.o: libdv/vlc.c + $(OBJDIR)/libdv/weighting.o: libdv/weighting.c + $(OBJDIR)/libraw1394/src/eventloop.o: libraw1394/src/eventloop.c + $(OBJDIR)/libraw1394/src/fcp.o: libraw1394/src/fcp.c + $(OBJDIR)/libraw1394/src/iso.o: libraw1394/src/iso.c + $(OBJDIR)/libraw1394/src/main.o: libraw1394/src/main.c + $(OBJDIR)/libraw1394/src/readwrite.o: libraw1394/src/readwrite.c + + + + + # $(OBJDIR)/$(DECORE_DIR)/bitstream.o: $(DECORE_DIR)/bitstream.c + # $(OBJDIR)/$(DECORE_DIR)/colorspace.o: $(DECORE_DIR)/colorspace.c + # $(OBJDIR)/$(DECORE_DIR)/decoder.o: $(DECORE_DIR)/decoder.c + # $(OBJDIR)/$(DECORE_DIR)/decore2.o: $(DECORE_DIR)/decore2.c + # $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + # $(OBJDIR)/$(DECORE_DIR)/image.o: $(DECORE_DIR)/image.c + # $(OBJDIR)/$(DECORE_DIR)/mbcoding.o: $(DECORE_DIR)/mbcoding.c + # $(OBJDIR)/$(DECORE_DIR)/mbprediction.o: $(DECORE_DIR)/mbprediction.c + # $(OBJDIR)/$(DECORE_DIR)/quantize.o: $(DECORE_DIR)/quantize.c + # $(OBJDIR)/$(DECORE_DIR)/transfer.o: $(DECORE_DIR)/transfer.c + + $(OBJDIR)/$(DECORE_DIR)/debug.o: $(DECORE_DIR)/debug.c + $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o: $(DECORE_DIR)/basic_prediction.c + $(OBJDIR)/$(DECORE_DIR)/clearblock.o: $(DECORE_DIR)/clearblock.c + $(OBJDIR)/$(DECORE_DIR)/decore.o: $(DECORE_DIR)/decore.c + $(OBJDIR)/$(DECORE_DIR)/gen_draw.o: $(DECORE_DIR)/gen_draw.c + $(OBJDIR)/$(DECORE_DIR)/getbits.o: $(DECORE_DIR)/getbits.c + $(OBJDIR)/$(DECORE_DIR)/gen_usetime.o: $(DECORE_DIR)/gen_usetime.c + $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o: $(DECORE_DIR)/mp4_vars.c + $(OBJDIR)/$(DECORE_DIR)/mp4_block.o: $(DECORE_DIR)/mp4_block.c + $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o: $(DECORE_DIR)/mp4_decoder.c + $(OBJDIR)/$(DECORE_DIR)/mp4_header.o: $(DECORE_DIR)/mp4_header.c + $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o: $(DECORE_DIR)/mp4_iquant.c + $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o: $(DECORE_DIR)/mp4_mblock.c + $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o: $(DECORE_DIR)/mp4_picture.c + $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o: $(DECORE_DIR)/mp4_predict.c + $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o: $(DECORE_DIR)/mp4_recon.c + $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o: $(DECORE_DIR)/mp4_tables.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o: $(DECORE_DIR)/mp4_vld.c + $(OBJDIR)/$(DECORE_DIR)/store.o: $(DECORE_DIR)/store.c + $(OBJDIR)/$(DECORE_DIR)/postprocess.o: $(DECORE_DIR)/postprocess.c + $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o: $(DECORE_DIR)/yuv2rgb.c + $(OBJDIR)/$(DECORE_DIR)/transferidct.o: $(DECORE_DIR)/transferidct.c + + + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o: $(ENCORE_DIR)/bitstream.c + $(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o: $(ENCORE_DIR)/colorspace/colorspace.c + $(OBJDIR)/$(ENCORE_DIR)/encoder.o: $(ENCORE_DIR)/encoder.c + $(OBJDIR)/$(ENCORE_DIR)/encore.o: $(ENCORE_DIR)/encore.c + $(OBJDIR)/$(ENCORE_DIR)/image.o: $(ENCORE_DIR)/image.c + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o: $(ENCORE_DIR)/mbcoding/mbcoding.c + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o: $(ENCORE_DIR)/mbcoding/putvlc.c + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o: $(ENCORE_DIR)/mbmotionestcomp/compensate.c + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o: $(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.c + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/sad.o: $(ENCORE_DIR)/mbmotionestcomp/sad.c + $(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o: $(ENCORE_DIR)/mbprediction/mbprediction.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o: $(ENCORE_DIR)/mbtransquant/dct.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o: $(ENCORE_DIR)/mbtransquant/fdct.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o: $(ENCORE_DIR)/mbtransquant/idct.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o: $(ENCORE_DIR)/mbtransquant/mbtransquant.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o: $(ENCORE_DIR)/mbtransquant/quantize.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o: $(ENCORE_DIR)/mbtransquant/transfer.c + $(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o: $(ENCORE_DIR)/ratecontrol.c + $(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o: $(ENCORE_DIR)/rgb2yuv.c + $(OBJDIR)/$(ENCORE_DIR)/timer.o: $(ENCORE_DIR)/timer.c + + + + + + + + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.o: $(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.o: $(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.asm + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.asm + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.asm + + + + + + + + + + + + + + + + + + + diff -C2 -r -N bcast-2000c/quicktime/.#dv.c.1.2 bcast-2000c-mf3/quicktime/.#dv.c.1.2 *** bcast-2000c/quicktime/.#dv.c.1.2 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/.#dv.c.1.2 Thu Dec 6 15:58:26 2001 *************** *** 0 **** --- 1,162 ---- + #include "colormodels.h" + #include "funcprotos.h" + #include "libdv.h" + #include "quicktime.h" + + + typedef struct + { + dv_t *dv; + unsigned char *data; + unsigned char *temp_frame, *temp_rows[3]; + } quicktime_dv_codec_t; + + static int quicktime_delete_codec_dv(quicktime_video_map_t *vtrack) + { + quicktime_dv_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + + if(codec->dv) dv_delete(codec->dv); + if(codec->temp_frame) free(codec->temp_frame); + if(codec->temp_rows) free(codec->temp_rows); + free(codec->data); + free(codec); + return 0; + } + + static int quicktime_decode_dv(quicktime_t *file, unsigned char **row_pointers, int track) + { + long bytes; + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_dv_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + int width = vtrack->track->tkhd.track_width; + int height = vtrack->track->tkhd.track_height; + int result = 0; + + quicktime_set_video_position(file, vtrack->current_position, track); + bytes = quicktime_frame_size(file, vtrack->current_position, track); + result = !quicktime_read_data(file, (char*)codec->data, bytes); + + if(codec->dv) + { + if(file->color_model == BC_YUV422P && + file->in_x == 0 && + file->in_y == 0 && + file->in_w == width && + file->in_h == height && + file->out_w == width && + file->out_h == height) + { + dv_read_video(codec->dv, + row_pointers, + codec->data, + bytes, + BC_YUV422P); + } + else + { + + if(!codec-> + codec->temp_frame = calloc(1, 720 * 576 * 2); + codec->temp_rows[0] = codec->temp_frame; + codec->temp_rows[1] = codec->temp_frame + 720 * 576; + codec->temp_rows[2] = codec->temp_frame + 720 * 576 + 720 * 576 / 2; + //printf("quicktime_decode_dv %d\n", file->color_model); + dv_read_video(codec->dv, + codec->temp_rows, + codec->data, + bytes, + BC_YUV422P); + + cmodel_transfer(row_pointers, + codec->temp_rows, + row_pointers[0], + row_pointers[1], + row_pointers[2], + codec->temp_rows[0], + codec->temp_rows[1], + codec->temp_rows[2], + file->in_x, + file->in_y, + file->in_w, + file->in_h, + 0, + 0, + file->out_w, + file->out_h, + BC_YUV422P, + file->color_model, + 0, + width, + file->out_w); + } + } + + return result; + } + + static int quicktime_encode_dv(quicktime_t *file, unsigned char **row_pointers, int track) + { + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_dv_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + quicktime_trak_t *trak = vtrack->track; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = 720; + int height_i = (height <= 480) ? 480 : 576; + int i; + + if(file->color_model == BC_YUV422 && + width = width_i && + height == height_i) + { + + } + else + { + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 2); + codec->temp_rows = malloc(sizeof(unsigned char*) * height_i); + for(i = 0; i < height_i; i++) + { + codec->temp_rows[i] = codec->temp_frame + width_i * 2; + } + } + } + + + + + return 1; + } + + // Logic: DV contains a mixture of 420 and 411 so can only output 444 or 422 + + static int quicktime_reads_colormodel_dv(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_YUV888 || + colormodel == BC_YUV422 || + colormodel == BC_YUV422P); + } + + void quicktime_init_codec_dv(quicktime_video_map_t *vtrack) + { + quicktime_dv_codec_t *codec; + int i; + + /* Init public items */ + ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_dv_codec_t)); + ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = quicktime_delete_codec_dv; + ((quicktime_codec_t*)vtrack->codec)->decode_video = quicktime_decode_dv; + ((quicktime_codec_t*)vtrack->codec)->encode_video = quicktime_encode_dv; + ((quicktime_codec_t*)vtrack->codec)->decode_audio = 0; + ((quicktime_codec_t*)vtrack->codec)->encode_audio = 0; + ((quicktime_codec_t*)vtrack->codec)->reads_colormodel = quicktime_reads_colormodel_dv; + + /* Init private items */ + codec = ((quicktime_codec_t*)vtrack->codec)->priv; + codec->dv = dv_new(); + codec->data = calloc(1, 140000); + } Binary files bcast-2000c/quicktime/.quicktime.h.swp and bcast-2000c-mf3/quicktime/.quicktime.h.swp differ diff -C2 -r -N bcast-2000c/quicktime/COPYING bcast-2000c-mf3/quicktime/COPYING *** bcast-2000c/quicktime/COPYING Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/COPYING Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,515 ---- + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + [This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + Licenses are intended to guarantee your freedom to share and change + free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some + specially designated software packages--typically libraries--of the + Free Software Foundation and other authors who decide to use it. You + can use it too, but we suggest you first think carefully about whether + this license or the ordinary General Public License is the better + strategy to use in any particular case, based on the explanations + below. + + When we speak of free software, we are referring to freedom of use, + not price. Our General Public Licenses are designed to make sure that + you have the freedom to distribute copies of free software (and charge + for this service if you wish); that you receive source code or can get + it if you want it; that you can change the software and use pieces of + it in new free programs; and that you are informed that you can do + these things. + + To protect your rights, we need to make restrictions that forbid + distributors to deny you these rights or to ask you to surrender these + rights. These restrictions translate to certain responsibilities for + you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis + or for a fee, you must give the recipients all the rights that we gave + you. You must make sure that they, too, receive or can get the source + code. If you link other code with the library, you must provide + complete object files to the recipients, so that they can relink them + with the library after making changes to the library and recompiling + it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the + library, and (2) we offer you this license, which gives you legal + permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that + there is no warranty for the free library. Also, if the library is + modified by someone else and passed on, the recipients should know + that what they have is not the original version, so that the original + author's reputation will not be affected by problems that might be + introduced by others. + ^L + Finally, software patents pose a constant threat to the existence of + any free program. We wish to make sure that a company cannot + effectively restrict the users of a free program by obtaining a + restrictive license from a patent holder. Therefore, we insist that + any patent license obtained for a version of the library must be + consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the + ordinary GNU General Public License. This license, the GNU Lesser + General Public License, applies to certain designated libraries, and + is quite different from the ordinary General Public License. We use + this license for certain libraries in order to permit linking those + libraries into non-free programs. + + When a program is linked with a library, whether statically or using + a shared library, the combination of the two is legally speaking a + combined work, a derivative of the original library. The ordinary + General Public License therefore permits such linking only if the + entire combination fits its criteria of freedom. The Lesser General + Public License permits more lax criteria for linking other code with + the library. + + We call this license the "Lesser" General Public License because it + does Less to protect the user's freedom than the ordinary General + Public License. It also provides other free software developers Less + of an advantage over competing non-free programs. These disadvantages + are the reason we use the ordinary General Public License for many + libraries. However, the Lesser license provides advantages in certain + special circumstances. + + For example, on rare occasions, there may be a special need to + encourage the widest possible use of a certain library, so that it + becomes + a de-facto standard. To achieve this, non-free programs must be + allowed to use the library. A more frequent case is that a free + library does the same job as widely used non-free libraries. In this + case, there is little to gain by limiting the free library to free + software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free + programs enables a greater number of people to use a large body of + free software. For example, permission to use the GNU C Library in + non-free programs enables many more people to use the whole GNU + operating system, as well as its variant, the GNU/Linux operating + system. + + Although the Lesser General Public License is Less protective of the + users' freedom, it does ensure that the user of a program that is + linked with the Library has the freedom and the wherewithal to run + that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and + modification follow. Pay close attention to the difference between a + "work based on the library" and a "work that uses the library". The + former contains code derived from the library, whereas the latter must + be combined with the library in order to run. + ^L + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other + program which contains a notice placed by the copyright holder or + other authorized party saying it may be distributed under the terms of + this Lesser General Public License (also called "this License"). + Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data + prepared so as to be conveniently linked with application programs + (which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work + which has been distributed under these terms. A "work based on the + Library" means either the Library or any derivative work under + copyright law: that is to say, a work containing the Library or a + portion of it, either verbatim or with modifications and/or translated + straightforwardly into another language. (Hereinafter, translation is + included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for + making modifications to it. For a library, complete source code means + all the source code for all modules it contains, plus any associated + interface definition files, plus the scripts used to control + compilation + and installation of the library. + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running a program using the Library is not restricted, and output from + such a program is covered only if its contents constitute a work based + on the Library (independent of the use of the Library in a tool for + writing it). Whether that is true depends on what the Library does + and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's + complete source code as you receive it, in any medium, provided that + you conspicuously and appropriately publish on each copy an + appropriate copyright notice and disclaimer of warranty; keep intact + all the notices that refer to this License and to the absence of any + warranty; and distribute a copy of this License along with the + Library. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange for a + fee. + + 2. You may modify your copy or copies of the Library or any portion + of it, thus forming a work based on the Library, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Library, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Library, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote + it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Library. + + In addition, mere aggregation of another work not based on the Library + with the Library (or with a work based on the Library) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public + License instead of this License to a given copy of the Library. To do + this, you must alter all the notices that refer to this License, so + that they refer to the ordinary GNU General Public License, version 2, + instead of to this License. (If a newer version than version 2 of the + ordinary GNU General Public License has appeared, then you can specify + that version instead if you wish.) Do not make any other change in + these notices. + ^L + Once this change is made in a given copy, it is irreversible for + that copy, so the ordinary GNU General Public License applies to all + subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of + the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or + derivative of it, under Section 2) in object code or executable form + under the terms of Sections 1 and 2 above provided that you accompany + it with the complete corresponding machine-readable source code, which + must be distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy + from a designated place, then offering equivalent access to copy the + source code from the same place satisfies the requirement to + distribute the source code, even though third parties are not + compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the + Library, but is designed to work with the Library by being compiled or + linked with it, is called a "work that uses the Library". Such a + work, in isolation, is not a derivative work of the Library, and + therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library + creates an executable that is a derivative of the Library (because it + contains portions of the Library), rather than a "work that uses the + library". The executable is therefore covered by this License. + Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file + that is part of the Library, the object code for the work may be a + derivative work of the Library even though the source code is not. + Whether this is true is especially significant if the work can be + linked without the Library, or if the work is itself a library. The + threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data + structure layouts and accessors, and small macros and small inline + functions (ten lines or less in length), then the use of the object + file is unrestricted, regardless of whether it is legally a derivative + work. (Executables containing this object code plus portions of the + Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may + distribute the object code for the work under the terms of Section 6. + Any executables containing that work also fall under Section 6, + whether or not they are linked directly with the Library itself. + ^L + 6. As an exception to the Sections above, you may also combine or + link a "work that uses the Library" with the Library to produce a + work containing portions of the Library, and distribute that work + under terms of your choice, provided that the terms permit + modification of the work for the customer's own use and reverse + engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the + Library is used in it and that the Library and its use are covered by + this License. You must supply a copy of this License. If the work + during execution displays copyright notices, you must include the + copyright notice for the Library among them, as well as a reference + directing the user to the copy of this License. Also, you must do one + of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the + Library" must include any data and utility programs needed for + reproducing the executable from it. However, as a special exception, + the materials to be distributed need not include anything that is + normally distributed (in either source or binary form) with the major + components (compiler, kernel, and so on) of the operating system on + which the executable runs, unless that component itself accompanies + the executable. + + It may happen that this requirement contradicts the license + restrictions of other proprietary libraries that do not normally + accompany the operating system. Such a contradiction means you cannot + use both them and the Library together in an executable that you + distribute. + ^L + 7. You may place library facilities that are a work based on the + Library side-by-side in a single library together with other library + facilities not covered by this License, and distribute such a combined + library, provided that the separate distribution of the work based on + the Library and of the other library facilities is otherwise + permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute + the Library except as expressly provided under this License. Any + attempt otherwise to copy, modify, sublicense, link with, or + distribute the Library is void, and will automatically terminate your + rights under this License. However, parties who have received copies, + or rights, from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Library or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Library (or any work based on the + Library), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the + Library), the recipient automatically receives a license from the + original licensor to copy, distribute, link with or modify the Library + subject to these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties with + this License. + ^L + 11. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Library at all. For example, if a patent + license would not permit royalty-free redistribution of the Library by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Library. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply, and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Library under this License + may add an explicit geographical distribution limitation excluding those + countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new + versions of the Lesser General Public License from time to time. + Such new versions will be similar in spirit to the present version, + but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Library + specifies a version number of this License which applies to it and + "any later version", you have the option of following the terms and + conditions either of that version or of any later version published by + the Free Software Foundation. If the Library does not specify a + license version number, you may choose any version ever published by + the Free Software Foundation. + ^L + 14. If you wish to incorporate parts of the Library into other free + programs whose distribution conditions are incompatible with these, + write to the author to ask for permission. For software which is + copyrighted by the Free Software Foundation, write to the Free + Software Foundation; we sometimes make exceptions for this. Our + decision will be guided by the two goals of preserving the free status + of all derivatives of our free software and of promoting the sharing + and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR + OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE + LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME + THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY + AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU + FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE + LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING + RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A + FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF + SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + DAMAGES. + + END OF TERMS AND CONDITIONS + ^L + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest + possible use to the public, we recommend making it free software that + everyone can redistribute and change. You can do so by permitting + redistribution under these terms (or, alternatively, under the terms + of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. + It is safest to attach them to the start of each source file to most + effectively convey the exclusion of warranty; and each file should + have at least the "copyright" line and a pointer to where the full + notice is found. + + + + Copyright (C) + + This library 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 of the License, or (at your option) any later version. + + This library 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 this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Also add information on how to contact you by electronic and paper + mail. + + You should also get your employer (if you work as a programmer) or + your + school, if any, to sign a "copyright disclaimer" for the library, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + + That's all there is to it! + + diff -C2 -r -N bcast-2000c/quicktime/CVS/Entries bcast-2000c-mf3/quicktime/CVS/Entries *** bcast-2000c/quicktime/CVS/Entries Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/CVS/Entries Mon Dec 17 14:28:20 2001 *************** *** 1,97 **** ! /Makefile/1.1.1.1/Thu Nov 2 04:28:41 2000// ! /README/1.1.1.1/Thu Nov 2 04:28:41 2000// ! /atom.c/1.1.1.1/Thu Nov 2 04:28:41 2000// ! /c_flags/1.1.1.1/Thu Nov 2 04:28:41 2000// ! /codecs.c/1.1.1.1/Thu Nov 2 04:28:41 2000// ! /codecs.h/1.1.1.1/Thu Nov 2 04:28:41 2000// ! /colormodels.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /colormodels.h/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /configure/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /ctab.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /dechunk.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /dinf.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /dref.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /dump.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /dv.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /dv.h/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /edts.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /elst.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /fastjpg.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /fastjpg.h/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /fastjpgmacro.h/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /funcprotos.h/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /global_config/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /graphics.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /graphics.h/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /hdlr.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /ima4.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /ima4.h/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /index.bt/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /jdatadst.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /jdatasrc.c/1.1.1.1/Thu Nov 2 04:28:42 2000// ! /jpeg.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /jpeg.h/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /make_package/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /make_streamable.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /matrix.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /mdat.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /mdhd.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /mdia.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /minf.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /mmx.h/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /moov.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /mvhd.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /private.h/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /qtinfo.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /qtpng.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /qtpng.h/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /quicktime.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /quicktime.h/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /raw.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /raw.h/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /rawaudio.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /rawaudio.h/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /revdct.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /rtjpeg.c/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /rtjpeg.h/1.1.1.1/Thu Nov 2 04:28:43 2000// ! /rtjpeg_core.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /rtjpeg_core.c.X/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /rtjpeg_core.h/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /sizes.h/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /smhd.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /stbl.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /stco.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /stsc.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /stsd.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /stsdtable.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /stss.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /stsz.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /stts.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /tkhd.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /trak.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /twos.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /twos.h/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /udta.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /ulaw.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /ulaw.h/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /util.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /vmhd.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /wmx1.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /wmx1.h/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /wmx2.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /wmx2.h/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /xanimjpeg.c/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /xanimjpeg.h/1.1.1.1/Thu Nov 2 04:28:44 2000// ! /yuv2.c/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /yuv2.h/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /yuv4.c/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /yuv4.h/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /yuv4toyuv.c/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /yuv9.h/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /yv12.c/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /yv12.h/1.1.1.1/Thu Nov 2 04:28:45 2000// D/docs//// D/jpeg//// D/libdv//// ! D/libraw1394.2214//// ! D/libraw1394.2217//// --- 1,138 ---- ! /.quicktime.h.swp/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /COPYING/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /atom.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /cmodel_yuv422.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /codecs.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /ctab.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dechunk.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dinf.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dref.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dump.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /edts.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /elst.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /fastjpg.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /fastjpg.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /fastjpgmacro.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /graphics.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /graphics.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /hdlr.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /ima4.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /index.bt/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdatadst.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdatasrc.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jpeg.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jpeg_old.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jpeg_old.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /make_package/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /make_streamable.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /matrix.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /mdat.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /mdhd.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /mdia.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /minf.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /mmx.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /mvhd.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /qtinfo.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /qtpng.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rawaudio.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rawaudio.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rechunk.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /revdct.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rtjpeg.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rtjpeg.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rtjpeg_core.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rtjpeg_core.c.X/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rtjpeg_core.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /smhd.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /stco.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /stsd.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /stsdtable.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /stss.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /stts.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /tkhd.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /udta.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /ulaw.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /ulaw.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /v410.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /vmhd.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wmx1.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wmx1.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wmx2.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wmx2.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /workarounds.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /workarounds.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /xanimjpeg.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /xanimjpeg.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /yuv2.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /yuv2.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /yuv4.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /yuv4.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /yuv4toyuv.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /yuv9.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /yv12.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /yv12.h/1.1.1.1/Mon Oct 1 03:16:38 2001// D/docs//// D/jpeg//// D/libdv//// ! D/libraw1394//// ! /qtpng.c/1.1.1.1/Thu Nov 15 00:55:54 2001// ! /recover.c/1.2/Mon Nov 19 13:23:40 2001// ! /libmjpeg.c/1.2/Mon Nov 26 14:23:42 2001// ! /colormodels.c/1.3/Tue Nov 27 16:23:36 2001// ! /v308.h/1.2/Tue Nov 27 14:50:53 2001// ! /v408.h/1.2/Tue Nov 27 14:46:30 2001// ! /v410.c/1.5/Tue Nov 27 14:35:19 2001// ! /v308.c/1.1/Tue Nov 27 14:51:28 2001// ! /v408.c/1.1/Tue Nov 27 14:50:18 2001// ! /libmjpeg.h/1.3/Wed Nov 28 15:03:55 2001// ! /moov.c/1.2/Thu Nov 29 15:22:07 2001// ! /twos.h/1.2/Thu Nov 29 15:30:50 2001// ! D/decore50//// ! D/encore50//// ! /colormodels.h/1.3/Fri Nov 30 13:29:04 2001// ! /Makefile.2/1.1/Thu Nov 29 10:12:33 2001// ! /Makefile.50/1.2/Fri Nov 30 01:09:09 2001// ! /divx.c.2/1.2/Fri Nov 30 01:09:09 2001// ! /divx.c.50/1.2/Fri Nov 30 01:09:09 2001// ! /divx.h/1.2/Mon Dec 3 13:48:32 2001// ! /divx.h.2/1.1/Thu Nov 29 10:12:33 2001// ! /divx.h.50/1.2/Fri Nov 30 01:09:09 2001// ! /dv.h/1.2/Mon Dec 3 13:48:32 2001// ! /jpeg.c/1.4/Mon Dec 3 13:48:32 2001// ! /libdv.h/1.4/Mon Dec 3 13:48:32 2001// ! /raw.h/1.2/Mon Dec 3 13:48:32 2001// ! D/decore2//// ! D/encore2//// ! D/libogg-1.0beta4//// ! D/libvorbis-1.0beta4//// ! /codecs.c/1.2/Mon Dec 3 15:48:54 2001// ! /ima4.c/1.2/Mon Dec 3 15:50:50 2001// ! /qtprivate.h/1.3/Mon Dec 3 15:26:48 2001// ! /cmodel_default.c/1.4/Wed Dec 5 13:46:46 2001// ! /cmodel_permutation.h/1.4/Wed Dec 5 13:46:46 2001// ! D/libogg-1.0rc2//// ! D/libvorbis-1.0rc2//// ! /raw.c/1.4/Wed Dec 5 14:18:01 2001// ! /stbl.c/1.2/Wed Dec 5 14:49:49 2001// ! /qtvorbis.h/1.1/Mon Dec 3 13:53:52 2001// ! /cmodel_yuv420p.c/1.1.1.1/Wed Dec 5 14:22:23 2001// ! /~mdat.c/1.1.1.1/Wed Dec 5 17:22:09 2001// ! /dv.c/1.6/Fri Dec 7 16:31:03 2001// ! /libdv.c/1.5/Fri Dec 7 16:20:32 2001// ! /Makefile.encore2/1.1/Sat Dec 8 02:49:19 2001// ! /Makefile.encore50/1.1/Sat Dec 8 07:58:34 2001// ! /divx.c.encore2/1.2/Mon Dec 10 13:46:07 2001// ! /divx.c.encore50/1.1/Sat Dec 8 07:58:34 2001// ! /funcprotos.h/1.8/Mon Dec 10 14:12:14 2001// ! /stsz.c/1.4/Mon Dec 10 14:33:43 2001// ! /divx.c/1.16/Thu Dec 13 15:16:25 2001// ! /README/1.7/Fri Dec 14 14:13:25 2001// ! /Makefile/1.24/Mon Dec 17 13:28:15 2001// ! /plugin.c/1.8/Mon Dec 17 13:28:18 2001// ! /quicktime.c/1.9/Mon Dec 17 13:28:18 2001// ! /quicktime.h/1.7/Mon Dec 17 13:28:18 2001// ! /stsc.c/1.2/Mon Dec 17 13:28:19 2001// ! /trak.c/1.6/Mon Dec 17 13:28:19 2001// ! /twos.c/1.4/Mon Dec 17 13:28:20 2001// ! /util.c/1.2/Fri Dec 14 16:14:34 2001// ! /vorbis.c/1.20/Mon Dec 17 13:28:20 2001// diff -C2 -r -N bcast-2000c/quicktime/CVS/Root bcast-2000c-mf3/quicktime/CVS/Root *** bcast-2000c/quicktime/CVS/Root Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/CVS/Root Tue Nov 6 14:47:04 2001 *************** *** 1 **** ! heroines@cvs.heroines.sourceforge.net:/cvsroot/heroines --- 1 ---- ! :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/Makefile bcast-2000c-mf3/quicktime/Makefile *** bcast-2000c/quicktime/Makefile Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/Makefile Mon Dec 31 10:47:14 2001 *************** *** 1,160 **** ! include global_config - OBJS = \ - atom.o \ - codecs.o \ - colormodels.o \ - ctab.o \ - dinf.o \ - dref.o \ - dv.o \ - edts.o \ - elst.o \ - graphics.o \ - hdlr.o \ - ima4.o \ - jpeg.o \ - jpeg_old.o \ - libmjpeg.o \ - matrix.o \ - mdat.o \ - mdhd.o \ - mdia.o \ - minf.o \ - moov.o \ - mvhd.o \ - plugin.o \ - qtpng.o \ - quicktime.o \ - raw.o \ - rawaudio.o \ - smhd.o \ - stbl.o \ - stco.o \ - stsc.o \ - stsd.o \ - stsdtable.o \ - stss.o \ - stsz.o \ - stts.o \ - tkhd.o \ - trak.o \ - twos.o \ - udta.o \ - ulaw.o \ - util.o \ - vmhd.o \ - yuv2.o \ - yuv4.o \ - yv12.o - - - JPEGOBJS = \ - jpeg/jcapimin.o \ - jpeg/jcapistd.o \ - jpeg/jctrans.o \ - jpeg/jcparam.o \ - jpeg/jdatadst.o \ - jpeg/jcinit.o \ - jpeg/jcmaster.o \ - jpeg/jcmarker.o \ - jpeg/jcmainct.o \ - jpeg/jcprepct.o \ - jpeg/jccoefct.o \ - jpeg/jccolor.o \ - jpeg/jcsample.o \ - jpeg/jchuff.o \ - jpeg/jcphuff.o \ - jpeg/jcdctmgr.o \ - jpeg/jfdctfst.o \ - jpeg/jfdctflt.o \ - jpeg/jfdctint.o \ - jpeg/jdapimin.o \ - jpeg/jdapistd.o \ - jpeg/jdtrans.o \ - jpeg/jdatasrc.o \ - jpeg/jdmaster.o \ - jpeg/jdinput.o \ - jpeg/jdmarker.o \ - jpeg/jdhuff.o \ - jpeg/jdphuff.o \ - jpeg/jdmainct.o \ - jpeg/jdcoefct.o \ - jpeg/jdpostct.o \ - jpeg/jddctmgr.o \ - jpeg/jidctfst.o \ - jpeg/jidctflt.o \ - jpeg/jidctint.o \ - jpeg/jidctred.o \ - jpeg/jdsample.o \ - jpeg/jdcolor.o \ - jpeg/jquant1.o \ - jpeg/jquant2.o \ - jpeg/jdmerge.o \ - jpeg/jcomapi.o \ - jpeg/jutils.o \ - jpeg/jerror.o \ - jpeg/jmemmgr.o \ - jpeg/jmemnobs.o - - DVOBJS = \ - libdv/bitstream.o \ - libdv/dct.o \ - libdv/idct_248.o \ - libdv/libdv.o \ - libdv/parse.o \ - libdv/place.o \ - libdv/quant.o \ - libdv/vlc.o \ - libdv/weighting.o \ - libdv/ycrcb_to_rgb32.o - - - OUTPUT = libquicktime.a - - all: $(OUTPUT) - - $(OUTPUT): $(OBJS) - $(MAKE) -C jpeg - $(MAKE) -C libdv - $(MAKE) -C libraw1394 - ar rcs $(OUTPUT) $(OBJS) $(JPEGOBJS) $(DVOBJS) $(FIREWIREOBJS) $(DVMMXOBJS) - g++ -shared -o libquicktime.so $(OBJS) $(JPEGOBJS) $(DVOBJS) $(FIREWIREOBJS) $(DVMMXOBJS) - - qtdump: dump.o $(OUTPUT) - $(CC) -o qtdump dump.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl - - make_streamable: make_streamable.o $(OUTPUT) - $(CC) -o make_streamable make_streamable.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl - - dechunk: dechunk.o $(OUTPUT) - $(CC) -o dechunk dechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl - - recover: recover.o $(OUTPUT) - $(CC) -o recover recover.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl - - yuv4toyuv: yuv4toyuv.o $(OUTPUT) - $(CC) -o yuv4toyuv yuv4toyuv.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl - - qtinfo: qtinfo.o - $(CC) -o qtinfo qtinfo.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl - util: qtdump make_streamable qtinfo dechunk yuv4toyuv recover - - quicktime.o: quicktime.h quicktime.c ! .c.o: ! $(CC) -c `./c_flags` $*.c clean: ! rm -f core ! rm -f *.o *.so ! rm -f $(OUTPUT) ! rm -f dump make_streamable a.out qtinfo dechunk yuv4toyuv rm -rf .deps - $(MAKE) -C libdv clean - $(MAKE) -C jpeg clean - $(MAKE) -C libraw1394 clean wc: --- 1,451 ---- ! OBJDIR := $(shell uname --machine) ! OBJS = ! USE_MMX = 0 ! CC = gcc ! HAVE_CFLAGS := $(shell if [ -n "$$CFLAGS" ]; then echo y ; fi ) ! # ENCORE_DIR := encore2/src ! # DECORE_DIR := decore2/src ! ENCORE_DIR := encore50 ! DECORE_DIR := decore50 ! ENCORE_INCLUDE := $(ENCORE_DIR)/encore.h ! DECORE_INCLUDE := $(DECORE_DIR)/decore.h ! OGG_DIR := $(shell expr libogg* ) ! VORBIS_DIR := $(shell expr libvorbis* ) ! ! ! ! ! DIRS = $(OBJDIR) \ ! $(OBJDIR)/jpeg \ ! $(OBJDIR)/libraw1394/src \ ! $(OBJDIR)/libdv ! ! ! DIRS += \ ! $(OBJDIR)/$(DECORE_DIR) ! ! DIRS += \ ! $(OBJDIR)/$(ENCORE_DIR) \ ! $(OBJDIR)/$(ENCORE_DIR)/att_mmx \ ! $(OBJDIR)/$(ENCORE_DIR)/colorspace \ ! $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx \ ! $(OBJDIR)/$(ENCORE_DIR)/intel_mmx \ ! $(OBJDIR)/$(ENCORE_DIR)/mbcoding \ ! $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp \ ! $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx \ ! $(OBJDIR)/$(ENCORE_DIR)/mbprediction \ ! $(OBJDIR)/$(ENCORE_DIR)/mbtransquant \ ! $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx ! ! DIRS += \ ! $(OBJDIR)/$(OGG_DIR)/src \ ! $(OBJDIR)/$(VORBIS_DIR)/lib ! ! ! ! ! ! ! ! ifeq ($(OBJDIR), i686) ! USE_MMX = 1 ! endif ! ! ! ! ! ifeq ($(HAVE_CFLAGS), y) ! endif ! ! ! ifneq ($(HAVE_CFLAGS), y) ! ! CFLAGS = -O3 -fomit-frame-pointer -march=i586 -I/usr/local/include ! ! ifeq ($(OBJDIR), alpha) ! CFLAGS = -O4 -arch ev67 -ieee -accept c99_keywords -gcc_messages ! endif ! ! endif ! ! ! ! # CFLAGS += -g ! CFLAGS += -D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ! CFLAGS += -DHAVE_FIREWIRE ! CFLAGS += -I. -Ijpeg -Ilibdv -Ilibraw1394 $(shell glib-config --cflags) ! ! ifeq ($(USE_MMX), 1) ! ! CFLAGS += -DARCH_X86 ! ! DVMMXOBJ = libdv/asmoff.h ! ! DVMMXOBJS = \ ! $(OBJDIR)/libdv/dct_block_mmx.o \ ! $(OBJDIR)/libdv/encode_x86.o \ ! $(OBJDIR)/libdv/idct_block_mmx.o \ ! $(OBJDIR)/libdv/quant_x86.o \ ! $(OBJDIR)/libdv/transpose_x86.o \ ! $(OBJDIR)/libdv/vlc_x86.o ! ! OBJS += $(OBJDIR)/libdv/mmx.o ! ! endif ! ! ! ! ! ! ! ! ! OBJS += \ ! $(OBJDIR)/atom.o \ ! $(OBJDIR)/cmodel_default.o \ ! $(OBJDIR)/cmodel_yuv420p.o \ ! $(OBJDIR)/cmodel_yuv422.o \ ! $(OBJDIR)/codecs.o \ ! $(OBJDIR)/colormodels.o \ ! $(OBJDIR)/ctab.o \ ! $(OBJDIR)/dinf.o \ ! $(OBJDIR)/divx.o \ ! $(OBJDIR)/dref.o \ ! $(OBJDIR)/dv.o \ ! $(OBJDIR)/edts.o \ ! $(OBJDIR)/elst.o \ ! $(OBJDIR)/graphics.o \ ! $(OBJDIR)/hdlr.o \ ! $(OBJDIR)/ima4.o \ ! $(OBJDIR)/jpeg.o \ ! $(OBJDIR)/jpeg_old.o \ ! $(OBJDIR)/libdv.o \ ! $(OBJDIR)/libmjpeg.o \ ! $(OBJDIR)/matrix.o \ ! $(OBJDIR)/mdat.o \ ! $(OBJDIR)/mdhd.o \ ! $(OBJDIR)/mdia.o \ ! $(OBJDIR)/minf.o \ ! $(OBJDIR)/moov.o \ ! $(OBJDIR)/mvhd.o \ ! $(OBJDIR)/plugin.o \ ! $(OBJDIR)/qtpng.o \ ! $(OBJDIR)/quicktime.o \ ! $(OBJDIR)/raw.o \ ! $(OBJDIR)/rawaudio.o \ ! $(OBJDIR)/smhd.o \ ! $(OBJDIR)/stbl.o \ ! $(OBJDIR)/stco.o \ ! $(OBJDIR)/stsc.o \ ! $(OBJDIR)/stsd.o \ ! $(OBJDIR)/stsdtable.o \ ! $(OBJDIR)/stss.o \ ! $(OBJDIR)/stsz.o \ ! $(OBJDIR)/stts.o \ ! $(OBJDIR)/tkhd.o \ ! $(OBJDIR)/trak.o \ ! $(OBJDIR)/twos.o \ ! $(OBJDIR)/udta.o \ ! $(OBJDIR)/ulaw.o \ ! $(OBJDIR)/util.o \ ! $(OBJDIR)/v308.o \ ! $(OBJDIR)/v408.o \ ! $(OBJDIR)/v410.o \ ! $(OBJDIR)/vmhd.o \ ! $(OBJDIR)/vorbis.o \ ! $(OBJDIR)/workarounds.o \ ! $(OBJDIR)/yuv2.o \ ! $(OBJDIR)/yuv4.o \ ! $(OBJDIR)/yv12.o \ ! $(OBJDIR)/jpeg/jcapimin.o \ ! $(OBJDIR)/jpeg/jcapistd.o \ ! $(OBJDIR)/jpeg/jctrans.o \ ! $(OBJDIR)/jpeg/jcparam.o \ ! $(OBJDIR)/jpeg/jdatadst.o \ ! $(OBJDIR)/jpeg/jcinit.o \ ! $(OBJDIR)/jpeg/jcmaster.o \ ! $(OBJDIR)/jpeg/jcmarker.o \ ! $(OBJDIR)/jpeg/jcmainct.o \ ! $(OBJDIR)/jpeg/jcprepct.o \ ! $(OBJDIR)/jpeg/jccoefct.o \ ! $(OBJDIR)/jpeg/jccolor.o \ ! $(OBJDIR)/jpeg/jcsample.o \ ! $(OBJDIR)/jpeg/jchuff.o \ ! $(OBJDIR)/jpeg/jcphuff.o \ ! $(OBJDIR)/jpeg/jcdctmgr.o \ ! $(OBJDIR)/jpeg/jfdctfst.o \ ! $(OBJDIR)/jpeg/jfdctflt.o \ ! $(OBJDIR)/jpeg/jfdctint.o \ ! $(OBJDIR)/jpeg/jdapimin.o \ ! $(OBJDIR)/jpeg/jdapistd.o \ ! $(OBJDIR)/jpeg/jdtrans.o \ ! $(OBJDIR)/jpeg/jdatasrc.o \ ! $(OBJDIR)/jpeg/jdmaster.o \ ! $(OBJDIR)/jpeg/jdinput.o \ ! $(OBJDIR)/jpeg/jdmarker.o \ ! $(OBJDIR)/jpeg/jdhuff.o \ ! $(OBJDIR)/jpeg/jdphuff.o \ ! $(OBJDIR)/jpeg/jdmainct.o \ ! $(OBJDIR)/jpeg/jdcoefct.o \ ! $(OBJDIR)/jpeg/jdpostct.o \ ! $(OBJDIR)/jpeg/jddctmgr.o \ ! $(OBJDIR)/jpeg/jidctfst.o \ ! $(OBJDIR)/jpeg/jidctflt.o \ ! $(OBJDIR)/jpeg/jidctint.o \ ! $(OBJDIR)/jpeg/jidctred.o \ ! $(OBJDIR)/jpeg/jdsample.o \ ! $(OBJDIR)/jpeg/jdcolor.o \ ! $(OBJDIR)/jpeg/jquant1.o \ ! $(OBJDIR)/jpeg/jquant2.o \ ! $(OBJDIR)/jpeg/jdmerge.o \ ! $(OBJDIR)/jpeg/jcomapi.o \ ! $(OBJDIR)/jpeg/jutils.o \ ! $(OBJDIR)/jpeg/jerror.o \ ! $(OBJDIR)/jpeg/jmemmgr.o \ ! $(OBJDIR)/jpeg/jmemnobs.o \ ! $(OBJDIR)/libraw1394/src/eventloop.o \ ! $(OBJDIR)/libraw1394/src/fcp.o \ ! $(OBJDIR)/libraw1394/src/iso.o \ ! $(OBJDIR)/libraw1394/src/main.o \ ! $(OBJDIR)/libraw1394/src/readwrite.o ! ! ! ! ! ! ! OBJS += \ ! $(OBJDIR)/libdv/YUY2.o \ ! $(OBJDIR)/libdv/YV12.o \ ! $(OBJDIR)/libdv/audio.o \ ! $(OBJDIR)/libdv/bitstream.o \ ! $(OBJDIR)/libdv/dct.o \ ! $(OBJDIR)/libdv/dv.o \ ! $(OBJDIR)/libdv/encode.o \ ! $(OBJDIR)/libdv/enc_input.o \ ! $(OBJDIR)/libdv/headers.o \ ! $(OBJDIR)/libdv/idct_248.o \ ! $(OBJDIR)/libdv/parse.o \ ! $(OBJDIR)/libdv/place.o \ ! $(OBJDIR)/libdv/quant.o \ ! $(OBJDIR)/libdv/rgb.o \ ! $(OBJDIR)/libdv/util.o \ ! $(OBJDIR)/libdv/vlc.o \ ! $(OBJDIR)/libdv/weighting.o ! ! # OBJS += \ ! # $(OBJDIR)/$(DECORE_DIR)/bitstream.o \ ! # $(OBJDIR)/$(DECORE_DIR)/colorspace.o \ ! # $(OBJDIR)/$(DECORE_DIR)/decoder.o \ ! # $(OBJDIR)/$(DECORE_DIR)/decore2.o \ ! # $(OBJDIR)/$(DECORE_DIR)/idct.o \ ! # $(OBJDIR)/$(DECORE_DIR)/image.o \ ! # $(OBJDIR)/$(DECORE_DIR)/mbcoding.o \ ! # $(OBJDIR)/$(DECORE_DIR)/mbprediction.o \ ! # $(OBJDIR)/$(DECORE_DIR)/quantize.o \ ! # $(OBJDIR)/$(DECORE_DIR)/transfer.o ! ! OBJS += \ ! $(OBJDIR)/$(DECORE_DIR)/debug.o \ ! $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o \ ! $(OBJDIR)/$(DECORE_DIR)/clearblock.o \ ! $(OBJDIR)/$(DECORE_DIR)/decore.o \ ! $(OBJDIR)/$(DECORE_DIR)/getbits.o \ ! $(OBJDIR)/$(DECORE_DIR)/idct.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_block.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_header.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o \ ! $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o \ ! $(OBJDIR)/$(DECORE_DIR)/postprocess.o \ ! $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o \ ! $(OBJDIR)/$(DECORE_DIR)/transferidct.o ! ! # OBJS += \ ! # $(OBJDIR)/$(ENCORE_DIR)/bitstream.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/encoder.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/encore.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/image.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/halfpel.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mad.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/sad.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/timer.o ! ! ! ifeq ($(USE_MMX), 1) ! ! ! # CFLAGS += -D_MMX_ ! # ENCOREMMX_OBJS= \ ! # $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.o \ ! # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.o ! ! ! ! endif ! ! ! OBJS += \ ! $(OBJDIR)/$(ENCORE_DIR)/bitstream.o \ ! $(OBJDIR)/$(ENCORE_DIR)/encore.o \ ! $(OBJDIR)/$(ENCORE_DIR)/mom_access.o \ ! $(OBJDIR)/$(ENCORE_DIR)/mom_util.o \ ! $(OBJDIR)/$(ENCORE_DIR)/mot_code.o \ ! $(OBJDIR)/$(ENCORE_DIR)/mot_est_comp.o \ ! $(OBJDIR)/$(ENCORE_DIR)/mot_est_mb.o \ ! $(OBJDIR)/$(ENCORE_DIR)/mot_util.o \ ! $(OBJDIR)/$(ENCORE_DIR)/putvlc.o \ ! $(OBJDIR)/$(ENCORE_DIR)/rate_ctl.o \ ! $(OBJDIR)/$(ENCORE_DIR)/text_bits.o \ ! $(OBJDIR)/$(ENCORE_DIR)/text_code.o \ ! $(OBJDIR)/$(ENCORE_DIR)/text_code_mb.o \ ! $(OBJDIR)/$(ENCORE_DIR)/text_dct.o \ ! $(OBJDIR)/$(ENCORE_DIR)/vop_code.o ! ! ! ! ! ! ! OBJS += \ ! $(OBJDIR)/$(OGG_DIR)/src/bitwise.o \ ! $(OBJDIR)/$(OGG_DIR)/src/framing.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/analysis.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/bitbuffer.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/block.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/codebook.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/envelope.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/floor0.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/floor1.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/info.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/lookup.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/lpc.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/lsp.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/mapping0.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/mdct.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/psy.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/registry.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/res0.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/sharedbook.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/smallft.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/synthesis.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/time0.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisenc.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisfile.o \ ! $(OBJDIR)/$(VORBIS_DIR)/lib/window.o ! ! ! ! ! ! ! ! ! ! ! OUTPUT = $(OBJDIR)/libquicktime.a ! SHAREDOUTPUT = $(OBJDIR)/libquicktime.so ! CFLAGS += -Ilibraw1394/src ! ! CFLAGS += \ ! -I$(DECORE_DIR) \ ! -I$(ENCORE_DIR) \ ! -DDECORE_INCLUDE=\"$(DECORE_INCLUDE)\" \ ! -DENCORE_INCLUDE=\"$(ENCORE_INCLUDE)\" \ ! -DLINUX \ ! -D_DECORE ! ! CFLAGS += \ ! -I$(OGG_DIR)/include \ ! -I$(VORBIS_DIR)/include \ ! -I$(VORBIS_DIR)/lib \ ! -DHAVE_ALLOCA_H=1 \ ! -DHAVE_ALLOCA=1 \ ! -DHAVE_SQRTF=1 \ ! -DHAVE_LOGF=1 \ ! -DHAVE_EXPF=1 \ ! -DHAVE_ACOSF=1 \ ! -DHAVE_ATANF=1 \ ! -DHAVE_FREXPF=1 \ ! -DHAVE_RINTF=1 \ ! -DUSE_MEMORY_H \ ! -D_REENTRANT \ ! -DHAVE_ALLOCA=1 \ ! -DHAVE_ALLOCA_H=1 ! ! $(shell if ! test -d $(OBJDIR) \; then mkdir -p $(OBJDIR) \; fi ) ! $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags) ! $(shell echo $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) > $(OBJDIR)/objs) ! ! all: $(DIRS) $(OUTPUT) $(SHAREDOUTPUT) ! ! $(DIRS): ! if ! test -d $@ ; then mkdir -p $@ ; fi ! ! $(OUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) ! ar rcs $(OUTPUT) `cat $(OBJDIR)/objs` ! ln -fs $(OUTPUT) . ! ! $(SHAREDOUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) ! gcc -shared -o $(SHAREDOUTPUT) `cat $(OBJDIR)/objs` ! ! $(OBJDIR)/qtdump: $(OBJDIR)/dump.o $(OUTPUT) ! $(CC) -o $(OBJDIR)/qtdump $(OBJDIR)/dump.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm ! ! $(OBJDIR)/make_streamable: $(OBJDIR)/make_streamable.o $(OUTPUT) ! $(CC) -o $(OBJDIR)/make_streamable $(OBJDIR)/make_streamable.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm ! ! $(OBJDIR)/dechunk: $(OBJDIR)/dechunk.o $(OUTPUT) ! $(CC) -o $(OBJDIR)/dechunk $(OBJDIR)/dechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm ! ! $(OBJDIR)/rechunk: $(OBJDIR)/rechunk.o $(OUTPUT) ! $(CC) -o $(OBJDIR)/rechunk $(OBJDIR)/rechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm ! ! $(OBJDIR)/recover: $(OBJDIR)/recover.o $(OUTPUT) ! $(CC) -o $(OBJDIR)/recover $(OBJDIR)/recover.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm ! ! $(OBJDIR)/yuv4toyuv: $(OBJDIR)/yuv4toyuv.o $(OUTPUT) ! $(CC) -o $(OBJDIR)/yuv4toyuv $(OBJDIR)/yuv4toyuv.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm ! ! $(OBJDIR)/qtinfo: $(OBJDIR)/qtinfo.o ! $(CC) -o $(OBJDIR)/qtinfo $(OBJDIR)/qtinfo.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm ! ! util: $(OBJDIR)/qtdump $(OBJDIR)/make_streamable $(OBJDIR)/qtinfo $(OBJDIR)/dechunk $(OBJDIR)/yuv4toyuv $(OBJDIR)/recover $(OBJDIR)/rechunk ! clean: ! rm -rf $(OBJDIR) rm -rf .deps wc: *************** *** 164,165 **** --- 455,795 ---- cd .. && \ tar zcvf quicktime.tar.gz quicktime + + install: + cp $(SHAREDOUTPUT) /usr/lib/libquicktime.so.1 + ln -sf /usr/lib/libquicktime.so.1 /usr/lib/libquicktime.so + cp quicktime.h qtprivate.h colormodels.h /usr/include + + $(OBJDIR)/dump.o \ + $(OBJDIR)/make_streamable.o \ + $(OBJDIR)/dechunk.o \ + $(OBJDIR)/recover.o \ + $(OBJDIR)/yuv4toyuv.o \ + $(OBJDIR)/qtinfo.o \ + $(OBJDIR)/rechunk.o \ + $(OBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.c) -o $*.o + + # gcc 2.95.2 bug + $(OBJDIR)/libdv/mmx.o: + $(CC) -c `cat $(OBJDIR)/c_flags` -fno-inline-functions $(subst $(OBJDIR)/,, $*.c) -o $*.o + + $(DVMMXOBJ): + $(CC) `cat $(OBJDIR)/c_flags` libdv/gasmoff.c -o $(OBJDIR)/gasmoff -lm + $(OBJDIR)/gasmoff > libdv/asmoff.h + + $(DVMMXOBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o + + $(ENCOREMMX_OBJS): + nasm -f elf $(subst $(OBJDIR)/,, $*.asm) -o $*.o + + + + + $(OBJDIR)/atom.o: atom.c + $(OBJDIR)/cmodel_default.o: cmodel_default.c + $(OBJDIR)/cmodel_yuv420p.o: cmodel_yuv420p.c + $(OBJDIR)/cmodel_yuv422.o: cmodel_yuv422.c + $(OBJDIR)/codecs.o: codecs.c + $(OBJDIR)/colormodels.o: colormodels.c + $(OBJDIR)/ctab.o: ctab.c + $(OBJDIR)/dechunk.o: dechunk.c + $(OBJDIR)/dinf.o: dinf.c + $(OBJDIR)/divx.o: divx.c + $(OBJDIR)/dref.o: dref.c + $(OBJDIR)/dump.o: dump.c + $(OBJDIR)/dv.o: dv.c + $(OBJDIR)/edts.o: edts.c + $(OBJDIR)/elst.o: elst.c + $(OBJDIR)/graphics.o: graphics.c + $(OBJDIR)/hdlr.o: hdlr.c + $(OBJDIR)/ima4.o: ima4.c + $(OBJDIR)/jpeg.o: jpeg.c + $(OBJDIR)/jpeg_old.o: jpeg_old.c + $(OBJDIR)/libdv.o: libdv.c + $(OBJDIR)/libmjpeg.o: libmjpeg.c + $(OBJDIR)/make_streamable.o: make_streamable.c + $(OBJDIR)/matrix.o: matrix.c + $(OBJDIR)/mdat.o: mdat.c + $(OBJDIR)/mdhd.o: mdhd.c + $(OBJDIR)/mdia.o: mdia.c + $(OBJDIR)/minf.o: minf.c + $(OBJDIR)/moov.o: moov.c + $(OBJDIR)/mvhd.o: mvhd.c + $(OBJDIR)/plugin.o: plugin.c + $(OBJDIR)/qtinfo.o: qtinfo.c + $(OBJDIR)/qtpng.o: qtpng.c + $(OBJDIR)/quicktime.o: quicktime.c + $(OBJDIR)/raw.o: raw.c + $(OBJDIR)/rawaudio.o: rawaudio.c + $(OBJDIR)/rechunk.o: rechunk.c + $(OBJDIR)/recover.o: recover.c + $(OBJDIR)/smhd.o: smhd.c + $(OBJDIR)/stbl.o: stbl.c + $(OBJDIR)/stco.o: stco.c + $(OBJDIR)/stsc.o: stsc.c + $(OBJDIR)/stsd.o: stsd.c + $(OBJDIR)/stsdtable.o: stsdtable.c + $(OBJDIR)/stss.o: stss.c + $(OBJDIR)/stsz.o: stsz.c + $(OBJDIR)/stts.o: stts.c + $(OBJDIR)/tkhd.o: tkhd.c + $(OBJDIR)/trak.o: trak.c + $(OBJDIR)/twos.o: twos.c + $(OBJDIR)/udta.o: udta.c + $(OBJDIR)/ulaw.o: ulaw.c + $(OBJDIR)/util.o: util.c + $(OBJDIR)/v308.o: v308.c + $(OBJDIR)/v408.o: v408.c + $(OBJDIR)/v410.o: v410.c + $(OBJDIR)/vmhd.o: vmhd.c + $(OBJDIR)/vorbis.o: vorbis.c + $(OBJDIR)/workarounds.o: workarounds.c + $(OBJDIR)/yuv2.o: yuv2.c + $(OBJDIR)/yuv4.o: yuv4.c + $(OBJDIR)/yuv4toyuv.o: yuv4toyuv.c + $(OBJDIR)/yv12.o: yv12.c + $(OBJDIR)/jpeg/jcapimin.o: jpeg/jcapimin.c + $(OBJDIR)/jpeg/jcapistd.o: jpeg/jcapistd.c + $(OBJDIR)/jpeg/jctrans.o: jpeg/jctrans.c + $(OBJDIR)/jpeg/jcparam.o: jpeg/jcparam.c + $(OBJDIR)/jpeg/jdatadst.o: jpeg/jdatadst.c + $(OBJDIR)/jpeg/jcinit.o: jpeg/jcinit.c + $(OBJDIR)/jpeg/jcmaster.o: jpeg/jcmaster.c + $(OBJDIR)/jpeg/jcmarker.o: jpeg/jcmarker.c + $(OBJDIR)/jpeg/jcmainct.o: jpeg/jcmainct.c + $(OBJDIR)/jpeg/jcprepct.o: jpeg/jcprepct.c + $(OBJDIR)/jpeg/jccoefct.o: jpeg/jccoefct.c + $(OBJDIR)/jpeg/jccolor.o: jpeg/jccolor.c + $(OBJDIR)/jpeg/jcsample.o: jpeg/jcsample.c + $(OBJDIR)/jpeg/jchuff.o: jpeg/jchuff.c + $(OBJDIR)/jpeg/jcphuff.o: jpeg/jcphuff.c + $(OBJDIR)/jpeg/jcdctmgr.o: jpeg/jcdctmgr.c + $(OBJDIR)/jpeg/jfdctfst.o: jpeg/jfdctfst.c + $(OBJDIR)/jpeg/jfdctflt.o: jpeg/jfdctflt.c + $(OBJDIR)/jpeg/jfdctint.o: jpeg/jfdctint.c + $(OBJDIR)/jpeg/jdapimin.o: jpeg/jdapimin.c + $(OBJDIR)/jpeg/jdapistd.o: jpeg/jdapistd.c + $(OBJDIR)/jpeg/jdtrans.o: jpeg/jdtrans.c + $(OBJDIR)/jpeg/jdatasrc.o: jpeg/jdatasrc.c + $(OBJDIR)/jpeg/jdmaster.o: jpeg/jdmaster.c + $(OBJDIR)/jpeg/jdinput.o: jpeg/jdinput.c + $(OBJDIR)/jpeg/jdmarker.o: jpeg/jdmarker.c + $(OBJDIR)/jpeg/jdhuff.o: jpeg/jdhuff.c + $(OBJDIR)/jpeg/jdphuff.o: jpeg/jdphuff.c + $(OBJDIR)/jpeg/jdmainct.o: jpeg/jdmainct.c + $(OBJDIR)/jpeg/jdcoefct.o: jpeg/jdcoefct.c + $(OBJDIR)/jpeg/jdpostct.o: jpeg/jdpostct.c + $(OBJDIR)/jpeg/jddctmgr.o: jpeg/jddctmgr.c + $(OBJDIR)/jpeg/jidctfst.o: jpeg/jidctfst.c + $(OBJDIR)/jpeg/jidctflt.o: jpeg/jidctflt.c + $(OBJDIR)/jpeg/jidctint.o: jpeg/jidctint.c + $(OBJDIR)/jpeg/jidctred.o: jpeg/jidctred.c + $(OBJDIR)/jpeg/jdsample.o: jpeg/jdsample.c + $(OBJDIR)/jpeg/jdcolor.o: jpeg/jdcolor.c + $(OBJDIR)/jpeg/jquant1.o: jpeg/jquant1.c + $(OBJDIR)/jpeg/jquant2.o: jpeg/jquant2.c + $(OBJDIR)/jpeg/jdmerge.o: jpeg/jdmerge.c + $(OBJDIR)/jpeg/jcomapi.o: jpeg/jcomapi.c + $(OBJDIR)/jpeg/jutils.o: jpeg/jutils.c + $(OBJDIR)/jpeg/jerror.o: jpeg/jerror.c + $(OBJDIR)/jpeg/jmemmgr.o: jpeg/jmemmgr.c + $(OBJDIR)/jpeg/jmemnobs.o: jpeg/jmemnobs.c + $(OBJDIR)/libdv/YUY2.o: libdv/YUY2.c + $(OBJDIR)/libdv/YV12.o: libdv/YV12.c + $(OBJDIR)/libdv/audio.o: libdv/audio.c + $(OBJDIR)/libdv/bitstream.o: libdv/bitstream.c + $(OBJDIR)/libdv/dct.o: libdv/dct.c + $(OBJDIR)/libdv/dv.o: libdv/dv.c + $(OBJDIR)/libdv/encode.o: libdv/encode.c + $(OBJDIR)/libdv/mmx.o: libdv/mmx.c + $(OBJDIR)/libdv/enc_input.o: libdv/enc_input.c + $(OBJDIR)/libdv/headers.o: libdv/headers.c + $(OBJDIR)/libdv/idct_248.o: libdv/idct_248.c + $(OBJDIR)/libdv/parse.o: libdv/parse.c + $(OBJDIR)/libdv/place.o: libdv/place.c + $(OBJDIR)/libdv/quant.o: libdv/quant.c + $(OBJDIR)/libdv/rgb.o: libdv/rgb.c + $(OBJDIR)/libdv/util.o: libdv/util.c + $(OBJDIR)/libdv/vlc.o: libdv/vlc.c + $(OBJDIR)/libdv/weighting.o: libdv/weighting.c + $(OBJDIR)/libraw1394/src/eventloop.o: libraw1394/src/eventloop.c + $(OBJDIR)/libraw1394/src/fcp.o: libraw1394/src/fcp.c + $(OBJDIR)/libraw1394/src/iso.o: libraw1394/src/iso.c + $(OBJDIR)/libraw1394/src/main.o: libraw1394/src/main.c + $(OBJDIR)/libraw1394/src/readwrite.o: libraw1394/src/readwrite.c + + + + + # $(OBJDIR)/$(DECORE_DIR)/bitstream.o: $(DECORE_DIR)/bitstream.c + # $(OBJDIR)/$(DECORE_DIR)/colorspace.o: $(DECORE_DIR)/colorspace.c + # $(OBJDIR)/$(DECORE_DIR)/decoder.o: $(DECORE_DIR)/decoder.c + # $(OBJDIR)/$(DECORE_DIR)/decore2.o: $(DECORE_DIR)/decore2.c + # $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + # $(OBJDIR)/$(DECORE_DIR)/image.o: $(DECORE_DIR)/image.c + # $(OBJDIR)/$(DECORE_DIR)/mbcoding.o: $(DECORE_DIR)/mbcoding.c + # $(OBJDIR)/$(DECORE_DIR)/mbprediction.o: $(DECORE_DIR)/mbprediction.c + # $(OBJDIR)/$(DECORE_DIR)/quantize.o: $(DECORE_DIR)/quantize.c + # $(OBJDIR)/$(DECORE_DIR)/transfer.o: $(DECORE_DIR)/transfer.c + + $(OBJDIR)/$(DECORE_DIR)/debug.o: $(DECORE_DIR)/debug.c + $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o: $(DECORE_DIR)/basic_prediction.c + $(OBJDIR)/$(DECORE_DIR)/clearblock.o: $(DECORE_DIR)/clearblock.c + $(OBJDIR)/$(DECORE_DIR)/decore.o: $(DECORE_DIR)/decore.c + $(OBJDIR)/$(DECORE_DIR)/gen_draw.o: $(DECORE_DIR)/gen_draw.c + $(OBJDIR)/$(DECORE_DIR)/getbits.o: $(DECORE_DIR)/getbits.c + $(OBJDIR)/$(DECORE_DIR)/gen_usetime.o: $(DECORE_DIR)/gen_usetime.c + $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o: $(DECORE_DIR)/mp4_vars.c + $(OBJDIR)/$(DECORE_DIR)/mp4_block.o: $(DECORE_DIR)/mp4_block.c + $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o: $(DECORE_DIR)/mp4_decoder.c + $(OBJDIR)/$(DECORE_DIR)/mp4_header.o: $(DECORE_DIR)/mp4_header.c + $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o: $(DECORE_DIR)/mp4_iquant.c + $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o: $(DECORE_DIR)/mp4_mblock.c + $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o: $(DECORE_DIR)/mp4_picture.c + $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o: $(DECORE_DIR)/mp4_predict.c + $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o: $(DECORE_DIR)/mp4_recon.c + $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o: $(DECORE_DIR)/mp4_tables.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o: $(DECORE_DIR)/mp4_vld.c + $(OBJDIR)/$(DECORE_DIR)/store.o: $(DECORE_DIR)/store.c + $(OBJDIR)/$(DECORE_DIR)/postprocess.o: $(DECORE_DIR)/postprocess.c + $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o: $(DECORE_DIR)/yuv2rgb.c + $(OBJDIR)/$(DECORE_DIR)/transferidct.o: $(DECORE_DIR)/transferidct.c + + + #$(OBJDIR)/$(ENCORE_DIR)/bitstream.o: $(ENCORE_DIR)/bitstream.c + #$(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o: $(ENCORE_DIR)/colorspace/colorspace.c + #$(OBJDIR)/$(ENCORE_DIR)/encoder.o: $(ENCORE_DIR)/encoder.c + #$(OBJDIR)/$(ENCORE_DIR)/encore.o: $(ENCORE_DIR)/encore.c + #$(OBJDIR)/$(ENCORE_DIR)/image.o: $(ENCORE_DIR)/image.c + #$(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o: $(ENCORE_DIR)/mbcoding/mbcoding.c + #$(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o: $(ENCORE_DIR)/mbcoding/putvlc.c + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o: $(ENCORE_DIR)/mbmotionestcomp/compensate.c + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o: $(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.c + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/sad.o: $(ENCORE_DIR)/mbmotionestcomp/sad.c + #$(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o: $(ENCORE_DIR)/mbprediction/mbprediction.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o: $(ENCORE_DIR)/mbtransquant/dct.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o: $(ENCORE_DIR)/mbtransquant/fdct.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o: $(ENCORE_DIR)/mbtransquant/idct.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o: $(ENCORE_DIR)/mbtransquant/mbtransquant.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o: $(ENCORE_DIR)/mbtransquant/quantize.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o: $(ENCORE_DIR)/mbtransquant/transfer.c + #$(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o: $(ENCORE_DIR)/ratecontrol.c + #$(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o: $(ENCORE_DIR)/rgb2yuv.c + #$(OBJDIR)/$(ENCORE_DIR)/timer.o: $(ENCORE_DIR)/timer.c + + #$(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.o: $(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.o: $(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.asm + + + + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o: $(ENCORE_DIR)/bitstream.c + $(OBJDIR)/$(ENCORE_DIR)/encore.o: $(ENCORE_DIR)/encore.c + $(OBJDIR)/$(ENCORE_DIR)/mom_access.o: $(ENCORE_DIR)/mom_access.c + $(OBJDIR)/$(ENCORE_DIR)/mom_util.o: $(ENCORE_DIR)/mom_util.c + $(OBJDIR)/$(ENCORE_DIR)/mot_code.o: $(ENCORE_DIR)/mot_code.c + $(OBJDIR)/$(ENCORE_DIR)/mot_est_comp.o: $(ENCORE_DIR)/mot_est_comp.c + $(OBJDIR)/$(ENCORE_DIR)/mot_est_mb.o: $(ENCORE_DIR)/mot_est_mb.c + $(OBJDIR)/$(ENCORE_DIR)/mot_util.o: $(ENCORE_DIR)/mot_util.c + $(OBJDIR)/$(ENCORE_DIR)/putvlc.o: $(ENCORE_DIR)/putvlc.c + $(OBJDIR)/$(ENCORE_DIR)/rate_ctl.o: $(ENCORE_DIR)/rate_ctl.c + $(OBJDIR)/$(ENCORE_DIR)/text_bits.o: $(ENCORE_DIR)/text_bits.c + $(OBJDIR)/$(ENCORE_DIR)/text_code.o: $(ENCORE_DIR)/text_code.c + $(OBJDIR)/$(ENCORE_DIR)/text_code_mb.o: $(ENCORE_DIR)/text_code_mb.c + $(OBJDIR)/$(ENCORE_DIR)/text_dct.o: $(ENCORE_DIR)/text_dct.c + $(OBJDIR)/$(ENCORE_DIR)/vop_code.o: $(ENCORE_DIR)/vop_code.c + + + + + + + + + + + + $(OBJDIR)/$(OGG_DIR)/src/bitwise.o: $(OGG_DIR)/src/bitwise.c + $(OBJDIR)/$(OGG_DIR)/src/framing.o: $(OGG_DIR)/src/framing.c + $(OBJDIR)/$(VORBIS_DIR)/lib/analysis.o: $(VORBIS_DIR)/lib/analysis.c + $(OBJDIR)/$(VORBIS_DIR)/lib/bitbuffer.o: $(VORBIS_DIR)/lib/bitbuffer.c + $(OBJDIR)/$(VORBIS_DIR)/lib/block.o: $(VORBIS_DIR)/lib/block.c + $(OBJDIR)/$(VORBIS_DIR)/lib/codebook.o: $(VORBIS_DIR)/lib/codebook.c + $(OBJDIR)/$(VORBIS_DIR)/lib/envelope.o: $(VORBIS_DIR)/lib/envelope.c + $(OBJDIR)/$(VORBIS_DIR)/lib/floor0.o: $(VORBIS_DIR)/lib/floor0.c + $(OBJDIR)/$(VORBIS_DIR)/lib/floor1.o: $(VORBIS_DIR)/lib/floor1.c + $(OBJDIR)/$(VORBIS_DIR)/lib/info.o: $(VORBIS_DIR)/lib/info.c + $(OBJDIR)/$(VORBIS_DIR)/lib/lookup.o: $(VORBIS_DIR)/lib/lookup.c + $(OBJDIR)/$(VORBIS_DIR)/lib/lpc.o: $(VORBIS_DIR)/lib/lpc.c + $(OBJDIR)/$(VORBIS_DIR)/lib/lsp.o: $(VORBIS_DIR)/lib/lsp.c + $(OBJDIR)/$(VORBIS_DIR)/lib/mapping0.o: $(VORBIS_DIR)/lib/mapping0.c + $(OBJDIR)/$(VORBIS_DIR)/lib/mdct.o: $(VORBIS_DIR)/lib/mdct.c + $(OBJDIR)/$(VORBIS_DIR)/lib/psy.o: $(VORBIS_DIR)/lib/psy.c + $(OBJDIR)/$(VORBIS_DIR)/lib/registry.o: $(VORBIS_DIR)/lib/registry.c + $(OBJDIR)/$(VORBIS_DIR)/lib/res0.o: $(VORBIS_DIR)/lib/res0.c + $(OBJDIR)/$(VORBIS_DIR)/lib/sharedbook.o: $(VORBIS_DIR)/lib/sharedbook.c + $(OBJDIR)/$(VORBIS_DIR)/lib/smallft.o: $(VORBIS_DIR)/lib/smallft.c + $(OBJDIR)/$(VORBIS_DIR)/lib/synthesis.o: $(VORBIS_DIR)/lib/synthesis.c + $(OBJDIR)/$(VORBIS_DIR)/lib/time0.o: $(VORBIS_DIR)/lib/time0.c + $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisenc.o: $(VORBIS_DIR)/lib/vorbisenc.c + $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisfile.o: $(VORBIS_DIR)/lib/vorbisfile.c + $(OBJDIR)/$(VORBIS_DIR)/lib/window.o: $(VORBIS_DIR)/lib/window.c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -C2 -r -N bcast-2000c/quicktime/Makefile.2 bcast-2000c-mf3/quicktime/Makefile.2 *** bcast-2000c/quicktime/Makefile.2 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/Makefile.2 Thu Nov 29 11:12:33 2001 *************** *** 0 **** --- 1,527 ---- + OBJDIR := $(shell uname --machine) + USE_MMX = 0 + CC = gcc + HAVE_CFLAGS := $(shell if [ -n "$CFLAGS" ]; then echo y; fi ) + ENCORE_DIR := $(shell echo `expr encore*/src` ) + DECORE_DIR := $(shell echo `expr decore*/src` ) + + + + + + + DIRS = $(OBJDIR) \ + $(OBJDIR)/jpeg \ + $(OBJDIR)/libraw1394/src \ + $(OBJDIR)/libdv \ + $(OBJDIR)/$(DECORE_DIR) \ + $(OBJDIR)/$(ENCORE_DIR) \ + $(OBJDIR)/$(ENCORE_DIR)/att_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace \ + $(OBJDIR)/$(ENCORE_DIR)/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp \ + $(OBJDIR)/$(ENCORE_DIR)/mbprediction \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant + + + + ifeq ($(OBJDIR), i686) + USE_MMX = 1 + endif + + ifeq ($(OBJDIR), alpha) + ifneq ($(HAVE_CFLAGS), y) + CFLAGS = -O4 -arch ev67 -ieee -accept c99_keywords -gcc_messages + endif + endif + + + #CFLAGS += -g + CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + CFLAGS += -DHAVE_FIREWIRE + CFLAGS += -I. -Ijpeg -Ilibdv -Ilibraw1394 $(shell glib-config --cflags) + + + ifeq ($(USE_MMX), 1) + + + + + CFLAGS += -DARCH_X86 + + DVMMXOBJ = libdv/asmoff.h + + DVMMXOBJS = \ + $(OBJDIR)/libdv/dct_block_mmx.o \ + $(OBJDIR)/libdv/encode_x86.o \ + $(OBJDIR)/libdv/idct_block_mmx.o \ + $(OBJDIR)/libdv/vlc_x86.o \ + $(OBJDIR)/libdv/quant_x86.o \ + $(OBJDIR)/libdv/transpose_x86.o + + + + endif + + + + + + + + OBJS = \ + $(OBJDIR)/atom.o \ + $(OBJDIR)/cmodel_default.o \ + $(OBJDIR)/cmodel_yuv420p.o \ + $(OBJDIR)/cmodel_yuv422.o \ + $(OBJDIR)/codecs.o \ + $(OBJDIR)/colormodels.o \ + $(OBJDIR)/ctab.o \ + $(OBJDIR)/dinf.o \ + $(OBJDIR)/divx.o \ + $(OBJDIR)/dref.o \ + $(OBJDIR)/dv.o \ + $(OBJDIR)/edts.o \ + $(OBJDIR)/elst.o \ + $(OBJDIR)/graphics.o \ + $(OBJDIR)/hdlr.o \ + $(OBJDIR)/ima4.o \ + $(OBJDIR)/jpeg.o \ + $(OBJDIR)/jpeg_old.o \ + $(OBJDIR)/libdv.o \ + $(OBJDIR)/libmjpeg.o \ + $(OBJDIR)/matrix.o \ + $(OBJDIR)/mdat.o \ + $(OBJDIR)/mdhd.o \ + $(OBJDIR)/mdia.o \ + $(OBJDIR)/minf.o \ + $(OBJDIR)/moov.o \ + $(OBJDIR)/mvhd.o \ + $(OBJDIR)/plugin.o \ + $(OBJDIR)/qtpng.o \ + $(OBJDIR)/quicktime.o \ + $(OBJDIR)/raw.o \ + $(OBJDIR)/rawaudio.o \ + $(OBJDIR)/smhd.o \ + $(OBJDIR)/stbl.o \ + $(OBJDIR)/stco.o \ + $(OBJDIR)/stsc.o \ + $(OBJDIR)/stsd.o \ + $(OBJDIR)/stsdtable.o \ + $(OBJDIR)/stss.o \ + $(OBJDIR)/stsz.o \ + $(OBJDIR)/stts.o \ + $(OBJDIR)/tkhd.o \ + $(OBJDIR)/trak.o \ + $(OBJDIR)/twos.o \ + $(OBJDIR)/udta.o \ + $(OBJDIR)/ulaw.o \ + $(OBJDIR)/util.o \ + $(OBJDIR)/v308.o \ + $(OBJDIR)/v408.o \ + $(OBJDIR)/v410.o \ + $(OBJDIR)/vmhd.o \ + $(OBJDIR)/workarounds.o \ + $(OBJDIR)/yuv2.o \ + $(OBJDIR)/yuv4.o \ + $(OBJDIR)/yv12.o \ + $(OBJDIR)/jpeg/jcapimin.o \ + $(OBJDIR)/jpeg/jcapistd.o \ + $(OBJDIR)/jpeg/jctrans.o \ + $(OBJDIR)/jpeg/jcparam.o \ + $(OBJDIR)/jpeg/jdatadst.o \ + $(OBJDIR)/jpeg/jcinit.o \ + $(OBJDIR)/jpeg/jcmaster.o \ + $(OBJDIR)/jpeg/jcmarker.o \ + $(OBJDIR)/jpeg/jcmainct.o \ + $(OBJDIR)/jpeg/jcprepct.o \ + $(OBJDIR)/jpeg/jccoefct.o \ + $(OBJDIR)/jpeg/jccolor.o \ + $(OBJDIR)/jpeg/jcsample.o \ + $(OBJDIR)/jpeg/jchuff.o \ + $(OBJDIR)/jpeg/jcphuff.o \ + $(OBJDIR)/jpeg/jcdctmgr.o \ + $(OBJDIR)/jpeg/jfdctfst.o \ + $(OBJDIR)/jpeg/jfdctflt.o \ + $(OBJDIR)/jpeg/jfdctint.o \ + $(OBJDIR)/jpeg/jdapimin.o \ + $(OBJDIR)/jpeg/jdapistd.o \ + $(OBJDIR)/jpeg/jdtrans.o \ + $(OBJDIR)/jpeg/jdatasrc.o \ + $(OBJDIR)/jpeg/jdmaster.o \ + $(OBJDIR)/jpeg/jdinput.o \ + $(OBJDIR)/jpeg/jdmarker.o \ + $(OBJDIR)/jpeg/jdhuff.o \ + $(OBJDIR)/jpeg/jdphuff.o \ + $(OBJDIR)/jpeg/jdmainct.o \ + $(OBJDIR)/jpeg/jdcoefct.o \ + $(OBJDIR)/jpeg/jdpostct.o \ + $(OBJDIR)/jpeg/jddctmgr.o \ + $(OBJDIR)/jpeg/jidctfst.o \ + $(OBJDIR)/jpeg/jidctflt.o \ + $(OBJDIR)/jpeg/jidctint.o \ + $(OBJDIR)/jpeg/jidctred.o \ + $(OBJDIR)/jpeg/jdsample.o \ + $(OBJDIR)/jpeg/jdcolor.o \ + $(OBJDIR)/jpeg/jquant1.o \ + $(OBJDIR)/jpeg/jquant2.o \ + $(OBJDIR)/jpeg/jdmerge.o \ + $(OBJDIR)/jpeg/jcomapi.o \ + $(OBJDIR)/jpeg/jutils.o \ + $(OBJDIR)/jpeg/jerror.o \ + $(OBJDIR)/jpeg/jmemmgr.o \ + $(OBJDIR)/jpeg/jmemnobs.o \ + $(OBJDIR)/libdv/YUY2.o \ + $(OBJDIR)/libdv/YV12.o \ + $(OBJDIR)/libdv/audio.o \ + $(OBJDIR)/libdv/bitstream.o \ + $(OBJDIR)/libdv/dct.o \ + $(OBJDIR)/libdv/dv.o \ + $(OBJDIR)/libdv/encode.o \ + $(OBJDIR)/libdv/idct_248.o \ + $(OBJDIR)/libdv/parse.o \ + $(OBJDIR)/libdv/place.o \ + $(OBJDIR)/libdv/quant.o \ + $(OBJDIR)/libdv/rgb.o \ + $(OBJDIR)/libdv/util.o \ + $(OBJDIR)/libdv/vlc.o \ + $(OBJDIR)/libdv/weighting.o \ + $(OBJDIR)/libraw1394/src/eventloop.o \ + $(OBJDIR)/libraw1394/src/fcp.o \ + $(OBJDIR)/libraw1394/src/iso.o \ + $(OBJDIR)/libraw1394/src/main.o \ + $(OBJDIR)/libraw1394/src/readwrite.o \ + $(OBJDIR)/$(DECORE_DIR)/bitstream.o \ + $(OBJDIR)/$(DECORE_DIR)/colorspace.o \ + $(OBJDIR)/$(DECORE_DIR)/decoder.o \ + $(OBJDIR)/$(DECORE_DIR)/decore2.o \ + $(OBJDIR)/$(DECORE_DIR)/idct.o \ + $(OBJDIR)/$(DECORE_DIR)/image.o \ + $(OBJDIR)/$(DECORE_DIR)/mbcoding.o \ + $(OBJDIR)/$(DECORE_DIR)/mbprediction.o \ + $(OBJDIR)/$(DECORE_DIR)/quantize.o \ + $(OBJDIR)/$(DECORE_DIR)/transfer.o \ + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o \ + $(OBJDIR)/$(ENCORE_DIR)/encoder.o \ + $(OBJDIR)/$(ENCORE_DIR)/encore.o \ + $(OBJDIR)/$(ENCORE_DIR)/image.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/halfpel.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mad.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/sad.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o \ + $(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o \ + $(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o \ + $(OBJDIR)/$(ENCORE_DIR)/timer.o + + + + + + + + + + + + + + + OBJS += $(DECORE_OBJS) + + + OUTPUT = $(OBJDIR)/libquicktime.a + SHAREDOUTPUT = $(OBJDIR)/libquicktime.so + CFLAGS += -Ilibraw1394/src \ + -I$(DECORE_DIR) \ + -I$(ENCORE_DIR) \ + -DDECORE_DIR=\"$(DECORE_DIR)/decore2.h\" \ + -DENCORE_DIR=\"$(ENCORE_DIR)/encore2.h\" \ + -DLINUX + + + ifeq ($(HAVE_DECORE50), y) + CFLAGS += -DHAVE_DECORE50 + endif + + $(shell if ! test -d $(OBJDIR) \; then mkdir -p $(OBJDIR) \; fi ) + $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags) + $(shell echo $(OBJS) $(DVMMXOBJS) > $(OBJDIR)/objs) + + all: $(DIRS) $(OUTPUT) $(SHAREDOUTPUT) + + $(DIRS): + if ! test -d $@ ; then mkdir -p $@ ; fi + + $(OUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) + ar rcs $(OUTPUT) `cat $(OBJDIR)/objs` + + $(SHAREDOUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) + gcc -shared -o $(SHAREDOUTPUT) `cat $(OBJDIR)/objs` + + $(OBJDIR)/qtdump: $(OBJDIR)/dump.o $(OUTPUT) + $(CC) -o $(OBJDIR)/qtdump $(OBJDIR)/dump.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/make_streamable: $(OBJDIR)/make_streamable.o $(OUTPUT) + $(CC) -o $(OBJDIR)/make_streamable $(OBJDIR)/make_streamable.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/dechunk: $(OBJDIR)/dechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/dechunk $(OBJDIR)/dechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/rechunk: $(OBJDIR)/rechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/rechunk $(OBJDIR)/rechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/recover: $(OBJDIR)/recover.o $(OUTPUT) + $(CC) -o $(OBJDIR)/recover $(OBJDIR)/recover.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/yuv4toyuv: $(OBJDIR)/yuv4toyuv.o $(OUTPUT) + $(CC) -o $(OBJDIR)/yuv4toyuv $(OBJDIR)/yuv4toyuv.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/qtinfo: $(OBJDIR)/qtinfo.o + $(CC) -o $(OBJDIR)/qtinfo $(OBJDIR)/qtinfo.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + util: $(OBJDIR)/qtdump $(OBJDIR)/make_streamable $(OBJDIR)/qtinfo $(OBJDIR)/dechunk $(OBJDIR)/yuv4toyuv $(OBJDIR)/recover $(OBJDIR)/rechunk + + + clean: + rm -rf $(OBJDIR) + rm -rf .deps + + wc: + cat *.c *.h | wc + + backup: clean + cd .. && \ + tar zcvf quicktime.tar.gz quicktime + + install: + cp $(SHAREDOUTPUT) /usr/lib/libquicktime.so.1 + ln -sf /usr/lib/libquicktime.so.1 /usr/lib/libquicktime.so + cp quicktime.h qtprivate.h colormodels.h /usr/include + + $(OBJDIR)/dump.o \ + $(OBJDIR)/make_streamable.o \ + $(OBJDIR)/dechunk.o \ + $(OBJDIR)/recover.o \ + $(OBJDIR)/yuv4toyuv.o \ + $(OBJDIR)/qtinfo.o \ + $(OBJDIR)/rechunk.o \ + $(OBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.c) -o $*.o + + $(DVMMXOBJ): + $(CC) `cat $(OBJDIR)/c_flags` libdv/gasmoff.c -o $(OBJDIR)/gasmoff -lm + $(OBJDIR)/gasmoff > libdv/asmoff.h + + $(DVMMXOBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o + + $(OBJDIR)/atom.o: atom.c + $(OBJDIR)/cmodel_default.o: cmodel_default.c + $(OBJDIR)/cmodel_yuv420p.o: cmodel_yuv420p.c + $(OBJDIR)/cmodel_yuv422.o: cmodel_yuv422.c + $(OBJDIR)/codecs.o: codecs.c + $(OBJDIR)/colormodels.o: colormodels.c + $(OBJDIR)/ctab.o: ctab.c + $(OBJDIR)/dechunk.o: dechunk.c + $(OBJDIR)/dinf.o: dinf.c + $(OBJDIR)/divx.o: divx.c + $(OBJDIR)/dref.o: dref.c + $(OBJDIR)/dump.o: dump.c + $(OBJDIR)/dv.o: dv.c + $(OBJDIR)/edts.o: edts.c + $(OBJDIR)/elst.o: elst.c + $(OBJDIR)/graphics.o: graphics.c + $(OBJDIR)/hdlr.o: hdlr.c + $(OBJDIR)/ima4.o: ima4.c + $(OBJDIR)/jpeg.o: jpeg.c + $(OBJDIR)/jpeg_old.o: jpeg_old.c + $(OBJDIR)/libdv.o: libdv.c + $(OBJDIR)/libmjpeg.o: libmjpeg.c + $(OBJDIR)/make_streamable.o: make_streamable.c + $(OBJDIR)/matrix.o: matrix.c + $(OBJDIR)/mdat.o: mdat.c + $(OBJDIR)/mdhd.o: mdhd.c + $(OBJDIR)/mdia.o: mdia.c + $(OBJDIR)/minf.o: minf.c + $(OBJDIR)/moov.o: moov.c + $(OBJDIR)/mvhd.o: mvhd.c + $(OBJDIR)/plugin.o: plugin.c + $(OBJDIR)/qtinfo.o: qtinfo.c + $(OBJDIR)/qtpng.o: qtpng.c + $(OBJDIR)/quicktime.o: quicktime.c + $(OBJDIR)/raw.o: raw.c + $(OBJDIR)/rawaudio.o: rawaudio.c + $(OBJDIR)/rechunk.o: rechunk.c + $(OBJDIR)/recover.o: recover.c + $(OBJDIR)/smhd.o: smhd.c + $(OBJDIR)/stbl.o: stbl.c + $(OBJDIR)/stco.o: stco.c + $(OBJDIR)/stsc.o: stsc.c + $(OBJDIR)/stsd.o: stsd.c + $(OBJDIR)/stsdtable.o: stsdtable.c + $(OBJDIR)/stss.o: stss.c + $(OBJDIR)/stsz.o: stsz.c + $(OBJDIR)/stts.o: stts.c + $(OBJDIR)/tkhd.o: tkhd.c + $(OBJDIR)/trak.o: trak.c + $(OBJDIR)/twos.o: twos.c + $(OBJDIR)/udta.o: udta.c + $(OBJDIR)/ulaw.o: ulaw.c + $(OBJDIR)/util.o: util.c + $(OBJDIR)/v308.o: v308.c + $(OBJDIR)/v408.o: v408.c + $(OBJDIR)/v410.o: v410.c + $(OBJDIR)/vmhd.o: vmhd.c + $(OBJDIR)/workarounds.o: workarounds.c + $(OBJDIR)/yuv2.o: yuv2.c + $(OBJDIR)/yuv4.o: yuv4.c + $(OBJDIR)/yuv4toyuv.o: yuv4toyuv.c + $(OBJDIR)/yv12.o: yv12.c + $(OBJDIR)/jpeg/jcapimin.o: jpeg/jcapimin.c + $(OBJDIR)/jpeg/jcapistd.o: jpeg/jcapistd.c + $(OBJDIR)/jpeg/jctrans.o: jpeg/jctrans.c + $(OBJDIR)/jpeg/jcparam.o: jpeg/jcparam.c + $(OBJDIR)/jpeg/jdatadst.o: jpeg/jdatadst.c + $(OBJDIR)/jpeg/jcinit.o: jpeg/jcinit.c + $(OBJDIR)/jpeg/jcmaster.o: jpeg/jcmaster.c + $(OBJDIR)/jpeg/jcmarker.o: jpeg/jcmarker.c + $(OBJDIR)/jpeg/jcmainct.o: jpeg/jcmainct.c + $(OBJDIR)/jpeg/jcprepct.o: jpeg/jcprepct.c + $(OBJDIR)/jpeg/jccoefct.o: jpeg/jccoefct.c + $(OBJDIR)/jpeg/jccolor.o: jpeg/jccolor.c + $(OBJDIR)/jpeg/jcsample.o: jpeg/jcsample.c + $(OBJDIR)/jpeg/jchuff.o: jpeg/jchuff.c + $(OBJDIR)/jpeg/jcphuff.o: jpeg/jcphuff.c + $(OBJDIR)/jpeg/jcdctmgr.o: jpeg/jcdctmgr.c + $(OBJDIR)/jpeg/jfdctfst.o: jpeg/jfdctfst.c + $(OBJDIR)/jpeg/jfdctflt.o: jpeg/jfdctflt.c + $(OBJDIR)/jpeg/jfdctint.o: jpeg/jfdctint.c + $(OBJDIR)/jpeg/jdapimin.o: jpeg/jdapimin.c + $(OBJDIR)/jpeg/jdapistd.o: jpeg/jdapistd.c + $(OBJDIR)/jpeg/jdtrans.o: jpeg/jdtrans.c + $(OBJDIR)/jpeg/jdatasrc.o: jpeg/jdatasrc.c + $(OBJDIR)/jpeg/jdmaster.o: jpeg/jdmaster.c + $(OBJDIR)/jpeg/jdinput.o: jpeg/jdinput.c + $(OBJDIR)/jpeg/jdmarker.o: jpeg/jdmarker.c + $(OBJDIR)/jpeg/jdhuff.o: jpeg/jdhuff.c + $(OBJDIR)/jpeg/jdphuff.o: jpeg/jdphuff.c + $(OBJDIR)/jpeg/jdmainct.o: jpeg/jdmainct.c + $(OBJDIR)/jpeg/jdcoefct.o: jpeg/jdcoefct.c + $(OBJDIR)/jpeg/jdpostct.o: jpeg/jdpostct.c + $(OBJDIR)/jpeg/jddctmgr.o: jpeg/jddctmgr.c + $(OBJDIR)/jpeg/jidctfst.o: jpeg/jidctfst.c + $(OBJDIR)/jpeg/jidctflt.o: jpeg/jidctflt.c + $(OBJDIR)/jpeg/jidctint.o: jpeg/jidctint.c + $(OBJDIR)/jpeg/jidctred.o: jpeg/jidctred.c + $(OBJDIR)/jpeg/jdsample.o: jpeg/jdsample.c + $(OBJDIR)/jpeg/jdcolor.o: jpeg/jdcolor.c + $(OBJDIR)/jpeg/jquant1.o: jpeg/jquant1.c + $(OBJDIR)/jpeg/jquant2.o: jpeg/jquant2.c + $(OBJDIR)/jpeg/jdmerge.o: jpeg/jdmerge.c + $(OBJDIR)/jpeg/jcomapi.o: jpeg/jcomapi.c + $(OBJDIR)/jpeg/jutils.o: jpeg/jutils.c + $(OBJDIR)/jpeg/jerror.o: jpeg/jerror.c + $(OBJDIR)/jpeg/jmemmgr.o: jpeg/jmemmgr.c + $(OBJDIR)/jpeg/jmemnobs.o: jpeg/jmemnobs.c + $(OBJDIR)/libdv/YUY2.o: libdv/YUY2.c + $(OBJDIR)/libdv/YV12.o: libdv/YV12.c + $(OBJDIR)/libdv/audio.o: libdv/audio.c + $(OBJDIR)/libdv/bitstream.o: libdv/bitstream.c + $(OBJDIR)/libdv/dct.o: libdv/dct.c + $(OBJDIR)/libdv/dv.o: libdv/dv.c + $(OBJDIR)/libdv/encode.o: libdv/encode.c + $(OBJDIR)/libdv/idct_248.o: libdv/idct_248.c + $(OBJDIR)/libdv/parse.o: libdv/parse.c + $(OBJDIR)/libdv/place.o: libdv/place.c + $(OBJDIR)/libdv/quant.o: libdv/quant.c + $(OBJDIR)/libdv/rgb.o: libdv/rgb.c + $(OBJDIR)/libdv/util.o: libdv/util.c + $(OBJDIR)/libdv/vlc.o: libdv/vlc.c + $(OBJDIR)/libdv/weighting.o: libdv/weighting.c + $(OBJDIR)/libraw1394/src/eventloop.o: libraw1394/src/eventloop.c + $(OBJDIR)/libraw1394/src/fcp.o: libraw1394/src/fcp.c + $(OBJDIR)/libraw1394/src/iso.o: libraw1394/src/iso.c + $(OBJDIR)/libraw1394/src/main.o: libraw1394/src/main.c + $(OBJDIR)/libraw1394/src/readwrite.o: libraw1394/src/readwrite.c + $(OBJDIR)/$(DECORE_DIR)/bitstream.o: $(DECORE_DIR)/bitstream.c + $(OBJDIR)/$(DECORE_DIR)/colorspace.o: $(DECORE_DIR)/colorspace.c + $(OBJDIR)/$(DECORE_DIR)/decoder.o: $(DECORE_DIR)/decoder.c + $(OBJDIR)/$(DECORE_DIR)/decore2.o: $(DECORE_DIR)/decore2.c + $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + $(OBJDIR)/$(DECORE_DIR)/image.o: $(DECORE_DIR)/image.c + $(OBJDIR)/$(DECORE_DIR)/mbcoding.o: $(DECORE_DIR)/mbcoding.c + $(OBJDIR)/$(DECORE_DIR)/mbprediction.o: $(DECORE_DIR)/mbprediction.c + $(OBJDIR)/$(DECORE_DIR)/quantize.o: $(DECORE_DIR)/quantize.c + $(OBJDIR)/$(DECORE_DIR)/transfer.o: $(DECORE_DIR)/transfer.c + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o: $(ENCORE_DIR)/bitstream.c + $(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o: $(ENCORE_DIR)/colorspace/colorspace.c + $(OBJDIR)/$(ENCORE_DIR)/encoder.o: $(ENCORE_DIR)/encoder.c + $(OBJDIR)/$(ENCORE_DIR)/encore.o: $(ENCORE_DIR)/encore.c + $(OBJDIR)/$(ENCORE_DIR)/image.o: $(ENCORE_DIR)/image.c + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o: $(ENCORE_DIR)/mbcoding/mbcoding.c + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o: $(ENCORE_DIR)/mbcoding/putvlc.c + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o: $(ENCORE_DIR)/mbmotionestcomp/compensate.c + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o: $(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.c + $(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o: $(ENCORE_DIR)/mbprediction/mbprediction.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o: $(ENCORE_DIR)/mbtransquant/dct.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o: $(ENCORE_DIR)/mbtransquant/fdct.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o: $(ENCORE_DIR)/mbtransquant/idct.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o: $(ENCORE_DIR)/mbtransquant/mbtransquant.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o: $(ENCORE_DIR)/mbtransquant/quantize.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o: $(ENCORE_DIR)/mbtransquant/transfer.c + $(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o: $(ENCORE_DIR)/ratecontrol.c + $(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o: $(ENCORE_DIR)/rgb2yuv.c + $(OBJDIR)/$(ENCORE_DIR)/timer.o: $(ENCORE_DIR)/timer.c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -C2 -r -N bcast-2000c/quicktime/Makefile.50 bcast-2000c-mf3/quicktime/Makefile.50 *** bcast-2000c/quicktime/Makefile.50 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/Makefile.50 Fri Nov 30 02:09:09 2001 *************** *** 0 **** --- 1,478 ---- + OBJDIR := $(shell uname --machine) + USE_MMX = 0 + CC = gcc + HAVE_CFLAGS := $(shell if [ -n "$CFLAGS" ]; then echo y; fi ) + ENCORE_DIR := $(shell echo `expr encore*` ) + + DECORE_DIR := $(shell echo `expr decore*` ) + + + + + + + DIRS = $(OBJDIR) \ + $(OBJDIR)/jpeg \ + $(OBJDIR)/libraw1394/src \ + $(OBJDIR)/libdv \ + $(OBJDIR)/$(DECORE_DIR) \ + $(OBJDIR)/$(ENCORE_DIR) + + + + ifeq ($(OBJDIR), i686) + USE_MMX = 1 + endif + + ifeq ($(OBJDIR), alpha) + ifneq ($(HAVE_CFLAGS), y) + CFLAGS = -O4 -arch ev67 -ieee -accept c99_keywords -gcc_messages + endif + endif + + + #CFLAGS += -g + CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + CFLAGS += -DHAVE_FIREWIRE + CFLAGS += -I. -Ijpeg -Ilibdv -Ilibraw1394 $(shell glib-config --cflags) + + ifeq ($(USE_MMX), 1) + + + + + CFLAGS += -DARCH_X86 + + DVMMXOBJ = libdv/asmoff.h + + DVMMXOBJS = \ + $(OBJDIR)/libdv/dct_block_mmx.o \ + $(OBJDIR)/libdv/encode_x86.o \ + $(OBJDIR)/libdv/idct_block_mmx.o \ + $(OBJDIR)/libdv/vlc_x86.o \ + $(OBJDIR)/libdv/quant_x86.o \ + $(OBJDIR)/libdv/transpose_x86.o + + + + endif + + + + DECORE_OBJS = \ + $(OBJDIR)/$(DECORE_DIR)/debug.o \ + $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o \ + $(OBJDIR)/$(DECORE_DIR)/clearblock.o \ + $(OBJDIR)/$(DECORE_DIR)/decore.o \ + $(OBJDIR)/$(DECORE_DIR)/getbits.o \ + $(OBJDIR)/$(DECORE_DIR)/idct.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_block.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_header.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o \ + $(OBJDIR)/$(DECORE_DIR)/postprocess.o \ + $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o \ + $(OBJDIR)/$(DECORE_DIR)/transferidct.o + + + + + + OBJS = \ + $(OBJDIR)/atom.o \ + $(OBJDIR)/cmodel_default.o \ + $(OBJDIR)/cmodel_yuv420p.o \ + $(OBJDIR)/cmodel_yuv422.o \ + $(OBJDIR)/codecs.o \ + $(OBJDIR)/colormodels.o \ + $(OBJDIR)/ctab.o \ + $(OBJDIR)/dinf.o \ + $(OBJDIR)/divx.o \ + $(OBJDIR)/dref.o \ + $(OBJDIR)/dv.o \ + $(OBJDIR)/edts.o \ + $(OBJDIR)/elst.o \ + $(OBJDIR)/graphics.o \ + $(OBJDIR)/hdlr.o \ + $(OBJDIR)/ima4.o \ + $(OBJDIR)/jpeg.o \ + $(OBJDIR)/jpeg_old.o \ + $(OBJDIR)/libdv.o \ + $(OBJDIR)/libmjpeg.o \ + $(OBJDIR)/matrix.o \ + $(OBJDIR)/mdat.o \ + $(OBJDIR)/mdhd.o \ + $(OBJDIR)/mdia.o \ + $(OBJDIR)/minf.o \ + $(OBJDIR)/moov.o \ + $(OBJDIR)/mvhd.o \ + $(OBJDIR)/plugin.o \ + $(OBJDIR)/qtpng.o \ + $(OBJDIR)/quicktime.o \ + $(OBJDIR)/raw.o \ + $(OBJDIR)/rawaudio.o \ + $(OBJDIR)/smhd.o \ + $(OBJDIR)/stbl.o \ + $(OBJDIR)/stco.o \ + $(OBJDIR)/stsc.o \ + $(OBJDIR)/stsd.o \ + $(OBJDIR)/stsdtable.o \ + $(OBJDIR)/stss.o \ + $(OBJDIR)/stsz.o \ + $(OBJDIR)/stts.o \ + $(OBJDIR)/tkhd.o \ + $(OBJDIR)/trak.o \ + $(OBJDIR)/twos.o \ + $(OBJDIR)/udta.o \ + $(OBJDIR)/ulaw.o \ + $(OBJDIR)/util.o \ + $(OBJDIR)/v308.o \ + $(OBJDIR)/v408.o \ + $(OBJDIR)/v410.o \ + $(OBJDIR)/vmhd.o \ + $(OBJDIR)/workarounds.o \ + $(OBJDIR)/yuv2.o \ + $(OBJDIR)/yuv4.o \ + $(OBJDIR)/yv12.o \ + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o \ + $(OBJDIR)/$(ENCORE_DIR)/encore.o \ + $(OBJDIR)/$(ENCORE_DIR)/mom_access.o \ + $(OBJDIR)/$(ENCORE_DIR)/mom_util.o \ + $(OBJDIR)/$(ENCORE_DIR)/mot_code.o \ + $(OBJDIR)/$(ENCORE_DIR)/mot_est_comp.o \ + $(OBJDIR)/$(ENCORE_DIR)/mot_est_mb.o \ + $(OBJDIR)/$(ENCORE_DIR)/mot_util.o \ + $(OBJDIR)/$(ENCORE_DIR)/putvlc.o \ + $(OBJDIR)/$(ENCORE_DIR)/rate_ctl.o \ + $(OBJDIR)/$(ENCORE_DIR)/text_bits.o \ + $(OBJDIR)/$(ENCORE_DIR)/text_code.o \ + $(OBJDIR)/$(ENCORE_DIR)/text_code_mb.o \ + $(OBJDIR)/$(ENCORE_DIR)/text_dct.o \ + $(OBJDIR)/$(ENCORE_DIR)/vop_code.o \ + $(OBJDIR)/jpeg/jcapimin.o \ + $(OBJDIR)/jpeg/jcapistd.o \ + $(OBJDIR)/jpeg/jctrans.o \ + $(OBJDIR)/jpeg/jcparam.o \ + $(OBJDIR)/jpeg/jdatadst.o \ + $(OBJDIR)/jpeg/jcinit.o \ + $(OBJDIR)/jpeg/jcmaster.o \ + $(OBJDIR)/jpeg/jcmarker.o \ + $(OBJDIR)/jpeg/jcmainct.o \ + $(OBJDIR)/jpeg/jcprepct.o \ + $(OBJDIR)/jpeg/jccoefct.o \ + $(OBJDIR)/jpeg/jccolor.o \ + $(OBJDIR)/jpeg/jcsample.o \ + $(OBJDIR)/jpeg/jchuff.o \ + $(OBJDIR)/jpeg/jcphuff.o \ + $(OBJDIR)/jpeg/jcdctmgr.o \ + $(OBJDIR)/jpeg/jfdctfst.o \ + $(OBJDIR)/jpeg/jfdctflt.o \ + $(OBJDIR)/jpeg/jfdctint.o \ + $(OBJDIR)/jpeg/jdapimin.o \ + $(OBJDIR)/jpeg/jdapistd.o \ + $(OBJDIR)/jpeg/jdtrans.o \ + $(OBJDIR)/jpeg/jdatasrc.o \ + $(OBJDIR)/jpeg/jdmaster.o \ + $(OBJDIR)/jpeg/jdinput.o \ + $(OBJDIR)/jpeg/jdmarker.o \ + $(OBJDIR)/jpeg/jdhuff.o \ + $(OBJDIR)/jpeg/jdphuff.o \ + $(OBJDIR)/jpeg/jdmainct.o \ + $(OBJDIR)/jpeg/jdcoefct.o \ + $(OBJDIR)/jpeg/jdpostct.o \ + $(OBJDIR)/jpeg/jddctmgr.o \ + $(OBJDIR)/jpeg/jidctfst.o \ + $(OBJDIR)/jpeg/jidctflt.o \ + $(OBJDIR)/jpeg/jidctint.o \ + $(OBJDIR)/jpeg/jidctred.o \ + $(OBJDIR)/jpeg/jdsample.o \ + $(OBJDIR)/jpeg/jdcolor.o \ + $(OBJDIR)/jpeg/jquant1.o \ + $(OBJDIR)/jpeg/jquant2.o \ + $(OBJDIR)/jpeg/jdmerge.o \ + $(OBJDIR)/jpeg/jcomapi.o \ + $(OBJDIR)/jpeg/jutils.o \ + $(OBJDIR)/jpeg/jerror.o \ + $(OBJDIR)/jpeg/jmemmgr.o \ + $(OBJDIR)/jpeg/jmemnobs.o \ + $(OBJDIR)/libdv/YUY2.o \ + $(OBJDIR)/libdv/YV12.o \ + $(OBJDIR)/libdv/audio.o \ + $(OBJDIR)/libdv/bitstream.o \ + $(OBJDIR)/libdv/dct.o \ + $(OBJDIR)/libdv/dv.o \ + $(OBJDIR)/libdv/encode.o \ + $(OBJDIR)/libdv/idct_248.o \ + $(OBJDIR)/libdv/parse.o \ + $(OBJDIR)/libdv/place.o \ + $(OBJDIR)/libdv/quant.o \ + $(OBJDIR)/libdv/rgb.o \ + $(OBJDIR)/libdv/util.o \ + $(OBJDIR)/libdv/vlc.o \ + $(OBJDIR)/libdv/weighting.o \ + $(OBJDIR)/libraw1394/src/eventloop.o \ + $(OBJDIR)/libraw1394/src/fcp.o \ + $(OBJDIR)/libraw1394/src/iso.o \ + $(OBJDIR)/libraw1394/src/main.o \ + $(OBJDIR)/libraw1394/src/readwrite.o + + OBJS += $(DECORE_OBJS) + + + OUTPUT = $(OBJDIR)/libquicktime.a + SHAREDOUTPUT = $(OBJDIR)/libquicktime.so + CFLAGS += -Ilibraw1394/src \ + -I$(DECORE_DIR) \ + -I$(ENCORE_DIR) \ + -DDECORE_DIR=\"$(DECORE_DIR)/decore.h\" \ + -DENCORE_DIR=\"$(ENCORE_DIR)/encore.h\" \ + -D_DECORE + + + $(shell if ! test -d $(OBJDIR) \; then mkdir -p $(OBJDIR) \; fi ) + $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags) + $(shell echo $(OBJS) $(DVMMXOBJS) > $(OBJDIR)/objs) + + all: $(DIRS) $(OUTPUT) $(SHAREDOUTPUT) + + $(DIRS): + if ! test -d $@ ; then mkdir -p $@ ; fi + + $(OUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) + ar rcs $(OUTPUT) `cat $(OBJDIR)/objs` + + $(SHAREDOUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) + gcc -shared -o $(SHAREDOUTPUT) `cat $(OBJDIR)/objs` + + $(OBJDIR)/qtdump: $(OBJDIR)/dump.o $(OUTPUT) + $(CC) -o $(OBJDIR)/qtdump $(OBJDIR)/dump.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/make_streamable: $(OBJDIR)/make_streamable.o $(OUTPUT) + $(CC) -o $(OBJDIR)/make_streamable $(OBJDIR)/make_streamable.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/dechunk: $(OBJDIR)/dechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/dechunk $(OBJDIR)/dechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/rechunk: $(OBJDIR)/rechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/rechunk $(OBJDIR)/rechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/recover: $(OBJDIR)/recover.o $(OUTPUT) + $(CC) -o $(OBJDIR)/recover $(OBJDIR)/recover.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/yuv4toyuv: $(OBJDIR)/yuv4toyuv.o $(OUTPUT) + $(CC) -o $(OBJDIR)/yuv4toyuv $(OBJDIR)/yuv4toyuv.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/qtinfo: $(OBJDIR)/qtinfo.o + $(CC) -o $(OBJDIR)/qtinfo $(OBJDIR)/qtinfo.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + util: $(OBJDIR)/qtdump $(OBJDIR)/make_streamable $(OBJDIR)/qtinfo $(OBJDIR)/dechunk $(OBJDIR)/yuv4toyuv $(OBJDIR)/recover $(OBJDIR)/rechunk + + + clean: + rm -rf $(OBJDIR) + rm -rf .deps + + wc: + cat *.c *.h | wc + + backup: clean + cd .. && \ + tar zcvf quicktime.tar.gz quicktime + + install: + cp $(SHAREDOUTPUT) /usr/lib/libquicktime.so.1 + ln -sf /usr/lib/libquicktime.so.1 /usr/lib/libquicktime.so + cp quicktime.h qtprivate.h colormodels.h /usr/include + + $(OBJDIR)/dump.o \ + $(OBJDIR)/make_streamable.o \ + $(OBJDIR)/dechunk.o \ + $(OBJDIR)/recover.o \ + $(OBJDIR)/yuv4toyuv.o \ + $(OBJDIR)/qtinfo.o \ + $(OBJDIR)/rechunk.o \ + $(OBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.c) -o $*.o + + $(DVMMXOBJ): + $(CC) `cat $(OBJDIR)/c_flags` libdv/gasmoff.c -o $(OBJDIR)/gasmoff -lm + $(OBJDIR)/gasmoff > libdv/asmoff.h + + $(DVMMXOBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o + + $(OBJDIR)/atom.o: atom.c + $(OBJDIR)/cmodel_default.o: cmodel_default.c + $(OBJDIR)/cmodel_yuv420p.o: cmodel_yuv420p.c + $(OBJDIR)/cmodel_yuv422.o: cmodel_yuv422.c + $(OBJDIR)/codecs.o: codecs.c + $(OBJDIR)/colormodels.o: colormodels.c + $(OBJDIR)/ctab.o: ctab.c + $(OBJDIR)/dechunk.o: dechunk.c + $(OBJDIR)/dinf.o: dinf.c + $(OBJDIR)/divx.o: divx.c + $(OBJDIR)/dref.o: dref.c + $(OBJDIR)/dump.o: dump.c + $(OBJDIR)/dv.o: dv.c + $(OBJDIR)/edts.o: edts.c + $(OBJDIR)/elst.o: elst.c + $(OBJDIR)/graphics.o: graphics.c + $(OBJDIR)/hdlr.o: hdlr.c + $(OBJDIR)/ima4.o: ima4.c + $(OBJDIR)/jpeg.o: jpeg.c + $(OBJDIR)/jpeg_old.o: jpeg_old.c + $(OBJDIR)/libdv.o: libdv.c + $(OBJDIR)/libmjpeg.o: libmjpeg.c + $(OBJDIR)/make_streamable.o: make_streamable.c + $(OBJDIR)/matrix.o: matrix.c + $(OBJDIR)/mdat.o: mdat.c + $(OBJDIR)/mdhd.o: mdhd.c + $(OBJDIR)/mdia.o: mdia.c + $(OBJDIR)/minf.o: minf.c + $(OBJDIR)/moov.o: moov.c + $(OBJDIR)/mvhd.o: mvhd.c + $(OBJDIR)/plugin.o: plugin.c + $(OBJDIR)/qtinfo.o: qtinfo.c + $(OBJDIR)/qtpng.o: qtpng.c + $(OBJDIR)/quicktime.o: quicktime.c + $(OBJDIR)/raw.o: raw.c + $(OBJDIR)/rawaudio.o: rawaudio.c + $(OBJDIR)/rechunk.o: rechunk.c + $(OBJDIR)/recover.o: recover.c + $(OBJDIR)/smhd.o: smhd.c + $(OBJDIR)/stbl.o: stbl.c + $(OBJDIR)/stco.o: stco.c + $(OBJDIR)/stsc.o: stsc.c + $(OBJDIR)/stsd.o: stsd.c + $(OBJDIR)/stsdtable.o: stsdtable.c + $(OBJDIR)/stss.o: stss.c + $(OBJDIR)/stsz.o: stsz.c + $(OBJDIR)/stts.o: stts.c + $(OBJDIR)/tkhd.o: tkhd.c + $(OBJDIR)/trak.o: trak.c + $(OBJDIR)/twos.o: twos.c + $(OBJDIR)/udta.o: udta.c + $(OBJDIR)/ulaw.o: ulaw.c + $(OBJDIR)/util.o: util.c + $(OBJDIR)/v308.o: v308.c + $(OBJDIR)/v408.o: v408.c + $(OBJDIR)/v410.o: v410.c + $(OBJDIR)/vmhd.o: vmhd.c + $(OBJDIR)/workarounds.o: workarounds.c + $(OBJDIR)/yuv2.o: yuv2.c + $(OBJDIR)/yuv4.o: yuv4.c + $(OBJDIR)/yuv4toyuv.o: yuv4toyuv.c + $(OBJDIR)/yv12.o: yv12.c + $(OBJDIR)/$(DECORE_DIR)/debug.o: $(DECORE_DIR)/debug.c + $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o: $(DECORE_DIR)/basic_prediction.c + $(OBJDIR)/$(DECORE_DIR)/clearblock.o: $(DECORE_DIR)/clearblock.c + $(OBJDIR)/$(DECORE_DIR)/decore.o: $(DECORE_DIR)/decore.c + $(OBJDIR)/$(DECORE_DIR)/gen_draw.o: $(DECORE_DIR)/gen_draw.c + $(OBJDIR)/$(DECORE_DIR)/getbits.o: $(DECORE_DIR)/getbits.c + $(OBJDIR)/$(DECORE_DIR)/gen_usetime.o: $(DECORE_DIR)/gen_usetime.c + $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o: $(DECORE_DIR)/mp4_vars.c + $(OBJDIR)/$(DECORE_DIR)/mp4_block.o: $(DECORE_DIR)/mp4_block.c + $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o: $(DECORE_DIR)/mp4_decoder.c + $(OBJDIR)/$(DECORE_DIR)/mp4_header.o: $(DECORE_DIR)/mp4_header.c + $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o: $(DECORE_DIR)/mp4_iquant.c + $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o: $(DECORE_DIR)/mp4_mblock.c + $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o: $(DECORE_DIR)/mp4_picture.c + $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o: $(DECORE_DIR)/mp4_predict.c + $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o: $(DECORE_DIR)/mp4_recon.c + $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o: $(DECORE_DIR)/mp4_tables.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o: $(DECORE_DIR)/mp4_vld.c + $(OBJDIR)/$(DECORE_DIR)/store.o: $(DECORE_DIR)/store.c + $(OBJDIR)/$(DECORE_DIR)/postprocess.o: $(DECORE_DIR)/postprocess.c + $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o: $(DECORE_DIR)/yuv2rgb.c + $(OBJDIR)/$(DECORE_DIR)/transferidct.o: $(DECORE_DIR)/transferidct.c + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o: $(ENCORE_DIR)/bitstream.c + $(OBJDIR)/$(ENCORE_DIR)/encore.o: $(ENCORE_DIR)/encore.c + $(OBJDIR)/$(ENCORE_DIR)/intel_mmx/text_fdct_mmx.o: $(ENCORE_DIR)/intel_mmx/text_fdct_mmx.c + $(OBJDIR)/$(ENCORE_DIR)/intel_mmx/text_idct_mmx.o: $(ENCORE_DIR)/intel_mmx/text_idct_mmx.c + $(OBJDIR)/$(ENCORE_DIR)/mom_access.o: $(ENCORE_DIR)/mom_access.c + $(OBJDIR)/$(ENCORE_DIR)/mom_util.o: $(ENCORE_DIR)/mom_util.c + $(OBJDIR)/$(ENCORE_DIR)/mot_code.o: $(ENCORE_DIR)/mot_code.c + $(OBJDIR)/$(ENCORE_DIR)/mot_est_comp.o: $(ENCORE_DIR)/mot_est_comp.c + $(OBJDIR)/$(ENCORE_DIR)/mot_est_mb.o: $(ENCORE_DIR)/mot_est_mb.c + $(OBJDIR)/$(ENCORE_DIR)/mot_util.o: $(ENCORE_DIR)/mot_util.c + $(OBJDIR)/$(ENCORE_DIR)/putvlc.o: $(ENCORE_DIR)/putvlc.c + $(OBJDIR)/$(ENCORE_DIR)/rate_ctl.o: $(ENCORE_DIR)/rate_ctl.c + $(OBJDIR)/$(ENCORE_DIR)/text_bits.o: $(ENCORE_DIR)/text_bits.c + $(OBJDIR)/$(ENCORE_DIR)/text_code.o: $(ENCORE_DIR)/text_code.c + $(OBJDIR)/$(ENCORE_DIR)/text_code_mb.o: $(ENCORE_DIR)/text_code_mb.c + $(OBJDIR)/$(ENCORE_DIR)/text_dct.o: $(ENCORE_DIR)/text_dct.c + $(OBJDIR)/$(ENCORE_DIR)/vop_code.o: $(ENCORE_DIR)/vop_code.c + $(OBJDIR)/jpeg/jcapimin.o: jpeg/jcapimin.c + $(OBJDIR)/jpeg/jcapistd.o: jpeg/jcapistd.c + $(OBJDIR)/jpeg/jctrans.o: jpeg/jctrans.c + $(OBJDIR)/jpeg/jcparam.o: jpeg/jcparam.c + $(OBJDIR)/jpeg/jdatadst.o: jpeg/jdatadst.c + $(OBJDIR)/jpeg/jcinit.o: jpeg/jcinit.c + $(OBJDIR)/jpeg/jcmaster.o: jpeg/jcmaster.c + $(OBJDIR)/jpeg/jcmarker.o: jpeg/jcmarker.c + $(OBJDIR)/jpeg/jcmainct.o: jpeg/jcmainct.c + $(OBJDIR)/jpeg/jcprepct.o: jpeg/jcprepct.c + $(OBJDIR)/jpeg/jccoefct.o: jpeg/jccoefct.c + $(OBJDIR)/jpeg/jccolor.o: jpeg/jccolor.c + $(OBJDIR)/jpeg/jcsample.o: jpeg/jcsample.c + $(OBJDIR)/jpeg/jchuff.o: jpeg/jchuff.c + $(OBJDIR)/jpeg/jcphuff.o: jpeg/jcphuff.c + $(OBJDIR)/jpeg/jcdctmgr.o: jpeg/jcdctmgr.c + $(OBJDIR)/jpeg/jfdctfst.o: jpeg/jfdctfst.c + $(OBJDIR)/jpeg/jfdctflt.o: jpeg/jfdctflt.c + $(OBJDIR)/jpeg/jfdctint.o: jpeg/jfdctint.c + $(OBJDIR)/jpeg/jdapimin.o: jpeg/jdapimin.c + $(OBJDIR)/jpeg/jdapistd.o: jpeg/jdapistd.c + $(OBJDIR)/jpeg/jdtrans.o: jpeg/jdtrans.c + $(OBJDIR)/jpeg/jdatasrc.o: jpeg/jdatasrc.c + $(OBJDIR)/jpeg/jdmaster.o: jpeg/jdmaster.c + $(OBJDIR)/jpeg/jdinput.o: jpeg/jdinput.c + $(OBJDIR)/jpeg/jdmarker.o: jpeg/jdmarker.c + $(OBJDIR)/jpeg/jdhuff.o: jpeg/jdhuff.c + $(OBJDIR)/jpeg/jdphuff.o: jpeg/jdphuff.c + $(OBJDIR)/jpeg/jdmainct.o: jpeg/jdmainct.c + $(OBJDIR)/jpeg/jdcoefct.o: jpeg/jdcoefct.c + $(OBJDIR)/jpeg/jdpostct.o: jpeg/jdpostct.c + $(OBJDIR)/jpeg/jddctmgr.o: jpeg/jddctmgr.c + $(OBJDIR)/jpeg/jidctfst.o: jpeg/jidctfst.c + $(OBJDIR)/jpeg/jidctflt.o: jpeg/jidctflt.c + $(OBJDIR)/jpeg/jidctint.o: jpeg/jidctint.c + $(OBJDIR)/jpeg/jidctred.o: jpeg/jidctred.c + $(OBJDIR)/jpeg/jdsample.o: jpeg/jdsample.c + $(OBJDIR)/jpeg/jdcolor.o: jpeg/jdcolor.c + $(OBJDIR)/jpeg/jquant1.o: jpeg/jquant1.c + $(OBJDIR)/jpeg/jquant2.o: jpeg/jquant2.c + $(OBJDIR)/jpeg/jdmerge.o: jpeg/jdmerge.c + $(OBJDIR)/jpeg/jcomapi.o: jpeg/jcomapi.c + $(OBJDIR)/jpeg/jutils.o: jpeg/jutils.c + $(OBJDIR)/jpeg/jerror.o: jpeg/jerror.c + $(OBJDIR)/jpeg/jmemmgr.o: jpeg/jmemmgr.c + $(OBJDIR)/jpeg/jmemnobs.o: jpeg/jmemnobs.c + $(OBJDIR)/libdv/YUY2.o: libdv/YUY2.c + $(OBJDIR)/libdv/YV12.o: libdv/YV12.c + $(OBJDIR)/libdv/audio.o: libdv/audio.c + $(OBJDIR)/libdv/bitstream.o: libdv/bitstream.c + $(OBJDIR)/libdv/dct.o: libdv/dct.c + $(OBJDIR)/libdv/dv.o: libdv/dv.c + $(OBJDIR)/libdv/encode.o: libdv/encode.c + $(OBJDIR)/libdv/idct_248.o: libdv/idct_248.c + $(OBJDIR)/libdv/parse.o: libdv/parse.c + $(OBJDIR)/libdv/place.o: libdv/place.c + $(OBJDIR)/libdv/quant.o: libdv/quant.c + $(OBJDIR)/libdv/rgb.o: libdv/rgb.c + $(OBJDIR)/libdv/util.o: libdv/util.c + $(OBJDIR)/libdv/vlc.o: libdv/vlc.c + $(OBJDIR)/libdv/weighting.o: libdv/weighting.c + $(OBJDIR)/libraw1394/src/eventloop.o: libraw1394/src/eventloop.c + $(OBJDIR)/libraw1394/src/fcp.o: libraw1394/src/fcp.c + $(OBJDIR)/libraw1394/src/iso.o: libraw1394/src/iso.c + $(OBJDIR)/libraw1394/src/main.o: libraw1394/src/main.c + $(OBJDIR)/libraw1394/src/readwrite.o: libraw1394/src/readwrite.c diff -C2 -r -N bcast-2000c/quicktime/Makefile.encore2 bcast-2000c-mf3/quicktime/Makefile.encore2 *** bcast-2000c/quicktime/Makefile.encore2 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/Makefile.encore2 Sat Dec 8 03:49:19 2001 *************** *** 0 **** --- 1,698 ---- + OBJDIR := $(shell uname --machine) + USE_MMX = 0 + CC = gcc + HAVE_CFLAGS := $(shell if [ -n "$CFLAGS" ]; then echo y; fi ) + ENCORE_DIR := encore2/src + #DECORE_DIR := decore2/src + #ENCORE_DIR := encore50 + DECORE_DIR := decore50 + ENCORE_INCLUDE := $(ENCORE_DIR)/encore2.h + DECORE_INCLUDE := $(DECORE_DIR)/decore.h + OGG_DIR := $(shell expr libogg* ) + VORBIS_DIR := $(shell expr libvorbis* ) + + + + + DIRS = $(OBJDIR) \ + $(OBJDIR)/jpeg \ + $(OBJDIR)/libraw1394/src \ + $(OBJDIR)/libdv + + + DIRS += \ + $(OBJDIR)/$(DECORE_DIR) + + DIRS += \ + $(OBJDIR)/$(ENCORE_DIR) \ + $(OBJDIR)/$(ENCORE_DIR)/att_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/mbprediction \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx + + DIRS += \ + $(OBJDIR)/$(OGG_DIR)/src \ + $(OBJDIR)/$(VORBIS_DIR)/lib + + + + + + + + ifeq ($(OBJDIR), i686) + USE_MMX = 1 + endif + + + + + + + + ifeq ($(OBJDIR), alpha) + ifneq ($(HAVE_CFLAGS), y) + CFLAGS = -O4 -arch ev67 -ieee -accept c99_keywords -gcc_messages + endif + endif + + + + + + + + + #CFLAGS += -g + CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + CFLAGS += -DHAVE_FIREWIRE + CFLAGS += -I. -Ijpeg -Ilibdv -Ilibraw1394 $(shell glib-config --cflags) + + ifeq ($(USE_MMX), 1) + + + + + CFLAGS += -DARCH_X86 + + DVMMXOBJ = libdv/asmoff.h + + DVMMXOBJS = \ + $(OBJDIR)/libdv/dct_block_mmx.o \ + $(OBJDIR)/libdv/encode_x86.o \ + $(OBJDIR)/libdv/idct_block_mmx.o \ + $(OBJDIR)/libdv/vlc_x86.o \ + $(OBJDIR)/libdv/quant_x86.o \ + $(OBJDIR)/libdv/transpose_x86.o + + + + + endif + + + + + + + + + OBJS = \ + $(OBJDIR)/atom.o \ + $(OBJDIR)/cmodel_default.o \ + $(OBJDIR)/cmodel_yuv420p.o \ + $(OBJDIR)/cmodel_yuv422.o \ + $(OBJDIR)/codecs.o \ + $(OBJDIR)/colormodels.o \ + $(OBJDIR)/ctab.o \ + $(OBJDIR)/dinf.o \ + $(OBJDIR)/divx.o \ + $(OBJDIR)/dref.o \ + $(OBJDIR)/dv.o \ + $(OBJDIR)/edts.o \ + $(OBJDIR)/elst.o \ + $(OBJDIR)/graphics.o \ + $(OBJDIR)/hdlr.o \ + $(OBJDIR)/ima4.o \ + $(OBJDIR)/jpeg.o \ + $(OBJDIR)/jpeg_old.o \ + $(OBJDIR)/libdv.o \ + $(OBJDIR)/libmjpeg.o \ + $(OBJDIR)/matrix.o \ + $(OBJDIR)/mdat.o \ + $(OBJDIR)/mdhd.o \ + $(OBJDIR)/mdia.o \ + $(OBJDIR)/minf.o \ + $(OBJDIR)/moov.o \ + $(OBJDIR)/mvhd.o \ + $(OBJDIR)/plugin.o \ + $(OBJDIR)/qtpng.o \ + $(OBJDIR)/quicktime.o \ + $(OBJDIR)/raw.o \ + $(OBJDIR)/rawaudio.o \ + $(OBJDIR)/smhd.o \ + $(OBJDIR)/stbl.o \ + $(OBJDIR)/stco.o \ + $(OBJDIR)/stsc.o \ + $(OBJDIR)/stsd.o \ + $(OBJDIR)/stsdtable.o \ + $(OBJDIR)/stss.o \ + $(OBJDIR)/stsz.o \ + $(OBJDIR)/stts.o \ + $(OBJDIR)/tkhd.o \ + $(OBJDIR)/trak.o \ + $(OBJDIR)/twos.o \ + $(OBJDIR)/udta.o \ + $(OBJDIR)/ulaw.o \ + $(OBJDIR)/util.o \ + $(OBJDIR)/v308.o \ + $(OBJDIR)/v408.o \ + $(OBJDIR)/v410.o \ + $(OBJDIR)/vmhd.o \ + $(OBJDIR)/vorbis.o \ + $(OBJDIR)/workarounds.o \ + $(OBJDIR)/yuv2.o \ + $(OBJDIR)/yuv4.o \ + $(OBJDIR)/yv12.o \ + $(OBJDIR)/jpeg/jcapimin.o \ + $(OBJDIR)/jpeg/jcapistd.o \ + $(OBJDIR)/jpeg/jctrans.o \ + $(OBJDIR)/jpeg/jcparam.o \ + $(OBJDIR)/jpeg/jdatadst.o \ + $(OBJDIR)/jpeg/jcinit.o \ + $(OBJDIR)/jpeg/jcmaster.o \ + $(OBJDIR)/jpeg/jcmarker.o \ + $(OBJDIR)/jpeg/jcmainct.o \ + $(OBJDIR)/jpeg/jcprepct.o \ + $(OBJDIR)/jpeg/jccoefct.o \ + $(OBJDIR)/jpeg/jccolor.o \ + $(OBJDIR)/jpeg/jcsample.o \ + $(OBJDIR)/jpeg/jchuff.o \ + $(OBJDIR)/jpeg/jcphuff.o \ + $(OBJDIR)/jpeg/jcdctmgr.o \ + $(OBJDIR)/jpeg/jfdctfst.o \ + $(OBJDIR)/jpeg/jfdctflt.o \ + $(OBJDIR)/jpeg/jfdctint.o \ + $(OBJDIR)/jpeg/jdapimin.o \ + $(OBJDIR)/jpeg/jdapistd.o \ + $(OBJDIR)/jpeg/jdtrans.o \ + $(OBJDIR)/jpeg/jdatasrc.o \ + $(OBJDIR)/jpeg/jdmaster.o \ + $(OBJDIR)/jpeg/jdinput.o \ + $(OBJDIR)/jpeg/jdmarker.o \ + $(OBJDIR)/jpeg/jdhuff.o \ + $(OBJDIR)/jpeg/jdphuff.o \ + $(OBJDIR)/jpeg/jdmainct.o \ + $(OBJDIR)/jpeg/jdcoefct.o \ + $(OBJDIR)/jpeg/jdpostct.o \ + $(OBJDIR)/jpeg/jddctmgr.o \ + $(OBJDIR)/jpeg/jidctfst.o \ + $(OBJDIR)/jpeg/jidctflt.o \ + $(OBJDIR)/jpeg/jidctint.o \ + $(OBJDIR)/jpeg/jidctred.o \ + $(OBJDIR)/jpeg/jdsample.o \ + $(OBJDIR)/jpeg/jdcolor.o \ + $(OBJDIR)/jpeg/jquant1.o \ + $(OBJDIR)/jpeg/jquant2.o \ + $(OBJDIR)/jpeg/jdmerge.o \ + $(OBJDIR)/jpeg/jcomapi.o \ + $(OBJDIR)/jpeg/jutils.o \ + $(OBJDIR)/jpeg/jerror.o \ + $(OBJDIR)/jpeg/jmemmgr.o \ + $(OBJDIR)/jpeg/jmemnobs.o \ + $(OBJDIR)/libraw1394/src/eventloop.o \ + $(OBJDIR)/libraw1394/src/fcp.o \ + $(OBJDIR)/libraw1394/src/iso.o \ + $(OBJDIR)/libraw1394/src/main.o \ + $(OBJDIR)/libraw1394/src/readwrite.o + + + + + + + + + + + OBJS += \ + $(OBJDIR)/libdv/YUY2.o \ + $(OBJDIR)/libdv/YV12.o \ + $(OBJDIR)/libdv/audio.o \ + $(OBJDIR)/libdv/bitstream.o \ + $(OBJDIR)/libdv/dct.o \ + $(OBJDIR)/libdv/dv.o \ + $(OBJDIR)/libdv/encode.o \ + $(OBJDIR)/libdv/enc_input.o \ + $(OBJDIR)/libdv/headers.o \ + $(OBJDIR)/libdv/idct_248.o \ + $(OBJDIR)/libdv/parse.o \ + $(OBJDIR)/libdv/place.o \ + $(OBJDIR)/libdv/quant.o \ + $(OBJDIR)/libdv/rgb.o \ + $(OBJDIR)/libdv/util.o \ + $(OBJDIR)/libdv/vlc.o \ + $(OBJDIR)/libdv/weighting.o + + # OBJS += \ + # $(OBJDIR)/$(DECORE_DIR)/bitstream.o \ + # $(OBJDIR)/$(DECORE_DIR)/colorspace.o \ + # $(OBJDIR)/$(DECORE_DIR)/decoder.o \ + # $(OBJDIR)/$(DECORE_DIR)/decore2.o \ + # $(OBJDIR)/$(DECORE_DIR)/idct.o \ + # $(OBJDIR)/$(DECORE_DIR)/image.o \ + # $(OBJDIR)/$(DECORE_DIR)/mbcoding.o \ + # $(OBJDIR)/$(DECORE_DIR)/mbprediction.o \ + # $(OBJDIR)/$(DECORE_DIR)/quantize.o \ + # $(OBJDIR)/$(DECORE_DIR)/transfer.o + + OBJS += \ + $(OBJDIR)/$(DECORE_DIR)/debug.o \ + $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o \ + $(OBJDIR)/$(DECORE_DIR)/clearblock.o \ + $(OBJDIR)/$(DECORE_DIR)/decore.o \ + $(OBJDIR)/$(DECORE_DIR)/getbits.o \ + $(OBJDIR)/$(DECORE_DIR)/idct.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_block.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_header.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o \ + $(OBJDIR)/$(DECORE_DIR)/postprocess.o \ + $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o \ + $(OBJDIR)/$(DECORE_DIR)/transferidct.o + + OBJS += \ + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o \ + $(OBJDIR)/$(ENCORE_DIR)/encoder.o \ + $(OBJDIR)/$(ENCORE_DIR)/encore.o \ + $(OBJDIR)/$(ENCORE_DIR)/image.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/halfpel.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mad.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/sad.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o \ + $(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o \ + $(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o \ + $(OBJDIR)/$(ENCORE_DIR)/timer.o + + + + + + ifeq ($(USE_MMX), 1) + + + #CFLAGS += -D_MMX_ + ENCOREMMX_OBJS= \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.o \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.o + + + + endif + + + + + OBJS += \ + $(OBJDIR)/$(OGG_DIR)/src/bitwise.o \ + $(OBJDIR)/$(OGG_DIR)/src/framing.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/analysis.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/bitbuffer.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/block.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/codebook.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/envelope.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/floor0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/floor1.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/info.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/lookup.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/lpc.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/lsp.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/mapping0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/mdct.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/psy.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/registry.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/res0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/sharedbook.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/smallft.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/synthesis.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/time0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisenc.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisfile.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/window.o + + + + + + + + + + + OUTPUT = $(OBJDIR)/libquicktime.a + SHAREDOUTPUT = $(OBJDIR)/libquicktime.so + CFLAGS += -Ilibraw1394/src + + CFLAGS += \ + -I$(DECORE_DIR) \ + -I$(ENCORE_DIR) \ + -DDECORE_INCLUDE=\"$(DECORE_INCLUDE)\" \ + -DENCORE_INCLUDE=\"$(ENCORE_INCLUDE)\" \ + -DLINUX \ + -D_DECORE + + CFLAGS += \ + -I$(OGG_DIR)/include \ + -I$(VORBIS_DIR)/include \ + -I$(VORBIS_DIR)/lib \ + -DHAVE_ALLOCA_H=1 \ + -DHAVE_ALLOCA=1 \ + -DHAVE_SQRTF=1 \ + -DHAVE_LOGF=1 \ + -DHAVE_EXPF=1 \ + -DHAVE_ACOSF=1 \ + -DHAVE_ATANF=1 \ + -DHAVE_FREXPF=1 \ + -DHAVE_RINTF=1 \ + -DUSE_MEMORY_H \ + -D_REENTRANT \ + -DHAVE_ALLOCA=1 \ + -DHAVE_ALLOCA_H=1 + + $(shell if ! test -d $(OBJDIR) \; then mkdir -p $(OBJDIR) \; fi ) + $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags) + $(shell echo $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) > $(OBJDIR)/objs) + + all: $(DIRS) $(OUTPUT) $(SHAREDOUTPUT) + + $(DIRS): + if ! test -d $@ ; then mkdir -p $@ ; fi + + $(OUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) + ar rcs $(OUTPUT) `cat $(OBJDIR)/objs` + + $(SHAREDOUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) + gcc -shared -o $(SHAREDOUTPUT) `cat $(OBJDIR)/objs` + + $(OBJDIR)/qtdump: $(OBJDIR)/dump.o $(OUTPUT) + $(CC) -o $(OBJDIR)/qtdump $(OBJDIR)/dump.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/make_streamable: $(OBJDIR)/make_streamable.o $(OUTPUT) + $(CC) -o $(OBJDIR)/make_streamable $(OBJDIR)/make_streamable.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/dechunk: $(OBJDIR)/dechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/dechunk $(OBJDIR)/dechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/rechunk: $(OBJDIR)/rechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/rechunk $(OBJDIR)/rechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/recover: $(OBJDIR)/recover.o $(OUTPUT) + $(CC) -o $(OBJDIR)/recover $(OBJDIR)/recover.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/yuv4toyuv: $(OBJDIR)/yuv4toyuv.o $(OUTPUT) + $(CC) -o $(OBJDIR)/yuv4toyuv $(OBJDIR)/yuv4toyuv.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/qtinfo: $(OBJDIR)/qtinfo.o + $(CC) -o $(OBJDIR)/qtinfo $(OBJDIR)/qtinfo.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + util: $(OBJDIR)/qtdump $(OBJDIR)/make_streamable $(OBJDIR)/qtinfo $(OBJDIR)/dechunk $(OBJDIR)/yuv4toyuv $(OBJDIR)/recover $(OBJDIR)/rechunk + + + clean: + rm -rf $(OBJDIR) + rm -rf .deps + + wc: + cat *.c *.h | wc + + backup: clean + cd .. && \ + tar zcvf quicktime.tar.gz quicktime + + install: + cp $(SHAREDOUTPUT) /usr/lib/libquicktime.so.1 + ln -sf /usr/lib/libquicktime.so.1 /usr/lib/libquicktime.so + cp quicktime.h qtprivate.h colormodels.h /usr/include + + $(OBJDIR)/dump.o \ + $(OBJDIR)/make_streamable.o \ + $(OBJDIR)/dechunk.o \ + $(OBJDIR)/recover.o \ + $(OBJDIR)/yuv4toyuv.o \ + $(OBJDIR)/qtinfo.o \ + $(OBJDIR)/rechunk.o \ + $(OBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.c) -o $*.o + + + + $(DVMMXOBJ): + $(CC) `cat $(OBJDIR)/c_flags` libdv/gasmoff.c -o $(OBJDIR)/gasmoff -lm + $(OBJDIR)/gasmoff > libdv/asmoff.h + + $(DVMMXOBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o + + $(ENCOREMMX_OBJS): + nasm -f elf $(subst $(OBJDIR)/,, $*.asm) -o $*.o + + + + + $(OBJDIR)/atom.o: atom.c + $(OBJDIR)/cmodel_default.o: cmodel_default.c + $(OBJDIR)/cmodel_yuv420p.o: cmodel_yuv420p.c + $(OBJDIR)/cmodel_yuv422.o: cmodel_yuv422.c + $(OBJDIR)/codecs.o: codecs.c + $(OBJDIR)/colormodels.o: colormodels.c + $(OBJDIR)/ctab.o: ctab.c + $(OBJDIR)/dechunk.o: dechunk.c + $(OBJDIR)/dinf.o: dinf.c + $(OBJDIR)/divx.o: divx.c + $(OBJDIR)/dref.o: dref.c + $(OBJDIR)/dump.o: dump.c + $(OBJDIR)/dv.o: dv.c + $(OBJDIR)/edts.o: edts.c + $(OBJDIR)/elst.o: elst.c + $(OBJDIR)/graphics.o: graphics.c + $(OBJDIR)/hdlr.o: hdlr.c + $(OBJDIR)/ima4.o: ima4.c + $(OBJDIR)/jpeg.o: jpeg.c + $(OBJDIR)/jpeg_old.o: jpeg_old.c + $(OBJDIR)/libdv.o: libdv.c + $(OBJDIR)/libmjpeg.o: libmjpeg.c + $(OBJDIR)/make_streamable.o: make_streamable.c + $(OBJDIR)/matrix.o: matrix.c + $(OBJDIR)/mdat.o: mdat.c + $(OBJDIR)/mdhd.o: mdhd.c + $(OBJDIR)/mdia.o: mdia.c + $(OBJDIR)/minf.o: minf.c + $(OBJDIR)/moov.o: moov.c + $(OBJDIR)/mvhd.o: mvhd.c + $(OBJDIR)/plugin.o: plugin.c + $(OBJDIR)/qtinfo.o: qtinfo.c + $(OBJDIR)/qtpng.o: qtpng.c + $(OBJDIR)/quicktime.o: quicktime.c + $(OBJDIR)/raw.o: raw.c + $(OBJDIR)/rawaudio.o: rawaudio.c + $(OBJDIR)/rechunk.o: rechunk.c + $(OBJDIR)/recover.o: recover.c + $(OBJDIR)/smhd.o: smhd.c + $(OBJDIR)/stbl.o: stbl.c + $(OBJDIR)/stco.o: stco.c + $(OBJDIR)/stsc.o: stsc.c + $(OBJDIR)/stsd.o: stsd.c + $(OBJDIR)/stsdtable.o: stsdtable.c + $(OBJDIR)/stss.o: stss.c + $(OBJDIR)/stsz.o: stsz.c + $(OBJDIR)/stts.o: stts.c + $(OBJDIR)/tkhd.o: tkhd.c + $(OBJDIR)/trak.o: trak.c + $(OBJDIR)/twos.o: twos.c + $(OBJDIR)/udta.o: udta.c + $(OBJDIR)/ulaw.o: ulaw.c + $(OBJDIR)/util.o: util.c + $(OBJDIR)/v308.o: v308.c + $(OBJDIR)/v408.o: v408.c + $(OBJDIR)/v410.o: v410.c + $(OBJDIR)/vmhd.o: vmhd.c + $(OBJDIR)/vorbis.o: vorbis.c + $(OBJDIR)/workarounds.o: workarounds.c + $(OBJDIR)/yuv2.o: yuv2.c + $(OBJDIR)/yuv4.o: yuv4.c + $(OBJDIR)/yuv4toyuv.o: yuv4toyuv.c + $(OBJDIR)/yv12.o: yv12.c + $(OBJDIR)/jpeg/jcapimin.o: jpeg/jcapimin.c + $(OBJDIR)/jpeg/jcapistd.o: jpeg/jcapistd.c + $(OBJDIR)/jpeg/jctrans.o: jpeg/jctrans.c + $(OBJDIR)/jpeg/jcparam.o: jpeg/jcparam.c + $(OBJDIR)/jpeg/jdatadst.o: jpeg/jdatadst.c + $(OBJDIR)/jpeg/jcinit.o: jpeg/jcinit.c + $(OBJDIR)/jpeg/jcmaster.o: jpeg/jcmaster.c + $(OBJDIR)/jpeg/jcmarker.o: jpeg/jcmarker.c + $(OBJDIR)/jpeg/jcmainct.o: jpeg/jcmainct.c + $(OBJDIR)/jpeg/jcprepct.o: jpeg/jcprepct.c + $(OBJDIR)/jpeg/jccoefct.o: jpeg/jccoefct.c + $(OBJDIR)/jpeg/jccolor.o: jpeg/jccolor.c + $(OBJDIR)/jpeg/jcsample.o: jpeg/jcsample.c + $(OBJDIR)/jpeg/jchuff.o: jpeg/jchuff.c + $(OBJDIR)/jpeg/jcphuff.o: jpeg/jcphuff.c + $(OBJDIR)/jpeg/jcdctmgr.o: jpeg/jcdctmgr.c + $(OBJDIR)/jpeg/jfdctfst.o: jpeg/jfdctfst.c + $(OBJDIR)/jpeg/jfdctflt.o: jpeg/jfdctflt.c + $(OBJDIR)/jpeg/jfdctint.o: jpeg/jfdctint.c + $(OBJDIR)/jpeg/jdapimin.o: jpeg/jdapimin.c + $(OBJDIR)/jpeg/jdapistd.o: jpeg/jdapistd.c + $(OBJDIR)/jpeg/jdtrans.o: jpeg/jdtrans.c + $(OBJDIR)/jpeg/jdatasrc.o: jpeg/jdatasrc.c + $(OBJDIR)/jpeg/jdmaster.o: jpeg/jdmaster.c + $(OBJDIR)/jpeg/jdinput.o: jpeg/jdinput.c + $(OBJDIR)/jpeg/jdmarker.o: jpeg/jdmarker.c + $(OBJDIR)/jpeg/jdhuff.o: jpeg/jdhuff.c + $(OBJDIR)/jpeg/jdphuff.o: jpeg/jdphuff.c + $(OBJDIR)/jpeg/jdmainct.o: jpeg/jdmainct.c + $(OBJDIR)/jpeg/jdcoefct.o: jpeg/jdcoefct.c + $(OBJDIR)/jpeg/jdpostct.o: jpeg/jdpostct.c + $(OBJDIR)/jpeg/jddctmgr.o: jpeg/jddctmgr.c + $(OBJDIR)/jpeg/jidctfst.o: jpeg/jidctfst.c + $(OBJDIR)/jpeg/jidctflt.o: jpeg/jidctflt.c + $(OBJDIR)/jpeg/jidctint.o: jpeg/jidctint.c + $(OBJDIR)/jpeg/jidctred.o: jpeg/jidctred.c + $(OBJDIR)/jpeg/jdsample.o: jpeg/jdsample.c + $(OBJDIR)/jpeg/jdcolor.o: jpeg/jdcolor.c + $(OBJDIR)/jpeg/jquant1.o: jpeg/jquant1.c + $(OBJDIR)/jpeg/jquant2.o: jpeg/jquant2.c + $(OBJDIR)/jpeg/jdmerge.o: jpeg/jdmerge.c + $(OBJDIR)/jpeg/jcomapi.o: jpeg/jcomapi.c + $(OBJDIR)/jpeg/jutils.o: jpeg/jutils.c + $(OBJDIR)/jpeg/jerror.o: jpeg/jerror.c + $(OBJDIR)/jpeg/jmemmgr.o: jpeg/jmemmgr.c + $(OBJDIR)/jpeg/jmemnobs.o: jpeg/jmemnobs.c + $(OBJDIR)/libdv/YUY2.o: libdv/YUY2.c + $(OBJDIR)/libdv/YV12.o: libdv/YV12.c + $(OBJDIR)/libdv/audio.o: libdv/audio.c + $(OBJDIR)/libdv/bitstream.o: libdv/bitstream.c + $(OBJDIR)/libdv/dct.o: libdv/dct.c + $(OBJDIR)/libdv/dv.o: libdv/dv.c + $(OBJDIR)/libdv/encode.o: libdv/encode.c + $(OBJDIR)/libdv/enc_input.o: libdv/enc_input.c + $(OBJDIR)/libdv/headers.o: libdv/headers.c + $(OBJDIR)/libdv/idct_248.o: libdv/idct_248.c + $(OBJDIR)/libdv/parse.o: libdv/parse.c + $(OBJDIR)/libdv/place.o: libdv/place.c + $(OBJDIR)/libdv/quant.o: libdv/quant.c + $(OBJDIR)/libdv/rgb.o: libdv/rgb.c + $(OBJDIR)/libdv/util.o: libdv/util.c + $(OBJDIR)/libdv/vlc.o: libdv/vlc.c + $(OBJDIR)/libdv/weighting.o: libdv/weighting.c + $(OBJDIR)/libraw1394/src/eventloop.o: libraw1394/src/eventloop.c + $(OBJDIR)/libraw1394/src/fcp.o: libraw1394/src/fcp.c + $(OBJDIR)/libraw1394/src/iso.o: libraw1394/src/iso.c + $(OBJDIR)/libraw1394/src/main.o: libraw1394/src/main.c + $(OBJDIR)/libraw1394/src/readwrite.o: libraw1394/src/readwrite.c + + + + + # $(OBJDIR)/$(DECORE_DIR)/bitstream.o: $(DECORE_DIR)/bitstream.c + # $(OBJDIR)/$(DECORE_DIR)/colorspace.o: $(DECORE_DIR)/colorspace.c + # $(OBJDIR)/$(DECORE_DIR)/decoder.o: $(DECORE_DIR)/decoder.c + # $(OBJDIR)/$(DECORE_DIR)/decore2.o: $(DECORE_DIR)/decore2.c + # $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + # $(OBJDIR)/$(DECORE_DIR)/image.o: $(DECORE_DIR)/image.c + # $(OBJDIR)/$(DECORE_DIR)/mbcoding.o: $(DECORE_DIR)/mbcoding.c + # $(OBJDIR)/$(DECORE_DIR)/mbprediction.o: $(DECORE_DIR)/mbprediction.c + # $(OBJDIR)/$(DECORE_DIR)/quantize.o: $(DECORE_DIR)/quantize.c + # $(OBJDIR)/$(DECORE_DIR)/transfer.o: $(DECORE_DIR)/transfer.c + + $(OBJDIR)/$(DECORE_DIR)/debug.o: $(DECORE_DIR)/debug.c + $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o: $(DECORE_DIR)/basic_prediction.c + $(OBJDIR)/$(DECORE_DIR)/clearblock.o: $(DECORE_DIR)/clearblock.c + $(OBJDIR)/$(DECORE_DIR)/decore.o: $(DECORE_DIR)/decore.c + $(OBJDIR)/$(DECORE_DIR)/gen_draw.o: $(DECORE_DIR)/gen_draw.c + $(OBJDIR)/$(DECORE_DIR)/getbits.o: $(DECORE_DIR)/getbits.c + $(OBJDIR)/$(DECORE_DIR)/gen_usetime.o: $(DECORE_DIR)/gen_usetime.c + $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o: $(DECORE_DIR)/mp4_vars.c + $(OBJDIR)/$(DECORE_DIR)/mp4_block.o: $(DECORE_DIR)/mp4_block.c + $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o: $(DECORE_DIR)/mp4_decoder.c + $(OBJDIR)/$(DECORE_DIR)/mp4_header.o: $(DECORE_DIR)/mp4_header.c + $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o: $(DECORE_DIR)/mp4_iquant.c + $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o: $(DECORE_DIR)/mp4_mblock.c + $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o: $(DECORE_DIR)/mp4_picture.c + $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o: $(DECORE_DIR)/mp4_predict.c + $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o: $(DECORE_DIR)/mp4_recon.c + $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o: $(DECORE_DIR)/mp4_tables.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o: $(DECORE_DIR)/mp4_vld.c + $(OBJDIR)/$(DECORE_DIR)/store.o: $(DECORE_DIR)/store.c + $(OBJDIR)/$(DECORE_DIR)/postprocess.o: $(DECORE_DIR)/postprocess.c + $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o: $(DECORE_DIR)/yuv2rgb.c + $(OBJDIR)/$(DECORE_DIR)/transferidct.o: $(DECORE_DIR)/transferidct.c + + + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o: $(ENCORE_DIR)/bitstream.c + $(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o: $(ENCORE_DIR)/colorspace/colorspace.c + $(OBJDIR)/$(ENCORE_DIR)/encoder.o: $(ENCORE_DIR)/encoder.c + $(OBJDIR)/$(ENCORE_DIR)/encore.o: $(ENCORE_DIR)/encore.c + $(OBJDIR)/$(ENCORE_DIR)/image.o: $(ENCORE_DIR)/image.c + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o: $(ENCORE_DIR)/mbcoding/mbcoding.c + $(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o: $(ENCORE_DIR)/mbcoding/putvlc.c + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o: $(ENCORE_DIR)/mbmotionestcomp/compensate.c + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o: $(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.c + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/sad.o: $(ENCORE_DIR)/mbmotionestcomp/sad.c + $(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o: $(ENCORE_DIR)/mbprediction/mbprediction.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o: $(ENCORE_DIR)/mbtransquant/dct.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o: $(ENCORE_DIR)/mbtransquant/fdct.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o: $(ENCORE_DIR)/mbtransquant/idct.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o: $(ENCORE_DIR)/mbtransquant/mbtransquant.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o: $(ENCORE_DIR)/mbtransquant/quantize.c + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o: $(ENCORE_DIR)/mbtransquant/transfer.c + $(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o: $(ENCORE_DIR)/ratecontrol.c + $(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o: $(ENCORE_DIR)/rgb2yuv.c + $(OBJDIR)/$(ENCORE_DIR)/timer.o: $(ENCORE_DIR)/timer.c + + + + + + + + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.o: $(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.o: $(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.asm + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.asm + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.asm + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.asm + + + + + + + + + + + + + + + + + + + diff -C2 -r -N bcast-2000c/quicktime/Makefile.encore50 bcast-2000c-mf3/quicktime/Makefile.encore50 *** bcast-2000c/quicktime/Makefile.encore50 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/Makefile.encore50 Sat Dec 8 08:58:34 2001 *************** *** 0 **** --- 1,747 ---- + OBJDIR := $(shell uname --machine) + USE_MMX = 0 + CC = gcc + HAVE_CFLAGS := $(shell if [ -n "$CFLAGS" ]; then echo y; fi ) + #ENCORE_DIR := encore2/src + #DECORE_DIR := decore2/src + ENCORE_DIR := encore50 + DECORE_DIR := decore50 + ENCORE_INCLUDE := $(ENCORE_DIR)/encore.h + DECORE_INCLUDE := $(DECORE_DIR)/decore.h + OGG_DIR := $(shell expr libogg* ) + VORBIS_DIR := $(shell expr libvorbis* ) + + + + + DIRS = $(OBJDIR) \ + $(OBJDIR)/jpeg \ + $(OBJDIR)/libraw1394/src \ + $(OBJDIR)/libdv + + + DIRS += \ + $(OBJDIR)/$(DECORE_DIR) + + DIRS += \ + $(OBJDIR)/$(ENCORE_DIR) \ + $(OBJDIR)/$(ENCORE_DIR)/att_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace \ + $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/mbcoding \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp \ + $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx \ + $(OBJDIR)/$(ENCORE_DIR)/mbprediction \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant \ + $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx + + DIRS += \ + $(OBJDIR)/$(OGG_DIR)/src \ + $(OBJDIR)/$(VORBIS_DIR)/lib + + + + + + + + ifeq ($(OBJDIR), i686) + USE_MMX = 1 + endif + + + + + + + + ifeq ($(OBJDIR), alpha) + ifneq ($(HAVE_CFLAGS), y) + CFLAGS = -O4 -arch ev67 -ieee -accept c99_keywords -gcc_messages + endif + endif + + + + + + + + + #CFLAGS += -g + CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + CFLAGS += -DHAVE_FIREWIRE + CFLAGS += -I. -Ijpeg -Ilibdv -Ilibraw1394 $(shell glib-config --cflags) + + ifeq ($(USE_MMX), 1) + + + + + CFLAGS += -DARCH_X86 + + DVMMXOBJ = libdv/asmoff.h + + DVMMXOBJS = \ + $(OBJDIR)/libdv/dct_block_mmx.o \ + $(OBJDIR)/libdv/encode_x86.o \ + $(OBJDIR)/libdv/idct_block_mmx.o \ + $(OBJDIR)/libdv/vlc_x86.o \ + $(OBJDIR)/libdv/quant_x86.o \ + $(OBJDIR)/libdv/transpose_x86.o + + + + + endif + + + + + + + + + OBJS = \ + $(OBJDIR)/atom.o \ + $(OBJDIR)/cmodel_default.o \ + $(OBJDIR)/cmodel_yuv420p.o \ + $(OBJDIR)/cmodel_yuv422.o \ + $(OBJDIR)/codecs.o \ + $(OBJDIR)/colormodels.o \ + $(OBJDIR)/ctab.o \ + $(OBJDIR)/dinf.o \ + $(OBJDIR)/divx.o \ + $(OBJDIR)/dref.o \ + $(OBJDIR)/dv.o \ + $(OBJDIR)/edts.o \ + $(OBJDIR)/elst.o \ + $(OBJDIR)/graphics.o \ + $(OBJDIR)/hdlr.o \ + $(OBJDIR)/ima4.o \ + $(OBJDIR)/jpeg.o \ + $(OBJDIR)/jpeg_old.o \ + $(OBJDIR)/libdv.o \ + $(OBJDIR)/libmjpeg.o \ + $(OBJDIR)/matrix.o \ + $(OBJDIR)/mdat.o \ + $(OBJDIR)/mdhd.o \ + $(OBJDIR)/mdia.o \ + $(OBJDIR)/minf.o \ + $(OBJDIR)/moov.o \ + $(OBJDIR)/mvhd.o \ + $(OBJDIR)/plugin.o \ + $(OBJDIR)/qtpng.o \ + $(OBJDIR)/quicktime.o \ + $(OBJDIR)/raw.o \ + $(OBJDIR)/rawaudio.o \ + $(OBJDIR)/smhd.o \ + $(OBJDIR)/stbl.o \ + $(OBJDIR)/stco.o \ + $(OBJDIR)/stsc.o \ + $(OBJDIR)/stsd.o \ + $(OBJDIR)/stsdtable.o \ + $(OBJDIR)/stss.o \ + $(OBJDIR)/stsz.o \ + $(OBJDIR)/stts.o \ + $(OBJDIR)/tkhd.o \ + $(OBJDIR)/trak.o \ + $(OBJDIR)/twos.o \ + $(OBJDIR)/udta.o \ + $(OBJDIR)/ulaw.o \ + $(OBJDIR)/util.o \ + $(OBJDIR)/v308.o \ + $(OBJDIR)/v408.o \ + $(OBJDIR)/v410.o \ + $(OBJDIR)/vmhd.o \ + $(OBJDIR)/vorbis.o \ + $(OBJDIR)/workarounds.o \ + $(OBJDIR)/yuv2.o \ + $(OBJDIR)/yuv4.o \ + $(OBJDIR)/yv12.o \ + $(OBJDIR)/jpeg/jcapimin.o \ + $(OBJDIR)/jpeg/jcapistd.o \ + $(OBJDIR)/jpeg/jctrans.o \ + $(OBJDIR)/jpeg/jcparam.o \ + $(OBJDIR)/jpeg/jdatadst.o \ + $(OBJDIR)/jpeg/jcinit.o \ + $(OBJDIR)/jpeg/jcmaster.o \ + $(OBJDIR)/jpeg/jcmarker.o \ + $(OBJDIR)/jpeg/jcmainct.o \ + $(OBJDIR)/jpeg/jcprepct.o \ + $(OBJDIR)/jpeg/jccoefct.o \ + $(OBJDIR)/jpeg/jccolor.o \ + $(OBJDIR)/jpeg/jcsample.o \ + $(OBJDIR)/jpeg/jchuff.o \ + $(OBJDIR)/jpeg/jcphuff.o \ + $(OBJDIR)/jpeg/jcdctmgr.o \ + $(OBJDIR)/jpeg/jfdctfst.o \ + $(OBJDIR)/jpeg/jfdctflt.o \ + $(OBJDIR)/jpeg/jfdctint.o \ + $(OBJDIR)/jpeg/jdapimin.o \ + $(OBJDIR)/jpeg/jdapistd.o \ + $(OBJDIR)/jpeg/jdtrans.o \ + $(OBJDIR)/jpeg/jdatasrc.o \ + $(OBJDIR)/jpeg/jdmaster.o \ + $(OBJDIR)/jpeg/jdinput.o \ + $(OBJDIR)/jpeg/jdmarker.o \ + $(OBJDIR)/jpeg/jdhuff.o \ + $(OBJDIR)/jpeg/jdphuff.o \ + $(OBJDIR)/jpeg/jdmainct.o \ + $(OBJDIR)/jpeg/jdcoefct.o \ + $(OBJDIR)/jpeg/jdpostct.o \ + $(OBJDIR)/jpeg/jddctmgr.o \ + $(OBJDIR)/jpeg/jidctfst.o \ + $(OBJDIR)/jpeg/jidctflt.o \ + $(OBJDIR)/jpeg/jidctint.o \ + $(OBJDIR)/jpeg/jidctred.o \ + $(OBJDIR)/jpeg/jdsample.o \ + $(OBJDIR)/jpeg/jdcolor.o \ + $(OBJDIR)/jpeg/jquant1.o \ + $(OBJDIR)/jpeg/jquant2.o \ + $(OBJDIR)/jpeg/jdmerge.o \ + $(OBJDIR)/jpeg/jcomapi.o \ + $(OBJDIR)/jpeg/jutils.o \ + $(OBJDIR)/jpeg/jerror.o \ + $(OBJDIR)/jpeg/jmemmgr.o \ + $(OBJDIR)/jpeg/jmemnobs.o \ + $(OBJDIR)/libraw1394/src/eventloop.o \ + $(OBJDIR)/libraw1394/src/fcp.o \ + $(OBJDIR)/libraw1394/src/iso.o \ + $(OBJDIR)/libraw1394/src/main.o \ + $(OBJDIR)/libraw1394/src/readwrite.o + + + + + + + + + + + OBJS += \ + $(OBJDIR)/libdv/YUY2.o \ + $(OBJDIR)/libdv/YV12.o \ + $(OBJDIR)/libdv/audio.o \ + $(OBJDIR)/libdv/bitstream.o \ + $(OBJDIR)/libdv/dct.o \ + $(OBJDIR)/libdv/dv.o \ + $(OBJDIR)/libdv/encode.o \ + $(OBJDIR)/libdv/enc_input.o \ + $(OBJDIR)/libdv/headers.o \ + $(OBJDIR)/libdv/idct_248.o \ + $(OBJDIR)/libdv/parse.o \ + $(OBJDIR)/libdv/place.o \ + $(OBJDIR)/libdv/quant.o \ + $(OBJDIR)/libdv/rgb.o \ + $(OBJDIR)/libdv/util.o \ + $(OBJDIR)/libdv/vlc.o \ + $(OBJDIR)/libdv/weighting.o + + # OBJS += \ + # $(OBJDIR)/$(DECORE_DIR)/bitstream.o \ + # $(OBJDIR)/$(DECORE_DIR)/colorspace.o \ + # $(OBJDIR)/$(DECORE_DIR)/decoder.o \ + # $(OBJDIR)/$(DECORE_DIR)/decore2.o \ + # $(OBJDIR)/$(DECORE_DIR)/idct.o \ + # $(OBJDIR)/$(DECORE_DIR)/image.o \ + # $(OBJDIR)/$(DECORE_DIR)/mbcoding.o \ + # $(OBJDIR)/$(DECORE_DIR)/mbprediction.o \ + # $(OBJDIR)/$(DECORE_DIR)/quantize.o \ + # $(OBJDIR)/$(DECORE_DIR)/transfer.o + + OBJS += \ + $(OBJDIR)/$(DECORE_DIR)/debug.o \ + $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o \ + $(OBJDIR)/$(DECORE_DIR)/clearblock.o \ + $(OBJDIR)/$(DECORE_DIR)/decore.o \ + $(OBJDIR)/$(DECORE_DIR)/getbits.o \ + $(OBJDIR)/$(DECORE_DIR)/idct.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_block.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_header.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o \ + $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o \ + $(OBJDIR)/$(DECORE_DIR)/postprocess.o \ + $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o \ + $(OBJDIR)/$(DECORE_DIR)/transferidct.o + + #OBJS += \ + # $(OBJDIR)/$(ENCORE_DIR)/bitstream.o \ + # $(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o \ + # $(OBJDIR)/$(ENCORE_DIR)/encoder.o \ + # $(OBJDIR)/$(ENCORE_DIR)/encore.o \ + # $(OBJDIR)/$(ENCORE_DIR)/image.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/halfpel.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mad.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/sad.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o \ + # $(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o \ + # $(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o \ + # $(OBJDIR)/$(ENCORE_DIR)/timer.o + + + ifeq ($(USE_MMX), 1) + + + #CFLAGS += -D_MMX_ + #ENCOREMMX_OBJS= \ + # $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.o \ + # $(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.o \ + # $(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.o + + + + endif + + + OBJS += \ + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o \ + $(OBJDIR)/$(ENCORE_DIR)/encore.o \ + $(OBJDIR)/$(ENCORE_DIR)/mom_access.o \ + $(OBJDIR)/$(ENCORE_DIR)/mom_util.o \ + $(OBJDIR)/$(ENCORE_DIR)/mot_code.o \ + $(OBJDIR)/$(ENCORE_DIR)/mot_est_comp.o \ + $(OBJDIR)/$(ENCORE_DIR)/mot_est_mb.o \ + $(OBJDIR)/$(ENCORE_DIR)/mot_util.o \ + $(OBJDIR)/$(ENCORE_DIR)/putvlc.o \ + $(OBJDIR)/$(ENCORE_DIR)/rate_ctl.o \ + $(OBJDIR)/$(ENCORE_DIR)/text_bits.o \ + $(OBJDIR)/$(ENCORE_DIR)/text_code.o \ + $(OBJDIR)/$(ENCORE_DIR)/text_code_mb.o \ + $(OBJDIR)/$(ENCORE_DIR)/text_dct.o \ + $(OBJDIR)/$(ENCORE_DIR)/vop_code.o + + + + + + + OBJS += \ + $(OBJDIR)/$(OGG_DIR)/src/bitwise.o \ + $(OBJDIR)/$(OGG_DIR)/src/framing.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/analysis.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/bitbuffer.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/block.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/codebook.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/envelope.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/floor0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/floor1.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/info.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/lookup.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/lpc.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/lsp.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/mapping0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/mdct.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/psy.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/registry.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/res0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/sharedbook.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/smallft.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/synthesis.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/time0.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisenc.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/vorbisfile.o \ + $(OBJDIR)/$(VORBIS_DIR)/lib/window.o + + + + + + + + + + + OUTPUT = $(OBJDIR)/libquicktime.a + SHAREDOUTPUT = $(OBJDIR)/libquicktime.so + CFLAGS += -Ilibraw1394/src + + CFLAGS += \ + -I$(DECORE_DIR) \ + -I$(ENCORE_DIR) \ + -DDECORE_INCLUDE=\"$(DECORE_INCLUDE)\" \ + -DENCORE_INCLUDE=\"$(ENCORE_INCLUDE)\" \ + -DLINUX \ + -D_DECORE + + CFLAGS += \ + -I$(OGG_DIR)/include \ + -I$(VORBIS_DIR)/include \ + -I$(VORBIS_DIR)/lib \ + -DHAVE_ALLOCA_H=1 \ + -DHAVE_ALLOCA=1 \ + -DHAVE_SQRTF=1 \ + -DHAVE_LOGF=1 \ + -DHAVE_EXPF=1 \ + -DHAVE_ACOSF=1 \ + -DHAVE_ATANF=1 \ + -DHAVE_FREXPF=1 \ + -DHAVE_RINTF=1 \ + -DUSE_MEMORY_H \ + -D_REENTRANT \ + -DHAVE_ALLOCA=1 \ + -DHAVE_ALLOCA_H=1 + + $(shell if ! test -d $(OBJDIR) \; then mkdir -p $(OBJDIR) \; fi ) + $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags) + $(shell echo $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) > $(OBJDIR)/objs) + + all: $(DIRS) $(OUTPUT) $(SHAREDOUTPUT) + + $(DIRS): + if ! test -d $@ ; then mkdir -p $@ ; fi + + $(OUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) + ar rcs $(OUTPUT) `cat $(OBJDIR)/objs` + + $(SHAREDOUTPUT): $(DVMMXOBJ) $(OBJS) $(DVMMXOBJS) $(ENCOREMMX_OBJS) + gcc -shared -o $(SHAREDOUTPUT) `cat $(OBJDIR)/objs` + + $(OBJDIR)/qtdump: $(OBJDIR)/dump.o $(OUTPUT) + $(CC) -o $(OBJDIR)/qtdump $(OBJDIR)/dump.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/make_streamable: $(OBJDIR)/make_streamable.o $(OUTPUT) + $(CC) -o $(OBJDIR)/make_streamable $(OBJDIR)/make_streamable.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/dechunk: $(OBJDIR)/dechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/dechunk $(OBJDIR)/dechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/rechunk: $(OBJDIR)/rechunk.o $(OUTPUT) + $(CC) -o $(OBJDIR)/rechunk $(OBJDIR)/rechunk.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/recover: $(OBJDIR)/recover.o $(OUTPUT) + $(CC) -o $(OBJDIR)/recover $(OBJDIR)/recover.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/yuv4toyuv: $(OBJDIR)/yuv4toyuv.o $(OUTPUT) + $(CC) -o $(OBJDIR)/yuv4toyuv $(OBJDIR)/yuv4toyuv.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + $(OBJDIR)/qtinfo: $(OBJDIR)/qtinfo.o + $(CC) -o $(OBJDIR)/qtinfo $(OBJDIR)/qtinfo.o $(OUTPUT) -lpng -lz -lpthread -lglib -ldl -lm + + util: $(OBJDIR)/qtdump $(OBJDIR)/make_streamable $(OBJDIR)/qtinfo $(OBJDIR)/dechunk $(OBJDIR)/yuv4toyuv $(OBJDIR)/recover $(OBJDIR)/rechunk + + + clean: + rm -rf $(OBJDIR) + rm -rf .deps + + wc: + cat *.c *.h | wc + + backup: clean + cd .. && \ + tar zcvf quicktime.tar.gz quicktime + + install: + cp $(SHAREDOUTPUT) /usr/lib/libquicktime.so.1 + ln -sf /usr/lib/libquicktime.so.1 /usr/lib/libquicktime.so + cp quicktime.h qtprivate.h colormodels.h /usr/include + + $(OBJDIR)/dump.o \ + $(OBJDIR)/make_streamable.o \ + $(OBJDIR)/dechunk.o \ + $(OBJDIR)/recover.o \ + $(OBJDIR)/yuv4toyuv.o \ + $(OBJDIR)/qtinfo.o \ + $(OBJDIR)/rechunk.o \ + $(OBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.c) -o $*.o + + + + $(DVMMXOBJ): + $(CC) `cat $(OBJDIR)/c_flags` libdv/gasmoff.c -o $(OBJDIR)/gasmoff -lm + $(OBJDIR)/gasmoff > libdv/asmoff.h + + $(DVMMXOBJS): + $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o + + $(ENCOREMMX_OBJS): + nasm -f elf $(subst $(OBJDIR)/,, $*.asm) -o $*.o + + + + + $(OBJDIR)/atom.o: atom.c + $(OBJDIR)/cmodel_default.o: cmodel_default.c + $(OBJDIR)/cmodel_yuv420p.o: cmodel_yuv420p.c + $(OBJDIR)/cmodel_yuv422.o: cmodel_yuv422.c + $(OBJDIR)/codecs.o: codecs.c + $(OBJDIR)/colormodels.o: colormodels.c + $(OBJDIR)/ctab.o: ctab.c + $(OBJDIR)/dechunk.o: dechunk.c + $(OBJDIR)/dinf.o: dinf.c + $(OBJDIR)/divx.o: divx.c + $(OBJDIR)/dref.o: dref.c + $(OBJDIR)/dump.o: dump.c + $(OBJDIR)/dv.o: dv.c + $(OBJDIR)/edts.o: edts.c + $(OBJDIR)/elst.o: elst.c + $(OBJDIR)/graphics.o: graphics.c + $(OBJDIR)/hdlr.o: hdlr.c + $(OBJDIR)/ima4.o: ima4.c + $(OBJDIR)/jpeg.o: jpeg.c + $(OBJDIR)/jpeg_old.o: jpeg_old.c + $(OBJDIR)/libdv.o: libdv.c + $(OBJDIR)/libmjpeg.o: libmjpeg.c + $(OBJDIR)/make_streamable.o: make_streamable.c + $(OBJDIR)/matrix.o: matrix.c + $(OBJDIR)/mdat.o: mdat.c + $(OBJDIR)/mdhd.o: mdhd.c + $(OBJDIR)/mdia.o: mdia.c + $(OBJDIR)/minf.o: minf.c + $(OBJDIR)/moov.o: moov.c + $(OBJDIR)/mvhd.o: mvhd.c + $(OBJDIR)/plugin.o: plugin.c + $(OBJDIR)/qtinfo.o: qtinfo.c + $(OBJDIR)/qtpng.o: qtpng.c + $(OBJDIR)/quicktime.o: quicktime.c + $(OBJDIR)/raw.o: raw.c + $(OBJDIR)/rawaudio.o: rawaudio.c + $(OBJDIR)/rechunk.o: rechunk.c + $(OBJDIR)/recover.o: recover.c + $(OBJDIR)/smhd.o: smhd.c + $(OBJDIR)/stbl.o: stbl.c + $(OBJDIR)/stco.o: stco.c + $(OBJDIR)/stsc.o: stsc.c + $(OBJDIR)/stsd.o: stsd.c + $(OBJDIR)/stsdtable.o: stsdtable.c + $(OBJDIR)/stss.o: stss.c + $(OBJDIR)/stsz.o: stsz.c + $(OBJDIR)/stts.o: stts.c + $(OBJDIR)/tkhd.o: tkhd.c + $(OBJDIR)/trak.o: trak.c + $(OBJDIR)/twos.o: twos.c + $(OBJDIR)/udta.o: udta.c + $(OBJDIR)/ulaw.o: ulaw.c + $(OBJDIR)/util.o: util.c + $(OBJDIR)/v308.o: v308.c + $(OBJDIR)/v408.o: v408.c + $(OBJDIR)/v410.o: v410.c + $(OBJDIR)/vmhd.o: vmhd.c + $(OBJDIR)/vorbis.o: vorbis.c + $(OBJDIR)/workarounds.o: workarounds.c + $(OBJDIR)/yuv2.o: yuv2.c + $(OBJDIR)/yuv4.o: yuv4.c + $(OBJDIR)/yuv4toyuv.o: yuv4toyuv.c + $(OBJDIR)/yv12.o: yv12.c + $(OBJDIR)/jpeg/jcapimin.o: jpeg/jcapimin.c + $(OBJDIR)/jpeg/jcapistd.o: jpeg/jcapistd.c + $(OBJDIR)/jpeg/jctrans.o: jpeg/jctrans.c + $(OBJDIR)/jpeg/jcparam.o: jpeg/jcparam.c + $(OBJDIR)/jpeg/jdatadst.o: jpeg/jdatadst.c + $(OBJDIR)/jpeg/jcinit.o: jpeg/jcinit.c + $(OBJDIR)/jpeg/jcmaster.o: jpeg/jcmaster.c + $(OBJDIR)/jpeg/jcmarker.o: jpeg/jcmarker.c + $(OBJDIR)/jpeg/jcmainct.o: jpeg/jcmainct.c + $(OBJDIR)/jpeg/jcprepct.o: jpeg/jcprepct.c + $(OBJDIR)/jpeg/jccoefct.o: jpeg/jccoefct.c + $(OBJDIR)/jpeg/jccolor.o: jpeg/jccolor.c + $(OBJDIR)/jpeg/jcsample.o: jpeg/jcsample.c + $(OBJDIR)/jpeg/jchuff.o: jpeg/jchuff.c + $(OBJDIR)/jpeg/jcphuff.o: jpeg/jcphuff.c + $(OBJDIR)/jpeg/jcdctmgr.o: jpeg/jcdctmgr.c + $(OBJDIR)/jpeg/jfdctfst.o: jpeg/jfdctfst.c + $(OBJDIR)/jpeg/jfdctflt.o: jpeg/jfdctflt.c + $(OBJDIR)/jpeg/jfdctint.o: jpeg/jfdctint.c + $(OBJDIR)/jpeg/jdapimin.o: jpeg/jdapimin.c + $(OBJDIR)/jpeg/jdapistd.o: jpeg/jdapistd.c + $(OBJDIR)/jpeg/jdtrans.o: jpeg/jdtrans.c + $(OBJDIR)/jpeg/jdatasrc.o: jpeg/jdatasrc.c + $(OBJDIR)/jpeg/jdmaster.o: jpeg/jdmaster.c + $(OBJDIR)/jpeg/jdinput.o: jpeg/jdinput.c + $(OBJDIR)/jpeg/jdmarker.o: jpeg/jdmarker.c + $(OBJDIR)/jpeg/jdhuff.o: jpeg/jdhuff.c + $(OBJDIR)/jpeg/jdphuff.o: jpeg/jdphuff.c + $(OBJDIR)/jpeg/jdmainct.o: jpeg/jdmainct.c + $(OBJDIR)/jpeg/jdcoefct.o: jpeg/jdcoefct.c + $(OBJDIR)/jpeg/jdpostct.o: jpeg/jdpostct.c + $(OBJDIR)/jpeg/jddctmgr.o: jpeg/jddctmgr.c + $(OBJDIR)/jpeg/jidctfst.o: jpeg/jidctfst.c + $(OBJDIR)/jpeg/jidctflt.o: jpeg/jidctflt.c + $(OBJDIR)/jpeg/jidctint.o: jpeg/jidctint.c + $(OBJDIR)/jpeg/jidctred.o: jpeg/jidctred.c + $(OBJDIR)/jpeg/jdsample.o: jpeg/jdsample.c + $(OBJDIR)/jpeg/jdcolor.o: jpeg/jdcolor.c + $(OBJDIR)/jpeg/jquant1.o: jpeg/jquant1.c + $(OBJDIR)/jpeg/jquant2.o: jpeg/jquant2.c + $(OBJDIR)/jpeg/jdmerge.o: jpeg/jdmerge.c + $(OBJDIR)/jpeg/jcomapi.o: jpeg/jcomapi.c + $(OBJDIR)/jpeg/jutils.o: jpeg/jutils.c + $(OBJDIR)/jpeg/jerror.o: jpeg/jerror.c + $(OBJDIR)/jpeg/jmemmgr.o: jpeg/jmemmgr.c + $(OBJDIR)/jpeg/jmemnobs.o: jpeg/jmemnobs.c + $(OBJDIR)/libdv/YUY2.o: libdv/YUY2.c + $(OBJDIR)/libdv/YV12.o: libdv/YV12.c + $(OBJDIR)/libdv/audio.o: libdv/audio.c + $(OBJDIR)/libdv/bitstream.o: libdv/bitstream.c + $(OBJDIR)/libdv/dct.o: libdv/dct.c + $(OBJDIR)/libdv/dv.o: libdv/dv.c + $(OBJDIR)/libdv/encode.o: libdv/encode.c + $(OBJDIR)/libdv/enc_input.o: libdv/enc_input.c + $(OBJDIR)/libdv/headers.o: libdv/headers.c + $(OBJDIR)/libdv/idct_248.o: libdv/idct_248.c + $(OBJDIR)/libdv/parse.o: libdv/parse.c + $(OBJDIR)/libdv/place.o: libdv/place.c + $(OBJDIR)/libdv/quant.o: libdv/quant.c + $(OBJDIR)/libdv/rgb.o: libdv/rgb.c + $(OBJDIR)/libdv/util.o: libdv/util.c + $(OBJDIR)/libdv/vlc.o: libdv/vlc.c + $(OBJDIR)/libdv/weighting.o: libdv/weighting.c + $(OBJDIR)/libraw1394/src/eventloop.o: libraw1394/src/eventloop.c + $(OBJDIR)/libraw1394/src/fcp.o: libraw1394/src/fcp.c + $(OBJDIR)/libraw1394/src/iso.o: libraw1394/src/iso.c + $(OBJDIR)/libraw1394/src/main.o: libraw1394/src/main.c + $(OBJDIR)/libraw1394/src/readwrite.o: libraw1394/src/readwrite.c + + + + + # $(OBJDIR)/$(DECORE_DIR)/bitstream.o: $(DECORE_DIR)/bitstream.c + # $(OBJDIR)/$(DECORE_DIR)/colorspace.o: $(DECORE_DIR)/colorspace.c + # $(OBJDIR)/$(DECORE_DIR)/decoder.o: $(DECORE_DIR)/decoder.c + # $(OBJDIR)/$(DECORE_DIR)/decore2.o: $(DECORE_DIR)/decore2.c + # $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + # $(OBJDIR)/$(DECORE_DIR)/image.o: $(DECORE_DIR)/image.c + # $(OBJDIR)/$(DECORE_DIR)/mbcoding.o: $(DECORE_DIR)/mbcoding.c + # $(OBJDIR)/$(DECORE_DIR)/mbprediction.o: $(DECORE_DIR)/mbprediction.c + # $(OBJDIR)/$(DECORE_DIR)/quantize.o: $(DECORE_DIR)/quantize.c + # $(OBJDIR)/$(DECORE_DIR)/transfer.o: $(DECORE_DIR)/transfer.c + + $(OBJDIR)/$(DECORE_DIR)/debug.o: $(DECORE_DIR)/debug.c + $(OBJDIR)/$(DECORE_DIR)/basic_prediction.o: $(DECORE_DIR)/basic_prediction.c + $(OBJDIR)/$(DECORE_DIR)/clearblock.o: $(DECORE_DIR)/clearblock.c + $(OBJDIR)/$(DECORE_DIR)/decore.o: $(DECORE_DIR)/decore.c + $(OBJDIR)/$(DECORE_DIR)/gen_draw.o: $(DECORE_DIR)/gen_draw.c + $(OBJDIR)/$(DECORE_DIR)/getbits.o: $(DECORE_DIR)/getbits.c + $(OBJDIR)/$(DECORE_DIR)/gen_usetime.o: $(DECORE_DIR)/gen_usetime.c + $(OBJDIR)/$(DECORE_DIR)/idct.o: $(DECORE_DIR)/idct.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vars.o: $(DECORE_DIR)/mp4_vars.c + $(OBJDIR)/$(DECORE_DIR)/mp4_block.o: $(DECORE_DIR)/mp4_block.c + $(OBJDIR)/$(DECORE_DIR)/mp4_decoder.o: $(DECORE_DIR)/mp4_decoder.c + $(OBJDIR)/$(DECORE_DIR)/mp4_header.o: $(DECORE_DIR)/mp4_header.c + $(OBJDIR)/$(DECORE_DIR)/mp4_iquant.o: $(DECORE_DIR)/mp4_iquant.c + $(OBJDIR)/$(DECORE_DIR)/mp4_mblock.o: $(DECORE_DIR)/mp4_mblock.c + $(OBJDIR)/$(DECORE_DIR)/mp4_picture.o: $(DECORE_DIR)/mp4_picture.c + $(OBJDIR)/$(DECORE_DIR)/mp4_predict.o: $(DECORE_DIR)/mp4_predict.c + $(OBJDIR)/$(DECORE_DIR)/mp4_recon.o: $(DECORE_DIR)/mp4_recon.c + $(OBJDIR)/$(DECORE_DIR)/mp4_tables.o: $(DECORE_DIR)/mp4_tables.c + $(OBJDIR)/$(DECORE_DIR)/mp4_vld.o: $(DECORE_DIR)/mp4_vld.c + $(OBJDIR)/$(DECORE_DIR)/store.o: $(DECORE_DIR)/store.c + $(OBJDIR)/$(DECORE_DIR)/postprocess.o: $(DECORE_DIR)/postprocess.c + $(OBJDIR)/$(DECORE_DIR)/yuv2rgb.o: $(DECORE_DIR)/yuv2rgb.c + $(OBJDIR)/$(DECORE_DIR)/transferidct.o: $(DECORE_DIR)/transferidct.c + + + #$(OBJDIR)/$(ENCORE_DIR)/bitstream.o: $(ENCORE_DIR)/bitstream.c + #$(OBJDIR)/$(ENCORE_DIR)/colorspace/colorspace.o: $(ENCORE_DIR)/colorspace/colorspace.c + #$(OBJDIR)/$(ENCORE_DIR)/encoder.o: $(ENCORE_DIR)/encoder.c + #$(OBJDIR)/$(ENCORE_DIR)/encore.o: $(ENCORE_DIR)/encore.c + #$(OBJDIR)/$(ENCORE_DIR)/image.o: $(ENCORE_DIR)/image.c + #$(OBJDIR)/$(ENCORE_DIR)/mbcoding/mbcoding.o: $(ENCORE_DIR)/mbcoding/mbcoding.c + #$(OBJDIR)/$(ENCORE_DIR)/mbcoding/putvlc.o: $(ENCORE_DIR)/mbcoding/putvlc.c + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/compensate.o: $(ENCORE_DIR)/mbmotionestcomp/compensate.c + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.o: $(ENCORE_DIR)/mbmotionestcomp/mbmotionestcomp.c + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/sad.o: $(ENCORE_DIR)/mbmotionestcomp/sad.c + #$(OBJDIR)/$(ENCORE_DIR)/mbprediction/mbprediction.o: $(ENCORE_DIR)/mbprediction/mbprediction.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/dct.o: $(ENCORE_DIR)/mbtransquant/dct.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/fdct.o: $(ENCORE_DIR)/mbtransquant/fdct.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/idct.o: $(ENCORE_DIR)/mbtransquant/idct.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/mbtransquant.o: $(ENCORE_DIR)/mbtransquant/mbtransquant.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/quantize.o: $(ENCORE_DIR)/mbtransquant/quantize.c + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/transfer.o: $(ENCORE_DIR)/mbtransquant/transfer.c + #$(OBJDIR)/$(ENCORE_DIR)/ratecontrol.o: $(ENCORE_DIR)/ratecontrol.c + #$(OBJDIR)/$(ENCORE_DIR)/rgb2yuv.o: $(ENCORE_DIR)/rgb2yuv.c + #$(OBJDIR)/$(ENCORE_DIR)/timer.o: $(ENCORE_DIR)/timer.c + + #$(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.o: $(ENCORE_DIR)/colorspace/intel_mmx/colorspace_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.o: $(ENCORE_DIR)/colorspace/intel_mmx/yuv_to_yuv.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/fdct_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/idct_sse.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/transfer_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.o: $(ENCORE_DIR)/mbtransquant/intel_mmx/quant_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/halfpel_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/compensate_mmx.asm + #$(OBJDIR)/$(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.o: $(ENCORE_DIR)/mbmotionestcomp/intel_mmx/sad_mmx.asm + + + + $(OBJDIR)/$(ENCORE_DIR)/bitstream.o: $(ENCORE_DIR)/bitstream.c + $(OBJDIR)/$(ENCORE_DIR)/encore.o: $(ENCORE_DIR)/encore.c + $(OBJDIR)/$(ENCORE_DIR)/mom_access.o: $(ENCORE_DIR)/mom_access.c + $(OBJDIR)/$(ENCORE_DIR)/mom_util.o: $(ENCORE_DIR)/mom_util.c + $(OBJDIR)/$(ENCORE_DIR)/mot_code.o: $(ENCORE_DIR)/mot_code.c + $(OBJDIR)/$(ENCORE_DIR)/mot_est_comp.o: $(ENCORE_DIR)/mot_est_comp.c + $(OBJDIR)/$(ENCORE_DIR)/mot_est_mb.o: $(ENCORE_DIR)/mot_est_mb.c + $(OBJDIR)/$(ENCORE_DIR)/mot_util.o: $(ENCORE_DIR)/mot_util.c + $(OBJDIR)/$(ENCORE_DIR)/putvlc.o: $(ENCORE_DIR)/putvlc.c + $(OBJDIR)/$(ENCORE_DIR)/rate_ctl.o: $(ENCORE_DIR)/rate_ctl.c + $(OBJDIR)/$(ENCORE_DIR)/text_bits.o: $(ENCORE_DIR)/text_bits.c + $(OBJDIR)/$(ENCORE_DIR)/text_code.o: $(ENCORE_DIR)/text_code.c + $(OBJDIR)/$(ENCORE_DIR)/text_code_mb.o: $(ENCORE_DIR)/text_code_mb.c + $(OBJDIR)/$(ENCORE_DIR)/text_dct.o: $(ENCORE_DIR)/text_dct.c + $(OBJDIR)/$(ENCORE_DIR)/vop_code.o: $(ENCORE_DIR)/vop_code.c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -C2 -r -N bcast-2000c/quicktime/README bcast-2000c-mf3/quicktime/README *** bcast-2000c/quicktime/README Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/README Fri Dec 14 15:13:25 2001 *************** *** 1,5 **** Quicktime for Linux ! Author: Adam Williams quicktime@altavista.net Homepage: heroinewarrior.com/quicktime Requires: libpthread --- 1,5 ---- Quicktime for Linux ! Author: Heroine Virtual (Motion picture solutions for Linux) broadcast@earthling.net Homepage: heroinewarrior.com/quicktime Requires: libpthread *************** *** 9,21 **** This is a Quicktime library for UNIX in a freely redistributable, ! statically linkable library. You can statically link it in a program ! and charge money for the program. The only condition is that if you ! use it in a program, you must put the author's name and email ! somewhere. If you improve the library itself or add a free codec to ! it, you should release your improvements. If you redistribute the ! code, you must also redistribute the author information and ! documentation. At this time it's very popular to license stuff under ! the GPL. You are free to include this library in a derived work and ! license the derived work under GPL. ***** --- 9,13 ---- This is a Quicktime library for UNIX in a freely redistributable, ! statically linkable library. ***** *************** *** 27,32 **** Configuration: ! The file "config.h" defines the size of a 16 bit word and what the ! maximum file size is. /******************************************************* --- 19,29 ---- Configuration: ! libdv must be hacked to compile on Compaq C. ! ! Replace ... with enumeration. ! Replace run:, len: with proper order. ! ! ! /******************************************************* *************** *** 41,42 **** --- 38,45 ---- http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html + + + + + + diff -C2 -r -N bcast-2000c/quicktime/c_flags bcast-2000c-mf3/quicktime/c_flags *** bcast-2000c/quicktime/c_flags Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/c_flags Thu Jan 1 01:00:00 1970 *************** *** 1 **** - echo $CFLAGS --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/cmodel_default.c bcast-2000c-mf3/quicktime/cmodel_default.c *** bcast-2000c/quicktime/cmodel_default.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/cmodel_default.c Mon Dec 17 15:44:37 2001 *************** *** 0 **** --- 1,915 ---- + /* + * This library 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 of the License, or + * (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + #include "cmodel_permutation.h" + + + + #define TRANSFER_FRAME_DEFAULT(output, \ + input, \ + y_in_offset, \ + u_in_offset, \ + v_in_offset, \ + input_column) \ + { \ + register int i, j; \ + switch(in_colormodel) \ + { \ + case BC_YUV888: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_RGB8((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_RGB565((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_BGR888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_BGR8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_RGB888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_RGBA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV101010: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_YUV101010((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV420P: \ + TRANSFER_YUV420P_OUT_HEAD \ + transfer_YUV888_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422P: \ + TRANSFER_YUV422P_OUT_HEAD \ + transfer_YUV888_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_YUV422((output), \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_YUV888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_YUVA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_VYU888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_VYU888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_UYVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV888_to_UYVA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_YUVA8888: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_RGB8((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_RGB565((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_BGR888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_BGR8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_RGB888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_RGBA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_VYU888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_VYU888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_YUVA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_UYVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_UYVA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV101010: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_YUV101010((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV420P: \ + TRANSFER_YUV420P_OUT_HEAD \ + transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422P: \ + TRANSFER_YUV422P_OUT_HEAD \ + transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA8888_to_YUV422((output), \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_YUV161616: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_RGB8((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_RGB565((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_BGR888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_BGR8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_RGB888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_RGBA8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV420P: \ + TRANSFER_YUV420P_OUT_HEAD \ + transfer_YUV161616_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (uint16_t*)(input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422P: \ + TRANSFER_YUV422P_OUT_HEAD \ + transfer_YUV161616_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (uint16_t*)(input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_YUV422((output), \ + (uint16_t*)(input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV101010: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_YUV101010((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_YUVA8888((output), \ + (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_VYU888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_VYU888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_UYVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_UYVA8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV161616: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV161616_to_YUV161616((uint16_t**)(output), \ + (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_YUVA16161616: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_RGB8((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_RGB565((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_BGR888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_BGR8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_RGB888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_RGBA8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV101010: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_YUV101010((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_VYU888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_VYU888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_UYVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_UYVA8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA16161616: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV420P: \ + TRANSFER_YUV420P_OUT_HEAD \ + transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (uint16_t*)(input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422P: \ + TRANSFER_YUV422P_OUT_HEAD \ + transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (uint16_t*)(input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422: \ + TRANSFER_FRAME_HEAD \ + transfer_YUVA16161616_to_YUV422((output), \ + (uint16_t*)(input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_YUV101010: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_RGB8((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_RGB565((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_BGR888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_BGR8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_RGB888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_RGBA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_YUV888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_YUVA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB161616: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_RGB161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA16161616: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_RGBA16161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV161616: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_YUV161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA16161616: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV101010_to_YUVA16161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_VYU888: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_RGB8((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_RGB565((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_BGR888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_BGR8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_RGB888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_RGBA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_YUV888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_YUVA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB161616: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_RGB161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA16161616: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_RGBA16161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV161616: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_YUV161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA16161616: \ + TRANSFER_FRAME_HEAD \ + transfer_VYU888_to_YUVA16161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_UYVA8888: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_RGB8((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_RGB565((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_BGR888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_BGR8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_RGB888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_RGBA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_YUV888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_YUVA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB161616: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_RGB161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA16161616: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_RGBA16161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV161616: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_YUV161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA16161616: \ + TRANSFER_FRAME_HEAD \ + transfer_UYVA8888_to_YUVA16161616((uint16_t**)(output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_ARGB8888: \ + case BC_ABGR8888: \ + switch(out_colormodel) \ + { \ + case BC_ARGB8888: \ + case BC_ABGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_ARGB8888_to_ARGB8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_RGB888: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_RGB8((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_RGB565((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_BGR888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_RGB888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_RGBA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_ARGB8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_ARGB8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_ABGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_ABGR8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_BGR8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_YUV888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_YUVA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV101010: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB888_to_YUV101010((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV420P: \ + TRANSFER_YUV420P_OUT_HEAD \ + transfer_RGB888_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422P: \ + TRANSFER_YUV422P_OUT_HEAD \ + transfer_RGB888_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_RGBA8888: \ + switch(out_colormodel) \ + { \ + case BC_TRANSPARENCY: \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_TRANSPARENCY((output), (input), &bit_counter); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB8: \ + if(bg_color > 0) \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_RGB8bg((output), (input), bg_r, bg_g, bg_b); \ + TRANSFER_FRAME_TAIL \ + else \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_RGB8((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + if(bg_color > 0) \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_RGB565bg((output), (input), bg_r, bg_g, bg_b); \ + TRANSFER_FRAME_TAIL \ + else \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_RGB565((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + if(bg_color > 0) \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_BGR888bg((output), (input), bg_r, bg_g, bg_b); \ + TRANSFER_FRAME_TAIL \ + else \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_BGR888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + if(bg_color > 0) \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_RGB888bg((output), (input), bg_r, bg_g, bg_b); \ + TRANSFER_FRAME_TAIL \ + else \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_RGB888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + if(bg_color > 0) \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_RGBA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + if(bg_color > 0) \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_BGR8888bg((output), (input), bg_r, bg_g, bg_b); \ + TRANSFER_FRAME_TAIL \ + else \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_BGR8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + if(bg_color > 0) \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_YUV888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + if(bg_color > 0) \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_YUVA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV101010: \ + if(bg_color > 0) \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA8888_to_YUV101010((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_RGB161616: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB161616_to_RGB8((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB161616_to_RGB565((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB161616_to_BGR888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB161616_to_BGR8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB161616_to_RGB888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB161616_to_RGBA8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB161616_to_YUV888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB161616_to_YUVA8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV101010: \ + TRANSFER_FRAME_HEAD \ + transfer_RGB161616_to_YUV101010((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV420P: \ + TRANSFER_YUV420P_OUT_HEAD \ + transfer_RGB161616_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (uint16_t*)(input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422P: \ + TRANSFER_YUV422P_OUT_HEAD \ + transfer_RGB161616_to_YUV420P_YUV422P(output_y, \ + output_u, \ + output_v, \ + (uint16_t*)(input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_RGBA16161616: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA16161616_to_RGB8((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA16161616_to_RGB565((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA16161616_to_BGR888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA16161616_to_BGR8888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA16161616_to_RGB888((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA16161616_to_RGBA8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV101010: \ + TRANSFER_FRAME_HEAD \ + transfer_RGBA16161616_to_YUV101010((output), (uint16_t*)(input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_BGR8888: \ + switch(out_colormodel) \ + { \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_BGR8888_to_RGB888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_BGR8888_to_BGR8888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_BGR888: \ + switch(out_colormodel) \ + { \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_BGR888_to_RGB888((output), (input)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + } \ + } + + + + + void cmodel_default(PERMUTATION_ARGS) + { + if(scale) + { + TRANSFER_FRAME_DEFAULT(&output_row, + input_row + column_table[j] * in_pixelsize, + 0, + 0, + 0, + 0); + } + else + { + TRANSFER_FRAME_DEFAULT(&output_row, + input_row + j * in_pixelsize, + 0, + 0, + 0, + 0); + } + } diff -C2 -r -N bcast-2000c/quicktime/cmodel_permutation.h bcast-2000c-mf3/quicktime/cmodel_permutation.h *** bcast-2000c/quicktime/cmodel_permutation.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/cmodel_permutation.h Mon Dec 17 15:44:30 2001 *************** *** 0 **** --- 1,2831 ---- + /* + * This library 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 of the License, or + * (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + #include "colormodels.h" + #include + + + #define RGB_TO_YUV(y, u, v, r, g, b) \ + { \ + y = ((yuv_table->rtoy_tab[r] + yuv_table->gtoy_tab[g] + yuv_table->btoy_tab[b]) >> 16); \ + u = ((yuv_table->rtou_tab[r] + yuv_table->gtou_tab[g] + yuv_table->btou_tab[b]) >> 16); \ + v = ((yuv_table->rtov_tab[r] + yuv_table->gtov_tab[g] + yuv_table->btov_tab[b]) >> 16); \ + RECLIP(y, 0, 0xff); \ + RECLIP(u, 0, 0xff); \ + RECLIP(v, 0, 0xff); \ + } + + #define YUV_TO_RGB(y, u, v, r, g, b) \ + { \ + (r) = ((y + yuv_table->vtor_tab[v]) >> 16); \ + (g) = ((y + yuv_table->utog_tab[u] + yuv_table->vtog_tab[v]) >> 16); \ + (b) = ((y + yuv_table->utob_tab[u]) >> 16); \ + RECLIP(r, 0, 0xff); \ + RECLIP(g, 0, 0xff); \ + RECLIP(b, 0, 0xff); \ + } + + // r, g, b -> 16 bits + #define RGB_TO_YUV16(y, u, v, r, g, b) \ + { \ + y = ((yuv_table->rtoy_tab16[r] + yuv_table->gtoy_tab16[g] + yuv_table->btoy_tab16[b]) >> 8); \ + u = ((yuv_table->rtou_tab16[r] + yuv_table->gtou_tab16[g] + yuv_table->btou_tab16[b]) >> 8); \ + v = ((yuv_table->rtov_tab16[r] + yuv_table->gtov_tab16[g] + yuv_table->btov_tab16[b]) >> 8); \ + RECLIP(y, 0, 0xffff); \ + RECLIP(u, 0, 0xffff); \ + RECLIP(v, 0, 0xffff); \ + } + + // y -> 24 bits u, v-> 16 bits + #define YUV_TO_RGB16(y, u, v, r, g, b) \ + { \ + (r) = ((y + yuv_table->vtor_tab16[v]) >> 8); \ + (g) = ((y + yuv_table->utog_tab16[u] + yuv_table->vtog_tab16[v]) >> 8); \ + (b) = ((y + yuv_table->utob_tab16[u]) >> 8); \ + RECLIP(r, 0, 0xffff); \ + RECLIP(g, 0, 0xffff); \ + RECLIP(b, 0, 0xffff); \ + } + + + #define WRITE_YUV101010(y, u, v) \ + { \ + uint32_t output_i = ((y & 0xffc0) << 16) | \ + ((u & 0xffc0) << 6) | \ + ((v & 0xffc0) >> 4); \ + *(*output)++ = (output_i & 0xff); \ + *(*output)++ = (output_i & 0xff00) >> 8; \ + *(*output)++ = (output_i & 0xff0000) >> 16; \ + *(*output)++ = (output_i & 0xff000000) >> 24; \ + } + + + + // ****************************** Pixel transfers ***************************** + + + + + + + // ****************************** ARGB8888 -> ********************************* + + static inline void transfer_ARGB8888_to_ARGB8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output)[3] = input[3]; + (*output) += 4; + } + + + + + + + + + + + + + + + + // ******************************** RGB888 -> ********************************* + + static inline void transfer_RGB888_to_RGB8(unsigned char *(*output), unsigned char *input) + { + *(*output) = (unsigned char)((input[0] & 0xc0) + + ((input[1] & 0xe0) >> 2) + + ((input[2] & 0xe0) >> 5)); + (*output)++; + } + + static inline void transfer_RGB888_to_RGB565(unsigned char *(*output), unsigned char *input) + { + uint16_t r, g, b; + r = *input++; + g = *input++; + b = *input; + *(uint16_t*)(*output) = ((r & 0xf8) << 8) + + ((g & 0xfc) << 3) + + ((b & 0xf8) >> 3); + (*output) += 2; + } + + static inline void transfer_RGB888_to_BGR888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[2]; + (*output)[1] = input[1]; + (*output)[2] = input[0]; + (*output) += 3; + } + + static inline void transfer_RGB888_to_RGB888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output) += 3; + } + + static inline void transfer_RGB888_to_RGBA8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output)[3] = 0xff; + (*output) += 4; + } + + static inline void transfer_RGB888_to_ARGB8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = 0xff; + (*output)[1] = input[0]; + (*output)[2] = input[1]; + (*output)[3] = input[2]; + (*output) += 4; + } + + static inline void transfer_RGB888_to_ABGR8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = 0xff; + (*output)[1] = input[2]; + (*output)[2] = input[1]; + (*output)[3] = input[0]; + (*output) += 4; + } + + static inline void transfer_RGB888_to_BGR8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[2]; + (*output)[1] = input[1]; + (*output)[2] = input[0]; + (*output) += 4; + } + + static inline void transfer_RGB888_to_YUV888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + + RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); + + (*output)[0] = y; + (*output)[1] = u; + (*output)[2] = v; + (*output) += 3; + } + + + static inline void transfer_RGB888_to_YUV101010(unsigned char *(*output), unsigned char *input) + { + int r, g, b; + int y, u, v; + + r = ((uint16_t)input[0]) << 8; + g = ((uint16_t)input[1]) << 8; + b = ((uint16_t)input[2]) << 8; + RGB_TO_YUV16(y, u, v, r, g, b); + WRITE_YUV101010(y, u, v); + } + + static inline void transfer_RGB888_to_VYU888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + + RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); + + (*output)[0] = v; + (*output)[1] = y; + (*output)[2] = u; + (*output) += 3; + } + + static inline void transfer_RGB888_to_UYVA8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + + RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); + + (*output)[0] = u; + (*output)[1] = y; + (*output)[2] = v; + (*output)[3] = 0xff; + (*output) += 4; + } + + + + static inline void transfer_RGB888_to_YUVA8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + + RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); + + (*output)[0] = y; + (*output)[1] = u; + (*output)[2] = v; + (*output)[3] = 255; + (*output) += 4; + } + + static inline void transfer_RGB888_to_YUV420P_YUV422P(unsigned char *output_y, + unsigned char *output_u, + unsigned char *output_v, + unsigned char *input, + int output_column) + { + int y, u, v; + + RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); + + output_y[output_column] = y; + output_u[output_column / 2] = u; + output_v[output_column / 2] = v; + } + + + + + + // *************************** RGBA8888 -> ************************************ + + static inline void transfer_RGBA8888_to_TRANSPARENCY(unsigned char *(*output), unsigned char *input, int (*bit_counter)) + { + if((*bit_counter) == 7) *(*output) = 0; + + if(input[3] < 127) + { + *(*output) |= (unsigned char)1 << (7 - (*bit_counter)); + } + + if((*bit_counter) == 0) + { + (*output)++; + (*bit_counter) = 7; + } + else + (*bit_counter)--; + } + + // These routines blend in a background color since they should be + // exclusively used for widgets. + + static inline void transfer_RGBA8888_to_RGB8bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) + { + unsigned int r, g, b, a, anti_a; + a = input[3]; + anti_a = 255 - a; + r = (unsigned int)input[0] * a + bg_r * anti_a; + g = (unsigned int)input[1] * a + bg_g * anti_a; + b = (unsigned int)input[2] * a + bg_b * anti_a; + *(*output) = (unsigned char)(((r & 0xc000) >> 8) + + ((g & 0xe000) >> 10) + + ((b & 0xe000) >> 13)); + (*output)++; + } + + static inline void transfer_RGBA8888_to_RGB565bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) + { + unsigned int r, g, b, a, anti_a; + a = input[3]; + anti_a = 255 - a; + r = (unsigned int)input[0] * a + bg_r * anti_a; + g = (unsigned int)input[1] * a + bg_g * anti_a; + b = (unsigned int)input[2] * a + bg_b * anti_a; + *(uint16_t*)(*output) = (uint16_t)((r & 0xf800) + + ((g & 0xfc00) >> 5) + + ((b & 0xf800) >> 11)); + (*output) += 2; + } + + static inline void transfer_RGBA8888_to_BGR888bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) + { + unsigned int r, g, b, a, anti_a; + a = input[3]; + anti_a = 255 - a; + r = (unsigned int)input[0] * a + bg_r * anti_a; + g = (unsigned int)input[1] * a + bg_g * anti_a; + b = (unsigned int)input[2] * a + bg_b * anti_a; + (*output)[0] = (b >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (r >> 8) + 1; + (*output) += 3; + } + + static inline void transfer_RGBA8888_to_RGB888bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) + { + unsigned int r, g, b, a, anti_a; + a = input[3]; + anti_a = 255 - a; + r = (unsigned int)input[0] * a + bg_r * anti_a; + g = (unsigned int)input[1] * a + bg_g * anti_a; + b = (unsigned int)input[2] * a + bg_b * anti_a; + (*output)[0] = (r >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (b >> 8) + 1; + (*output) += 3; + } + + static inline void transfer_RGBA8888_to_BGR8888bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) + { + unsigned int r, g, b, a, anti_a; + a = input[3]; + anti_a = 255 - a; + + r = (unsigned int)input[0] * a + bg_r * anti_a; + g = (unsigned int)input[1] * a + bg_g * anti_a; + b = (unsigned int)input[2] * a + bg_b * anti_a; + + (*output)[0] = (b >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (r >> 8) + 1; + (*output) += 4; + } + + + + + + + + // These routines blend in a black background + + static inline void transfer_RGBA8888_to_RGB8(unsigned char *(*output), unsigned char *input) + { + unsigned int r, g, b, a; + a = input[3]; + r = (unsigned int)input[0] * a; + g = (unsigned int)input[1] * a; + b = (unsigned int)input[2] * a; + *(*output) = (unsigned char)(((r & 0xc000) >> 8) + + ((g & 0xe000) >> 10) + + ((b & 0xe000) >> 13)); + (*output)++; + } + + static inline void transfer_RGBA8888_to_RGB565(unsigned char *(*output), unsigned char *input) + { + unsigned int r, g, b, a; + a = input[3]; + r = (unsigned int)input[0] * a; + g = (unsigned int)input[1] * a; + b = (unsigned int)input[2] * a; + *(uint16_t*)(*output) = (uint16_t)((r & 0xf800) + + ((g & 0xfc00) >> 5) + + ((b & 0xf800) >> 11)); + (*output) += 2; + } + + static inline void transfer_RGBA8888_to_BGR888(unsigned char *(*output), unsigned char *input) + { + unsigned int r, g, b, a; + a = input[3]; + r = (unsigned int)input[0] * a; + g = (unsigned int)input[1] * a; + b = (unsigned int)input[2] * a; + (*output)[0] = (b >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (r >> 8) + 1; + (*output) += 3; + } + + static inline void transfer_RGBA8888_to_RGB888(unsigned char *(*output), unsigned char *input) + { + unsigned int r, g, b, a; + a = input[3]; + r = (unsigned int)input[0] * a; + g = (unsigned int)input[1] * a; + b = (unsigned int)input[2] * a; + (*output)[0] = (r >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (b >> 8) + 1; + (*output) += 3; + } + + static inline void transfer_RGBA8888_to_RGBA8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output)[3] = input[3]; + (*output) += 4; + } + + static inline void transfer_RGBA8888_to_BGR8888(unsigned char *(*output), unsigned char *input) + { + unsigned int r, g, b, a; + a = input[3]; + r = (unsigned int)input[0] * a; + g = (unsigned int)input[1] * a; + b = (unsigned int)input[2] * a; + (*output)[0] = (b >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (r >> 8) + 1; + (*output) += 4; + } + + static inline void transfer_RGBA8888_to_YUV888(unsigned char *(*output), unsigned char *input) + { + int y, u, v, a, r, g, b; + + a = input[3]; + r = ((input[0] * a) >> 8) + 1; + g = ((input[1] * a) >> 8) + 1; + b = ((input[2] * a) >> 8) + 1; + + RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); + + (*output)[0] = y; + (*output)[1] = u; + (*output)[2] = v; + (*output) += 3; + } + + static inline void transfer_RGBA8888_to_YUVA8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + + RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); + + (*output)[0] = y; + (*output)[1] = u; + (*output)[2] = v; + (*output)[3] = input[3]; + (*output) += 4; + } + + static inline void transfer_RGBA8888_to_YUV101010(unsigned char *(*output), unsigned char *input) + { + int r, g, b; + int y, u, v; + + r = ((uint16_t)input[0] * input[3]) + 0x1fe; + g = ((uint16_t)input[1] * input[3]) + 0x1fe; + b = ((uint16_t)input[2] * input[3]) + 0x1fe; + RGB_TO_YUV16(y, u, v, r, g, b); + WRITE_YUV101010(y, u, v); + } + + static inline void transfer_RGBA8888_to_VYU888(unsigned char *(*output), unsigned char *input) + { + int y, u, v, a, r, g, b; + + a = input[3]; + r = ((input[0] * a) >> 8) + 1; + g = ((input[1] * a) >> 8) + 1; + b = ((input[2] * a) >> 8) + 1; + + RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); + + (*output)[0] = v; + (*output)[1] = y; + (*output)[2] = u; + (*output) += 3; + } + + static inline void transfer_RGBA8888_to_UYVA8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + + RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); + + (*output)[0] = u; + (*output)[1] = y; + (*output)[2] = v; + (*output)[3] = input[3]; + (*output) += 4; + } + + + // ******************************** RGB161616 -> ********************************* + + static inline void transfer_RGB161616_to_RGB8(unsigned char *(*output), uint16_t *input) + { + *(*output) = (unsigned char)(((input[0] & 0xc000) >> 8) + + ((input[1] & 0xe000) >> 10) + + ((input[2] & 0xe000) >> 13)); + (*output)++; + } + + static inline void transfer_RGB161616_to_RGB565(unsigned char *(*output), uint16_t *input) + { + uint16_t r, g, b; + r = *input++; + g = *input++; + b = *input; + *(uint16_t*)(*output) = (r & 0xf800) | + ((g & 0xfc00) >> 5) | + ((b & 0xf800) >> 11); + (*output) += 2; + } + + static inline void transfer_RGB161616_to_BGR888(unsigned char *(*output), uint16_t *input) + { + (*output)[0] = input[2] >> 8; + (*output)[1] = input[1] >> 8; + (*output)[2] = input[0] >> 8; + (*output) += 3; + } + + static inline void transfer_RGB161616_to_RGB888(unsigned char *(*output), uint16_t *input) + { + (*output)[0] = input[0] >> 8; + (*output)[1] = input[1] >> 8; + (*output)[2] = input[2] >> 8; + (*output) += 3; + } + + static inline void transfer_RGB161616_to_RGBA8888(unsigned char *(*output), uint16_t *input) + { + (*output)[0] = input[0] >> 8; + (*output)[1] = input[1] >> 8; + (*output)[2] = input[2] >> 8; + (*output)[3] = 0xff; + (*output) += 4; + } + + static inline void transfer_RGB161616_to_BGR8888(unsigned char *(*output), uint16_t *input) + { + (*output)[0] = input[2] >> 8; + (*output)[1] = input[1] >> 8; + (*output)[2] = input[0] >> 8; + (*output) += 4; + } + + static inline void transfer_RGB161616_to_YUV888(unsigned char *(*output), uint16_t *input) + { + int y, u, v, r, g, b; + r = input[0] >> 8; + g = input[1] >> 8; + b = input[2] >> 8; + + RGB_TO_YUV(y, u, v, r, g, b); + + (*output)[0] = y; + (*output)[1] = u; + (*output)[2] = v; + (*output) += 3; + } + + static inline void transfer_RGB161616_to_YUVA8888(unsigned char *(*output), uint16_t *input) + { + int y, u, v, r, g, b; + + r = input[0] >> 8; + g = input[1] >> 8; + b = input[2] >> 8; + + RGB_TO_YUV(y, u, v, r, g, b); + + (*output)[0] = y; + (*output)[1] = u; + (*output)[2] = v; + (*output)[3] = 255; + (*output) += 4; + } + + + static inline void transfer_RGB161616_to_YUV101010(unsigned char *(*output), uint16_t *input) + { + int r, g, b; + int y, u, v; + + r = input[0]; + g = input[1]; + b = input[2]; + RGB_TO_YUV16(y, u, v, r, g, b); + WRITE_YUV101010(y, u, v); + } + + static inline void transfer_RGB161616_to_VYU888(unsigned char *(*output), uint16_t *input) + { + int y, u, v, r, g, b; + r = input[0] >> 8; + g = input[1] >> 8; + b = input[2] >> 8; + + RGB_TO_YUV(y, u, v, r, g, b); + + (*output)[0] = v; + (*output)[1] = y; + (*output)[2] = u; + (*output) += 3; + } + + static inline void transfer_RGB161616_to_UYVA8888(unsigned char *(*output), uint16_t *input) + { + int y, u, v, r, g, b; + + r = input[0] >> 8; + g = input[1] >> 8; + b = input[2] >> 8; + + RGB_TO_YUV(y, u, v, r, g, b); + + (*output)[0] = u; + (*output)[1] = y; + (*output)[2] = v; + (*output)[3] = 0xff; + (*output) += 4; + } + + + static inline void transfer_RGB161616_to_YUV420P_YUV422P(unsigned char *output_y, + unsigned char *output_u, + unsigned char *output_v, + uint16_t *input, + int output_column) + { + int y, u, v, r, g, b; + r = input[0] >> 8; + g = input[1] >> 8; + b = input[2] >> 8; + + RGB_TO_YUV(y, u, v, r, g, b); + + output_y[output_column] = y; + output_u[output_column / 2] = u; + output_v[output_column / 2] = v; + } + + + // ****************************** RGBA16161616 -> ***************************** + + static inline void transfer_RGBA16161616_to_RGB8(unsigned char *(*output), uint16_t *input) + { + unsigned int r, g, b, a; + a = (input)[3] >> 8; + r = (unsigned int)(input)[0] * a; + g = (unsigned int)(input)[1] * a; + b = (unsigned int)(input)[2] * a; + + *(*output) = (unsigned char)(((r & 0xc00000) >> 16) + + ((g & 0xe00000) >> 18) + + ((b & 0xe00000) >> 21)); + (*output)++; + } + + static inline void transfer_RGBA16161616_to_RGB565(unsigned char *(*output), uint16_t *input) + { + unsigned int r, g, b, a; + a = (input)[3] >> 8; + r = (unsigned int)(input)[0] * a; + g = (unsigned int)(input)[1] * a; + b = (unsigned int)(input)[2] * a; + + *(uint16_t*)(*output) = (uint16_t)(((r & 0xf80000) >> 8) + + ((g & 0xfc0000) >> 13) + + ((b & 0xf80000) >> 19)); + (*output) += 2; + } + + static inline void transfer_RGBA16161616_to_BGR888(unsigned char *(*output), uint16_t *input) + { + unsigned int r, g, b, a; + a = (input)[3] >> 8; + r = (unsigned int)(input)[0] * a; + g = (unsigned int)(input)[1] * a; + b = (unsigned int)(input)[2] * a; + + (*output)[0] = (unsigned char)(b >> 16); + (*output)[1] = (unsigned char)(g >> 16); + (*output)[2] = (unsigned char)(r >> 16); + (*output) += 3; + } + + static inline void transfer_RGBA16161616_to_RGB888(unsigned char *(*output), uint16_t *input) + { + unsigned int r, g, b, a; + a = (input)[3] >> 8; + r = (unsigned int)(input)[0] * a; + g = (unsigned int)(input)[1] * a; + b = (unsigned int)(input)[2] * a; + + (*output)[0] = (unsigned char)(r >> 16); + (*output)[1] = (unsigned char)(g >> 16); + (*output)[2] = (unsigned char)(b >> 16); + (*output) += 3; + } + + + static inline void transfer_RGBA16161616_to_RGBA8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[0] >> 8; + (*output)[1] = input[1] >> 8; + (*output)[2] = input[2] >> 8; + (*output)[3] = input[3] >> 8; + (*output) += 4; + } + + + static inline void transfer_RGBA16161616_to_BGR8888(unsigned char *(*output), uint16_t *input) + { + unsigned int r, g, b, a; + a = (input)[3] >> 8; + r = (input)[0] * a; + g = (input)[1] * a; + b = (input)[2] * a; + + (*output)[0] = (unsigned char)(b >> 16); + (*output)[1] = (unsigned char)(g >> 16); + (*output)[2] = (unsigned char)(r >> 16); + (*output) += 4; + } + + static inline void transfer_RGBA16161616_to_YUV101010(unsigned char *(*output), uint16_t *input) + { + int r, g, b; + int y, u, v; + + r = (((uint32_t)input[0] * input[3]) >> 16) + 0x1; + g = (((uint32_t)input[1] * input[3]) >> 16) + 0x1; + b = (((uint32_t)input[2] * input[3]) >> 16) + 0x1; + RGB_TO_YUV16(y, u, v, r, g, b); + WRITE_YUV101010(y, u, v); + } + + + + + + + + + + + static inline void transfer_BGR8888_to_RGB888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[2]; + (*output)[1] = input[1]; + (*output)[2] = input[0]; + (*output) += 3; + } + + static inline void transfer_BGR8888_to_BGR8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output) += 4; + } + + static inline void transfer_BGR888_to_RGB888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[2]; + (*output)[1] = input[1]; + (*output)[2] = input[0]; + (*output) += 3; + } + + + + + + + + // ******************************** YUV888 -> ********************************* + + + static inline void transfer_YUV888_to_RGB8(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + + *(*output) = (unsigned char)((r & 0xc0) + + ((g & 0xe0) >> 2) + + ((b & 0xe0) >> 5)); + (*output)++; + } + + static inline void transfer_YUV888_to_RGB565(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + *(uint16_t*)(*output) = ((r & 0xf8) << 8) + + ((g & 0xfc) << 3) + + ((b & 0xf8) >> 3); + (*output) += 2; + } + + static inline void transfer_YUV888_to_BGR888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + + (*output)[2] = r; + (*output)[1] = g; + (*output)[0] = b; + (*output) += 3; + } + + static inline void transfer_YUV888_to_BGR8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + (*output)[2] = r; + (*output)[1] = g; + (*output)[0] = b; + (*output) += 4; + } + + static inline void transfer_YUV888_to_RGB888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output) += 3; + } + + static inline void transfer_YUV888_to_RGBA8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output)[3] = 0xff; + (*output) += 4; + } + + static inline void transfer_YUV888_to_YUVA8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = (int)input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output)[3] = 0xff; + (*output) += 4; + } + + static inline void transfer_YUV888_to_YUV888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = (int)input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output) += 3; + } + + + static inline void transfer_YUV888_to_VYU888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[2]; + (*output)[1] = input[0]; + (*output)[2] = input[1]; + (*output) += 3; + } + + + static inline void transfer_YUV888_to_UYVA8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[1]; + (*output)[1] = input[0]; + (*output)[2] = input[2]; + (*output)[3] = 0xff; + (*output) += 4; + } + + + static inline void transfer_YUV888_to_YUV101010(unsigned char *(*output), unsigned char *input) + { + uint16_t y_i = ((uint16_t)input[0]) << 8; + uint16_t u_i = ((uint16_t)input[1]) << 8; + uint16_t v_i = ((uint16_t)input[2]) << 8; + WRITE_YUV101010(y_i, u_i, v_i); + } + + static inline void transfer_YUV888_to_YUV420P_YUV422P(unsigned char *output_y, + unsigned char *output_u, + unsigned char *output_v, + unsigned char *input, + int output_column) + { + output_y[output_column] = input[0]; + output_u[output_column / 2] = input[1]; + output_v[output_column / 2] = input[2]; + } + + static inline void transfer_YUV888_to_YUV422(unsigned char *(*output), + unsigned char *input, + int j) + { + // Store U and V for even pixels only + if(!(j & 1)) + { + (*output)[1] = input[1]; + (*output)[3] = input[2]; + (*output)[0] = input[0]; + } + else + // Store Y and advance output for odd pixels only + { + (*output)[2] = input[0]; + (*output) += 4; + } + } + + + + + + + // ******************************** YUVA8888 -> ******************************* + + + + + static inline void transfer_YUVA8888_to_RGB8(unsigned char *(*output), unsigned char *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + + *(*output) = (unsigned char)(((r & 0xc000) >> 8) + + ((g & 0xe000) >> 10) + + ((b & 0xe000) >> 13)); + (*output)++; + } + + static inline void transfer_YUVA8888_to_RGB565(unsigned char *(*output), unsigned char *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + + *(uint16_t*)(*output) = (uint16_t)((r & 0xf800) + + ((g & 0xfc00) >> 5) + + ((b & 0xf800) >> 11)); + (*output) += 2; + } + + static inline void transfer_YUVA8888_to_BGR888(unsigned char *(*output), unsigned char *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + + (*output)[0] = (b >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (r >> 8) + 1; + (*output) += 3; + } + + static inline void transfer_YUVA8888_to_RGB888(unsigned char *(*output), unsigned char *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + + (*output)[0] = (r >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (b >> 8) + 1; + (*output) += 3; + } + + static inline void transfer_YUVA8888_to_RGBA8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + + YUV_TO_RGB(y, u, v, r, g, b); + + (*output)[0] = (r >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (b >> 8) + 1; + (*output)[3] = (input[3] >> 8) + 1; + (*output) += 4; + } + + static inline void transfer_YUVA8888_to_BGR8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 16; + u = input[1]; + v = input[2]; + + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + (*output)[0] = (b >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (r >> 8) + 1; + (*output) += 4; + } + + + static inline void transfer_YUVA8888_to_VYU888(unsigned char *(*output), unsigned char *input) + { + int y, u, v, a, anti_a; + a = input[3]; + anti_a = 0xff - a; + y = ((uint32_t)input[0] * a) / 0xff; + u = ((uint32_t)input[1] * a + 0x80 * anti_a) / 0xff; + v = ((uint32_t)input[2] * a + 0x80 * anti_a) / 0xff; + + (*output)[0] = v; + (*output)[1] = y; + (*output)[2] = u; + (*output) += 3; + } + + + static inline void transfer_YUVA8888_to_YUVA8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output)[3] = input[3]; + (*output) += 4; + } + + static inline void transfer_YUVA8888_to_UYVA8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[1]; + (*output)[1] = input[0]; + (*output)[2] = input[2]; + (*output)[3] = input[3]; + (*output) += 4; + } + + static inline void transfer_YUVA8888_to_YUV101010(unsigned char *(*output), unsigned char *input) + { + uint16_t y_i = ((uint16_t)input[0] * input[3]) + 0x1fe; + uint16_t u_i = ((uint16_t)input[1] * input[3]) + 0x1fe; + uint16_t v_i = ((uint16_t)input[2] * input[3]) + 0x1fe; + WRITE_YUV101010(y_i, u_i, v_i); + } + + + static inline void transfer_YUVA8888_to_YUV420P_YUV422P(unsigned char *output_y, + unsigned char *output_u, + unsigned char *output_v, + unsigned char *input, + int output_column) + { + int a = input[3]; + + output_y[output_column] = ((input[0] * a) >> 8) + 1; + output_u[output_column / 2] = ((input[1] * a) >> 8) + 1; + output_v[output_column / 2] = ((input[2] * a) >> 8) + 1; + } + + static inline void transfer_YUVA8888_to_YUV422(unsigned char *(*output), + unsigned char *input, + int j) + { + int a = input[3]; + // Store U and V for even pixels only + if(!(j & 1)) + { + (*output)[1] = ((input[1] * a) >> 8) + 1; + (*output)[3] = ((input[2] * a) >> 8) + 1; + (*output)[0] = ((input[0] * a) >> 8) + 1; + } + else + // Store Y and advance output for odd pixels only + { + (*output)[2] = ((input[0] * a) >> 8) + 1; + (*output) += 4; + } + } + + + + + + + + + + + + // ********************************* YUV101010 -> ***************************** + + #define READ_YUV101010 \ + unsigned int y, u, v; \ + uint32_t input_i = input[0] | \ + (input[1] << 8) | \ + (input[2] << 16) | \ + (input[3] << 24); \ + \ + y = (input_i & 0xffc00000) >> 16; \ + u = (input_i & 0x3ff000) >> 6; \ + v = (input_i & 0xffc) << 4; + + static inline void transfer_YUV101010_to_RGB8(unsigned char *(*output), unsigned char *input) + { + int r, g, b; + + READ_YUV101010 + + y <<= 8; + + YUV_TO_RGB16(y, u, v, r, g, b); + + *(*output)++ = (unsigned char)(((input[0] & 0xc000) >> 8) + + ((input[1] & 0xe000) >> 10) + + ((input[2] & 0xe000) >> 13)); + } + + static inline void transfer_YUV101010_to_RGB565(unsigned char *(*output), unsigned char *input) + { + int r, g, b; + + READ_YUV101010 + + y <<= 8; + + YUV_TO_RGB16(y, u, v, r, g, b); + + *(uint16_t*)(*output) = (r & 0xf800) | + ((g & 0xfc00) >> 5) | + ((b & 0xf800) >> 11); + (*output) += 2; + } + + static inline void transfer_YUV101010_to_BGR888(unsigned char *(*output), unsigned char *input) + { + int r, g, b; + + READ_YUV101010 + + y <<= 8; + + YUV_TO_RGB16(y, u, v, r, g, b); + + *(*output)++ = b >> 8; + *(*output)++ = g >> 8; + *(*output)++ = r >> 8; + } + + static inline void transfer_YUV101010_to_BGR8888(unsigned char *(*output), unsigned char *input) + { + int r, g, b; + + READ_YUV101010 + + y <<= 8; + + YUV_TO_RGB16(y, u, v, r, g, b); + + *(*output)++ = b >> 8; + *(*output)++ = g >> 8; + *(*output)++ = r >> 8; + (*output)++; + } + + static inline void transfer_YUV101010_to_YUV888(unsigned char *(*output), unsigned char *input) + { + READ_YUV101010 + + *(*output)++ = y >> 8; + *(*output)++ = u >> 8; + *(*output)++ = v >> 8; + } + + static inline void transfer_YUV101010_to_YUVA8888(unsigned char *(*output), unsigned char *input) + { + READ_YUV101010 + + *(*output)++ = y >> 8; + *(*output)++ = u >> 8; + *(*output)++ = v >> 8; + *(*output)++ = 0xff; + } + + static inline void transfer_YUV101010_to_YUV161616(uint16_t *(*output), unsigned char *input) + { + READ_YUV101010 + + *(*output)++ = y; + *(*output)++ = u; + *(*output)++ = v; + } + + static inline void transfer_YUV101010_to_YUVA16161616(uint16_t *(*output), unsigned char *input) + { + READ_YUV101010 + + *(*output)++ = y; + *(*output)++ = u; + *(*output)++ = v; + *(*output)++ = 0xffff; + } + + static inline void transfer_YUV101010_to_RGB888(unsigned char *(*output), unsigned char *input) + { + int r, g, b; + + READ_YUV101010 + + y <<= 8; + + YUV_TO_RGB16(y, u, v, r, g, b); + + *(*output)++ = r >> 8; + *(*output)++ = g >> 8; + *(*output)++ = b >> 8; + } + + static inline void transfer_YUV101010_to_RGBA8888(unsigned char *(*output), unsigned char *input) + { + int r, g, b; + + READ_YUV101010 + + y <<= 8; + + YUV_TO_RGB16(y, u, v, r, g, b); + + *(*output)++ = r >> 8; + *(*output)++ = g >> 8; + *(*output)++ = b >> 8; + *(*output)++ = 0xff; + } + + static inline void transfer_YUV101010_to_RGB161616(uint16_t *(*output), unsigned char *input) + { + int r, g, b; + + READ_YUV101010 + + y <<= 8; + + YUV_TO_RGB16(y, u, v, r, g, b); + + *(*output)++ = r; + *(*output)++ = g; + *(*output)++ = b; + } + + static inline void transfer_YUV101010_to_RGBA16161616(uint16_t *(*output), unsigned char *input) + { + int r, g, b; + + READ_YUV101010 + + y <<= 8; + + YUV_TO_RGB16(y, u, v, r, g, b); + + *(*output)++ = r; + *(*output)++ = g; + *(*output)++ = b; + *(*output)++ = 0xffff; + } + + + + + + + + + + // ******************************** YUV161616 -> ****************************** + + + static inline void transfer_YUV161616_to_RGB8(unsigned char *(*output), uint16_t *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 8; + u = input[1] >> 8; + v = input[2] >> 8; + YUV_TO_RGB(y, u, v, r, g, b); + + *(*output) = (unsigned char)((r & 0xc0) + + ((g & 0xe0) >> 2) + + ((b & 0xe0) >> 5)); + (*output)++; + } + + static inline void transfer_YUV161616_to_RGB565(unsigned char *(*output), uint16_t *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 8; + u = input[1] >> 8; + v = input[2] >> 8; + YUV_TO_RGB(y, u, v, r, g, b); + *(uint16_t*)(*output) = ((r & 0xf8) << 8) + + ((g & 0xfc) << 3) + + ((b & 0xf8) >> 3); + (*output) += 2; + } + + static inline void transfer_YUV161616_to_BGR888(unsigned char *(*output), uint16_t *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 8; + u = input[1]; + v = input[2]; + YUV_TO_RGB16(y, u, v, r, g, b); + + (*output)[2] = r >> 8; + (*output)[1] = g >> 8; + (*output)[0] = b >> 8; + (*output) += 3; + } + + static inline void transfer_YUV161616_to_RGB888(unsigned char *(*output), uint16_t *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 8; + u = input[1]; + v = input[2]; + YUV_TO_RGB16(y, u, v, r, g, b); + + (*output)[0] = r >> 8; + (*output)[1] = g >> 8; + (*output)[2] = b >> 8; + (*output) += 3; + } + + static inline void transfer_YUV161616_to_RGBA8888(unsigned char *(*output), uint16_t *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 8; + u = input[1]; + v = input[2]; + YUV_TO_RGB16(y, u, v, r, g, b); + + (*output)[0] = r >> 8; + (*output)[1] = g >> 8; + (*output)[2] = b >> 8; + (*output)[3] = 0xff; + (*output) += 4; + } + + static inline void transfer_YUV161616_to_BGR8888(unsigned char *(*output), uint16_t *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[0]) << 8; + u = input[1] >> 8; + v = input[2] >> 8; + YUV_TO_RGB(y, u, v, r, g, b); + (*output)[2] = r; + (*output)[1] = g; + (*output)[0] = b; + (*output) += 4; + } + + static inline void transfer_YUV161616_to_YUV161616(uint16_t *(*output), uint16_t *input) + { + (*output)[0] = input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output) += 3; + } + + static inline void transfer_YUV161616_to_YUVA8888(unsigned char *(*output), uint16_t *input) + { + (*output)[0] = input[0] >> 8; + (*output)[1] = input[1] >> 8; + (*output)[2] = input[2] >> 8; + (*output)[3] = 255; + (*output) += 4; + } + + + static inline void transfer_YUV161616_to_VYU888(unsigned char *(*output), uint16_t *input) + { + (*output)[0] = input[2] >> 8; + (*output)[1] = input[0] >> 8; + (*output)[2] = input[1] >> 8; + (*output) += 3; + } + + + static inline void transfer_YUV161616_to_UYVA8888(unsigned char *(*output), uint16_t *input) + { + (*output)[0] = input[1] >> 8; + (*output)[1] = input[0] >> 8; + (*output)[2] = input[2] >> 8; + (*output)[3] = input[3] >> 8; + (*output) += 4; + } + + static inline void transfer_YUV161616_to_YUV101010(unsigned char *(*output), uint16_t *input) + { + uint16_t y_i = input[0]; + uint16_t u_i = input[1]; + uint16_t v_i = input[2]; + WRITE_YUV101010(y_i, u_i, v_i); + } + + static inline void transfer_YUV161616_to_YUV420P_YUV422P(unsigned char *output_y, + unsigned char *output_u, + unsigned char *output_v, + uint16_t *input, + int output_column) + { + output_y[output_column] = input[0] >> 8; + output_u[output_column / 2] = input[1] >> 8; + output_v[output_column / 2] = input[2] >> 8; + } + + static inline void transfer_YUV161616_to_YUV422(unsigned char *(*output), + uint16_t *input, + int j) + { + // Store U and V for even pixels only + if(!(j & 1)) + { + (*output)[1] = input[1] >> 8; + (*output)[3] = input[2] >> 8; + (*output)[0] = input[0] >> 8; + } + else + // Store Y and advance output for odd pixels only + { + (*output)[2] = input[0] >> 8; + (*output) += 4; + } + } + + + + + + + + + + + + // ******************************** YUVA16161616 -> *************************** + + + + + static inline void transfer_YUVA16161616_to_RGB8(unsigned char *(*output), uint16_t *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 8; + u = input[1] >> 8; + v = input[2] >> 8; + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + + *(*output) = (unsigned char)(((r & 0xc000) >> 8) + + ((g & 0xe000) >> 10) + + ((b & 0xe000) >> 13)); + (*output)++; + } + + static inline void transfer_YUVA16161616_to_RGB565(unsigned char *(*output), uint16_t *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 8; + u = input[1] >> 8; + v = input[2] >> 8; + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + + *(uint16_t*)(*output) = (uint16_t)((r & 0xf800) + + ((g & 0xfc00) >> 5) + + ((b & 0xf800) >> 11)); + (*output) += 2; + } + + static inline void transfer_YUVA16161616_to_BGR888(unsigned char *(*output), uint16_t *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 8; + u = input[1] >> 8; + v = input[2] >> 8; + + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + + (*output)[0] = (b >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (r >> 8) + 1; + (*output) += 3; + } + + static inline void transfer_YUVA16161616_to_RGB888(unsigned char *(*output), uint16_t *input) + { + unsigned int y, u, v, a; + unsigned int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 8; + u = input[1]; + v = input[2]; + + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + + (*output)[0] = (r >> 24) + 1; + (*output)[1] = (g >> 24) + 1; + (*output)[2] = (b >> 24) + 1; + (*output) += 3; + } + + static inline void transfer_YUVA16161616_to_RGBA8888(unsigned char *(*output), uint16_t *input) + { + unsigned int y, u, v, a; + unsigned int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 8; + u = input[1]; + v = input[2]; + + YUV_TO_RGB(y, u, v, r, g, b); + + (*output)[0] = (r >> 8); + (*output)[1] = (g >> 8); + (*output)[2] = (b >> 8); + (*output)[3] = 0xff; + (*output) += 4; + } + + static inline void transfer_YUVA16161616_to_BGR8888(unsigned char *(*output), uint16_t *input) + { + int y, u, v, a; + int r, g, b; + + a = input[3]; + y = ((int)input[0]) << 8; + u = input[1] >> 8; + v = input[2] >> 8; + + YUV_TO_RGB(y, u, v, r, g, b); + + r *= a; + g *= a; + b *= a; + (*output)[0] = (b >> 8) + 1; + (*output)[1] = (g >> 8) + 1; + (*output)[2] = (r >> 8) + 1; + (*output) += 4; + } + + + static inline void transfer_YUVA16161616_to_VYU888(unsigned char *(*output), uint16_t *input) + { + int y, u, v, a, anti_a; + a = input[3]; + anti_a = 0xffff - a; + y = ((uint32_t)input[0] * a) / 0xffff; + u = ((uint32_t)input[1] * a + 0x8000 * anti_a) / 0xffff; + v = ((uint32_t)input[2] * a + 0x8000 * anti_a) / 0xffff; + + (*output)[0] = v >> 8; + (*output)[1] = y >> 8; + (*output)[2] = u >> 8; + (*output) += 3; + } + + + static inline void transfer_YUVA16161616_to_YUVA16161616(uint16_t *(*output), uint16_t *input) + { + (*output)[0] = input[0]; + (*output)[1] = input[1]; + (*output)[2] = input[2]; + (*output)[3] = input[3]; + (*output) += 4; + } + + static inline void transfer_YUVA16161616_to_UYVA8888(unsigned char *(*output), uint16_t *input) + { + (*output)[0] = input[1] >> 8; + (*output)[1] = input[0] >> 8; + (*output)[2] = input[2] >> 8; + (*output)[3] = input[3] >> 8; + (*output) += 4; + } + + + static inline void transfer_YUVA16161616_to_YUV101010(unsigned char *(*output), uint16_t *input) + { + uint16_t y_i = (((uint32_t)input[0] * input[3]) >> 16) + 1; + uint16_t u_i = (((uint32_t)input[1] * input[3]) >> 16) + 1; + uint16_t v_i = (((uint32_t)input[2] * input[3]) >> 16) + 1; + WRITE_YUV101010(y_i, u_i, v_i); + } + + static inline void transfer_YUVA16161616_to_YUV420P_YUV422P(unsigned char *output_y, + unsigned char *output_u, + unsigned char *output_v, + uint16_t *input, + int output_column) + { + int a = input[3]; + + output_y[output_column] = ((input[0] * a) >> 16) + 1; + output_u[output_column / 2] = ((input[1] * a) >> 16) + 1; + output_v[output_column / 2] = ((input[2] * a) >> 16) + 1; + } + + static inline void transfer_YUVA16161616_to_YUV422(unsigned char *(*output), + uint16_t *input, + int j) + { + int a = input[3]; + // Store U and V for even pixels only + if(!(j & 1)) + { + (*output)[1] = ((input[1] * a) >> 16) + 1; + (*output)[3] = ((input[2] * a) >> 16) + 1; + (*output)[0] = ((input[0] * a) >> 16) + 1; + } + else + // Store Y and advance output for odd pixels only + { + (*output)[2] = ((input[0] * a) >> 16) + 1; + (*output) += 4; + } + } + + + + + + + + + + + + + + + + + // ******************************** VYU888 -> ********************************* + + + static inline void transfer_VYU888_to_RGB8(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[2]; + v = input[0]; + YUV_TO_RGB(y, u, v, r, g, b); + + *(*output) = (unsigned char)((r & 0xc0) + + ((g & 0xe0) >> 2) + + ((b & 0xe0) >> 5)); + (*output)++; + } + + static inline void transfer_VYU888_to_RGB565(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[2]; + v = input[0]; + YUV_TO_RGB(y, u, v, r, g, b); + *(uint16_t*)(*output) = ((r & 0xf8) << 8) + + ((g & 0xfc) << 3) + + ((b & 0xf8) >> 3); + (*output) += 2; + } + + static inline void transfer_VYU888_to_BGR888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[2]; + v = input[0]; + YUV_TO_RGB(y, u, v, r, g, b); + + (*output)[2] = r; + (*output)[1] = g; + (*output)[0] = b; + (*output) += 3; + } + + static inline void transfer_VYU888_to_BGR8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[2]; + v = input[0]; + YUV_TO_RGB(y, u, v, r, g, b); + (*output)[2] = r; + (*output)[1] = g; + (*output)[0] = b; + (*output) += 4; + } + + + static inline void transfer_VYU888_to_RGB888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[2]; + v = input[0]; + YUV_TO_RGB(y, u, v, r, g, b); + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output) += 3; + } + + static inline void transfer_VYU888_to_RGBA8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[2]; + v = input[0]; + YUV_TO_RGB(y, u, v, r, g, b); + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output)[3] = 0xff; + (*output) += 4; + } + + + static inline void transfer_VYU888_to_RGB161616(uint16_t *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[2] << 8; + v = input[0] << 8; + YUV_TO_RGB16(y, u, v, r, g, b); + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output) += 3; + } + + static inline void transfer_VYU888_to_RGBA16161616(uint16_t *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[2] << 8; + v = input[0] << 8; + YUV_TO_RGB16(y, u, v, r, g, b); + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output)[3] = 0xffff; + (*output) += 3; + } + + + static inline void transfer_VYU888_to_YUV888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[1]; + (*output)[1] = input[2]; + (*output)[2] = input[0]; + (*output) += 3; + } + + static inline void transfer_VYU888_to_YUVA8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[1]; + (*output)[1] = input[2]; + (*output)[2] = input[0]; + (*output)[3] = 0xff; + (*output) += 4; + } + + + static inline void transfer_VYU888_to_YUV161616(uint16_t *(*output), unsigned char *input) + { + (*output)[0] = ((int)input[1]) << 8; + (*output)[1] = ((int)input[2]) << 8; + (*output)[2] = ((int)input[0]) << 8; + (*output) += 3; + } + + static inline void transfer_VYU888_to_YUVA16161616(uint16_t *(*output), unsigned char *input) + { + (*output)[0] = ((int)input[1]) << 8; + (*output)[1] = ((int)input[2]) << 8; + (*output)[2] = ((int)input[0]) << 8; + (*output)[3] = 0xff; + (*output) += 4; + } + + + + + + + + + + + + + + + // ******************************** UYVA8888 -> ********************************* + + + static inline void transfer_UYVA8888_to_RGB8(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[0]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + + r = r * input[3] / 0xff; + g = g * input[3] / 0xff; + b = b * input[3] / 0xff; + *(*output) = (unsigned char)((r & 0xc0) + + ((g & 0xe0) >> 2) + + ((b & 0xe0) >> 5)); + (*output)++; + } + + static inline void transfer_UYVA8888_to_RGB565(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[0]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + r = r * input[3] / 0xff; + g = g * input[3] / 0xff; + b = b * input[3] / 0xff; + *(uint16_t*)(*output) = ((r & 0xf8) << 8) + + ((g & 0xfc) << 3) + + ((b & 0xf8) >> 3); + (*output) += 2; + } + + static inline void transfer_UYVA8888_to_BGR888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[0]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + r = r * input[3] / 0xff; + g = g * input[3] / 0xff; + b = b * input[3] / 0xff; + + (*output)[2] = r; + (*output)[1] = g; + (*output)[0] = b; + (*output) += 3; + } + + static inline void transfer_UYVA8888_to_BGR8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[0]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + r = r * input[3] / 0xff; + g = g * input[3] / 0xff; + b = b * input[3] / 0xff; + + (*output)[2] = r; + (*output)[1] = g; + (*output)[0] = b; + (*output) += 4; + } + + + static inline void transfer_UYVA8888_to_RGB888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[0]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + r = r * input[3] / 0xff; + g = g * input[3] / 0xff; + b = b * input[3] / 0xff; + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output) += 3; + } + + static inline void transfer_UYVA8888_to_RGBA8888(unsigned char *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[0]; + v = input[2]; + YUV_TO_RGB(y, u, v, r, g, b); + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output)[3] = input[3]; + (*output) += 4; + } + + + static inline void transfer_UYVA8888_to_RGB161616(uint16_t *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[0] << 8; + v = input[2] << 8; + YUV_TO_RGB16(y, u, v, r, g, b); + r = r * input[3] / 0xff; + g = g * input[3] / 0xff; + b = b * input[3] / 0xff; + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output) += 3; + } + + static inline void transfer_UYVA8888_to_RGBA16161616(uint16_t *(*output), unsigned char *input) + { + int y, u, v; + int r, g, b; + + y = ((int)input[1]) << 16; + u = input[0] << 8; + v = input[2] << 8; + YUV_TO_RGB16(y, u, v, r, g, b); + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output)[3] = input[3] << 8; + (*output) += 4; + } + + + static inline void transfer_UYVA8888_to_YUV888(unsigned char *(*output), unsigned char *input) + { + int a, anti_a; + a = input[3]; + anti_a = 0xff - a; + + (*output)[0] = (a * input[1]) / 0xff; + (*output)[1] = (a * input[0] + anti_a * 0x80) / 0xff; + (*output)[2] = (a * input[2] + anti_a * 0x80) / 0xff; + (*output) += 3; + } + + static inline void transfer_UYVA8888_to_YUVA8888(unsigned char *(*output), unsigned char *input) + { + (*output)[0] = input[1]; + (*output)[1] = input[0]; + (*output)[2] = input[2]; + (*output)[3] = input[3]; + (*output) += 4; + } + + + static inline void transfer_UYVA8888_to_YUV161616(uint16_t *(*output), unsigned char *input) + { + int a, anti_a; + a = input[3]; + anti_a = 0xff - a; + + (*output)[0] = a * input[1]; + (*output)[1] = a * input[0] + anti_a * 0x80; + (*output)[2] = a * input[2] + anti_a * 0x80; + (*output) += 3; + } + + static inline void transfer_UYVA8888_to_YUVA16161616(uint16_t *(*output), unsigned char *input) + { + (*output)[0] = input[1] << 8; + (*output)[1] = input[0] << 8; + (*output)[2] = input[2] << 8; + (*output)[3] = input[3] << 8; + (*output) += 4; + } + + + + + + + + + + + + + + + + // ******************************** YUV422P -> ******************************** + + static inline void transfer_YUV422P_to_RGB8(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + int y, u, v; + int r, g, b; + + y = (int)(*input_y) << 16; + u = *input_u; + v = *input_v; + YUV_TO_RGB(y, u, v, r, g, b) + + *(*output) = (unsigned char)((r & 0xc0) + + ((g & 0xe0) >> 2) + + ((b & 0xe0) >> 5)); + (*output)++; + } + + static inline void transfer_YUV422P_to_RGB565(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + int y, u, v; + int r, g, b; + + y = (int)(*input_y) << 16; + u = *input_u; + v = *input_v; + YUV_TO_RGB(y, u, v, r, g, b) + + *(uint16_t*)(*output) = ((r & 0xf8) << 8) + + ((g & 0xfc) << 3) + + ((b & 0xf8) >> 3); + (*output) += 2; + } + + static inline void transfer_YUV422P_to_BGR888(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + int y, u, v; + int r, g, b; + + y = (int)(*input_y) << 16; + u = *input_u; + v = *input_v; + YUV_TO_RGB(y, u, v, r, g, b) + + (*output)[0] = b; + (*output)[1] = g; + (*output)[2] = r; + (*output) += 3; + } + + static inline void transfer_YUV422P_to_BGR8888(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + int y, u, v; + int r, g, b; + + y = (int)(*input_y) << 16; + u = *input_u; + v = *input_v; + YUV_TO_RGB(y, u, v, r, g, b) + + (*output)[0] = b; + (*output)[1] = g; + (*output)[2] = r; + (*output) += 4; + } + + static inline void transfer_YUV422P_to_RGB888(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + // Signedness is important + int y, u, v; + int r, g, b; + + y = *input_y << 16; + u = *input_u; + v = *input_v; + YUV_TO_RGB(y, u, v, r, g, b) + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output) += 3; + } + + static inline void transfer_YUV422P_to_ARGB8888(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + // Signedness is important + int y, u, v; + int r, g, b; + + y = *input_y << 16; + u = *input_u; + v = *input_v; + YUV_TO_RGB(y, u, v, r, g, b) + + (*output)[0] = 0xff; + (*output)[1] = r; + (*output)[2] = g; + (*output)[3] = b; + (*output) += 4; + } + + static inline void transfer_YUV422P_to_ABGR8888(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + // Signedness is important + int y, u, v; + int r, g, b; + + y = *input_y << 16; + u = *input_u; + v = *input_v; + YUV_TO_RGB(y, u, v, r, g, b) + + (*output)[0] = 0xff; + (*output)[3] = r; + (*output)[2] = g; + (*output)[1] = b; + (*output) += 4; + } + + static inline void transfer_YUV422P_to_RGBA8888(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + // Signedness is important + int y, u, v; + int r, g, b; + + y = *input_y << 16; + u = *input_u; + v = *input_v; + YUV_TO_RGB(y, u, v, r, g, b) + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output)[3] = 0xff; + (*output) += 4; + } + + static inline void transfer_YUV422P_to_RGB161616(uint16_t *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + // Signedness is important + int y, u, v; + int r, g, b; + y = *input_y << 16; + u = *input_u << 8; + v = *input_v << 8; + YUV_TO_RGB16(y, u, v, r, g, b) + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + + (*output) += 3; + } + + + static inline void transfer_YUV422P_to_RGBA16161616(uint16_t *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + // Signedness is important + int y, u, v; + int r, g, b; + y = *input_y << 16; + u = *input_u << 8; + v = *input_v << 8; + YUV_TO_RGB16(y, u, v, r, g, b) + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output)[3] = 0xffff; + + (*output) += 4; + } + + + + static inline void transfer_YUV422P_to_YUV888(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + (*output)[0] = *input_y; + (*output)[1] = *input_u; + (*output)[2] = *input_v; + (*output) += 3; + } + + static inline void transfer_YUV422P_to_YUV161616(uint16_t *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + (*output)[0] = *input_y << 8; + (*output)[1] = *input_u << 8; + (*output)[2] = *input_v << 8; + (*output) += 3; + } + + static inline void transfer_YUV422P_to_YUVA8888(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + (*output)[0] = *input_y; + (*output)[1] = *input_u; + (*output)[2] = *input_v; + (*output)[3] = 0xff; + (*output) += 4; + } + + static inline void transfer_YUV422P_to_YUVA16161616(uint16_t *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v) + { + (*output)[0] = (*input_y) << 8; + (*output)[1] = (*input_u) << 8; + (*output)[2] = (*input_v) << 8; + (*output)[3] = 0xffff; + (*output) += 4; + } + + static inline void transfer_YUV422P_to_YUV420P(unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v, + unsigned char *output_y, + unsigned char *output_u, + unsigned char *output_v, + int j) + { + output_y[j] = *input_y; + output_u[j / 2] = *input_u; + output_v[j / 2] = *input_v; + } + + static inline void transfer_YUV422P_to_YUV422(unsigned char *(*output), + unsigned char *input_y, + unsigned char *input_u, + unsigned char *input_v, + int j) + { + // Store U and V for even pixels only + if(!(j & 1)) + { + (*output)[1] = *input_u; + (*output)[3] = *input_v; + (*output)[0] = *input_y; + } + else + // Store Y and advance output for odd pixels only + { + (*output)[2] = *input_y; + (*output) += 4; + } + } + + + + + + + + + + // ******************************** YUV422 -> ********************************* + + static inline void transfer_YUV422_to_RGB8(unsigned char *(*output), + unsigned char *input, + int column) + { + int y, u, v; + int r, g, b; + + // Even pixel + if(!(column & 1)) + y = (int)(input[0]) << 16; + else + // Odd pixel + y = (int)(input[2]) << 16; + + u = input[1]; + v = input[3]; + YUV_TO_RGB(y, u, v, r, g, b) + + *(*output) = (unsigned char)((r & 0xc0) + + ((g & 0xe0) >> 2) + + ((b & 0xe0) >> 5)); + (*output)++; + } + + static inline void transfer_YUV422_to_RGB565(unsigned char *(*output), + unsigned char *input, + int column) + { + int y, u, v; + int r, g, b; + + // Even pixel + if(!(column & 1)) + y = (int)(input[0]) << 16; + else + // Odd pixel + y = (int)(input[2]) << 16; + u = input[1]; + v = input[3]; + YUV_TO_RGB(y, u, v, r, g, b) + + *(uint16_t*)(*output) = ((r & 0xf8) << 8) + + ((g & 0xfc) << 3) + + ((b & 0xf8) >> 3); + (*output) += 2; + } + + static inline void transfer_YUV422_to_BGR888(unsigned char *(*output), + unsigned char *input, + int column) + { + int y, u, v; + int r, g, b; + + // Even pixel + if(!(column & 1)) + y = (int)(input[0]) << 16; + else + // Odd pixel + y = (int)(input[2]) << 16; + u = input[1]; + v = input[3]; + YUV_TO_RGB(y, u, v, r, g, b) + + (*output)[0] = b; + (*output)[1] = g; + (*output)[2] = r; + (*output) += 3; + } + + static inline void transfer_YUV422_to_RGB888(unsigned char *(*output), + unsigned char *input, + int column) + { + int y, u, v; + int r, g, b; + + // Even pixel + if(!(column & 1)) + y = (int)(input[0]) << 16; + else + // Odd pixel + y = (int)(input[2]) << 16; + u = input[1]; + v = input[3]; + YUV_TO_RGB(y, u, v, r, g, b) + + (*output)[0] = r; + (*output)[1] = g; + (*output)[2] = b; + (*output) += 3; + } + + static inline void transfer_YUV422_to_YUV888(unsigned char *(*output), + unsigned char *input, + int column) + { + // Even pixel + if(!(column & 1)) + (*output)[0] = input[0]; + else + // Odd pixel + (*output)[0] = input[2]; + + (*output)[1] = input[1]; + (*output)[2] = input[3]; + (*output) += 3; + } + + static inline void transfer_YUV422_to_YUVA8888(unsigned char *(*output), + unsigned char *input, + int column) + { + // Even pixel + if(!(column & 1)) + (*output)[0] = input[0]; + else + // Odd pixel + (*output)[0] = input[2]; + + (*output)[1] = input[1]; + (*output)[2] = input[3]; + (*output)[3] = 255; + (*output) += 4; + } + + static inline void transfer_YUV422_to_YUV161616(uint16_t *(*output), + unsigned char *input, + int column) + { + // Even pixel + if(!(column & 1)) + (*output)[0] = input[0] << 8; + else + // Odd pixel + (*output)[0] = input[2] << 8; + + (*output)[1] = input[1] << 8; + (*output)[2] = input[3] << 8; + (*output) += 3; + } + + static inline void transfer_YUV422_to_YUVA16161616(uint16_t *(*output), + unsigned char *input, + int column) + { + // Even pixel + if(!(column & 1)) + (*output)[0] = input[0] << 8; + else + // Odd pixel + (*output)[0] = input[2] << 8; + + (*output)[1] = input[1] << 8; + (*output)[2] = input[3] << 8; + (*output)[3] = 255; + (*output) += 4; + } + + static inline void transfer_YUV422_to_BGR8888(unsigned char *(*output), + unsigned char *input, + int column) + { + int y, u, v; + int r, g, b; + + // Even pixel + if(!(column & 1)) + y = (int)(input[0]) << 16; + else + // Odd pixel + y = (int)(input[2]) << 16; + u = input[1]; + v = input[3]; + + YUV_TO_RGB(y, u, v, r, g, b) + + (*output)[0] = b; + (*output)[1] = g; + (*output)[2] = r; + (*output) += 4; + } + + + static inline void transfer_YUV422_to_YUV422P(unsigned char *output_y, + unsigned char *output_u, + unsigned char *output_v, + unsigned char *input, + int output_column) + { + // Store U and V for even pixels only + if(!(output_column & 1)) + { + output_y[output_column] = input[0]; + output_u[output_column / 2] = input[1]; + output_v[output_column / 2] = input[3]; + } + else + // Store Y and advance output for odd pixels only + { + output_y[output_column] = input[2]; + } + } + + static inline void transfer_YUV422_to_YUV420P(unsigned char *output_y, + unsigned char *output_u, + unsigned char *output_v, + unsigned char *input, + int output_column, + int output_row) + { + // Even column + if(!(output_column & 1)) + { + output_y[output_column] = input[0]; + // Store U and V for even columns and even rows only + if(!(output_row & 1)) + { + output_u[output_column / 2] = input[1]; + output_v[output_column / 2] = input[3]; + } + } + else + // Odd column + { + output_y[output_column] = input[2]; + } + } + + static inline void transfer_YUV422_to_YUV422(unsigned char *(*output), + unsigned char *input, + int j) + { + // Store U and V for even pixels only + if(!(j & 1)) + { + (*output)[0] = input[0]; + (*output)[1] = input[1]; + (*output)[3] = input[3]; + } + else + // Store Y and advance output for odd pixels only + { + (*output)[2] = input[2]; + (*output) += 4; + } + } + + + + + + + + + // ******************************** Loops ************************************* + + #define TRANSFER_FRAME_HEAD \ + for(i = 0; i < out_h; i++) \ + { \ + unsigned char *output_row = output_rows[i + out_y] + out_x * out_pixelsize; \ + unsigned char *input_row = input_rows[row_table[i]]; \ + int bit_counter = 7; \ + for(j = 0; j < out_w; j++) \ + { + + #define TRANSFER_FRAME_TAIL \ + } \ + } + + #define TRANSFER_YUV420P_OUT_HEAD \ + for(i = 0; i < out_h; i++) \ + { \ + unsigned char *input_row = input_rows[row_table[i]]; \ + unsigned char *output_y = out_y_plane + row_table[i] * total_out_w + out_x; \ + unsigned char *output_u = out_u_plane + i / 2 * total_out_w / 2 + out_x / 2; \ + unsigned char *output_v = out_v_plane + i / 2 * total_out_w / 2 + out_x / 2; \ + for(j = 0; j < out_w; j++) \ + { + + #define TRANSFER_YUV422P_OUT_HEAD \ + for(i = 0; i < out_h; i++) \ + { \ + unsigned char *input_row = input_rows[row_table[i]]; \ + unsigned char *output_y = out_y_plane + row_table[i] * total_out_w + out_x; \ + unsigned char *output_u = out_u_plane + i * total_out_w / 2 + out_x / 2; \ + unsigned char *output_v = out_v_plane + i * total_out_w / 2 + out_x / 2; \ + for(j = 0; j < out_w; j++) \ + { + + #define TRANSFER_YUV420P_IN_HEAD \ + for(i = 0; i < out_h; i++) \ + { \ + unsigned char *output_row = output_rows[i + out_y] + out_x * out_pixelsize; \ + unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ + unsigned char *input_u = in_u_plane + (row_table[i] / 2) * (total_in_w / 2); \ + unsigned char *input_v = in_v_plane + (row_table[i] / 2) * (total_in_w / 2); \ + for(j = 0; j < out_w; j++) \ + { + + + #define TRANSFER_YUV422P_IN_HEAD \ + for(i = 0; i < out_h; i++) \ + { \ + unsigned char *output_row = output_rows[i + out_y] + out_x * out_pixelsize; \ + unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ + unsigned char *input_u = in_u_plane + row_table[i] * (total_in_w / 2); \ + unsigned char *input_v = in_v_plane + row_table[i] * (total_in_w / 2); \ + for(j = 0; j < out_w; j++) \ + { + + + #define TRANSFER_YUV422_IN_HEAD \ + for(i = 0; i < out_h; i++) \ + { \ + unsigned char *output_row = output_rows[i + out_y] + ((out_x * out_pixelsize) & 0xfffffffc); \ + unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ + unsigned char *input_u = in_u_plane + row_table[i] * (total_in_w / 2); \ + unsigned char *input_v = in_v_plane + row_table[i] * (total_in_w / 2); \ + for(j = 0; j < out_w; j++) \ + { + + + + + + // ******************************** Permutation ******************************* + + + + #define PERMUTATION_ARGS \ + unsigned char **output_rows, \ + unsigned char **input_rows, \ + unsigned char *out_y_plane, \ + unsigned char *out_u_plane, \ + unsigned char *out_v_plane, \ + unsigned char *in_y_plane, \ + unsigned char *in_u_plane, \ + unsigned char *in_v_plane, \ + int in_x, \ + int in_y, \ + int in_w, \ + int in_h, \ + int out_x, \ + int out_y, \ + int out_w, \ + int out_h, \ + int in_colormodel, \ + int out_colormodel, \ + int bg_color, \ + int total_in_w, \ + int total_out_w, \ + int scale, \ + int out_pixelsize, \ + int in_pixelsize, \ + int *row_table, \ + int *column_table, \ + int bg_r, \ + int bg_g, \ + int bg_b diff -C2 -r -N bcast-2000c/quicktime/cmodel_yuv420p.c bcast-2000c-mf3/quicktime/cmodel_yuv420p.c *** bcast-2000c/quicktime/cmodel_yuv420p.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/cmodel_yuv420p.c Wed Dec 5 15:22:23 2001 *************** *** 0 **** --- 1,352 ---- + /* + * This library 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 of the License, or + * (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + #include "cmodel_permutation.h" + + + #define TRANSFER_FRAME_DEFAULT(output, \ + input, \ + y_in_offset, \ + u_in_offset, \ + v_in_offset, \ + input_column) \ + { \ + register int i, j; \ + \ + switch(in_colormodel) \ + { \ + case BC_YUV420P: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_RGB8((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_RGB565((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_BGR888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_BGR8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV420P: \ + for(i = 0; i < out_h; i++) \ + { \ + unsigned char *output_y = out_y_plane + i * total_out_w; \ + unsigned char *output_u = out_u_plane + i / 2 * total_out_w / 2; \ + unsigned char *output_v = out_v_plane + i / 2 * total_out_w / 2; \ + unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ + unsigned char *input_u = in_u_plane + row_table[i] / 2 * total_in_w / 2; \ + unsigned char *input_v = in_v_plane + row_table[i] / 2 * total_in_w / 2; \ + for(j = 0; j < out_w; j++) \ + { \ + transfer_YUV422P_to_YUV420P(input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset), \ + output_y, \ + output_u, \ + output_v, \ + j); \ + } \ + } \ + break; \ + case BC_YUV422: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_YUV422((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_RGB888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_ARGB8888: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_ARGB8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_ABGR8888: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_ABGR8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_RGBA8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB161616: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_RGB161616((uint16_t**)(output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA16161616: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_RGBA16161616((uint16_t**)(output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_YUV888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_YUVA8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV161616: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_YUV161616((uint16_t**)(output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA16161616: \ + TRANSFER_YUV420P_IN_HEAD \ + transfer_YUV422P_to_YUVA16161616((uint16_t**)(output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + case BC_YUV422P: \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_RGB8((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_RGB565((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_BGR888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_BGR8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_RGB888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_ARGB8888: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_ARGB8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_ABGR8888: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_ABGR8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA8888: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_RGBA8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB161616: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_RGB161616((uint16_t**)(output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGBA16161616: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_RGBA16161616((uint16_t**)(output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_YUV888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_YUVA8888((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV161616: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_YUV161616((uint16_t**)(output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA16161616: \ + TRANSFER_YUV422P_IN_HEAD \ + transfer_YUV422P_to_YUVA16161616((uint16_t**)(output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV420P: \ + for(i = 0; i < out_h; i++) \ + { \ + unsigned char *output_y = out_y_plane + i * total_in_w; \ + unsigned char *output_u = out_u_plane + i / 2 * total_in_w / 2; \ + unsigned char *output_v = out_v_plane + i / 2 * total_in_w / 2; \ + unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ + unsigned char *input_u = in_u_plane + row_table[i] * total_in_w / 2; \ + unsigned char *input_v = in_v_plane + row_table[i] * total_in_w / 2; \ + for(j = 0; j < out_w; j++) \ + { \ + transfer_YUV422P_to_YUV420P(input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset), \ + output_y, \ + output_u, \ + output_v, \ + j); \ + } \ + } \ + break; \ + case BC_YUV422: \ + TRANSFER_YUV422_IN_HEAD \ + transfer_YUV422P_to_YUV422((output), \ + input_y + (y_in_offset), \ + input_u + (u_in_offset), \ + input_v + (v_in_offset), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + break; \ + \ + } \ + } + + void cmodel_yuv420p(PERMUTATION_ARGS) + { + if(scale) + { + TRANSFER_FRAME_DEFAULT(&output_row, + input_row + column_table[j] * in_pixelsize, + column_table[j], + column_table[j] / 2, + column_table[j] / 2, + 0); + } + else + { + TRANSFER_FRAME_DEFAULT(&output_row, + input_row + j * in_pixelsize, + j, + j / 2, + j / 2, + 0); + } + } diff -C2 -r -N bcast-2000c/quicktime/cmodel_yuv422.c bcast-2000c-mf3/quicktime/cmodel_yuv422.c *** bcast-2000c/quicktime/cmodel_yuv422.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/cmodel_yuv422.c Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,132 ---- + /* + * This library 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 of the License, or + * (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + + + + + #include "cmodel_permutation.h" + + + + + #define TRANSFER_FRAME_DEFAULT(output, \ + input, \ + y_in_offset, \ + u_in_offset, \ + v_in_offset, \ + input_column) \ + { \ + register int i, j; \ + \ + switch(out_colormodel) \ + { \ + case BC_RGB8: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_RGB8((output), (input), (input_column)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR565: \ + case BC_RGB565: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_RGB565((output), (input), (input_column)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_RGB888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_RGB888((output), (input), (input_column)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_YUV888((output), (input), (input_column)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_YUVA8888((output), (input), (input_column)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV161616: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_YUV161616((uint16_t**)(output), (input), (input_column)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUVA16161616: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_YUVA16161616((uint16_t**)(output), (input), (input_column)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_BGR888((output), (input), (input_column)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_BGR8888: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_BGR8888((output), (input), (input_column)); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422P: \ + TRANSFER_YUV422P_OUT_HEAD \ + transfer_YUV422_to_YUV422P(output_y, \ + output_u, \ + output_v, \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV422: \ + TRANSFER_FRAME_HEAD \ + transfer_YUV422_to_YUV422((output), \ + (input), \ + j); \ + TRANSFER_FRAME_TAIL \ + break; \ + case BC_YUV420P: \ + TRANSFER_YUV420P_OUT_HEAD \ + transfer_YUV422_to_YUV420P(output_y, \ + output_u, \ + output_v, \ + (input), \ + j, \ + i); \ + TRANSFER_FRAME_TAIL \ + break; \ + } \ + } + + void cmodel_yuv422(PERMUTATION_ARGS) + { + if(scale) + { + TRANSFER_FRAME_DEFAULT(&output_row, + input_row + ((column_table[j] * in_pixelsize) & 0xfffffffc), + 0, + 0, + 0, + column_table[j]); + } + else + { + TRANSFER_FRAME_DEFAULT(&output_row, + input_row + ((j * in_pixelsize) & 0xfffffffc), + 0, + 0, + 0, + j); + } + } diff -C2 -r -N bcast-2000c/quicktime/codecs.c bcast-2000c-mf3/quicktime/codecs.c *** bcast-2000c/quicktime/codecs.c Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/codecs.c Mon Dec 3 16:48:54 2001 *************** *** 67,70 **** --- 67,74 ---- } + static void quicktime_flush_codec_stub(quicktime_t *file, int track) + { + } + int quicktime_codec_defaults(quicktime_codec_t *codec) { *************** *** 77,80 **** --- 81,85 ---- codec->reads_colormodel = quicktime_reads_colormodel_stub; codec->writes_colormodel = quicktime_writes_colormodel_stub; + codec->flush = quicktime_flush_codec_stub; return 0; } *************** *** 304,307 **** --- 309,326 ---- } + /* Compressors that can only encode a window at a time */ + /* need to flush extra data here. */ + + int quicktime_flush_acodec(quicktime_t *file, int track) + { + ((quicktime_codec_t*)file->atracks[track].codec)->flush(file, track); + return 0; + }; + + void quicktime_flush_vcodec(quicktime_t *file, int track) + { + ((quicktime_codec_t*)file->vtracks[track].codec)->flush(file, track); + } + longest quicktime_samples_to_bytes(quicktime_trak_t *track, long samples) { *************** *** 319,339 **** } - /* Compressors that can only encode a window at a time */ - /* need to flush extra data here. */ - - int quicktime_flush_acodec(quicktime_t *file, int track) - { - int result = 0; - if(quicktime_match_32(quicktime_audio_compressor(file, track), QUICKTIME_IMA4)) - { - result = quicktime_flush_ima4(file, track); - } - return result; - }; - - void quicktime_flush_vcodec(quicktime_t *file, int track) - { - } - int quicktime_codecs_flush(quicktime_t *file) { --- 338,341 ---- *************** *** 346,350 **** for(i = 0; i < file->total_atracks && !result; i++) { ! result += quicktime_flush_acodec(file, i); } } --- 348,360 ---- for(i = 0; i < file->total_atracks && !result; i++) { ! quicktime_flush_acodec(file, i); ! } ! } ! ! if(file->total_vtracks) ! { ! for(i = 0; i < file->total_vtracks && !result; i++) ! { ! quicktime_flush_vcodec(file, i); } } diff -C2 -r -N bcast-2000c/quicktime/colormodels.c bcast-2000c-mf3/quicktime/colormodels.c *** bcast-2000c/quicktime/colormodels.c Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/colormodels.c Mon Dec 17 15:45:47 2001 *************** *** 1,40 **** #include "colormodels.h" - #include #include ! static cmodel_yuv_t *yuv_table = 0; void cmodel_init_yuv(cmodel_yuv_t *yuv_table) { int i; ! for(i = 0; i < 256; i++) { /* compression */ ! yuv_table->rtoy_tab[i] = (long)( 0.2990 * 65536 * i); ! yuv_table->rtou_tab[i] = (long)(-0.1687 * 65536 * i); ! yuv_table->rtov_tab[i] = (long)( 0.5000 * 65536 * i); ! ! yuv_table->gtoy_tab[i] = (long)( 0.5870 * 65536 * i); ! yuv_table->gtou_tab[i] = (long)(-0.3320 * 65536 * i); ! yuv_table->gtov_tab[i] = (long)(-0.4187 * 65536 * i); ! ! yuv_table->btoy_tab[i] = (long)( 0.1140 * 65536 * i); ! yuv_table->btou_tab[i] = (long)( 0.5000 * 65536 * i) + 0x800000; ! yuv_table->btov_tab[i] = (long)(-0.0813 * 65536 * i) + 0x800000; } ! yuv_table->vtor = &(yuv_table->vtor_tab[128]); ! yuv_table->vtog = &(yuv_table->vtog_tab[128]); ! yuv_table->utog = &(yuv_table->utog_tab[128]); ! yuv_table->utob = &(yuv_table->utob_tab[128]); ! for(i = -128; i < 128; i++) { /* decompression */ ! yuv_table->vtor[i] = (long)( 1.4020 * 65536 * i); ! yuv_table->vtog[i] = (long)(-0.7141 * 65536 * i); ! yuv_table->utog[i] = (long)(-0.3441 * 65536 * i); ! yuv_table->utob[i] = (long)( 1.7720 * 65536 * i); } } --- 1,85 ---- + /* + * This library 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 of the License, or + * (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ #include "colormodels.h" #include ! cmodel_yuv_t *yuv_table = 0; void cmodel_init_yuv(cmodel_yuv_t *yuv_table) { int i; ! for(i = 0; i < 0x100; i++) { /* compression */ ! yuv_table->rtoy_tab[i] = (int)( 0.2990 * 0x10000 * i); ! yuv_table->rtou_tab[i] = (int)(-0.1687 * 0x10000 * i); ! yuv_table->rtov_tab[i] = (int)( 0.5000 * 0x10000 * i); ! ! yuv_table->gtoy_tab[i] = (int)( 0.5870 * 0x10000 * i); ! yuv_table->gtou_tab[i] = (int)(-0.3320 * 0x10000 * i); ! yuv_table->gtov_tab[i] = (int)(-0.4187 * 0x10000 * i); ! ! yuv_table->btoy_tab[i] = (int)( 0.1140 * 0x10000 * i); ! yuv_table->btou_tab[i] = (int)( 0.5000 * 0x10000 * i) + 0x800000; ! yuv_table->btov_tab[i] = (int)(-0.0813 * 0x10000 * i) + 0x800000; ! } ! ! yuv_table->vtor = &(yuv_table->vtor_tab[0x80]); ! yuv_table->vtog = &(yuv_table->vtog_tab[0x80]); ! yuv_table->utog = &(yuv_table->utog_tab[0x80]); ! yuv_table->utob = &(yuv_table->utob_tab[0x80]); ! for(i = -0x80; i < 0x80; i++) ! { ! /* decompression */ ! yuv_table->vtor[i] = (int)( 1.4020 * 0x10000 * i); ! yuv_table->vtog[i] = (int)(-0.7141 * 0x10000 * i); ! ! yuv_table->utog[i] = (int)(-0.3441 * 0x10000 * i); ! yuv_table->utob[i] = (int)( 1.7720 * 0x10000 * i); } ! for(i = 0; i < 0x10000; i++) ! { ! /* compression */ ! yuv_table->rtoy_tab16[i] = (int)( 0.2990 * 0x100 * i); ! yuv_table->rtou_tab16[i] = (int)(-0.1687 * 0x100 * i); ! yuv_table->rtov_tab16[i] = (int)( 0.5000 * 0x100 * i); ! ! yuv_table->gtoy_tab16[i] = (int)( 0.5870 * 0x100 * i); ! yuv_table->gtou_tab16[i] = (int)(-0.3320 * 0x100 * i); ! yuv_table->gtov_tab16[i] = (int)(-0.4187 * 0x100 * i); ! ! yuv_table->btoy_tab16[i] = (int)( 0.1140 * 0x100 * i); ! yuv_table->btou_tab16[i] = (int)( 0.5000 * 0x100 * i) + 0x800000; ! yuv_table->btov_tab16[i] = (int)(-0.0813 * 0x100 * i) + 0x800000; ! } ! ! yuv_table->vtor16 = &(yuv_table->vtor_tab16[0x8000]); ! yuv_table->vtog16 = &(yuv_table->vtog_tab16[0x8000]); ! yuv_table->utog16 = &(yuv_table->utog_tab16[0x8000]); ! yuv_table->utob16 = &(yuv_table->utob_tab16[0x8000]); ! for(i = -0x8000; i < 0x8000; i++) { /* decompression */ ! yuv_table->vtor16[i] = (int)( 1.4020 * 0x100 * i); ! yuv_table->vtog16[i] = (int)(-0.7141 * 0x100 * i); ! yuv_table->utog16[i] = (int)(-0.3441 * 0x100 * i); ! yuv_table->utob16[i] = (int)( 1.7720 * 0x100 * i); } } *************** *** 56,63 **** --- 101,128 ---- } + int cmodel_components(int colormodel) + { + switch(colormodel) + { + case BC_A8: return 1; break; + case BC_A16: return 1; break; + case BC_RGB888: return 3; break; + case BC_RGBA8888: return 4; break; + case BC_RGB161616: return 3; break; + case BC_RGBA16161616: return 4; break; + case BC_YUV888: return 3; break; + case BC_YUVA8888: return 4; break; + case BC_YUV161616: return 3; break; + case BC_YUVA16161616: return 4; break; + case BC_YUV101010: return 3; break; + } + } + int cmodel_calculate_pixelsize(int colormodel) { switch(colormodel) { + case BC_A8: return 1; break; + case BC_A16: return 2; break; case BC_TRANSPARENCY: return 1; break; case BC_COMPRESSED: return 1; break; *************** *** 69,72 **** --- 134,139 ---- // Working bitmaps are packed to simplify processing case BC_RGB888: return 3; break; + case BC_ARGB8888: return 4; break; + case BC_ABGR8888: return 4; break; case BC_RGBA8888: return 4; break; case BC_RGB161616: return 6; break; *************** *** 76,79 **** --- 143,149 ---- case BC_YUV161616: return 6; break; case BC_YUVA16161616: return 8; break; + case BC_YUV101010: return 4; break; + case BC_VYU888: return 3; break; + case BC_UYVA8888: return 4; break; // Planar case BC_YUV420P: return 1; break; *************** *** 85,1135 **** } ! #define RGB_TO_YUV(y, u, v, r, g, b) \ ! { \ ! y = ((yuv_table->rtoy_tab[r] + yuv_table->gtoy_tab[g] + yuv_table->btoy_tab[b]) >> 16); \ ! u = ((yuv_table->rtou_tab[r] + yuv_table->gtou_tab[g] + yuv_table->btou_tab[b]) >> 16); \ ! v = ((yuv_table->rtov_tab[r] + yuv_table->gtov_tab[g] + yuv_table->btov_tab[b]) >> 16); \ ! RECLIP(y, 0, 255); \ ! RECLIP(u, 0, 255); \ ! RECLIP(v, 0, 255); \ ! } ! ! ! ! ! // Pixel transfers ! static inline void transfer_RGBA16161616_to_RGB8(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = ((guint16*)input)[3] >> 8; ! r = (unsigned int)((guint16*)input)[0] * a; ! g = (unsigned int)((guint16*)input)[1] * a; ! b = (unsigned int)((guint16*)input)[2] * a; ! ! *(*output) = (unsigned char)(((r & 0xc00000) >> 16) + ! ((g & 0xe00000) >> 18) + ! ((b & 0xe00000) >> 21)); ! (*output)++; ! } ! ! static inline void transfer_RGBA16161616_to_RGB565(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = ((guint16*)input)[3] >> 8; ! r = (unsigned int)((guint16*)input)[0] * a; ! g = (unsigned int)((guint16*)input)[1] * a; ! b = (unsigned int)((guint16*)input)[2] * a; ! ! *(guint16*)(*output) = (guint16)(((r & 0xf80000) >> 8) + ! ((g & 0xfc0000) >> 13) + ! ((b & 0xf80000) >> 19)); ! (*output) += 2; ! } ! ! static inline void transfer_RGBA16161616_to_BGR888(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = ((guint16*)input)[3] >> 8; ! r = (unsigned int)((guint16*)input)[0] * a; ! g = (unsigned int)((guint16*)input)[1] * a; ! b = (unsigned int)((guint16*)input)[2] * a; ! ! (*output)[0] = (unsigned char)(b >> 16); ! (*output)[1] = (unsigned char)(g >> 16); ! (*output)[2] = (unsigned char)(r >> 16); ! (*output) += 3; ! } ! ! static inline void transfer_RGBA16161616_to_BGR8888(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = ((guint16*)input)[3] >> 8; ! r = ((guint16*)input)[0] * a; ! g = ((guint16*)input)[1] * a; ! b = ((guint16*)input)[2] * a; ! ! (*output)[0] = (unsigned char)(b >> 16); ! (*output)[1] = (unsigned char)(g >> 16); ! (*output)[2] = (unsigned char)(r >> 16); ! (*output) += 4; ! } ! ! ! ! ! ! ! ! ! ! static inline void transfer_RGBA8888_to_TRANSPARENCY(unsigned char *(*output), unsigned char *input, int (*bit_counter)) { ! if((*bit_counter) == 7) *(*output) = 0; ! ! if(input[3] < 127) ! { ! *(*output) |= (unsigned char)1 << (7 - (*bit_counter)); ! } ! ! if((*bit_counter) == 0) { ! (*output)++; ! (*bit_counter) = 7; } ! else ! (*bit_counter)--; ! } ! ! // These routines blend in a background color since they should be ! // exclusively used for widgets. ! ! static inline void transfer_RGBA8888_to_RGB8bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) ! { ! unsigned int r, g, b, a, anti_a; ! a = input[3]; ! anti_a = 255 - a; ! r = (unsigned int)input[0] * a + bg_r * anti_a; ! g = (unsigned int)input[1] * a + bg_g * anti_a; ! b = (unsigned int)input[2] * a + bg_b * anti_a; ! *(*output) = (unsigned char)(((r & 0xc000) >> 8) + ! ((g & 0xe000) >> 10) + ! ((b & 0xe000) >> 13)); ! (*output)++; ! } ! ! static inline void transfer_RGBA8888_to_RGB565bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) ! { ! unsigned int r, g, b, a, anti_a; ! a = input[3]; ! anti_a = 255 - a; ! r = (unsigned int)input[0] * a + bg_r * anti_a; ! g = (unsigned int)input[1] * a + bg_g * anti_a; ! b = (unsigned int)input[2] * a + bg_b * anti_a; ! *(guint16*)(*output) = (guint16)((r & 0xf800) + ! ((g & 0xfc00) >> 5) + ! ((b & 0xf800) >> 11)); ! (*output) += 2; ! } ! ! static inline void transfer_RGBA8888_to_BGR888bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) ! { ! unsigned int r, g, b, a, anti_a; ! a = input[3]; ! anti_a = 255 - a; ! r = (unsigned int)input[0] * a + bg_r * anti_a; ! g = (unsigned int)input[1] * a + bg_g * anti_a; ! b = (unsigned int)input[2] * a + bg_b * anti_a; ! (*output)[0] = (b >> 8) + 1; ! (*output)[1] = (g >> 8) + 1; ! (*output)[2] = (r >> 8) + 1; ! (*output) += 3; ! } ! ! static inline void transfer_RGBA8888_to_BGR8888bg(unsigned char *(*output), unsigned char *input, int bg_r, int bg_g, int bg_b) ! { ! unsigned int r, g, b, a, anti_a; ! a = input[3]; ! anti_a = 255 - a; ! ! r = (unsigned int)input[0] * a + bg_r * anti_a; ! g = (unsigned int)input[1] * a + bg_g * anti_a; ! b = (unsigned int)input[2] * a + bg_b * anti_a; ! ! (*output)[0] = (b >> 8) + 1; ! (*output)[1] = (g >> 8) + 1; ! (*output)[2] = (r >> 8) + 1; ! (*output) += 4; ! } ! ! ! ! ! ! ! ! // These routines blend in a black background ! ! static inline void transfer_RGBA8888_to_RGB8(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = input[3]; ! r = (unsigned int)input[0] * a; ! g = (unsigned int)input[1] * a; ! b = (unsigned int)input[2] * a; ! *(*output) = (unsigned char)(((r & 0xc000) >> 8) + ! ((g & 0xe000) >> 10) + ! ((b & 0xe000) >> 13)); ! (*output)++; ! } ! ! static inline void transfer_RGBA8888_to_RGB565(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = input[3]; ! r = (unsigned int)input[0] * a; ! g = (unsigned int)input[1] * a; ! b = (unsigned int)input[2] * a; ! *(guint16*)(*output) = (guint16)((r & 0xf800) + ! ((g & 0xfc00) >> 5) + ! ((b & 0xf800) >> 11)); ! (*output) += 2; ! } ! ! static inline void transfer_RGBA8888_to_BGR888(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = input[3]; ! r = (unsigned int)input[0] * a; ! g = (unsigned int)input[1] * a; ! b = (unsigned int)input[2] * a; ! (*output)[0] = (b >> 8) + 1; ! (*output)[1] = (g >> 8) + 1; ! (*output)[2] = (r >> 8) + 1; ! (*output) += 3; ! } ! ! static inline void transfer_RGBA8888_to_BGR8888(unsigned char *(*output), unsigned char *input) ! { ! unsigned int r, g, b, a; ! a = input[3]; ! r = (unsigned int)input[0] * a; ! g = (unsigned int)input[1] * a; ! b = (unsigned int)input[2] * a; ! (*output)[0] = (b >> 8) + 1; ! (*output)[1] = (g >> 8) + 1; ! (*output)[2] = (r >> 8) + 1; ! (*output) += 4; ! } ! ! ! ! ! ! ! ! ! ! static inline void transfer_RGB888_to_RGB8(unsigned char *(*output), unsigned char *input) ! { ! *(*output) = (unsigned char)((input[0] & 0xc0) + ! ((input[1] & 0xe0) >> 2) + ! ((input[2] & 0xe0) >> 5)); ! (*output)++; ! } ! ! static inline void transfer_RGB888_to_RGB565(unsigned char *(*output), unsigned char *input) ! { ! guint16 r, g, b; ! r = *input++; ! g = *input++; ! b = *input; ! *(guint16*)(*output) = ((r & 0xf8) << 8) ! + ((g & 0xfc) << 3) ! + ((b & 0xf8) >> 3); ! (*output) += 2; ! } ! ! static inline void transfer_RGB888_to_BGR888(unsigned char *(*output), unsigned char *input) ! { ! (*output)[0] = input[2]; ! (*output)[1] = input[1]; ! (*output)[2] = input[0]; ! (*output) += 3; ! } ! ! static inline void transfer_RGB888_to_BGR8888(unsigned char *(*output), unsigned char *input) ! { ! (*output)[0] = input[2]; ! (*output)[1] = input[1]; ! (*output)[2] = input[0]; ! (*output) += 4; ! } ! ! static inline void transfer_BGR8888_to_RGB888(unsigned char *(*output), unsigned char *input) ! { ! (*output)[0] = input[2]; ! (*output)[1] = input[1]; ! (*output)[2] = input[0]; ! (*output) += 3; ! } ! ! static inline void transfer_BGR888_to_RGB888(unsigned char *(*output), unsigned char *input) ! { ! (*output)[0] = input[2]; ! (*output)[1] = input[1]; ! (*output)[2] = input[0]; ! (*output) += 3; ! } ! ! static inline void transfer_RGB888_to_YUV420P_YUV422P(unsigned char *output_y, ! unsigned char *output_u, ! unsigned char *output_v, ! unsigned char *input, ! int output_column) ! { ! int y, u, v; ! ! RGB_TO_YUV(y, u, v, input[0], input[1], input[2]); ! ! output_y[output_column] = y; ! output_u[output_column / 2] = u; ! output_v[output_column / 2] = v; ! } ! ! ! ! ! ! ! ! ! ! ! ! #define YUV_TO_RGB(y, u, v, r, g, b) \ ! { \ ! r = ((y + yuv_table->vtor_tab[v]) >> 16); \ ! g = ((y + yuv_table->utog_tab[u] + yuv_table->vtog_tab[v]) >> 16); \ ! b = ((y + yuv_table->utob_tab[u]) >> 16); \ ! RECLIP(r, 0, 255); \ ! RECLIP(g, 0, 255); \ ! RECLIP(b, 0, 255); \ ! } ! ! static inline void transfer_YUV420P_to_RGB8(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! *(*output) = (unsigned char)((r & 0xc0) + ! ((g & 0xe0) >> 2) + ! ((b & 0xe0) >> 5)); ! (*output)++; ! } ! ! static inline void transfer_YUV420P_to_RGB565(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! *(guint16*)(*output) = ((r & 0xf8) << 8) ! + ((g & 0xfc) << 3) ! + ((b & 0xf8) >> 3); ! (*output) += 2; ! } ! ! static inline void transfer_YUV420P_to_BGR888(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = b; ! (*output)[1] = g; ! (*output)[2] = r; ! (*output) += 3; ! } ! ! static inline void transfer_YUV420P_to_RGB888(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = r; ! (*output)[1] = g; ! (*output)[2] = b; ! (*output) += 3; ! } ! ! static inline void transfer_YUV420P_to_BGR8888(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! int y, u, v; ! int r, g, b; ! ! y = (int)(*input_y) << 16; ! u = *input_u; ! v = *input_v; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = b; ! (*output)[1] = g; ! (*output)[2] = r; ! (*output) += 4; ! } ! ! ! ! ! ! ! ! ! ! ! ! static inline void transfer_YUV422P_to_YUV888(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v) ! { ! (*output)[0] = *input_y; ! (*output)[1] = *input_u; ! (*output)[2] = *input_v; ! (*output) += 3; } ! static inline void transfer_YUV422P_to_YUV422(unsigned char *(*output), ! unsigned char *input_y, ! unsigned char *input_u, ! unsigned char *input_v, ! int j) { ! // Store U and V for even pixels only ! if(!(j & 1)) ! { ! (*output)[1] = *input_u; ! (*output)[3] = *input_v; ! (*output)[0] = *input_y; ! } ! else ! // Store Y and advance output for odd pixels only { ! (*output)[2] = *input_y; ! (*output) += 4; ! } ! } ! ! ! ! ! ! ! ! ! ! ! ! static inline void transfer_YUV422_to_RGB8(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! ! u = input[1]; ! v = input[3]; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! *(*output) = (unsigned char)((r & 0xc0) + ! ((g & 0xe0) >> 2) + ! ((b & 0xe0) >> 5)); ! (*output)++; ! } ! ! static inline void transfer_YUV422_to_RGB565(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! u = input[1]; ! v = input[3]; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! *(guint16*)(*output) = ((r & 0xf8) << 8) ! + ((g & 0xfc) << 3) ! + ((b & 0xf8) >> 3); ! (*output) += 2; ! } ! ! static inline void transfer_YUV422_to_BGR888(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! u = input[1]; ! v = input[3]; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = b; ! (*output)[1] = g; ! (*output)[2] = r; ! (*output) += 3; ! } ! ! static inline void transfer_YUV422_to_RGB888(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! u = input[1]; ! v = input[3]; ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = r; ! (*output)[1] = g; ! (*output)[2] = b; ! (*output) += 3; ! } ! ! static inline void transfer_YUV422_to_YUV888(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! // Even pixel ! if(!(column & 1)) ! (*output)[0] = input[0]; ! else ! // Odd pixel ! (*output)[0] = input[2]; ! ! (*output)[1] = input[1]; ! (*output)[2] = input[3]; ! (*output) += 3; ! } ! ! static inline void transfer_YUV422_to_BGR8888(unsigned char *(*output), ! unsigned char *input, ! int column) ! { ! int y, u, v; ! int r, g, b; ! ! // Even pixel ! if(!(column & 1)) ! y = (int)(input[0]) << 16; ! else ! // Odd pixel ! y = (int)(input[2]) << 16; ! u = input[1]; ! v = input[3]; ! ! YUV_TO_RGB(y, u, v, r, g, b) ! ! (*output)[0] = b; ! (*output)[1] = g; ! (*output)[2] = r; ! (*output) += 4; ! } ! ! static inline void transfer_YUV422_to_YUV422P(unsigned char *output_y, ! unsigned char *output_u, ! unsigned char *output_v, ! unsigned char *input, ! int output_column) ! { ! // Store U and V for even pixels only ! if(!(output_column & 1)) ! { ! output_y[output_column] = input[0]; ! output_u[output_column / 2] = input[1]; ! output_v[output_column / 2] = input[3]; ! } ! else ! // Store Y and advance output for odd pixels only ! { ! output_y[output_column] = input[2]; ! } ! } ! static inline void transfer_YUV422_to_YUV420P(unsigned char *output_y, ! unsigned char *output_u, ! unsigned char *output_v, ! unsigned char *input, ! int output_column, ! int output_row) ! { ! // Store U and V for even pixels only ! if(!(output_column & 1) && !(output_row & 1)) ! { ! output_y[output_column] = input[0]; ! output_u[output_column / 2] = input[1]; ! output_v[output_column / 2] = input[3]; ! } ! else ! // Store Y and advance output for odd pixels only ! { ! output_y[output_column] = input[2]; } } - - - - - - - - - #define TRANSFER_FRAME_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *output_row = output_rows[i + out_y] + out_x * out_pixelsize; \ - unsigned char *input_row = input_rows[row_table[i]]; \ - int bit_counter = 7; \ - for(j = 0; j < out_w; j++) \ - { - - #define TRANSFER_FRAME_TAIL \ - } \ - } - - #define TRANSFER_YUV420P_OUT_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *input_row = input_rows[row_table[i]]; \ - unsigned char *output_y = out_y_plane + row_table[i] * total_out_w + out_x; \ - unsigned char *output_u = out_u_plane + i / 2 * total_out_w / 2 + out_x / 2; \ - unsigned char *output_v = out_v_plane + i / 2 * total_out_w / 2 + out_x / 2; \ - for(j = 0; j < out_w; j++) \ - { - - #define TRANSFER_YUV422P_OUT_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *input_row = input_rows[row_table[i]]; \ - unsigned char *output_y = out_y_plane + row_table[i] * total_out_w + out_x; \ - unsigned char *output_u = out_u_plane + i * total_out_w / 2 + out_x / 2; \ - unsigned char *output_v = out_v_plane + i * total_out_w / 2 + out_x / 2; \ - for(j = 0; j < out_w; j++) \ - { - - #define TRANSFER_YUV420P_IN_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *output_row = output_rows[i + out_y] + out_x * out_pixelsize; \ - unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ - unsigned char *input_u = in_u_plane + (row_table[i] / 2) * (total_in_w / 2); \ - unsigned char *input_v = in_v_plane + (row_table[i] / 2) * (total_in_w / 2); \ - for(j = 0; j < out_w; j++) \ - { - - - #define TRANSFER_YUV422P_IN_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *output_row = output_rows[i + out_y] + out_x * out_pixelsize; \ - unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ - unsigned char *input_u = in_u_plane + row_table[i] * (total_in_w / 2); \ - unsigned char *input_v = in_v_plane + row_table[i] * (total_in_w / 2); \ - for(j = 0; j < out_w; j++) \ - { - - - #define TRANSFER_YUV422_IN_HEAD \ - for(i = 0; i < out_h; i++) \ - { \ - unsigned char *output_row = output_rows[i + out_y] + ((out_x * out_pixelsize) & 0xfffffffc); \ - unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \ - unsigned char *input_u = in_u_plane + row_table[i] * (total_in_w / 2); \ - unsigned char *input_v = in_v_plane + row_table[i] * (total_in_w / 2); \ - for(j = 0; j < out_w; j++) \ - { - - - - - - - - #define TRANSFER_FRAME_PERMUTATION2(output, \ - input, \ - y_in_offset, \ - u_in_offset, \ - v_in_offset, \ - input_column) \ - { \ - register int i, j; \ - switch(in_colormodel) \ - { \ - case BC_YUV420P: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_RGB8((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_RGB565((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_RGB888: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_RGB888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_BGR888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV420P_to_BGR8888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV888: \ - TRANSFER_YUV420P_IN_HEAD \ - transfer_YUV422P_to_YUV888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_YUV422P: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_RGB8((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_RGB565((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_RGB888: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_RGB888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_BGR888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV420P_to_BGR8888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV888: \ - TRANSFER_YUV422P_IN_HEAD \ - transfer_YUV422P_to_YUV888((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV422: \ - TRANSFER_YUV422_IN_HEAD \ - transfer_YUV422P_to_YUV422((output), \ - input_y + (y_in_offset), \ - input_u + (u_in_offset), \ - input_v + (v_in_offset), \ - j); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_YUV422: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_RGB8((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_RGB565((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_RGB888: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_RGB888((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV888: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_YUV888((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_BGR888((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_FRAME_HEAD \ - transfer_YUV422_to_BGR8888((output), (input), (input_column)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV422P: \ - TRANSFER_YUV422P_OUT_HEAD \ - transfer_YUV422_to_YUV422P(output_y, \ - output_u, \ - output_v, \ - (input), \ - j); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV420P: \ - TRANSFER_YUV420P_OUT_HEAD \ - transfer_YUV422_to_YUV420P(output_y, \ - output_u, \ - output_v, \ - (input), \ - j, \ - i); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_RGBA16161616: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA16161616_to_RGB8((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA16161616_to_RGB565((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA16161616_to_BGR888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA16161616_to_BGR8888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_RGBA8888: \ - switch(out_colormodel) \ - { \ - case BC_TRANSPARENCY: \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_TRANSPARENCY((output), (input), &bit_counter); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_RGB8: \ - if(bg_color > 0) \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_RGB8bg((output), (input), bg_r, bg_g, bg_b); \ - TRANSFER_FRAME_TAIL \ - else \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_RGB8((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - if(bg_color > 0) \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_RGB565bg((output), (input), bg_r, bg_g, bg_b); \ - TRANSFER_FRAME_TAIL \ - else \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_RGB565((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - if(bg_color > 0) \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_BGR888bg((output), (input), bg_r, bg_g, bg_b); \ - TRANSFER_FRAME_TAIL \ - else \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_BGR888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - if(bg_color > 0) \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_BGR8888bg((output), (input), bg_r, bg_g, bg_b); \ - TRANSFER_FRAME_TAIL \ - else \ - TRANSFER_FRAME_HEAD \ - transfer_RGBA8888_to_BGR8888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_RGB888: \ - switch(out_colormodel) \ - { \ - case BC_RGB8: \ - TRANSFER_FRAME_HEAD \ - transfer_RGB888_to_RGB8((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR565: \ - case BC_RGB565: \ - TRANSFER_FRAME_HEAD \ - transfer_RGB888_to_RGB565((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR888: \ - TRANSFER_FRAME_HEAD \ - transfer_RGB888_to_BGR888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_BGR8888: \ - TRANSFER_FRAME_HEAD \ - transfer_RGB888_to_BGR8888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV420P: \ - TRANSFER_YUV420P_OUT_HEAD \ - transfer_RGB888_to_YUV420P_YUV422P(output_y, \ - output_u, \ - output_v, \ - (input), \ - j); \ - TRANSFER_FRAME_TAIL \ - break; \ - case BC_YUV422P: \ - TRANSFER_YUV422P_OUT_HEAD \ - transfer_RGB888_to_YUV420P_YUV422P(output_y, \ - output_u, \ - output_v, \ - (input), \ - j); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_BGR8888: \ - switch(out_colormodel) \ - { \ - case BC_RGB888: \ - TRANSFER_FRAME_HEAD \ - transfer_BGR8888_to_RGB888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - \ - case BC_BGR888: \ - switch(out_colormodel) \ - { \ - case BC_RGB888: \ - TRANSFER_FRAME_HEAD \ - transfer_BGR888_to_RGB888((output), (input)); \ - TRANSFER_FRAME_TAIL \ - break; \ - } \ - break; \ - } \ - } - static void get_scale_tables(int **column_table, int **row_table, --- 155,199 ---- } ! int cmodel_calculate_max(int colormodel) { ! switch(colormodel) { ! // Working bitmaps are packed to simplify processing ! case BC_A8: return 0xff; break; ! case BC_A16: return 0xffff; break; ! case BC_RGB888: return 0xff; break; ! case BC_RGBA8888: return 0xff; break; ! case BC_RGB161616: return 0xffff; break; ! case BC_RGBA16161616: return 0xffff; break; ! case BC_YUV888: return 0xff; break; ! case BC_YUVA8888: return 0xff; break; ! case BC_YUV161616: return 0xffff; break; ! case BC_YUVA16161616: return 0xffff; break; } ! return 0; } ! int cmodel_calculate_datasize(int w, int h, int bytes_per_line, int color_model) { ! if(bytes_per_line < 0) bytes_per_line = w * cmodel_calculate_pixelsize(color_model); ! switch(color_model) { ! case BC_YUV420P: ! case BC_YUV411P: ! return w * h + w * h / 2 + 4; ! break; ! case BC_YUV422P: ! return w * h * 2 + 4; ! break; ! default: ! return h * bytes_per_line + 4; ! break; } + return 0; } static void get_scale_tables(int **column_table, int **row_table, *************** *** 1185,1194 **** int out_colormodel, int bg_color, ! int total_in_w, ! int total_out_w) { int *column_table; int *row_table; ! int scale_x, scale; int bg_r, bg_g, bg_b; int in_pixelsize = cmodel_calculate_pixelsize(in_colormodel); --- 249,258 ---- int out_colormodel, int bg_color, ! int in_rowspan, ! int out_rowspan) { int *column_table; int *row_table; ! int scale; int bg_r, bg_g, bg_b; int in_pixelsize = cmodel_calculate_pixelsize(in_colormodel); *************** *** 1207,1281 **** // Get scaling ! scale = scale_x = (out_w != in_w); get_scale_tables(&column_table, &row_table, in_x, in_y, in_x + in_w, in_y + in_h, out_x, out_y, out_x + out_w, out_y + out_h); ! //printf("cmodel_transfer %d %d\n", in_colormodel, out_colormodel); switch(in_colormodel) { case BC_YUV420P: case BC_YUV422P: ! if(scale) ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + column_table[j] * in_pixelsize, ! column_table[j], ! column_table[j] / 2, ! column_table[j] / 2, ! 0); ! } ! else ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + j * in_pixelsize, ! j, ! j / 2, ! j / 2, ! 0); ! } break; case BC_YUV422: ! if(scale) ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + ((column_table[j] * in_pixelsize) & 0xfffffffc), ! 0, ! 0, ! 0, ! column_table[j]); ! } ! else ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + ((j * in_pixelsize) & 0xfffffffc), ! 0, ! 0, ! 0, ! j); ! } break; default: ! if(scale) ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + column_table[j] * in_pixelsize, ! 0, ! 0, ! 0, ! 0); ! } ! else ! { ! TRANSFER_FRAME_PERMUTATION2(&output_row, ! input_row + j * in_pixelsize, ! 0, ! 0, ! 0, ! 0); ! } break; } --- 271,380 ---- // Get scaling ! scale = (out_w != in_w) || (in_x != 0); get_scale_tables(&column_table, &row_table, in_x, in_y, in_x + in_w, in_y + in_h, out_x, out_y, out_x + out_w, out_y + out_h); ! //printf("cmodel_transfer %d %d %d %d %d %d\n", ! // in_colormodel, out_colormodel, out_x, out_y, out_w, out_h); + // Handle planar cmodels separately switch(in_colormodel) { case BC_YUV420P: case BC_YUV422P: ! cmodel_yuv420p(output_rows, \ ! input_rows, \ ! out_y_plane, \ ! out_u_plane, \ ! out_v_plane, \ ! in_y_plane, \ ! in_u_plane, \ ! in_v_plane, \ ! in_x, \ ! in_y, \ ! in_w, \ ! in_h, \ ! out_x, \ ! out_y, \ ! out_w, \ ! out_h, \ ! in_colormodel, \ ! out_colormodel, \ ! bg_color, \ ! in_rowspan, \ ! out_rowspan, \ ! scale, \ ! out_pixelsize, \ ! in_pixelsize, \ ! row_table, \ ! column_table, \ ! bg_r, \ ! bg_g, \ ! bg_b); break; case BC_YUV422: ! cmodel_yuv422(output_rows, \ ! input_rows, \ ! out_y_plane, \ ! out_u_plane, \ ! out_v_plane, \ ! in_y_plane, \ ! in_u_plane, \ ! in_v_plane, \ ! in_x, \ ! in_y, \ ! in_w, \ ! in_h, \ ! out_x, \ ! out_y, \ ! out_w, \ ! out_h, \ ! in_colormodel, \ ! out_colormodel, \ ! bg_color, \ ! in_rowspan, \ ! out_rowspan, \ ! scale, \ ! out_pixelsize, \ ! in_pixelsize, \ ! row_table, \ ! column_table, \ ! bg_r, \ ! bg_g, \ ! bg_b); break; default: ! cmodel_default(output_rows, \ ! input_rows, \ ! out_y_plane, \ ! out_u_plane, \ ! out_v_plane, \ ! in_y_plane, \ ! in_u_plane, \ ! in_v_plane, \ ! in_x, \ ! in_y, \ ! in_w, \ ! in_h, \ ! out_x, \ ! out_y, \ ! out_w, \ ! out_h, \ ! in_colormodel, \ ! out_colormodel, \ ! bg_color, \ ! in_rowspan, \ ! out_rowspan, \ ! scale, \ ! out_pixelsize, \ ! in_pixelsize, \ ! row_table, \ ! column_table, \ ! bg_r, \ ! bg_g, \ ! bg_b); break; } *************** *** 1328,1329 **** --- 427,453 ---- } + int cmodel_is_yuv(int colormodel) + { + switch(colormodel) + { + case BC_YUV888: + case BC_YUVA8888: + case BC_YUV161616: + case BC_YUVA16161616: + case BC_YUV422: + case BC_YUV420P: + case BC_YUV422P: + case BC_YUV411P: + return 1; + break; + + default: + return 0; + break; + } + } + + + + + diff -C2 -r -N bcast-2000c/quicktime/colormodels.h bcast-2000c-mf3/quicktime/colormodels.h *** bcast-2000c/quicktime/colormodels.h Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/colormodels.h Fri Nov 30 14:29:04 2001 *************** *** 1,2 **** --- 1,20 ---- + /* + * This library 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 of the License, or + * (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + + #ifndef COLORMODELS_H #define COLORMODELS_H *************** *** 13,16 **** --- 31,36 ---- #define BC_RGB888 9 #define BC_RGBA8888 10 + #define BC_ARGB8888 20 + #define BC_ABGR8888 21 #define BC_RGB161616 11 #define BC_RGBA16161616 12 *************** *** 19,28 **** #define BC_YUV161616 15 #define BC_YUVA16161616 16 // Planar #define BC_YUV420P 7 #define BC_YUV422P 17 - #define BC_YUV422 19 #define BC_YUV411P 18 // For communication with the X Server #define FOURCC_YV12 0x32315659 /* YV12 YUV420P */ --- 39,55 ---- #define BC_YUV161616 15 #define BC_YUVA16161616 16 + #define BC_YUV422 19 + #define BC_A8 22 + #define BC_A16 23 + #define BC_YUV101010 24 + #define BC_VYU888 25 + #define BC_UYVA8888 26 // Planar #define BC_YUV420P 7 #define BC_YUV422P 17 #define BC_YUV411P 18 + // Colormodels purely used by Quicktime are done in Quicktime. + // For communication with the X Server #define FOURCC_YV12 0x32315659 /* YV12 YUV420P */ *************** *** 39,66 **** typedef struct { ! long rtoy_tab[256], gtoy_tab[256], btoy_tab[256]; ! long rtou_tab[256], gtou_tab[256], btou_tab[256]; ! long rtov_tab[256], gtov_tab[256], btov_tab[256]; ! ! long vtor_tab[256], vtog_tab[256]; ! long utog_tab[256], utob_tab[256]; ! long *vtor, *vtog, *utog, *utob; } cmodel_yuv_t; int cmodel_calculate_pixelsize(int colormodel); ! void cmodel_transfer(unsigned char **output_rows, unsigned char **input_rows, ! unsigned char *out_y_plane, unsigned char *out_u_plane, unsigned char *out_v_plane, ! unsigned char *in_y_plane, unsigned char *in_u_plane, unsigned char *in_v_plane, ! int in_x, int in_y, int in_w, int in_h, ! int out_x, int out_y, int out_w, --- 66,107 ---- typedef struct { ! int rtoy_tab[0x100], gtoy_tab[0x100], btoy_tab[0x100]; ! int rtou_tab[0x100], gtou_tab[0x100], btou_tab[0x100]; ! int rtov_tab[0x100], gtov_tab[0x100], btov_tab[0x100]; ! ! int vtor_tab[0x100], vtog_tab[0x100]; ! int utog_tab[0x100], utob_tab[0x100]; ! int *vtor, *vtog, *utog, *utob; ! ! int rtoy_tab16[0x10000], gtoy_tab16[0x10000], btoy_tab16[0x10000]; ! int rtou_tab16[0x10000], gtou_tab16[0x10000], btou_tab16[0x10000]; ! int rtov_tab16[0x10000], gtov_tab16[0x10000], btov_tab16[0x10000]; ! ! int vtor_tab16[0x10000], vtog_tab16[0x10000]; ! int utog_tab16[0x10000], utob_tab16[0x10000]; ! int *vtor16, *vtog16, *utog16, *utob16; } cmodel_yuv_t; + extern cmodel_yuv_t *yuv_table; + int cmodel_calculate_pixelsize(int colormodel); + int cmodel_calculate_datasize(int w, int h, int bytes_per_line, int color_model); + int cmodel_calculate_max(int colormodel); + int cmodel_components(int colormodel); + int cmodel_is_yuv(int colormodel); ! void cmodel_transfer(unsigned char **output_rows, /* Leave NULL if non existent */ unsigned char **input_rows, ! unsigned char *out_y_plane, /* Leave NULL if non existent */ unsigned char *out_u_plane, unsigned char *out_v_plane, ! unsigned char *in_y_plane, /* Leave NULL if non existent */ unsigned char *in_u_plane, unsigned char *in_v_plane, ! int in_x, /* Dimensions to capture from input frame */ int in_y, int in_w, int in_h, ! int out_x, /* Dimensions to project on output frame */ int out_y, int out_w, *************** *** 68,74 **** int in_colormodel, int out_colormodel, ! int bg_color, ! int total_in_w, ! int total_out_w); void cmodel_init_yuv(cmodel_yuv_t *yuv_table); --- 109,115 ---- int in_colormodel, int out_colormodel, ! int bg_color, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ ! int in_rowspan, /* For planar use the luma rowspan */ ! int out_rowspan); /* For planar use the luma rowspan */ void cmodel_init_yuv(cmodel_yuv_t *yuv_table); diff -C2 -r -N bcast-2000c/quicktime/configure bcast-2000c-mf3/quicktime/configure *** bcast-2000c/quicktime/configure Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/configure Thu Jan 1 01:00:00 1970 *************** *** 1,87 **** - #!/bin/sh - - USE_FIREWIRE=1 - USE_MMX=1 - - for ac_option - do - case "$ac_option" in - --no-firewire) - USE_FIREWIRE=0 - ;; - - --no-mmx) - USE_MMX=0 - ;; - - -h | --help | -help) - cat << EOF - Options: - --no-firewire Compile quicktime with no firewire support - --no-mmx Compile quicktime with no MMX support. - EOF - exit 0 - ;; - - *) - ;; - esac - done - - echo "Configuring libquicktime" - - cat > global_config << EOF - # DO NOT EDIT. EDIT ./configure INSTEAD AND RERUN IT. - EOF - - if test -z "$CFLAGS"; then - echo >> global_config "CFLAGS = -O2 -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -march=i486 -I/usr/local/include" - fi - - if [ ${USE_FIREWIRE} = 1 ]; then - echo >> global_config "CFLAGS += -DHAVE_FIREWIRE" - fi - - if [ ${USE_MMX} = 1 ]; then - echo >> global_config "CFLAGS += -DUSE_MMX" - fi - - echo >> global_config "CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" - - cat >> global_config << EOF - CFLAGS += -I. -Ijpeg -Ilibdv \$(shell glib-config --cflags) - export CFLAGS - CC = gcc - EOF - - if [ ${USE_MMX} = 1 ]; then - cat >> global_config << EOF - DVMMXOBJS = \ - libdv/idct_block_mmx.o \ - libdv/quant_x86.o - - DVMMX_OBJS2 = idct_block_mmx.o \ - quant_x86.o - EOF - fi - - if [ ${USE_FIREWIRE} = 1 ]; then - cat >> global_config << EOF - FIREWIREOBJS = \ - libraw1394/eventloop.o \ - libraw1394/fcp.o \ - libraw1394/iso.o \ - libraw1394/main.o \ - libraw1394/readwrite.o - - FIREWIREOBJS2 = \ - eventloop.o \ - fcp.o \ - iso.o \ - main.o \ - readwrite.o - - EOF - fi - - echo "done" --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/debug bcast-2000c-mf3/quicktime/debug *** bcast-2000c/quicktime/debug Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/debug Thu Jan 1 01:00:00 1970 *************** *** 1,18585 **** - quicktime_atom_read_header 1 mdat start 0 size 1 end 1 ftell 8 8 - quicktime_read_info ftell 179852810 length 17986db74 - quicktime_atom_read_header 1 moov start 179852810 size 1 end 179852811 ftell 179852818 79852818 - quicktime_atom_read_header 1 mvhd start 179852820 size 1 end 179852821 ftell 179852828 79852828 - quicktime_atom_read_header 1 udta start 179852894 size 1 end 179852895 ftell 17985289c 7985289c - quicktime_atom_read_header 1 ©cpy start 1798528a4 size 1 end 1798528a5 ftell 1798528ac 798528ac - quicktime_atom_read_header 1 ©inf start 1798528d5 size 1 end 1798528d6 ftell 1798528dd 798528dd - quicktime_atom_read_header 1 trak start 1798528fc size 1 end 1798528fd ftell 179852904 79852904 - quicktime_atom_read_header 1 tkhd start 17985290c size 1 end 17985290d ftell 179852914 79852914 - quicktime_atom_read_header 1 edts start 179852970 size 1 end 179852971 ftell 179852978 79852978 - quicktime_atom_read_header 1 elst start 179852980 size 1 end 179852981 ftell 179852988 79852988 - quicktime_atom_read_header 1 mdia start 1798529a4 size 1 end 1798529a5 ftell 1798529ac 798529ac - quicktime_atom_read_header 1 mdhd start 1798529b4 size 1 end 1798529b5 ftell 1798529bc 798529bc - quicktime_atom_read_header 1 hdlr start 1798529dc size 1 end 1798529dd ftell 1798529e4 798529e4 - quicktime_atom_read_header 1 minf start 179852a1e size 1 end 179852a1f ftell 179852a26 79852a26 - quicktime_atom_read_header 1 vmhd start 179852a2e size 1 end 179852a2f ftell 179852a36 79852a36 - quicktime_read_minf 1 - quicktime_atom_read_header 1 hdlr start 179852a4a size 1 end 179852a4b ftell 179852a52 79852a52 - quicktime_read_minf 1 - quicktime_atom_read_header 1 dinf start 179852a8b size 1 end 179852a8c ftell 179852a93 79852a93 - quicktime_read_minf 1 - quicktime_atom_read_header 1 dref start 179852a9b size 1 end 179852a9c ftell 179852aa3 79852aa3 - quicktime_atom_read_header 1 stbl start 179852abf size 1 end 179852ac0 ftell 179852ac7 79852ac7 - quicktime_read_minf 1 - quicktime_atom_read_header 1 stsd start 179852acf size 1 end 179852ad0 ftell 179852ad7 79852ad7 - quicktime_read_stbl 1 - quicktime_atom_read_header 1 yuv2 start 179852ae7 size 1 end 179852ae8 ftell 179852aef 79852aef - quicktime_atom_read_header 1 stts start 179852b45 size 1 end 179852b46 ftell 179852b4d 79852b4d - quicktime_read_stbl 1 - quicktime_atom_read_header 1 stsc start 179852b65 size 1 end 179852b66 ftell 179852b6d 79852b6d - quicktime_read_stbl 1 - quicktime_atom_read_header 1 stsz start 179852b89 size 1 end 179852b8a ftell 179852b91 79852b91 - quicktime_read_stbl 1 - quicktime_atom_read_header 1 co64 start 17985b99d size 1 end 17985b99e ftell 17985b9a5 7985b9a5 - quicktime_read_stbl 1 - quicktime_atom_read_header 1 trak start 17986d5a5 size 1 end 17986d5a6 ftell 17986d5ad 7986d5ad - quicktime_atom_read_header 1 tkhd start 17986d5b5 size 1 end 17986d5b6 ftell 17986d5bd 7986d5bd - quicktime_atom_read_header 1 edts start 17986d619 size 1 end 17986d61a ftell 17986d621 7986d621 - quicktime_atom_read_header 1 elst start 17986d629 size 1 end 17986d62a ftell 17986d631 7986d631 - quicktime_atom_read_header 1 mdia start 17986d64d size 1 end 17986d64e ftell 17986d655 7986d655 - quicktime_atom_read_header 1 mdhd start 17986d65d size 1 end 17986d65e ftell 17986d665 7986d665 - quicktime_atom_read_header 1 hdlr start 17986d685 size 1 end 17986d686 ftell 17986d68d 7986d68d - quicktime_atom_read_header 1 minf start 17986d6c7 size 1 end 17986d6c8 ftell 17986d6cf 7986d6cf - quicktime_atom_read_header 1 smhd start 17986d6d7 size 1 end 17986d6d8 ftell 17986d6df 7986d6df - quicktime_read_minf 1 - quicktime_atom_read_header 1 hdlr start 17986d6ef size 1 end 17986d6f0 ftell 17986d6f7 7986d6f7 - quicktime_read_minf 1 - quicktime_atom_read_header 1 dinf start 17986d730 size 1 end 17986d731 ftell 17986d738 7986d738 - quicktime_read_minf 1 - quicktime_atom_read_header 1 dref start 17986d740 size 1 end 17986d741 ftell 17986d748 7986d748 - quicktime_atom_read_header 1 stbl start 17986d764 size 1 end 17986d765 ftell 17986d76c 7986d76c - quicktime_read_minf 1 - quicktime_atom_read_header 1 stsd start 17986d774 size 1 end 17986d775 ftell 17986d77c 7986d77c - quicktime_read_stbl 1 - quicktime_atom_read_header 1 twos start 17986d78c size 1 end 17986d78d ftell 17986d794 7986d794 - quicktime_atom_read_header 1 stts start 17986d7b8 size 1 end 17986d7b9 ftell 17986d7c0 7986d7c0 - quicktime_read_stbl 1 - quicktime_atom_read_header 1 stsc start 17986d7d8 size 1 end 17986d7d9 ftell 17986d7e0 7986d7e0 - quicktime_read_stbl 1 - quicktime_atom_read_header 1 stsz start 17986d808 size 1 end 17986d809 ftell 17986d810 7986d810 - quicktime_read_stbl 1 - quicktime_atom_read_header 1 co64 start 17986d824 size 1 end 17986d825 ftell 17986d82c 7986d82c - quicktime_read_stbl 1 - quicktime_read_info ftell 17986db74 length 17986db74 - quicktime_dump - movie data - size 2038769680 - start 0 - movie - movie header - version 0 - flags 0 - creation_time 3059582186 - modification_time 3059582186 - time_scale 30000 - duration 9097578 - preferred_rate 1.000000 - preferred_volume 0.996094 - reserved - matrix 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 nan nan - preview_time 0 - preview_duration 0 - poster_time 0 - selection_time 0 - selection_duration 9097578 - current_time 0 - next_track_id 3 - user data (udta) - info -> Made with Quicktime for Linux - track - track header - version 0 - flags 15 - creation_time 3059582186 - modification_time 3059582186 - track_id 1 - reserved1 0 - duration 9095086 - reserved2 - layer 0 - alternate_group 0 - volume 0.000000 - reserved3 0 - matrix nan nan nan nan nan nan nan nan nan - track_width 720.000000 - track_height 480.000000 - edit atom (edts) - edit list (elst) - version 0 - flags 0 - total_entries 1 - edit list table - duration 9095086 - time 0 - rate 0.000000 - media - media header - version 0 - flags 0 - creation_time 3059582186 - modification_time 3059582186 - time_scale 30000 - duration 9095086 - language 0 - quality 0 - handler reference (hdlr) - version 0 - flags 0 - component_type mhlr - component_subtype vide - component_name Linux Video Media Handler - media info - is_audio 0 - is_video 1 - video media header - version 0 - flags 1 - graphics_mode 64 - opcolor 32768 32768 32768 - handler reference (hdlr) - version 0 - flags 0 - component_type dhlr - component_subtype alis - component_name Linux Alias Data Handler - data information (dinf) - data reference (dref) - version 0 - flags 0 - data reference table (dref) - type alis - version 0 - flags 1 - data - sample table - sample description - version 0 - flags 0 - total_entries 1 - format yuv2 - reserved - data_reference 1 - version 0 - revision 0 - vendor lnux - temporal_quality 0 - spatial_quality 258 - width 720 - height 480 - dpi_horizontal 72.000000 - dpi_vertical 72.000000 - data_size 0 - frames_per_sample 1 - compressor_name Quicktime for Linux - depth 24 - ctab_id 65535 - gamma 0.000000 - time to sample - version 0 - flags 0 - total_entries 1 - count 9086 duration 1001 - sync sample - version 0 - flags 0 - total_entries 0 - sample to chunk - version 0 - flags 0 - total_entries 1 - chunk 1 samples 1 id 1 - sample size - version 0 - flags 0 - sample_size 0 - total_entries 9086 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - sample_size a8c00 - chunk offset - version 0 - flags 0 - total_entries 9086 - offset 0 10 - offset 1 a8c10 - offset 2 151810 - offset 3 1fa410 - offset 4 2a3010 - offset 5 34bc10 - offset 6 3f4810 - offset 7 49d410 - offset 8 546010 - offset 9 5eec10 - offset 10 697810 - offset 11 740410 - offset 12 7e9010 - offset 13 891c10 - offset 14 93a810 - offset 15 9e3410 - offset 16 a8c010 - offset 17 b34c10 - offset 18 bdd810 - offset 19 c86410 - offset 20 d2f010 - offset 21 dd7c10 - offset 22 e80810 - offset 23 f29410 - offset 24 fd2010 - offset 25 107ac10 - offset 26 1123810 - offset 27 11cc410 - offset 28 1275010 - offset 29 131dc10 - offset 30 13c6810 - offset 31 146f410 - offset 32 1518010 - offset 33 15c0c10 - offset 34 1669810 - offset 35 1712410 - offset 36 17bb010 - offset 37 1863c10 - offset 38 190c810 - offset 39 19b5410 - offset 40 1a5e010 - offset 41 1b06c10 - offset 42 1baf810 - offset 43 1c58410 - offset 44 1d01010 - offset 45 1da9c10 - offset 46 1e52810 - offset 47 1efb410 - offset 48 1fa4010 - offset 49 204cc10 - offset 50 20f5810 - offset 51 219e410 - offset 52 2247010 - offset 53 22efc10 - offset 54 2398810 - offset 55 2441410 - offset 56 24ea010 - offset 57 2592c10 - offset 58 263b810 - offset 59 26e4410 - offset 60 278d010 - offset 61 2835c10 - offset 62 28de810 - offset 63 2987410 - offset 64 2a30010 - offset 65 2ad8c10 - offset 66 2b81810 - offset 67 2c2a410 - offset 68 2cd3010 - offset 69 2d7bc10 - offset 70 2e24810 - offset 71 2ecd410 - offset 72 2f76010 - offset 73 301ec10 - offset 74 30c7810 - offset 75 3170410 - offset 76 3219010 - offset 77 32c1c10 - offset 78 336a810 - offset 79 3413410 - offset 80 34bc010 - offset 81 3564c10 - offset 82 360d810 - offset 83 36b6410 - offset 84 375f010 - offset 85 3807c10 - offset 86 38b0810 - offset 87 3959410 - offset 88 3a02010 - offset 89 3aaac10 - offset 90 3bd3810 - offset 91 3c7c410 - offset 92 3d25010 - offset 93 3dcdc10 - offset 94 3e76810 - offset 95 3f1f410 - offset 96 3fc8010 - offset 97 4070c10 - offset 98 4119810 - offset 99 41c2410 - offset 100 426b010 - offset 101 4313c10 - offset 102 43bc810 - offset 103 4465410 - offset 104 450e010 - offset 105 45b6c10 - offset 106 465f810 - offset 107 4708410 - offset 108 47b1010 - offset 109 4859c10 - offset 110 4902810 - offset 111 49ab410 - offset 112 4a54010 - offset 113 4afcc10 - offset 114 4ba5810 - offset 115 4c4e410 - offset 116 4cf7010 - offset 117 4d9fc10 - offset 118 4e48810 - offset 119 4ef1410 - offset 120 4f9a010 - offset 121 5042c10 - offset 122 50eb810 - offset 123 5194410 - offset 124 523d010 - offset 125 52e5c10 - offset 126 538e810 - offset 127 5437410 - offset 128 54e0010 - offset 129 5588c10 - offset 130 5631810 - offset 131 56da410 - offset 132 5783010 - offset 133 582bc10 - offset 134 58d4810 - offset 135 597d410 - offset 136 5a26010 - offset 137 5acec10 - offset 138 5b77810 - offset 139 5c20410 - offset 140 5cc9010 - offset 141 5d71c10 - offset 142 5e1a810 - offset 143 5ec3410 - offset 144 5f6c010 - offset 145 6014c10 - offset 146 60bd810 - offset 147 6166410 - offset 148 620f010 - offset 149 62b7c10 - offset 150 6360810 - offset 151 6409410 - offset 152 64b2010 - offset 153 655ac10 - offset 154 6603810 - offset 155 66ac410 - offset 156 6755010 - offset 157 67fdc10 - offset 158 68a6810 - offset 159 694f410 - offset 160 69f8010 - offset 161 6aa0c10 - offset 162 6b49810 - offset 163 6bf2410 - offset 164 6c9b010 - offset 165 6d43c10 - offset 166 6dec810 - offset 167 6e95410 - offset 168 6f3e010 - offset 169 6fe6c10 - offset 170 710f810 - offset 171 71b8410 - offset 172 7261010 - offset 173 7309c10 - offset 174 73b2810 - offset 175 745b410 - offset 176 7504010 - offset 177 75acc10 - offset 178 7655810 - offset 179 76fe410 - offset 180 77a7010 - offset 181 784fc10 - offset 182 78f8810 - offset 183 79a1410 - offset 184 7a4a010 - offset 185 7af2c10 - offset 186 7b9b810 - offset 187 7c44410 - offset 188 7ced010 - offset 189 7d95c10 - offset 190 7e3e810 - offset 191 7ee7410 - offset 192 7f90010 - offset 193 8038c10 - offset 194 80e1810 - offset 195 818a410 - offset 196 8233010 - offset 197 82dbc10 - offset 198 8384810 - offset 199 842d410 - offset 200 84d6010 - offset 201 857ec10 - offset 202 8627810 - offset 203 86d0410 - offset 204 8779010 - offset 205 8821c10 - offset 206 88ca810 - offset 207 8973410 - offset 208 8a1c010 - offset 209 8ac4c10 - offset 210 8b6d810 - offset 211 8c16410 - offset 212 8cbf010 - offset 213 8d67c10 - offset 214 8e10810 - offset 215 8eb9410 - offset 216 8f62010 - offset 217 900ac10 - offset 218 90b3810 - offset 219 915c410 - offset 220 9205010 - offset 221 92adc10 - offset 222 9356810 - offset 223 93ff410 - offset 224 94a8010 - offset 225 9550c10 - offset 226 95f9810 - offset 227 96a2410 - offset 228 974b010 - offset 229 97f3c10 - offset 230 989c810 - offset 231 9945410 - offset 232 99ee010 - offset 233 9a96c10 - offset 234 9b3f810 - offset 235 9be8410 - offset 236 9c91010 - offset 237 9d39c10 - offset 238 9de2810 - offset 239 9e8b410 - offset 240 9f34010 - offset 241 9fdcc10 - offset 242 a085810 - offset 243 a12e410 - offset 244 a1d7010 - offset 245 a27fc10 - offset 246 a328810 - offset 247 a3d1410 - offset 248 a47a010 - offset 249 a522c10 - offset 250 a5cb810 - offset 251 a674410 - offset 252 a71d010 - offset 253 a7c5c10 - offset 254 a86e810 - offset 255 a917410 - offset 256 a9c0010 - offset 257 aa68c10 - offset 258 ab11810 - offset 259 abba410 - offset 260 ace3010 - offset 261 ad8bc10 - offset 262 ae34810 - offset 263 aedd410 - offset 264 af86010 - offset 265 b02ec10 - offset 266 b0d7810 - offset 267 b180410 - offset 268 b229010 - offset 269 b2d1c10 - offset 270 b37a810 - offset 271 b423410 - offset 272 b4cc010 - offset 273 b574c10 - offset 274 b61d810 - offset 275 b6c6410 - offset 276 b76f010 - offset 277 b817c10 - offset 278 b8c0810 - offset 279 b969410 - offset 280 ba12010 - offset 281 babac10 - offset 282 bb63810 - offset 283 bc0c410 - offset 284 bcb5010 - offset 285 bd5dc10 - offset 286 be06810 - offset 287 beaf410 - offset 288 bf58010 - offset 289 c000c10 - offset 290 c0a9810 - offset 291 c152410 - offset 292 c1fb010 - offset 293 c2a3c10 - offset 294 c34c810 - offset 295 c3f5410 - offset 296 c49e010 - offset 297 c546c10 - offset 298 c5ef810 - offset 299 c698410 - offset 300 c741010 - offset 301 c7e9c10 - offset 302 c892810 - offset 303 c93b410 - offset 304 c9e4010 - offset 305 ca8cc10 - offset 306 cb35810 - offset 307 cbde410 - offset 308 cc87010 - offset 309 cd2fc10 - offset 310 cdd8810 - offset 311 ce81410 - offset 312 cf2a010 - offset 313 cfd2c10 - offset 314 d07b810 - offset 315 d124410 - offset 316 d1cd010 - offset 317 d275c10 - offset 318 d31e810 - offset 319 d3c7410 - offset 320 d470010 - offset 321 d518c10 - offset 322 d5c1810 - offset 323 d66a410 - offset 324 d713010 - offset 325 d7bbc10 - offset 326 d864810 - offset 327 d90d410 - offset 328 d9b6010 - offset 329 da5ec10 - offset 330 db07810 - offset 331 dbb0410 - offset 332 dc59010 - offset 333 dd01c10 - offset 334 ddaa810 - offset 335 de53410 - offset 336 defc010 - offset 337 dfa4c10 - offset 338 e04d810 - offset 339 e0f6410 - offset 340 e19f010 - offset 341 e247c10 - offset 342 e2f0810 - offset 343 e399410 - offset 344 e442010 - offset 345 e4eac10 - offset 346 e593810 - offset 347 e63c410 - offset 348 e6e5010 - offset 349 e78dc10 - offset 350 e8b6810 - offset 351 e95f410 - offset 352 ea08010 - offset 353 eab0c10 - offset 354 eb59810 - offset 355 ec02410 - offset 356 ecab010 - offset 357 ed53c10 - offset 358 edfc810 - offset 359 eea5410 - offset 360 ef4e010 - offset 361 eff6c10 - offset 362 f09f810 - offset 363 f148410 - offset 364 f1f1010 - offset 365 f299c10 - offset 366 f342810 - offset 367 f3eb410 - offset 368 f494010 - offset 369 f53cc10 - offset 370 f5e5810 - offset 371 f68e410 - offset 372 f737010 - offset 373 f7dfc10 - offset 374 f888810 - offset 375 f931410 - offset 376 f9da010 - offset 377 fa82c10 - offset 378 fb2b810 - offset 379 fbd4410 - offset 380 fc7d010 - offset 381 fd25c10 - offset 382 fdce810 - offset 383 fe77410 - offset 384 ff20010 - offset 385 ffc8c10 - offset 386 10071810 - offset 387 1011a410 - offset 388 101c3010 - offset 389 1026bc10 - offset 390 10314810 - offset 391 103bd410 - offset 392 10466010 - offset 393 1050ec10 - offset 394 105b7810 - offset 395 10660410 - offset 396 10709010 - offset 397 107b1c10 - offset 398 1085a810 - offset 399 10903410 - offset 400 109ac010 - offset 401 10a54c10 - offset 402 10afd810 - offset 403 10ba6410 - offset 404 10c4f010 - offset 405 10cf7c10 - offset 406 10da0810 - offset 407 10e49410 - offset 408 10ef2010 - offset 409 10f9ac10 - offset 410 11043810 - offset 411 110ec410 - offset 412 11195010 - offset 413 1123dc10 - offset 414 112e6810 - offset 415 1138f410 - offset 416 11438010 - offset 417 114e0c10 - offset 418 11589810 - offset 419 11632410 - offset 420 116db010 - offset 421 11783c10 - offset 422 1182c810 - offset 423 118d5410 - offset 424 1197e010 - offset 425 11a26c10 - offset 426 11acf810 - offset 427 11b78410 - offset 428 11c21010 - offset 429 11cc9c10 - offset 430 11d72810 - offset 431 11e1b410 - offset 432 11ec4010 - offset 433 11f6cc10 - offset 434 12015810 - offset 435 120be410 - offset 436 12167010 - offset 437 1220fc10 - offset 438 122b8810 - offset 439 12361410 - offset 440 1248a010 - offset 441 12532c10 - offset 442 125db810 - offset 443 12684410 - offset 444 1272d010 - offset 445 127d5c10 - offset 446 1287e810 - offset 447 12927410 - offset 448 129d0010 - offset 449 12a78c10 - offset 450 12b21810 - offset 451 12bca410 - offset 452 12c73010 - offset 453 12d1bc10 - offset 454 12dc4810 - offset 455 12e6d410 - offset 456 12f16010 - offset 457 12fbec10 - offset 458 13067810 - offset 459 13110410 - offset 460 131b9010 - offset 461 13261c10 - offset 462 1330a810 - offset 463 133b3410 - offset 464 1345c010 - offset 465 13504c10 - offset 466 135ad810 - offset 467 13656410 - offset 468 136ff010 - offset 469 137a7c10 - offset 470 13850810 - offset 471 138f9410 - offset 472 139a2010 - offset 473 13a4ac10 - offset 474 13af3810 - offset 475 13b9c410 - offset 476 13c45010 - offset 477 13cedc10 - offset 478 13d96810 - offset 479 13e3f410 - offset 480 13ee8010 - offset 481 13f90c10 - offset 482 14039810 - offset 483 140e2410 - offset 484 1418b010 - offset 485 14233c10 - offset 486 142dc810 - offset 487 14385410 - offset 488 1442e010 - offset 489 144d6c10 - offset 490 1457f810 - offset 491 14628410 - offset 492 146d1010 - offset 493 14779c10 - offset 494 14822810 - offset 495 148cb410 - offset 496 14974010 - offset 497 14a1cc10 - offset 498 14ac5810 - offset 499 14b6e410 - offset 500 14c17010 - offset 501 14cbfc10 - offset 502 14d68810 - offset 503 14e11410 - offset 504 14eba010 - offset 505 14f62c10 - offset 506 1500b810 - offset 507 150b4410 - offset 508 1515d010 - offset 509 15205c10 - offset 510 152ae810 - offset 511 15357410 - offset 512 15400010 - offset 513 154a8c10 - offset 514 15551810 - offset 515 155fa410 - offset 516 156a3010 - offset 517 1574bc10 - offset 518 157f4810 - offset 519 1589d410 - offset 520 15946010 - offset 521 159eec10 - offset 522 15a97810 - offset 523 15b40410 - offset 524 15be9010 - offset 525 15c91c10 - offset 526 15d3a810 - offset 527 15de3410 - offset 528 15e8c010 - offset 529 15f34c10 - offset 530 1605d810 - offset 531 16106410 - offset 532 161af010 - offset 533 16257c10 - offset 534 16300810 - offset 535 163a9410 - offset 536 16452010 - offset 537 164fac10 - offset 538 165a3810 - offset 539 1664c410 - offset 540 166f5010 - offset 541 1679dc10 - offset 542 16846810 - offset 543 168ef410 - offset 544 16998010 - offset 545 16a40c10 - offset 546 16ae9810 - offset 547 16b92410 - offset 548 16c3b010 - offset 549 16ce3c10 - offset 550 16d8c810 - offset 551 16e35410 - offset 552 16ede010 - offset 553 16f86c10 - offset 554 1702f810 - offset 555 170d8410 - offset 556 17181010 - offset 557 17229c10 - offset 558 172d2810 - offset 559 1737b410 - offset 560 17424010 - offset 561 174ccc10 - offset 562 17575810 - offset 563 1761e410 - offset 564 176c7010 - offset 565 1776fc10 - offset 566 17818810 - offset 567 178c1410 - offset 568 1796a010 - offset 569 17a12c10 - offset 570 17abb810 - offset 571 17b64410 - offset 572 17c0d010 - offset 573 17cb5c10 - offset 574 17d5e810 - offset 575 17e07410 - offset 576 17eb0010 - offset 577 17f58c10 - offset 578 18001810 - offset 579 180aa410 - offset 580 18153010 - offset 581 181fbc10 - offset 582 182a4810 - offset 583 1834d410 - offset 584 183f6010 - offset 585 1849ec10 - offset 586 18547810 - offset 587 185f0410 - offset 588 18699010 - offset 589 18741c10 - offset 590 187ea810 - offset 591 18893410 - offset 592 1893c010 - offset 593 189e4c10 - offset 594 18a8d810 - offset 595 18b36410 - offset 596 18bdf010 - offset 597 18c87c10 - offset 598 18d30810 - offset 599 18dd9410 - offset 600 18e82010 - offset 601 18f2ac10 - offset 602 18fd3810 - offset 603 1907c410 - offset 604 19125010 - offset 605 191cdc10 - offset 606 19276810 - offset 607 1931f410 - offset 608 193c8010 - offset 609 19470c10 - offset 610 19519810 - offset 611 195c2410 - offset 612 1966b010 - offset 613 19713c10 - offset 614 197bc810 - offset 615 19865410 - offset 616 1990e010 - offset 617 199b6c10 - offset 618 19a5f810 - offset 619 19b08410 - offset 620 19c31010 - offset 621 19cd9c10 - offset 622 19d82810 - offset 623 19e2b410 - offset 624 19ed4010 - offset 625 19f7cc10 - offset 626 1a025810 - offset 627 1a0ce410 - offset 628 1a177010 - offset 629 1a21fc10 - offset 630 1a2c8810 - offset 631 1a371410 - offset 632 1a41a010 - offset 633 1a4c2c10 - offset 634 1a56b810 - offset 635 1a614410 - offset 636 1a6bd010 - offset 637 1a765c10 - offset 638 1a80e810 - offset 639 1a8b7410 - offset 640 1a960010 - offset 641 1aa08c10 - offset 642 1aab1810 - offset 643 1ab5a410 - offset 644 1ac03010 - offset 645 1acabc10 - offset 646 1ad54810 - offset 647 1adfd410 - offset 648 1aea6010 - offset 649 1af4ec10 - offset 650 1aff7810 - offset 651 1b0a0410 - offset 652 1b149010 - offset 653 1b1f1c10 - offset 654 1b29a810 - offset 655 1b343410 - offset 656 1b3ec010 - offset 657 1b494c10 - offset 658 1b53d810 - offset 659 1b5e6410 - offset 660 1b68f010 - offset 661 1b737c10 - offset 662 1b7e0810 - offset 663 1b889410 - offset 664 1b932010 - offset 665 1b9dac10 - offset 666 1ba83810 - offset 667 1bb2c410 - offset 668 1bbd5010 - offset 669 1bc7dc10 - offset 670 1bd26810 - offset 671 1bdcf410 - offset 672 1be78010 - offset 673 1bf20c10 - offset 674 1bfc9810 - offset 675 1c072410 - offset 676 1c11b010 - offset 677 1c1c3c10 - offset 678 1c26c810 - offset 679 1c315410 - offset 680 1c3be010 - offset 681 1c466c10 - offset 682 1c50f810 - offset 683 1c5b8410 - offset 684 1c661010 - offset 685 1c709c10 - offset 686 1c7b2810 - offset 687 1c85b410 - offset 688 1c904010 - offset 689 1c9acc10 - offset 690 1ca55810 - offset 691 1cafe410 - offset 692 1cba7010 - offset 693 1cc4fc10 - offset 694 1ccf8810 - offset 695 1cda1410 - offset 696 1ce4a010 - offset 697 1cef2c10 - offset 698 1cf9b810 - offset 699 1d044410 - offset 700 1d0ed010 - offset 701 1d195c10 - offset 702 1d23e810 - offset 703 1d2e7410 - offset 704 1d390010 - offset 705 1d438c10 - offset 706 1d4e1810 - offset 707 1d58a410 - offset 708 1d633010 - offset 709 1d6dbc10 - offset 710 1d804810 - offset 711 1d8ad410 - offset 712 1d956010 - offset 713 1d9fec10 - offset 714 1daa7810 - offset 715 1db50410 - offset 716 1dbf9010 - offset 717 1dca1c10 - offset 718 1dd4a810 - offset 719 1ddf3410 - offset 720 1de9c010 - offset 721 1df44c10 - offset 722 1dfed810 - offset 723 1e096410 - offset 724 1e13f010 - offset 725 1e1e7c10 - offset 726 1e290810 - offset 727 1e339410 - offset 728 1e3e2010 - offset 729 1e48ac10 - offset 730 1e533810 - offset 731 1e5dc410 - offset 732 1e685010 - offset 733 1e72dc10 - offset 734 1e7d6810 - offset 735 1e87f410 - offset 736 1e928010 - offset 737 1e9d0c10 - offset 738 1ea79810 - offset 739 1eb22410 - offset 740 1ebcb010 - offset 741 1ec73c10 - offset 742 1ed1c810 - offset 743 1edc5410 - offset 744 1ee6e010 - offset 745 1ef16c10 - offset 746 1efbf810 - offset 747 1f068410 - offset 748 1f111010 - offset 749 1f1b9c10 - offset 750 1f262810 - offset 751 1f30b410 - offset 752 1f3b4010 - offset 753 1f45cc10 - offset 754 1f505810 - offset 755 1f5ae410 - offset 756 1f657010 - offset 757 1f6ffc10 - offset 758 1f7a8810 - offset 759 1f851410 - offset 760 1f8fa010 - offset 761 1f9a2c10 - offset 762 1fa4b810 - offset 763 1faf4410 - offset 764 1fb9d010 - offset 765 1fc45c10 - offset 766 1fcee810 - offset 767 1fd97410 - offset 768 1fe40010 - offset 769 1fee8c10 - offset 770 1ff91810 - offset 771 2003a410 - offset 772 200e3010 - offset 773 2018bc10 - offset 774 20234810 - offset 775 202dd410 - offset 776 20386010 - offset 777 2042ec10 - offset 778 204d7810 - offset 779 20580410 - offset 780 20629010 - offset 781 206d1c10 - offset 782 2077a810 - offset 783 20823410 - offset 784 208cc010 - offset 785 20974c10 - offset 786 20a1d810 - offset 787 20ac6410 - offset 788 20b6f010 - offset 789 20c17c10 - offset 790 20cc0810 - offset 791 20d69410 - offset 792 20e12010 - offset 793 20ebac10 - offset 794 20f63810 - offset 795 2100c410 - offset 796 210b5010 - offset 797 2115dc10 - offset 798 21206810 - offset 799 212af410 - offset 800 213d8010 - offset 801 21480c10 - offset 802 21529810 - offset 803 215d2410 - offset 804 2167b010 - offset 805 21723c10 - offset 806 217cc810 - offset 807 21875410 - offset 808 2191e010 - offset 809 219c6c10 - offset 810 21a6f810 - offset 811 21b18410 - offset 812 21bc1010 - offset 813 21c69c10 - offset 814 21d12810 - offset 815 21dbb410 - offset 816 21e64010 - offset 817 21f0cc10 - offset 818 21fb5810 - offset 819 2205e410 - offset 820 22107010 - offset 821 221afc10 - offset 822 22258810 - offset 823 22301410 - offset 824 223aa010 - offset 825 22452c10 - offset 826 224fb810 - offset 827 225a4410 - offset 828 2264d010 - offset 829 226f5c10 - offset 830 2279e810 - offset 831 22847410 - offset 832 228f0010 - offset 833 22998c10 - offset 834 22a41810 - offset 835 22aea410 - offset 836 22b93010 - offset 837 22c3bc10 - offset 838 22ce4810 - offset 839 22d8d410 - offset 840 22e36010 - offset 841 22edec10 - offset 842 22f87810 - offset 843 23030410 - offset 844 230d9010 - offset 845 23181c10 - offset 846 2322a810 - offset 847 232d3410 - offset 848 2337c010 - offset 849 23424c10 - offset 850 234cd810 - offset 851 23576410 - offset 852 2361f010 - offset 853 236c7c10 - offset 854 23770810 - offset 855 23819410 - offset 856 238c2010 - offset 857 2396ac10 - offset 858 23a13810 - offset 859 23abc410 - offset 860 23b65010 - offset 861 23c0dc10 - offset 862 23cb6810 - offset 863 23d5f410 - offset 864 23e08010 - offset 865 23eb0c10 - offset 866 23f59810 - offset 867 24002410 - offset 868 240ab010 - offset 869 24153c10 - offset 870 241fc810 - offset 871 242a5410 - offset 872 2434e010 - offset 873 243f6c10 - offset 874 2449f810 - offset 875 24548410 - offset 876 245f1010 - offset 877 24699c10 - offset 878 24742810 - offset 879 247eb410 - offset 880 24894010 - offset 881 2493cc10 - offset 882 249e5810 - offset 883 24a8e410 - offset 884 24b37010 - offset 885 24bdfc10 - offset 886 24c88810 - offset 887 24d31410 - offset 888 24dda010 - offset 889 24e82c10 - offset 890 24fab810 - offset 891 25054410 - offset 892 250fd010 - offset 893 251a5c10 - offset 894 2524e810 - offset 895 252f7410 - offset 896 253a0010 - offset 897 25448c10 - offset 898 254f1810 - offset 899 2559a410 - offset 900 25643010 - offset 901 256ebc10 - offset 902 25794810 - offset 903 2583d410 - offset 904 258e6010 - offset 905 2598ec10 - offset 906 25a37810 - offset 907 25ae0410 - offset 908 25b89010 - offset 909 25c31c10 - offset 910 25cda810 - offset 911 25d83410 - offset 912 25e2c010 - offset 913 25ed4c10 - offset 914 25f7d810 - offset 915 26026410 - offset 916 260cf010 - offset 917 26177c10 - offset 918 26220810 - offset 919 262c9410 - offset 920 26372010 - offset 921 2641ac10 - offset 922 264c3810 - offset 923 2656c410 - offset 924 26615010 - offset 925 266bdc10 - offset 926 26766810 - offset 927 2680f410 - offset 928 268b8010 - offset 929 26960c10 - offset 930 26a09810 - offset 931 26ab2410 - offset 932 26b5b010 - offset 933 26c03c10 - offset 934 26cac810 - offset 935 26d55410 - offset 936 26dfe010 - offset 937 26ea6c10 - offset 938 26f4f810 - offset 939 26ff8410 - offset 940 270a1010 - offset 941 27149c10 - offset 942 271f2810 - offset 943 2729b410 - offset 944 27344010 - offset 945 273ecc10 - offset 946 27495810 - offset 947 2753e410 - offset 948 275e7010 - offset 949 2768fc10 - offset 950 27738810 - offset 951 277e1410 - offset 952 2788a010 - offset 953 27932c10 - offset 954 279db810 - offset 955 27a84410 - offset 956 27b2d010 - offset 957 27bd5c10 - offset 958 27c7e810 - offset 959 27d27410 - offset 960 27dd0010 - offset 961 27e78c10 - offset 962 27f21810 - offset 963 27fca410 - offset 964 28073010 - offset 965 2811bc10 - offset 966 281c4810 - offset 967 2826d410 - offset 968 28316010 - offset 969 283bec10 - offset 970 28467810 - offset 971 28510410 - offset 972 285b9010 - offset 973 28661c10 - offset 974 2870a810 - offset 975 287b3410 - offset 976 2885c010 - offset 977 28904c10 - offset 978 289ad810 - offset 979 28a56410 - offset 980 28b7f010 - offset 981 28c27c10 - offset 982 28cd0810 - offset 983 28d79410 - offset 984 28e22010 - offset 985 28ecac10 - offset 986 28f73810 - offset 987 2901c410 - offset 988 290c5010 - offset 989 2916dc10 - offset 990 29216810 - offset 991 292bf410 - offset 992 29368010 - offset 993 29410c10 - offset 994 294b9810 - offset 995 29562410 - offset 996 2960b010 - offset 997 296b3c10 - offset 998 2975c810 - offset 999 29805410 - offset 1000 298ae010 - offset 1001 29956c10 - offset 1002 299ff810 - offset 1003 29aa8410 - offset 1004 29b51010 - offset 1005 29bf9c10 - offset 1006 29ca2810 - offset 1007 29d4b410 - offset 1008 29df4010 - offset 1009 29e9cc10 - offset 1010 29f45810 - offset 1011 29fee410 - offset 1012 2a097010 - offset 1013 2a13fc10 - offset 1014 2a1e8810 - offset 1015 2a291410 - offset 1016 2a33a010 - offset 1017 2a3e2c10 - offset 1018 2a48b810 - offset 1019 2a534410 - offset 1020 2a5dd010 - offset 1021 2a685c10 - offset 1022 2a72e810 - offset 1023 2a7d7410 - offset 1024 2a880010 - offset 1025 2a928c10 - offset 1026 2a9d1810 - offset 1027 2aa7a410 - offset 1028 2ab23010 - offset 1029 2abcbc10 - offset 1030 2ac74810 - offset 1031 2ad1d410 - offset 1032 2adc6010 - offset 1033 2ae6ec10 - offset 1034 2af17810 - offset 1035 2afc0410 - offset 1036 2b069010 - offset 1037 2b111c10 - offset 1038 2b1ba810 - offset 1039 2b263410 - offset 1040 2b30c010 - offset 1041 2b3b4c10 - offset 1042 2b45d810 - offset 1043 2b506410 - offset 1044 2b5af010 - offset 1045 2b657c10 - offset 1046 2b700810 - offset 1047 2b7a9410 - offset 1048 2b852010 - offset 1049 2b8fac10 - offset 1050 2b9a3810 - offset 1051 2ba4c410 - offset 1052 2baf5010 - offset 1053 2bb9dc10 - offset 1054 2bc46810 - offset 1055 2bcef410 - offset 1056 2bd98010 - offset 1057 2be40c10 - offset 1058 2bee9810 - offset 1059 2bf92410 - offset 1060 2c03b010 - offset 1061 2c0e3c10 - offset 1062 2c18c810 - offset 1063 2c235410 - offset 1064 2c2de010 - offset 1065 2c386c10 - offset 1066 2c42f810 - offset 1067 2c4d8410 - offset 1068 2c581010 - offset 1069 2c629c10 - offset 1070 2c752810 - offset 1071 2c7fb410 - offset 1072 2c8a4010 - offset 1073 2c94cc10 - offset 1074 2c9f5810 - offset 1075 2ca9e410 - offset 1076 2cb47010 - offset 1077 2cbefc10 - offset 1078 2cc98810 - offset 1079 2cd41410 - offset 1080 2cdea010 - offset 1081 2ce92c10 - offset 1082 2cf3b810 - offset 1083 2cfe4410 - offset 1084 2d08d010 - offset 1085 2d135c10 - offset 1086 2d1de810 - offset 1087 2d287410 - offset 1088 2d330010 - offset 1089 2d3d8c10 - offset 1090 2d481810 - offset 1091 2d52a410 - offset 1092 2d5d3010 - offset 1093 2d67bc10 - offset 1094 2d724810 - offset 1095 2d7cd410 - offset 1096 2d876010 - offset 1097 2d91ec10 - offset 1098 2d9c7810 - offset 1099 2da70410 - offset 1100 2db19010 - offset 1101 2dbc1c10 - offset 1102 2dc6a810 - offset 1103 2dd13410 - offset 1104 2ddbc010 - offset 1105 2de64c10 - offset 1106 2df0d810 - offset 1107 2dfb6410 - offset 1108 2e05f010 - offset 1109 2e107c10 - offset 1110 2e1b0810 - offset 1111 2e259410 - offset 1112 2e302010 - offset 1113 2e3aac10 - offset 1114 2e453810 - offset 1115 2e4fc410 - offset 1116 2e5a5010 - offset 1117 2e64dc10 - offset 1118 2e6f6810 - offset 1119 2e79f410 - offset 1120 2e848010 - offset 1121 2e8f0c10 - offset 1122 2e999810 - offset 1123 2ea42410 - offset 1124 2eaeb010 - offset 1125 2eb93c10 - offset 1126 2ec3c810 - offset 1127 2ece5410 - offset 1128 2ed8e010 - offset 1129 2ee36c10 - offset 1130 2eedf810 - offset 1131 2ef88410 - offset 1132 2f031010 - offset 1133 2f0d9c10 - offset 1134 2f182810 - offset 1135 2f22b410 - offset 1136 2f2d4010 - offset 1137 2f37cc10 - offset 1138 2f425810 - offset 1139 2f4ce410 - offset 1140 2f577010 - offset 1141 2f61fc10 - offset 1142 2f6c8810 - offset 1143 2f771410 - offset 1144 2f81a010 - offset 1145 2f8c2c10 - offset 1146 2f96b810 - offset 1147 2fa14410 - offset 1148 2fabd010 - offset 1149 2fb65c10 - offset 1150 2fc8e810 - offset 1151 2fd37410 - offset 1152 2fde0010 - offset 1153 2fe88c10 - offset 1154 2ff31810 - offset 1155 2ffda410 - offset 1156 30083010 - offset 1157 3012bc10 - offset 1158 301d4810 - offset 1159 3027d410 - offset 1160 30326010 - offset 1161 303cec10 - offset 1162 30477810 - offset 1163 30520410 - offset 1164 305c9010 - offset 1165 30671c10 - offset 1166 3071a810 - offset 1167 307c3410 - offset 1168 3086c010 - offset 1169 30914c10 - offset 1170 309bd810 - offset 1171 30a66410 - offset 1172 30b0f010 - offset 1173 30bb7c10 - offset 1174 30c60810 - offset 1175 30d09410 - offset 1176 30db2010 - offset 1177 30e5ac10 - offset 1178 30f03810 - offset 1179 30fac410 - offset 1180 31055010 - offset 1181 310fdc10 - offset 1182 311a6810 - offset 1183 3124f410 - offset 1184 312f8010 - offset 1185 313a0c10 - offset 1186 31449810 - offset 1187 314f2410 - offset 1188 3159b010 - offset 1189 31643c10 - offset 1190 316ec810 - offset 1191 31795410 - offset 1192 3183e010 - offset 1193 318e6c10 - offset 1194 3198f810 - offset 1195 31a38410 - offset 1196 31ae1010 - offset 1197 31b89c10 - offset 1198 31c32810 - offset 1199 31cdb410 - offset 1200 31d84010 - offset 1201 31e2cc10 - offset 1202 31ed5810 - offset 1203 31f7e410 - offset 1204 32027010 - offset 1205 320cfc10 - offset 1206 32178810 - offset 1207 32221410 - offset 1208 322ca010 - offset 1209 32372c10 - offset 1210 3241b810 - offset 1211 324c4410 - offset 1212 3256d010 - offset 1213 32615c10 - offset 1214 326be810 - offset 1215 32767410 - offset 1216 32810010 - offset 1217 328b8c10 - offset 1218 32961810 - offset 1219 32a0a410 - offset 1220 32ab3010 - offset 1221 32b5bc10 - offset 1222 32c04810 - offset 1223 32cad410 - offset 1224 32d56010 - offset 1225 32dfec10 - offset 1226 32ea7810 - offset 1227 32f50410 - offset 1228 32ff9010 - offset 1229 330a1c10 - offset 1230 3314a810 - offset 1231 331f3410 - offset 1232 3329c010 - offset 1233 33344c10 - offset 1234 333ed810 - offset 1235 33496410 - offset 1236 3353f010 - offset 1237 335e7c10 - offset 1238 33690810 - offset 1239 33739410 - offset 1240 33862010 - offset 1241 3390ac10 - offset 1242 339b3810 - offset 1243 33a5c410 - offset 1244 33b05010 - offset 1245 33badc10 - offset 1246 33c56810 - offset 1247 33cff410 - offset 1248 33da8010 - offset 1249 33e50c10 - offset 1250 33ef9810 - offset 1251 33fa2410 - offset 1252 3404b010 - offset 1253 340f3c10 - offset 1254 3419c810 - offset 1255 34245410 - offset 1256 342ee010 - offset 1257 34396c10 - offset 1258 3443f810 - offset 1259 344e8410 - offset 1260 34591010 - offset 1261 34639c10 - offset 1262 346e2810 - offset 1263 3478b410 - offset 1264 34834010 - offset 1265 348dcc10 - offset 1266 34985810 - offset 1267 34a2e410 - offset 1268 34ad7010 - offset 1269 34b7fc10 - offset 1270 34c28810 - offset 1271 34cd1410 - offset 1272 34d7a010 - offset 1273 34e22c10 - offset 1274 34ecb810 - offset 1275 34f74410 - offset 1276 3501d010 - offset 1277 350c5c10 - offset 1278 3516e810 - offset 1279 35217410 - offset 1280 352c0010 - offset 1281 35368c10 - offset 1282 35411810 - offset 1283 354ba410 - offset 1284 35563010 - offset 1285 3560bc10 - offset 1286 356b4810 - offset 1287 3575d410 - offset 1288 35806010 - offset 1289 358aec10 - offset 1290 35957810 - offset 1291 35a00410 - offset 1292 35aa9010 - offset 1293 35b51c10 - offset 1294 35bfa810 - offset 1295 35ca3410 - offset 1296 35d4c010 - offset 1297 35df4c10 - offset 1298 35e9d810 - offset 1299 35f46410 - offset 1300 35fef010 - offset 1301 36097c10 - offset 1302 36140810 - offset 1303 361e9410 - offset 1304 36292010 - offset 1305 3633ac10 - offset 1306 363e3810 - offset 1307 3648c410 - offset 1308 36535010 - offset 1309 365ddc10 - offset 1310 36686810 - offset 1311 3672f410 - offset 1312 367d8010 - offset 1313 36880c10 - offset 1314 36929810 - offset 1315 369d2410 - offset 1316 36a7b010 - offset 1317 36b23c10 - offset 1318 36bcc810 - offset 1319 36c75410 - offset 1320 36d1e010 - offset 1321 36dc6c10 - offset 1322 36e6f810 - offset 1323 36f18410 - offset 1324 36fc1010 - offset 1325 37069c10 - offset 1326 37112810 - offset 1327 371bb410 - offset 1328 37264010 - offset 1329 3730cc10 - offset 1330 37435810 - offset 1331 374de410 - offset 1332 37587010 - offset 1333 3762fc10 - offset 1334 376d8810 - offset 1335 37781410 - offset 1336 3782a010 - offset 1337 378d2c10 - offset 1338 3797b810 - offset 1339 37a24410 - offset 1340 37acd010 - offset 1341 37b75c10 - offset 1342 37c1e810 - offset 1343 37cc7410 - offset 1344 37d70010 - offset 1345 37e18c10 - offset 1346 37ec1810 - offset 1347 37f6a410 - offset 1348 38013010 - offset 1349 380bbc10 - offset 1350 38164810 - offset 1351 3820d410 - offset 1352 382b6010 - offset 1353 3835ec10 - offset 1354 38407810 - offset 1355 384b0410 - offset 1356 38559010 - offset 1357 38601c10 - offset 1358 386aa810 - offset 1359 38753410 - offset 1360 387fc010 - offset 1361 388a4c10 - offset 1362 3894d810 - offset 1363 389f6410 - offset 1364 38a9f010 - offset 1365 38b47c10 - offset 1366 38bf0810 - offset 1367 38c99410 - offset 1368 38d42010 - offset 1369 38deac10 - offset 1370 38e93810 - offset 1371 38f3c410 - offset 1372 38fe5010 - offset 1373 3908dc10 - offset 1374 39136810 - offset 1375 391df410 - offset 1376 39288010 - offset 1377 39330c10 - offset 1378 393d9810 - offset 1379 39482410 - offset 1380 3952b010 - offset 1381 395d3c10 - offset 1382 3967c810 - offset 1383 39725410 - offset 1384 397ce010 - offset 1385 39876c10 - offset 1386 3991f810 - offset 1387 399c8410 - offset 1388 39a71010 - offset 1389 39b19c10 - offset 1390 39bc2810 - offset 1391 39c6b410 - offset 1392 39d14010 - offset 1393 39dbcc10 - offset 1394 39e65810 - offset 1395 39f0e410 - offset 1396 39fb7010 - offset 1397 3a05fc10 - offset 1398 3a108810 - offset 1399 3a1b1410 - offset 1400 3a25a010 - offset 1401 3a302c10 - offset 1402 3a3ab810 - offset 1403 3a454410 - offset 1404 3a4fd010 - offset 1405 3a5a5c10 - offset 1406 3a64e810 - offset 1407 3a6f7410 - offset 1408 3a7a0010 - offset 1409 3a848c10 - offset 1410 3a8f1810 - offset 1411 3a99a410 - offset 1412 3aa43010 - offset 1413 3aaebc10 - offset 1414 3ab94810 - offset 1415 3ac3d410 - offset 1416 3ace6010 - offset 1417 3ad8ec10 - offset 1418 3ae37810 - offset 1419 3aee0410 - offset 1420 3b009010 - offset 1421 3b0b1c10 - offset 1422 3b15a810 - offset 1423 3b203410 - offset 1424 3b2ac010 - offset 1425 3b354c10 - offset 1426 3b3fd810 - offset 1427 3b4a6410 - offset 1428 3b54f010 - offset 1429 3b5f7c10 - offset 1430 3b6a0810 - offset 1431 3b749410 - offset 1432 3b7f2010 - offset 1433 3b89ac10 - offset 1434 3b943810 - offset 1435 3b9ec410 - offset 1436 3ba95010 - offset 1437 3bb3dc10 - offset 1438 3bbe6810 - offset 1439 3bc8f410 - offset 1440 3bd38010 - offset 1441 3bde0c10 - offset 1442 3be89810 - offset 1443 3bf32410 - offset 1444 3bfdb010 - offset 1445 3c083c10 - offset 1446 3c12c810 - offset 1447 3c1d5410 - offset 1448 3c27e010 - offset 1449 3c326c10 - offset 1450 3c3cf810 - offset 1451 3c478410 - offset 1452 3c521010 - offset 1453 3c5c9c10 - offset 1454 3c672810 - offset 1455 3c71b410 - offset 1456 3c7c4010 - offset 1457 3c86cc10 - offset 1458 3c915810 - offset 1459 3c9be410 - offset 1460 3ca67010 - offset 1461 3cb0fc10 - offset 1462 3cbb8810 - offset 1463 3cc61410 - offset 1464 3cd0a010 - offset 1465 3cdb2c10 - offset 1466 3ce5b810 - offset 1467 3cf04410 - offset 1468 3cfad010 - offset 1469 3d055c10 - offset 1470 3d0fe810 - offset 1471 3d1a7410 - offset 1472 3d250010 - offset 1473 3d2f8c10 - offset 1474 3d3a1810 - offset 1475 3d44a410 - offset 1476 3d4f3010 - offset 1477 3d59bc10 - offset 1478 3d644810 - offset 1479 3d6ed410 - offset 1480 3d796010 - offset 1481 3d83ec10 - offset 1482 3d8e7810 - offset 1483 3d990410 - offset 1484 3da39010 - offset 1485 3dae1c10 - offset 1486 3db8a810 - offset 1487 3dc33410 - offset 1488 3dcdc010 - offset 1489 3dd84c10 - offset 1490 3de2d810 - offset 1491 3ded6410 - offset 1492 3df7f010 - offset 1493 3e027c10 - offset 1494 3e0d0810 - offset 1495 3e179410 - offset 1496 3e222010 - offset 1497 3e2cac10 - offset 1498 3e373810 - offset 1499 3e41c410 - offset 1500 3e4c5010 - offset 1501 3e56dc10 - offset 1502 3e616810 - offset 1503 3e6bf410 - offset 1504 3e768010 - offset 1505 3e810c10 - offset 1506 3e8b9810 - offset 1507 3e962410 - offset 1508 3ea0b010 - offset 1509 3eab3c10 - offset 1510 3ebdc810 - offset 1511 3ec85410 - offset 1512 3ed2e010 - offset 1513 3edd6c10 - offset 1514 3ee7f810 - offset 1515 3ef28410 - offset 1516 3efd1010 - offset 1517 3f079c10 - offset 1518 3f122810 - offset 1519 3f1cb410 - offset 1520 3f274010 - offset 1521 3f31cc10 - offset 1522 3f3c5810 - offset 1523 3f46e410 - offset 1524 3f517010 - offset 1525 3f5bfc10 - offset 1526 3f668810 - offset 1527 3f711410 - offset 1528 3f7ba010 - offset 1529 3f862c10 - offset 1530 3f90b810 - offset 1531 3f9b4410 - offset 1532 3fa5d010 - offset 1533 3fb05c10 - offset 1534 3fbae810 - offset 1535 3fc57410 - offset 1536 3fd00010 - offset 1537 3fda8c10 - offset 1538 3fe51810 - offset 1539 3fefa410 - offset 1540 3ffa3010 - offset 1541 4004bc10 - offset 1542 400f4810 - offset 1543 4019d410 - offset 1544 40246010 - offset 1545 402eec10 - offset 1546 40397810 - offset 1547 40440410 - offset 1548 404e9010 - offset 1549 40591c10 - offset 1550 4063a810 - offset 1551 406e3410 - offset 1552 4078c010 - offset 1553 40834c10 - offset 1554 408dd810 - offset 1555 40986410 - offset 1556 40a2f010 - offset 1557 40ad7c10 - offset 1558 40b80810 - offset 1559 40c29410 - offset 1560 40cd2010 - offset 1561 40d7ac10 - offset 1562 40e23810 - offset 1563 40ecc410 - offset 1564 40f75010 - offset 1565 4101dc10 - offset 1566 410c6810 - offset 1567 4116f410 - offset 1568 41218010 - offset 1569 412c0c10 - offset 1570 41369810 - offset 1571 41412410 - offset 1572 414bb010 - offset 1573 41563c10 - offset 1574 4160c810 - offset 1575 416b5410 - offset 1576 4175e010 - offset 1577 41806c10 - offset 1578 418af810 - offset 1579 41958410 - offset 1580 41a01010 - offset 1581 41aa9c10 - offset 1582 41b52810 - offset 1583 41bfb410 - offset 1584 41ca4010 - offset 1585 41d4cc10 - offset 1586 41df5810 - offset 1587 41e9e410 - offset 1588 41f47010 - offset 1589 41fefc10 - offset 1590 42098810 - offset 1591 42141410 - offset 1592 421ea010 - offset 1593 42292c10 - offset 1594 4233b810 - offset 1595 423e4410 - offset 1596 4248d010 - offset 1597 42535c10 - offset 1598 425de810 - offset 1599 42687410 - offset 1600 427b0010 - offset 1601 42858c10 - offset 1602 42901810 - offset 1603 429aa410 - offset 1604 42a53010 - offset 1605 42afbc10 - offset 1606 42ba4810 - offset 1607 42c4d410 - offset 1608 42cf6010 - offset 1609 42d9ec10 - offset 1610 42e47810 - offset 1611 42ef0410 - offset 1612 42f99010 - offset 1613 43041c10 - offset 1614 430ea810 - offset 1615 43193410 - offset 1616 4323c010 - offset 1617 432e4c10 - offset 1618 4338d810 - offset 1619 43436410 - offset 1620 434df010 - offset 1621 43587c10 - offset 1622 43630810 - offset 1623 436d9410 - offset 1624 43782010 - offset 1625 4382ac10 - offset 1626 438d3810 - offset 1627 4397c410 - offset 1628 43a25010 - offset 1629 43acdc10 - offset 1630 43b76810 - offset 1631 43c1f410 - offset 1632 43cc8010 - offset 1633 43d70c10 - offset 1634 43e19810 - offset 1635 43ec2410 - offset 1636 43f6b010 - offset 1637 44013c10 - offset 1638 440bc810 - offset 1639 44165410 - offset 1640 4420e010 - offset 1641 442b6c10 - offset 1642 4435f810 - offset 1643 44408410 - offset 1644 444b1010 - offset 1645 44559c10 - offset 1646 44602810 - offset 1647 446ab410 - offset 1648 44754010 - offset 1649 447fcc10 - offset 1650 448a5810 - offset 1651 4494e410 - offset 1652 449f7010 - offset 1653 44a9fc10 - offset 1654 44b48810 - offset 1655 44bf1410 - offset 1656 44c9a010 - offset 1657 44d42c10 - offset 1658 44deb810 - offset 1659 44e94410 - offset 1660 44f3d010 - offset 1661 44fe5c10 - offset 1662 4508e810 - offset 1663 45137410 - offset 1664 451e0010 - offset 1665 45288c10 - offset 1666 45331810 - offset 1667 453da410 - offset 1668 45483010 - offset 1669 4552bc10 - offset 1670 455d4810 - offset 1671 4567d410 - offset 1672 45726010 - offset 1673 457cec10 - offset 1674 45877810 - offset 1675 45920410 - offset 1676 459c9010 - offset 1677 45a71c10 - offset 1678 45b1a810 - offset 1679 45bc3410 - offset 1680 45c6c010 - offset 1681 45d14c10 - offset 1682 45dbd810 - offset 1683 45e66410 - offset 1684 45f0f010 - offset 1685 45fb7c10 - offset 1686 46060810 - offset 1687 46109410 - offset 1688 461b2010 - offset 1689 4625ac10 - offset 1690 46383810 - offset 1691 4642c410 - offset 1692 464d5010 - offset 1693 4657dc10 - offset 1694 46626810 - offset 1695 466cf410 - offset 1696 46778010 - offset 1697 46820c10 - offset 1698 468c9810 - offset 1699 46972410 - offset 1700 46a1b010 - offset 1701 46ac3c10 - offset 1702 46b6c810 - offset 1703 46c15410 - offset 1704 46cbe010 - offset 1705 46d66c10 - offset 1706 46e0f810 - offset 1707 46eb8410 - offset 1708 46f61010 - offset 1709 47009c10 - offset 1710 470b2810 - offset 1711 4715b410 - offset 1712 47204010 - offset 1713 472acc10 - offset 1714 47355810 - offset 1715 473fe410 - offset 1716 474a7010 - offset 1717 4754fc10 - offset 1718 475f8810 - offset 1719 476a1410 - offset 1720 4774a010 - offset 1721 477f2c10 - offset 1722 4789b810 - offset 1723 47944410 - offset 1724 479ed010 - offset 1725 47a95c10 - offset 1726 47b3e810 - offset 1727 47be7410 - offset 1728 47c90010 - offset 1729 47d38c10 - offset 1730 47de1810 - offset 1731 47e8a410 - offset 1732 47f33010 - offset 1733 47fdbc10 - offset 1734 48084810 - offset 1735 4812d410 - offset 1736 481d6010 - offset 1737 4827ec10 - offset 1738 48327810 - offset 1739 483d0410 - offset 1740 48479010 - offset 1741 48521c10 - offset 1742 485ca810 - offset 1743 48673410 - offset 1744 4871c010 - offset 1745 487c4c10 - offset 1746 4886d810 - offset 1747 48916410 - offset 1748 489bf010 - offset 1749 48a67c10 - offset 1750 48b10810 - offset 1751 48bb9410 - offset 1752 48c62010 - offset 1753 48d0ac10 - offset 1754 48db3810 - offset 1755 48e5c410 - offset 1756 48f05010 - offset 1757 48fadc10 - offset 1758 49056810 - offset 1759 490ff410 - offset 1760 491a8010 - offset 1761 49250c10 - offset 1762 492f9810 - offset 1763 493a2410 - offset 1764 4944b010 - offset 1765 494f3c10 - offset 1766 4959c810 - offset 1767 49645410 - offset 1768 496ee010 - offset 1769 49796c10 - offset 1770 4983f810 - offset 1771 498e8410 - offset 1772 49991010 - offset 1773 49a39c10 - offset 1774 49ae2810 - offset 1775 49b8b410 - offset 1776 49c34010 - offset 1777 49cdcc10 - offset 1778 49d85810 - offset 1779 49e2e410 - offset 1780 49f57010 - offset 1781 49fffc10 - offset 1782 4a0a8810 - offset 1783 4a151410 - offset 1784 4a1fa010 - offset 1785 4a2a2c10 - offset 1786 4a34b810 - offset 1787 4a3f4410 - offset 1788 4a49d010 - offset 1789 4a545c10 - offset 1790 4a5ee810 - offset 1791 4a697410 - offset 1792 4a740010 - offset 1793 4a7e8c10 - offset 1794 4a891810 - offset 1795 4a93a410 - offset 1796 4a9e3010 - offset 1797 4aa8bc10 - offset 1798 4ab34810 - offset 1799 4abdd410 - offset 1800 4ac86010 - offset 1801 4ad2ec10 - offset 1802 4add7810 - offset 1803 4ae80410 - offset 1804 4af29010 - offset 1805 4afd1c10 - offset 1806 4b07a810 - offset 1807 4b123410 - offset 1808 4b1cc010 - offset 1809 4b274c10 - offset 1810 4b31d810 - offset 1811 4b3c6410 - offset 1812 4b46f010 - offset 1813 4b517c10 - offset 1814 4b5c0810 - offset 1815 4b669410 - offset 1816 4b712010 - offset 1817 4b7bac10 - offset 1818 4b863810 - offset 1819 4b90c410 - offset 1820 4b9b5010 - offset 1821 4ba5dc10 - offset 1822 4bb06810 - offset 1823 4bbaf410 - offset 1824 4bc58010 - offset 1825 4bd00c10 - offset 1826 4bda9810 - offset 1827 4be52410 - offset 1828 4befb010 - offset 1829 4bfa3c10 - offset 1830 4c04c810 - offset 1831 4c0f5410 - offset 1832 4c19e010 - offset 1833 4c246c10 - offset 1834 4c2ef810 - offset 1835 4c398410 - offset 1836 4c441010 - offset 1837 4c4e9c10 - offset 1838 4c592810 - offset 1839 4c63b410 - offset 1840 4c6e4010 - offset 1841 4c78cc10 - offset 1842 4c835810 - offset 1843 4c8de410 - offset 1844 4c987010 - offset 1845 4ca2fc10 - offset 1846 4cad8810 - offset 1847 4cb81410 - offset 1848 4cc2a010 - offset 1849 4ccd2c10 - offset 1850 4cd7b810 - offset 1851 4ce24410 - offset 1852 4cecd010 - offset 1853 4cf75c10 - offset 1854 4d01e810 - offset 1855 4d0c7410 - offset 1856 4d170010 - offset 1857 4d218c10 - offset 1858 4d2c1810 - offset 1859 4d36a410 - offset 1860 4d413010 - offset 1861 4d4bbc10 - offset 1862 4d564810 - offset 1863 4d60d410 - offset 1864 4d6b6010 - offset 1865 4d75ec10 - offset 1866 4d807810 - offset 1867 4d8b0410 - offset 1868 4d959010 - offset 1869 4da01c10 - offset 1870 4db2a810 - offset 1871 4dbd3410 - offset 1872 4dc7c010 - offset 1873 4dd24c10 - offset 1874 4ddcd810 - offset 1875 4de76410 - offset 1876 4df1f010 - offset 1877 4dfc7c10 - offset 1878 4e070810 - offset 1879 4e119410 - offset 1880 4e1c2010 - offset 1881 4e26ac10 - offset 1882 4e313810 - offset 1883 4e3bc410 - offset 1884 4e465010 - offset 1885 4e50dc10 - offset 1886 4e5b6810 - offset 1887 4e65f410 - offset 1888 4e708010 - offset 1889 4e7b0c10 - offset 1890 4e859810 - offset 1891 4e902410 - offset 1892 4e9ab010 - offset 1893 4ea53c10 - offset 1894 4eafc810 - offset 1895 4eba5410 - offset 1896 4ec4e010 - offset 1897 4ecf6c10 - offset 1898 4ed9f810 - offset 1899 4ee48410 - offset 1900 4eef1010 - offset 1901 4ef99c10 - offset 1902 4f042810 - offset 1903 4f0eb410 - offset 1904 4f194010 - offset 1905 4f23cc10 - offset 1906 4f2e5810 - offset 1907 4f38e410 - offset 1908 4f437010 - offset 1909 4f4dfc10 - offset 1910 4f588810 - offset 1911 4f631410 - offset 1912 4f6da010 - offset 1913 4f782c10 - offset 1914 4f82b810 - offset 1915 4f8d4410 - offset 1916 4f97d010 - offset 1917 4fa25c10 - offset 1918 4face810 - offset 1919 4fb77410 - offset 1920 4fc20010 - offset 1921 4fcc8c10 - offset 1922 4fd71810 - offset 1923 4fe1a410 - offset 1924 4fec3010 - offset 1925 4ff6bc10 - offset 1926 50014810 - offset 1927 500bd410 - offset 1928 50166010 - offset 1929 5020ec10 - offset 1930 502b7810 - offset 1931 50360410 - offset 1932 50409010 - offset 1933 504b1c10 - offset 1934 5055a810 - offset 1935 50603410 - offset 1936 506ac010 - offset 1937 50754c10 - offset 1938 507fd810 - offset 1939 508a6410 - offset 1940 5094f010 - offset 1941 509f7c10 - offset 1942 50aa0810 - offset 1943 50b49410 - offset 1944 50bf2010 - offset 1945 50c9ac10 - offset 1946 50d43810 - offset 1947 50dec410 - offset 1948 50e95010 - offset 1949 50f3dc10 - offset 1950 50fe6810 - offset 1951 5108f410 - offset 1952 51138010 - offset 1953 511e0c10 - offset 1954 51289810 - offset 1955 51332410 - offset 1956 513db010 - offset 1957 51483c10 - offset 1958 5152c810 - offset 1959 515d5410 - offset 1960 516fe010 - offset 1961 517a6c10 - offset 1962 5184f810 - offset 1963 518f8410 - offset 1964 519a1010 - offset 1965 51a49c10 - offset 1966 51af2810 - offset 1967 51b9b410 - offset 1968 51c44010 - offset 1969 51cecc10 - offset 1970 51d95810 - offset 1971 51e3e410 - offset 1972 51ee7010 - offset 1973 51f8fc10 - offset 1974 52038810 - offset 1975 520e1410 - offset 1976 5218a010 - offset 1977 52232c10 - offset 1978 522db810 - offset 1979 52384410 - offset 1980 5242d010 - offset 1981 524d5c10 - offset 1982 5257e810 - offset 1983 52627410 - offset 1984 526d0010 - offset 1985 52778c10 - offset 1986 52821810 - offset 1987 528ca410 - offset 1988 52973010 - offset 1989 52a1bc10 - offset 1990 52ac4810 - offset 1991 52b6d410 - offset 1992 52c16010 - offset 1993 52cbec10 - offset 1994 52d67810 - offset 1995 52e10410 - offset 1996 52eb9010 - offset 1997 52f61c10 - offset 1998 5300a810 - offset 1999 530b3410 - offset 2000 5315c010 - offset 2001 53204c10 - offset 2002 532ad810 - offset 2003 53356410 - offset 2004 533ff010 - offset 2005 534a7c10 - offset 2006 53550810 - offset 2007 535f9410 - offset 2008 536a2010 - offset 2009 5374ac10 - offset 2010 537f3810 - offset 2011 5389c410 - offset 2012 53945010 - offset 2013 539edc10 - offset 2014 53a96810 - offset 2015 53b3f410 - offset 2016 53be8010 - offset 2017 53c90c10 - offset 2018 53d39810 - offset 2019 53de2410 - offset 2020 53e8b010 - offset 2021 53f33c10 - offset 2022 53fdc810 - offset 2023 54085410 - offset 2024 5412e010 - offset 2025 541d6c10 - offset 2026 5427f810 - offset 2027 54328410 - offset 2028 543d1010 - offset 2029 54479c10 - offset 2030 54522810 - offset 2031 545cb410 - offset 2032 54674010 - offset 2033 5471cc10 - offset 2034 547c5810 - offset 2035 5486e410 - offset 2036 54917010 - offset 2037 549bfc10 - offset 2038 54a68810 - offset 2039 54b11410 - offset 2040 54c3a010 - offset 2041 54ce2c10 - offset 2042 54d8b810 - offset 2043 54e34410 - offset 2044 54edd010 - offset 2045 54f85c10 - offset 2046 5502e810 - offset 2047 550d7410 - offset 2048 55180010 - offset 2049 55228c10 - offset 2050 552d1810 - offset 2051 5537a410 - offset 2052 55423010 - offset 2053 554cbc10 - offset 2054 55574810 - offset 2055 5561d410 - offset 2056 556c6010 - offset 2057 5576ec10 - offset 2058 55817810 - offset 2059 558c0410 - offset 2060 55969010 - offset 2061 55a11c10 - offset 2062 55aba810 - offset 2063 55b63410 - offset 2064 55c0c010 - offset 2065 55cb4c10 - offset 2066 55d5d810 - offset 2067 55e06410 - offset 2068 55eaf010 - offset 2069 55f57c10 - offset 2070 56000810 - offset 2071 560a9410 - offset 2072 56152010 - offset 2073 561fac10 - offset 2074 562a3810 - offset 2075 5634c410 - offset 2076 563f5010 - offset 2077 5649dc10 - offset 2078 56546810 - offset 2079 565ef410 - offset 2080 56698010 - offset 2081 56740c10 - offset 2082 567e9810 - offset 2083 56892410 - offset 2084 5693b010 - offset 2085 569e3c10 - offset 2086 56a8c810 - offset 2087 56b35410 - offset 2088 56bde010 - offset 2089 56c86c10 - offset 2090 56d2f810 - offset 2091 56dd8410 - offset 2092 56e81010 - offset 2093 56f29c10 - offset 2094 56fd2810 - offset 2095 5707b410 - offset 2096 57124010 - offset 2097 571ccc10 - offset 2098 57275810 - offset 2099 5731e410 - offset 2100 573c7010 - offset 2101 5746fc10 - offset 2102 57518810 - offset 2103 575c1410 - offset 2104 5766a010 - offset 2105 57712c10 - offset 2106 577bb810 - offset 2107 57864410 - offset 2108 5790d010 - offset 2109 579b5c10 - offset 2110 57a5e810 - offset 2111 57b07410 - offset 2112 57bb0010 - offset 2113 57c58c10 - offset 2114 57d01810 - offset 2115 57daa410 - offset 2116 57e53010 - offset 2117 57efbc10 - offset 2118 57fa4810 - offset 2119 5804d410 - offset 2120 580f6010 - offset 2121 5819ec10 - offset 2122 58247810 - offset 2123 582f0410 - offset 2124 58399010 - offset 2125 58441c10 - offset 2126 584ea810 - offset 2127 58593410 - offset 2128 5863c010 - offset 2129 586e4c10 - offset 2130 5880d810 - offset 2131 588b6410 - offset 2132 5895f010 - offset 2133 58a07c10 - offset 2134 58ab0810 - offset 2135 58b59410 - offset 2136 58c02010 - offset 2137 58caac10 - offset 2138 58d53810 - offset 2139 58dfc410 - offset 2140 58ea5010 - offset 2141 58f4dc10 - offset 2142 58ff6810 - offset 2143 5909f410 - offset 2144 59148010 - offset 2145 591f0c10 - offset 2146 59299810 - offset 2147 59342410 - offset 2148 593eb010 - offset 2149 59493c10 - offset 2150 5953c810 - offset 2151 595e5410 - offset 2152 5968e010 - offset 2153 59736c10 - offset 2154 597df810 - offset 2155 59888410 - offset 2156 59931010 - offset 2157 599d9c10 - offset 2158 59a82810 - offset 2159 59b2b410 - offset 2160 59bd4010 - offset 2161 59c7cc10 - offset 2162 59d25810 - offset 2163 59dce410 - offset 2164 59e77010 - offset 2165 59f1fc10 - offset 2166 59fc8810 - offset 2167 5a071410 - offset 2168 5a11a010 - offset 2169 5a1c2c10 - offset 2170 5a26b810 - offset 2171 5a314410 - offset 2172 5a3bd010 - offset 2173 5a465c10 - offset 2174 5a50e810 - offset 2175 5a5b7410 - offset 2176 5a660010 - offset 2177 5a708c10 - offset 2178 5a7b1810 - offset 2179 5a85a410 - offset 2180 5a903010 - offset 2181 5a9abc10 - offset 2182 5aa54810 - offset 2183 5aafd410 - offset 2184 5aba6010 - offset 2185 5ac4ec10 - offset 2186 5acf7810 - offset 2187 5ada0410 - offset 2188 5ae49010 - offset 2189 5aef1c10 - offset 2190 5af9a810 - offset 2191 5b043410 - offset 2192 5b0ec010 - offset 2193 5b194c10 - offset 2194 5b23d810 - offset 2195 5b2e6410 - offset 2196 5b38f010 - offset 2197 5b437c10 - offset 2198 5b4e0810 - offset 2199 5b589410 - offset 2200 5b632010 - offset 2201 5b6dac10 - offset 2202 5b783810 - offset 2203 5b82c410 - offset 2204 5b8d5010 - offset 2205 5b97dc10 - offset 2206 5ba26810 - offset 2207 5bacf410 - offset 2208 5bb78010 - offset 2209 5bc20c10 - offset 2210 5bcc9810 - offset 2211 5bd72410 - offset 2212 5be1b010 - offset 2213 5bec3c10 - offset 2214 5bf6c810 - offset 2215 5c015410 - offset 2216 5c0be010 - offset 2217 5c166c10 - offset 2218 5c20f810 - offset 2219 5c2b8410 - offset 2220 5c3e1010 - offset 2221 5c489c10 - offset 2222 5c532810 - offset 2223 5c5db410 - offset 2224 5c684010 - offset 2225 5c72cc10 - offset 2226 5c7d5810 - offset 2227 5c87e410 - offset 2228 5c927010 - offset 2229 5c9cfc10 - offset 2230 5ca78810 - offset 2231 5cb21410 - offset 2232 5cbca010 - offset 2233 5cc72c10 - offset 2234 5cd1b810 - offset 2235 5cdc4410 - offset 2236 5ce6d010 - offset 2237 5cf15c10 - offset 2238 5cfbe810 - offset 2239 5d067410 - offset 2240 5d110010 - offset 2241 5d1b8c10 - offset 2242 5d261810 - offset 2243 5d30a410 - offset 2244 5d3b3010 - offset 2245 5d45bc10 - offset 2246 5d504810 - offset 2247 5d5ad410 - offset 2248 5d656010 - offset 2249 5d6fec10 - offset 2250 5d7a7810 - offset 2251 5d850410 - offset 2252 5d8f9010 - offset 2253 5d9a1c10 - offset 2254 5da4a810 - offset 2255 5daf3410 - offset 2256 5db9c010 - offset 2257 5dc44c10 - offset 2258 5dced810 - offset 2259 5dd96410 - offset 2260 5de3f010 - offset 2261 5dee7c10 - offset 2262 5df90810 - offset 2263 5e039410 - offset 2264 5e0e2010 - offset 2265 5e18ac10 - offset 2266 5e233810 - offset 2267 5e2dc410 - offset 2268 5e385010 - offset 2269 5e42dc10 - offset 2270 5e4d6810 - offset 2271 5e57f410 - offset 2272 5e628010 - offset 2273 5e6d0c10 - offset 2274 5e779810 - offset 2275 5e822410 - offset 2276 5e8cb010 - offset 2277 5e973c10 - offset 2278 5ea1c810 - offset 2279 5eac5410 - offset 2280 5eb6e010 - offset 2281 5ec16c10 - offset 2282 5ecbf810 - offset 2283 5ed68410 - offset 2284 5ee11010 - offset 2285 5eeb9c10 - offset 2286 5ef62810 - offset 2287 5f00b410 - offset 2288 5f0b4010 - offset 2289 5f15cc10 - offset 2290 5f205810 - offset 2291 5f2ae410 - offset 2292 5f357010 - offset 2293 5f3ffc10 - offset 2294 5f4a8810 - offset 2295 5f551410 - offset 2296 5f5fa010 - offset 2297 5f6a2c10 - offset 2298 5f74b810 - offset 2299 5f7f4410 - offset 2300 5f89d010 - offset 2301 5f945c10 - offset 2302 5f9ee810 - offset 2303 5fa97410 - offset 2304 5fb40010 - offset 2305 5fbe8c10 - offset 2306 5fc91810 - offset 2307 5fd3a410 - offset 2308 5fde3010 - offset 2309 5fe8bc10 - offset 2310 5ffb4810 - offset 2311 6005d410 - offset 2312 60106010 - offset 2313 601aec10 - offset 2314 60257810 - offset 2315 60300410 - offset 2316 603a9010 - offset 2317 60451c10 - offset 2318 604fa810 - offset 2319 605a3410 - offset 2320 6064c010 - offset 2321 606f4c10 - offset 2322 6079d810 - offset 2323 60846410 - offset 2324 608ef010 - offset 2325 60997c10 - offset 2326 60a40810 - offset 2327 60ae9410 - offset 2328 60b92010 - offset 2329 60c3ac10 - offset 2330 60ce3810 - offset 2331 60d8c410 - offset 2332 60e35010 - offset 2333 60eddc10 - offset 2334 60f86810 - offset 2335 6102f410 - offset 2336 610d8010 - offset 2337 61180c10 - offset 2338 61229810 - offset 2339 612d2410 - offset 2340 6137b010 - offset 2341 61423c10 - offset 2342 614cc810 - offset 2343 61575410 - offset 2344 6161e010 - offset 2345 616c6c10 - offset 2346 6176f810 - offset 2347 61818410 - offset 2348 618c1010 - offset 2349 61969c10 - offset 2350 61a12810 - offset 2351 61abb410 - offset 2352 61b64010 - offset 2353 61c0cc10 - offset 2354 61cb5810 - offset 2355 61d5e410 - offset 2356 61e07010 - offset 2357 61eafc10 - offset 2358 61f58810 - offset 2359 62001410 - offset 2360 620aa010 - offset 2361 62152c10 - offset 2362 621fb810 - offset 2363 622a4410 - offset 2364 6234d010 - offset 2365 623f5c10 - offset 2366 6249e810 - offset 2367 62547410 - offset 2368 625f0010 - offset 2369 62698c10 - offset 2370 62741810 - offset 2371 627ea410 - offset 2372 62893010 - offset 2373 6293bc10 - offset 2374 629e4810 - offset 2375 62a8d410 - offset 2376 62b36010 - offset 2377 62bdec10 - offset 2378 62c87810 - offset 2379 62d30410 - offset 2380 62dd9010 - offset 2381 62e81c10 - offset 2382 62f2a810 - offset 2383 62fd3410 - offset 2384 6307c010 - offset 2385 63124c10 - offset 2386 631cd810 - offset 2387 63276410 - offset 2388 6331f010 - offset 2389 633c7c10 - offset 2390 63470810 - offset 2391 63519410 - offset 2392 635c2010 - offset 2393 6366ac10 - offset 2394 63713810 - offset 2395 637bc410 - offset 2396 63865010 - offset 2397 6390dc10 - offset 2398 639b6810 - offset 2399 63a5f410 - offset 2400 63b88010 - offset 2401 63c30c10 - offset 2402 63cd9810 - offset 2403 63d82410 - offset 2404 63e2b010 - offset 2405 63ed3c10 - offset 2406 63f7c810 - offset 2407 64025410 - offset 2408 640ce010 - offset 2409 64176c10 - offset 2410 6421f810 - offset 2411 642c8410 - offset 2412 64371010 - offset 2413 64419c10 - offset 2414 644c2810 - offset 2415 6456b410 - offset 2416 64614010 - offset 2417 646bcc10 - offset 2418 64765810 - offset 2419 6480e410 - offset 2420 648b7010 - offset 2421 6495fc10 - offset 2422 64a08810 - offset 2423 64ab1410 - offset 2424 64b5a010 - offset 2425 64c02c10 - offset 2426 64cab810 - offset 2427 64d54410 - offset 2428 64dfd010 - offset 2429 64ea5c10 - offset 2430 64f4e810 - offset 2431 64ff7410 - offset 2432 650a0010 - offset 2433 65148c10 - offset 2434 651f1810 - offset 2435 6529a410 - offset 2436 65343010 - offset 2437 653ebc10 - offset 2438 65494810 - offset 2439 6553d410 - offset 2440 655e6010 - offset 2441 6568ec10 - offset 2442 65737810 - offset 2443 657e0410 - offset 2444 65889010 - offset 2445 65931c10 - offset 2446 659da810 - offset 2447 65a83410 - offset 2448 65b2c010 - offset 2449 65bd4c10 - offset 2450 65c7d810 - offset 2451 65d26410 - offset 2452 65dcf010 - offset 2453 65e77c10 - offset 2454 65f20810 - offset 2455 65fc9410 - offset 2456 66072010 - offset 2457 6611ac10 - offset 2458 661c3810 - offset 2459 6626c410 - offset 2460 66315010 - offset 2461 663bdc10 - offset 2462 66466810 - offset 2463 6650f410 - offset 2464 665b8010 - offset 2465 66660c10 - offset 2466 66709810 - offset 2467 667b2410 - offset 2468 6685b010 - offset 2469 66903c10 - offset 2470 669ac810 - offset 2471 66a55410 - offset 2472 66afe010 - offset 2473 66ba6c10 - offset 2474 66c4f810 - offset 2475 66cf8410 - offset 2476 66da1010 - offset 2477 66e49c10 - offset 2478 66ef2810 - offset 2479 66f9b410 - offset 2480 67044010 - offset 2481 670ecc10 - offset 2482 67195810 - offset 2483 6723e410 - offset 2484 672e7010 - offset 2485 6738fc10 - offset 2486 67438810 - offset 2487 674e1410 - offset 2488 6758a010 - offset 2489 67632c10 - offset 2490 6775b810 - offset 2491 67804410 - offset 2492 678ad010 - offset 2493 67955c10 - offset 2494 679fe810 - offset 2495 67aa7410 - offset 2496 67b50010 - offset 2497 67bf8c10 - offset 2498 67ca1810 - offset 2499 67d4a410 - offset 2500 67df3010 - offset 2501 67e9bc10 - offset 2502 67f44810 - offset 2503 67fed410 - offset 2504 68096010 - offset 2505 6813ec10 - offset 2506 681e7810 - offset 2507 68290410 - offset 2508 68339010 - offset 2509 683e1c10 - offset 2510 6848a810 - offset 2511 68533410 - offset 2512 685dc010 - offset 2513 68684c10 - offset 2514 6872d810 - offset 2515 687d6410 - offset 2516 6887f010 - offset 2517 68927c10 - offset 2518 689d0810 - offset 2519 68a79410 - offset 2520 68b22010 - offset 2521 68bcac10 - offset 2522 68c73810 - offset 2523 68d1c410 - offset 2524 68dc5010 - offset 2525 68e6dc10 - offset 2526 68f16810 - offset 2527 68fbf410 - offset 2528 69068010 - offset 2529 69110c10 - offset 2530 691b9810 - offset 2531 69262410 - offset 2532 6930b010 - offset 2533 693b3c10 - offset 2534 6945c810 - offset 2535 69505410 - offset 2536 695ae010 - offset 2537 69656c10 - offset 2538 696ff810 - offset 2539 697a8410 - offset 2540 69851010 - offset 2541 698f9c10 - offset 2542 699a2810 - offset 2543 69a4b410 - offset 2544 69af4010 - offset 2545 69b9cc10 - offset 2546 69c45810 - offset 2547 69cee410 - offset 2548 69d97010 - offset 2549 69e3fc10 - offset 2550 69ee8810 - offset 2551 69f91410 - offset 2552 6a03a010 - offset 2553 6a0e2c10 - offset 2554 6a18b810 - offset 2555 6a234410 - offset 2556 6a2dd010 - offset 2557 6a385c10 - offset 2558 6a42e810 - offset 2559 6a4d7410 - offset 2560 6a580010 - offset 2561 6a628c10 - offset 2562 6a6d1810 - offset 2563 6a77a410 - offset 2564 6a823010 - offset 2565 6a8cbc10 - offset 2566 6a974810 - offset 2567 6aa1d410 - offset 2568 6aac6010 - offset 2569 6ab6ec10 - offset 2570 6ac17810 - offset 2571 6acc0410 - offset 2572 6ad69010 - offset 2573 6ae11c10 - offset 2574 6aeba810 - offset 2575 6af63410 - offset 2576 6b00c010 - offset 2577 6b0b4c10 - offset 2578 6b15d810 - offset 2579 6b206410 - offset 2580 6b32f010 - offset 2581 6b3d7c10 - offset 2582 6b480810 - offset 2583 6b529410 - offset 2584 6b5d2010 - offset 2585 6b67ac10 - offset 2586 6b723810 - offset 2587 6b7cc410 - offset 2588 6b875010 - offset 2589 6b91dc10 - offset 2590 6b9c6810 - offset 2591 6ba6f410 - offset 2592 6bb18010 - offset 2593 6bbc0c10 - offset 2594 6bc69810 - offset 2595 6bd12410 - offset 2596 6bdbb010 - offset 2597 6be63c10 - offset 2598 6bf0c810 - offset 2599 6bfb5410 - offset 2600 6c05e010 - offset 2601 6c106c10 - offset 2602 6c1af810 - offset 2603 6c258410 - offset 2604 6c301010 - offset 2605 6c3a9c10 - offset 2606 6c452810 - offset 2607 6c4fb410 - offset 2608 6c5a4010 - offset 2609 6c64cc10 - offset 2610 6c6f5810 - offset 2611 6c79e410 - offset 2612 6c847010 - offset 2613 6c8efc10 - offset 2614 6c998810 - offset 2615 6ca41410 - offset 2616 6caea010 - offset 2617 6cb92c10 - offset 2618 6cc3b810 - offset 2619 6cce4410 - offset 2620 6cd8d010 - offset 2621 6ce35c10 - offset 2622 6cede810 - offset 2623 6cf87410 - offset 2624 6d030010 - offset 2625 6d0d8c10 - offset 2626 6d181810 - offset 2627 6d22a410 - offset 2628 6d2d3010 - offset 2629 6d37bc10 - offset 2630 6d424810 - offset 2631 6d4cd410 - offset 2632 6d576010 - offset 2633 6d61ec10 - offset 2634 6d6c7810 - offset 2635 6d770410 - offset 2636 6d819010 - offset 2637 6d8c1c10 - offset 2638 6d96a810 - offset 2639 6da13410 - offset 2640 6dabc010 - offset 2641 6db64c10 - offset 2642 6dc0d810 - offset 2643 6dcb6410 - offset 2644 6dd5f010 - offset 2645 6de07c10 - offset 2646 6deb0810 - offset 2647 6df59410 - offset 2648 6e002010 - offset 2649 6e0aac10 - offset 2650 6e153810 - offset 2651 6e1fc410 - offset 2652 6e2a5010 - offset 2653 6e34dc10 - offset 2654 6e3f6810 - offset 2655 6e49f410 - offset 2656 6e548010 - offset 2657 6e5f0c10 - offset 2658 6e699810 - offset 2659 6e742410 - offset 2660 6e7eb010 - offset 2661 6e893c10 - offset 2662 6e93c810 - offset 2663 6e9e5410 - offset 2664 6ea8e010 - offset 2665 6eb36c10 - offset 2666 6ebdf810 - offset 2667 6ec88410 - offset 2668 6ed31010 - offset 2669 6edd9c10 - offset 2670 6ef02810 - offset 2671 6efab410 - offset 2672 6f054010 - offset 2673 6f0fcc10 - offset 2674 6f1a5810 - offset 2675 6f24e410 - offset 2676 6f2f7010 - offset 2677 6f39fc10 - offset 2678 6f448810 - offset 2679 6f4f1410 - offset 2680 6f59a010 - offset 2681 6f642c10 - offset 2682 6f6eb810 - offset 2683 6f794410 - offset 2684 6f83d010 - offset 2685 6f8e5c10 - offset 2686 6f98e810 - offset 2687 6fa37410 - offset 2688 6fae0010 - offset 2689 6fb88c10 - offset 2690 6fc31810 - offset 2691 6fcda410 - offset 2692 6fd83010 - offset 2693 6fe2bc10 - offset 2694 6fed4810 - offset 2695 6ff7d410 - offset 2696 70026010 - offset 2697 700cec10 - offset 2698 70177810 - offset 2699 70220410 - offset 2700 702c9010 - offset 2701 70371c10 - offset 2702 7041a810 - offset 2703 704c3410 - offset 2704 7056c010 - offset 2705 70614c10 - offset 2706 706bd810 - offset 2707 70766410 - offset 2708 7080f010 - offset 2709 708b7c10 - offset 2710 70960810 - offset 2711 70a09410 - offset 2712 70ab2010 - offset 2713 70b5ac10 - offset 2714 70c03810 - offset 2715 70cac410 - offset 2716 70d55010 - offset 2717 70dfdc10 - offset 2718 70ea6810 - offset 2719 70f4f410 - offset 2720 70ff8010 - offset 2721 710a0c10 - offset 2722 71149810 - offset 2723 711f2410 - offset 2724 7129b010 - offset 2725 71343c10 - offset 2726 713ec810 - offset 2727 71495410 - offset 2728 7153e010 - offset 2729 715e6c10 - offset 2730 7168f810 - offset 2731 71738410 - offset 2732 717e1010 - offset 2733 71889c10 - offset 2734 71932810 - offset 2735 719db410 - offset 2736 71a84010 - offset 2737 71b2cc10 - offset 2738 71bd5810 - offset 2739 71c7e410 - offset 2740 71d27010 - offset 2741 71dcfc10 - offset 2742 71e78810 - offset 2743 71f21410 - offset 2744 71fca010 - offset 2745 72072c10 - offset 2746 7211b810 - offset 2747 721c4410 - offset 2748 7226d010 - offset 2749 72315c10 - offset 2750 723be810 - offset 2751 72467410 - offset 2752 72510010 - offset 2753 725b8c10 - offset 2754 72661810 - offset 2755 7270a410 - offset 2756 727b3010 - offset 2757 7285bc10 - offset 2758 72904810 - offset 2759 729ad410 - offset 2760 72ad6010 - offset 2761 72b7ec10 - offset 2762 72c27810 - offset 2763 72cd0410 - offset 2764 72d79010 - offset 2765 72e21c10 - offset 2766 72eca810 - offset 2767 72f73410 - offset 2768 7301c010 - offset 2769 730c4c10 - offset 2770 7316d810 - offset 2771 73216410 - offset 2772 732bf010 - offset 2773 73367c10 - offset 2774 73410810 - offset 2775 734b9410 - offset 2776 73562010 - offset 2777 7360ac10 - offset 2778 736b3810 - offset 2779 7375c410 - offset 2780 73805010 - offset 2781 738adc10 - offset 2782 73956810 - offset 2783 739ff410 - offset 2784 73aa8010 - offset 2785 73b50c10 - offset 2786 73bf9810 - offset 2787 73ca2410 - offset 2788 73d4b010 - offset 2789 73df3c10 - offset 2790 73e9c810 - offset 2791 73f45410 - offset 2792 73fee010 - offset 2793 74096c10 - offset 2794 7413f810 - offset 2795 741e8410 - offset 2796 74291010 - offset 2797 74339c10 - offset 2798 743e2810 - offset 2799 7448b410 - offset 2800 74534010 - offset 2801 745dcc10 - offset 2802 74685810 - offset 2803 7472e410 - offset 2804 747d7010 - offset 2805 7487fc10 - offset 2806 74928810 - offset 2807 749d1410 - offset 2808 74a7a010 - offset 2809 74b22c10 - offset 2810 74bcb810 - offset 2811 74c74410 - offset 2812 74d1d010 - offset 2813 74dc5c10 - offset 2814 74e6e810 - offset 2815 74f17410 - offset 2816 74fc0010 - offset 2817 75068c10 - offset 2818 75111810 - offset 2819 751ba410 - offset 2820 75263010 - offset 2821 7530bc10 - offset 2822 753b4810 - offset 2823 7545d410 - offset 2824 75506010 - offset 2825 755aec10 - offset 2826 75657810 - offset 2827 75700410 - offset 2828 757a9010 - offset 2829 75851c10 - offset 2830 758fa810 - offset 2831 759a3410 - offset 2832 75a4c010 - offset 2833 75af4c10 - offset 2834 75b9d810 - offset 2835 75c46410 - offset 2836 75cef010 - offset 2837 75d97c10 - offset 2838 75e40810 - offset 2839 75ee9410 - offset 2840 75f92010 - offset 2841 7603ac10 - offset 2842 760e3810 - offset 2843 7618c410 - offset 2844 76235010 - offset 2845 762ddc10 - offset 2846 76386810 - offset 2847 7642f410 - offset 2848 764d8010 - offset 2849 76580c10 - offset 2850 766a9810 - offset 2851 76752410 - offset 2852 767fb010 - offset 2853 768a3c10 - offset 2854 7694c810 - offset 2855 769f5410 - offset 2856 76a9e010 - offset 2857 76b46c10 - offset 2858 76bef810 - offset 2859 76c98410 - offset 2860 76d41010 - offset 2861 76de9c10 - offset 2862 76e92810 - offset 2863 76f3b410 - offset 2864 76fe4010 - offset 2865 7708cc10 - offset 2866 77135810 - offset 2867 771de410 - offset 2868 77287010 - offset 2869 7732fc10 - offset 2870 773d8810 - offset 2871 77481410 - offset 2872 7752a010 - offset 2873 775d2c10 - offset 2874 7767b810 - offset 2875 77724410 - offset 2876 777cd010 - offset 2877 77875c10 - offset 2878 7791e810 - offset 2879 779c7410 - offset 2880 77a70010 - offset 2881 77b18c10 - offset 2882 77bc1810 - offset 2883 77c6a410 - offset 2884 77d13010 - offset 2885 77dbbc10 - offset 2886 77e64810 - offset 2887 77f0d410 - offset 2888 77fb6010 - offset 2889 7805ec10 - offset 2890 78107810 - offset 2891 781b0410 - offset 2892 78259010 - offset 2893 78301c10 - offset 2894 783aa810 - offset 2895 78453410 - offset 2896 784fc010 - offset 2897 785a4c10 - offset 2898 7864d810 - offset 2899 786f6410 - offset 2900 7879f010 - offset 2901 78847c10 - offset 2902 788f0810 - offset 2903 78999410 - offset 2904 78a42010 - offset 2905 78aeac10 - offset 2906 78b93810 - offset 2907 78c3c410 - offset 2908 78ce5010 - offset 2909 78d8dc10 - offset 2910 78e36810 - offset 2911 78edf410 - offset 2912 78f88010 - offset 2913 79030c10 - offset 2914 790d9810 - offset 2915 79182410 - offset 2916 7922b010 - offset 2917 792d3c10 - offset 2918 7937c810 - offset 2919 79425410 - offset 2920 794ce010 - offset 2921 79576c10 - offset 2922 7961f810 - offset 2923 796c8410 - offset 2924 79771010 - offset 2925 79819c10 - offset 2926 798c2810 - offset 2927 7996b410 - offset 2928 79a14010 - offset 2929 79abcc10 - offset 2930 79b65810 - offset 2931 79c0e410 - offset 2932 79cb7010 - offset 2933 79d5fc10 - offset 2934 79e08810 - offset 2935 79eb1410 - offset 2936 79f5a010 - offset 2937 7a002c10 - offset 2938 7a0ab810 - offset 2939 7a154410 - offset 2940 7a27d010 - offset 2941 7a325c10 - offset 2942 7a3ce810 - offset 2943 7a477410 - offset 2944 7a520010 - offset 2945 7a5c8c10 - offset 2946 7a671810 - offset 2947 7a71a410 - offset 2948 7a7c3010 - offset 2949 7a86bc10 - offset 2950 7a914810 - offset 2951 7a9bd410 - offset 2952 7aa66010 - offset 2953 7ab0ec10 - offset 2954 7abb7810 - offset 2955 7ac60410 - offset 2956 7ad09010 - offset 2957 7adb1c10 - offset 2958 7ae5a810 - offset 2959 7af03410 - offset 2960 7afac010 - offset 2961 7b054c10 - offset 2962 7b0fd810 - offset 2963 7b1a6410 - offset 2964 7b24f010 - offset 2965 7b2f7c10 - offset 2966 7b3a0810 - offset 2967 7b449410 - offset 2968 7b4f2010 - offset 2969 7b59ac10 - offset 2970 7b643810 - offset 2971 7b6ec410 - offset 2972 7b795010 - offset 2973 7b83dc10 - offset 2974 7b8e6810 - offset 2975 7b98f410 - offset 2976 7ba38010 - offset 2977 7bae0c10 - offset 2978 7bb89810 - offset 2979 7bc32410 - offset 2980 7bcdb010 - offset 2981 7bd83c10 - offset 2982 7be2c810 - offset 2983 7bed5410 - offset 2984 7bf7e010 - offset 2985 7c026c10 - offset 2986 7c0cf810 - offset 2987 7c178410 - offset 2988 7c221010 - offset 2989 7c2c9c10 - offset 2990 7c372810 - offset 2991 7c41b410 - offset 2992 7c4c4010 - offset 2993 7c56cc10 - offset 2994 7c615810 - offset 2995 7c6be410 - offset 2996 7c767010 - offset 2997 7c80fc10 - offset 2998 7c8b8810 - offset 2999 7c961410 - offset 3000 7ca0a010 - offset 3001 7cab2c10 - offset 3002 7cb5b810 - offset 3003 7cc04410 - offset 3004 7ccad010 - offset 3005 7cd55c10 - offset 3006 7cdfe810 - offset 3007 7cea7410 - offset 3008 7cf50010 - offset 3009 7cff8c10 - offset 3010 7d0a1810 - offset 3011 7d14a410 - offset 3012 7d1f3010 - offset 3013 7d29bc10 - offset 3014 7d344810 - offset 3015 7d3ed410 - offset 3016 7d496010 - offset 3017 7d53ec10 - offset 3018 7d5e7810 - offset 3019 7d690410 - offset 3020 7d7b9010 - offset 3021 7d861c10 - offset 3022 7d90a810 - offset 3023 7d9b3410 - offset 3024 7da5c010 - offset 3025 7db04c10 - offset 3026 7dbad810 - offset 3027 7dc56410 - offset 3028 7dcff010 - offset 3029 7dda7c10 - offset 3030 7de50810 - offset 3031 7def9410 - offset 3032 7dfa2010 - offset 3033 7e04ac10 - offset 3034 7e0f3810 - offset 3035 7e19c410 - offset 3036 7e245010 - offset 3037 7e2edc10 - offset 3038 7e396810 - offset 3039 7e43f410 - offset 3040 7e4e8010 - offset 3041 7e590c10 - offset 3042 7e639810 - offset 3043 7e6e2410 - offset 3044 7e78b010 - offset 3045 7e833c10 - offset 3046 7e8dc810 - offset 3047 7e985410 - offset 3048 7ea2e010 - offset 3049 7ead6c10 - offset 3050 7eb7f810 - offset 3051 7ec28410 - offset 3052 7ecd1010 - offset 3053 7ed79c10 - offset 3054 7ee22810 - offset 3055 7eecb410 - offset 3056 7ef74010 - offset 3057 7f01cc10 - offset 3058 7f0c5810 - offset 3059 7f16e410 - offset 3060 7f217010 - offset 3061 7f2bfc10 - offset 3062 7f368810 - offset 3063 7f411410 - offset 3064 7f4ba010 - offset 3065 7f562c10 - offset 3066 7f60b810 - offset 3067 7f6b4410 - offset 3068 7f75d010 - offset 3069 7f805c10 - offset 3070 7f8ae810 - offset 3071 7f957410 - offset 3072 7fa00010 - offset 3073 7faa8c10 - offset 3074 7fb51810 - offset 3075 7fbfa410 - offset 3076 7fca3010 - offset 3077 7fd4bc10 - offset 3078 7fdf4810 - offset 3079 7fe9d410 - offset 3080 7ff46010 - offset 3081 7ffeec10 - offset 3082 80097810 - offset 3083 80140410 - offset 3084 801e9010 - offset 3085 80291c10 - offset 3086 8033a810 - offset 3087 803e3410 - offset 3088 8048c010 - offset 3089 80534c10 - offset 3090 805dd810 - offset 3091 80686410 - offset 3092 8072f010 - offset 3093 807d7c10 - offset 3094 80880810 - offset 3095 80929410 - offset 3096 809d2010 - offset 3097 80a7ac10 - offset 3098 80b23810 - offset 3099 80bcc410 - offset 3100 80c75010 - offset 3101 80d1dc10 - offset 3102 80dc6810 - offset 3103 80e6f410 - offset 3104 80f18010 - offset 3105 80fc0c10 - offset 3106 81069810 - offset 3107 81112410 - offset 3108 811bb010 - offset 3109 81263c10 - offset 3110 8138c810 - offset 3111 81435410 - offset 3112 814de010 - offset 3113 81586c10 - offset 3114 8162f810 - offset 3115 816d8410 - offset 3116 81781010 - offset 3117 81829c10 - offset 3118 818d2810 - offset 3119 8197b410 - offset 3120 81a24010 - offset 3121 81accc10 - offset 3122 81b75810 - offset 3123 81c1e410 - offset 3124 81cc7010 - offset 3125 81d6fc10 - offset 3126 81e18810 - offset 3127 81ec1410 - offset 3128 81f6a010 - offset 3129 82012c10 - offset 3130 820bb810 - offset 3131 82164410 - offset 3132 8220d010 - offset 3133 822b5c10 - offset 3134 8235e810 - offset 3135 82407410 - offset 3136 824b0010 - offset 3137 82558c10 - offset 3138 82601810 - offset 3139 826aa410 - offset 3140 82753010 - offset 3141 827fbc10 - offset 3142 828a4810 - offset 3143 8294d410 - offset 3144 829f6010 - offset 3145 82a9ec10 - offset 3146 82b47810 - offset 3147 82bf0410 - offset 3148 82c99010 - offset 3149 82d41c10 - offset 3150 82dea810 - offset 3151 82e93410 - offset 3152 82f3c010 - offset 3153 82fe4c10 - offset 3154 8308d810 - offset 3155 83136410 - offset 3156 831df010 - offset 3157 83287c10 - offset 3158 83330810 - offset 3159 833d9410 - offset 3160 83482010 - offset 3161 8352ac10 - offset 3162 835d3810 - offset 3163 8367c410 - offset 3164 83725010 - offset 3165 837cdc10 - offset 3166 83876810 - offset 3167 8391f410 - offset 3168 839c8010 - offset 3169 83a70c10 - offset 3170 83b19810 - offset 3171 83bc2410 - offset 3172 83c6b010 - offset 3173 83d13c10 - offset 3174 83dbc810 - offset 3175 83e65410 - offset 3176 83f0e010 - offset 3177 83fb6c10 - offset 3178 8405f810 - offset 3179 84108410 - offset 3180 841b1010 - offset 3181 84259c10 - offset 3182 84302810 - offset 3183 843ab410 - offset 3184 84454010 - offset 3185 844fcc10 - offset 3186 845a5810 - offset 3187 8464e410 - offset 3188 846f7010 - offset 3189 8479fc10 - offset 3190 84848810 - offset 3191 848f1410 - offset 3192 8499a010 - offset 3193 84a42c10 - offset 3194 84aeb810 - offset 3195 84b94410 - offset 3196 84c3d010 - offset 3197 84ce5c10 - offset 3198 84d8e810 - offset 3199 84e37410 - offset 3200 84f60010 - offset 3201 85008c10 - offset 3202 850b1810 - offset 3203 8515a410 - offset 3204 85203010 - offset 3205 852abc10 - offset 3206 85354810 - offset 3207 853fd410 - offset 3208 854a6010 - offset 3209 8554ec10 - offset 3210 855f7810 - offset 3211 856a0410 - offset 3212 85749010 - offset 3213 857f1c10 - offset 3214 8589a810 - offset 3215 85943410 - offset 3216 859ec010 - offset 3217 85a94c10 - offset 3218 85b3d810 - offset 3219 85be6410 - offset 3220 85c8f010 - offset 3221 85d37c10 - offset 3222 85de0810 - offset 3223 85e89410 - offset 3224 85f32010 - offset 3225 85fdac10 - offset 3226 86083810 - offset 3227 8612c410 - offset 3228 861d5010 - offset 3229 8627dc10 - offset 3230 86326810 - offset 3231 863cf410 - offset 3232 86478010 - offset 3233 86520c10 - offset 3234 865c9810 - offset 3235 86672410 - offset 3236 8671b010 - offset 3237 867c3c10 - offset 3238 8686c810 - offset 3239 86915410 - offset 3240 869be010 - offset 3241 86a66c10 - offset 3242 86b0f810 - offset 3243 86bb8410 - offset 3244 86c61010 - offset 3245 86d09c10 - offset 3246 86db2810 - offset 3247 86e5b410 - offset 3248 86f04010 - offset 3249 86facc10 - offset 3250 87055810 - offset 3251 870fe410 - offset 3252 871a7010 - offset 3253 8724fc10 - offset 3254 872f8810 - offset 3255 873a1410 - offset 3256 8744a010 - offset 3257 874f2c10 - offset 3258 8759b810 - offset 3259 87644410 - offset 3260 876ed010 - offset 3261 87795c10 - offset 3262 8783e810 - offset 3263 878e7410 - offset 3264 87990010 - offset 3265 87a38c10 - offset 3266 87ae1810 - offset 3267 87b8a410 - offset 3268 87c33010 - offset 3269 87cdbc10 - offset 3270 87d84810 - offset 3271 87e2d410 - offset 3272 87ed6010 - offset 3273 87f7ec10 - offset 3274 88027810 - offset 3275 880d0410 - offset 3276 88179010 - offset 3277 88221c10 - offset 3278 882ca810 - offset 3279 88373410 - offset 3280 8841c010 - offset 3281 884c4c10 - offset 3282 8856d810 - offset 3283 88616410 - offset 3284 886bf010 - offset 3285 88767c10 - offset 3286 88810810 - offset 3287 888b9410 - offset 3288 88962010 - offset 3289 88a0ac10 - offset 3290 88b33810 - offset 3291 88bdc410 - offset 3292 88c85010 - offset 3293 88d2dc10 - offset 3294 88dd6810 - offset 3295 88e7f410 - offset 3296 88f28010 - offset 3297 88fd0c10 - offset 3298 89079810 - offset 3299 89122410 - offset 3300 891cb010 - offset 3301 89273c10 - offset 3302 8931c810 - offset 3303 893c5410 - offset 3304 8946e010 - offset 3305 89516c10 - offset 3306 895bf810 - offset 3307 89668410 - offset 3308 89711010 - offset 3309 897b9c10 - offset 3310 89862810 - offset 3311 8990b410 - offset 3312 899b4010 - offset 3313 89a5cc10 - offset 3314 89b05810 - offset 3315 89bae410 - offset 3316 89c57010 - offset 3317 89cffc10 - offset 3318 89da8810 - offset 3319 89e51410 - offset 3320 89efa010 - offset 3321 89fa2c10 - offset 3322 8a04b810 - offset 3323 8a0f4410 - offset 3324 8a19d010 - offset 3325 8a245c10 - offset 3326 8a2ee810 - offset 3327 8a397410 - offset 3328 8a440010 - offset 3329 8a4e8c10 - offset 3330 8a591810 - offset 3331 8a63a410 - offset 3332 8a6e3010 - offset 3333 8a78bc10 - offset 3334 8a834810 - offset 3335 8a8dd410 - offset 3336 8a986010 - offset 3337 8aa2ec10 - offset 3338 8aad7810 - offset 3339 8ab80410 - offset 3340 8ac29010 - offset 3341 8acd1c10 - offset 3342 8ad7a810 - offset 3343 8ae23410 - offset 3344 8aecc010 - offset 3345 8af74c10 - offset 3346 8b01d810 - offset 3347 8b0c6410 - offset 3348 8b16f010 - offset 3349 8b217c10 - offset 3350 8b2c0810 - offset 3351 8b369410 - offset 3352 8b412010 - offset 3353 8b4bac10 - offset 3354 8b563810 - offset 3355 8b60c410 - offset 3356 8b6b5010 - offset 3357 8b75dc10 - offset 3358 8b806810 - offset 3359 8b8af410 - offset 3360 8b958010 - offset 3361 8ba00c10 - offset 3362 8baa9810 - offset 3363 8bb52410 - offset 3364 8bbfb010 - offset 3365 8bca3c10 - offset 3366 8bd4c810 - offset 3367 8bdf5410 - offset 3368 8be9e010 - offset 3369 8bf46c10 - offset 3370 8bfef810 - offset 3371 8c098410 - offset 3372 8c141010 - offset 3373 8c1e9c10 - offset 3374 8c292810 - offset 3375 8c33b410 - offset 3376 8c3e4010 - offset 3377 8c48cc10 - offset 3378 8c535810 - offset 3379 8c5de410 - offset 3380 8c707010 - offset 3381 8c7afc10 - offset 3382 8c858810 - offset 3383 8c901410 - offset 3384 8c9aa010 - offset 3385 8ca52c10 - offset 3386 8cafb810 - offset 3387 8cba4410 - offset 3388 8cc4d010 - offset 3389 8ccf5c10 - offset 3390 8cd9e810 - offset 3391 8ce47410 - offset 3392 8cef0010 - offset 3393 8cf98c10 - offset 3394 8d041810 - offset 3395 8d0ea410 - offset 3396 8d193010 - offset 3397 8d23bc10 - offset 3398 8d2e4810 - offset 3399 8d38d410 - offset 3400 8d436010 - offset 3401 8d4dec10 - offset 3402 8d587810 - offset 3403 8d630410 - offset 3404 8d6d9010 - offset 3405 8d781c10 - offset 3406 8d82a810 - offset 3407 8d8d3410 - offset 3408 8d97c010 - offset 3409 8da24c10 - offset 3410 8dacd810 - offset 3411 8db76410 - offset 3412 8dc1f010 - offset 3413 8dcc7c10 - offset 3414 8dd70810 - offset 3415 8de19410 - offset 3416 8dec2010 - offset 3417 8df6ac10 - offset 3418 8e013810 - offset 3419 8e0bc410 - offset 3420 8e165010 - offset 3421 8e20dc10 - offset 3422 8e2b6810 - offset 3423 8e35f410 - offset 3424 8e408010 - offset 3425 8e4b0c10 - offset 3426 8e559810 - offset 3427 8e602410 - offset 3428 8e6ab010 - offset 3429 8e753c10 - offset 3430 8e7fc810 - offset 3431 8e8a5410 - offset 3432 8e94e010 - offset 3433 8e9f6c10 - offset 3434 8ea9f810 - offset 3435 8eb48410 - offset 3436 8ebf1010 - offset 3437 8ec99c10 - offset 3438 8ed42810 - offset 3439 8edeb410 - offset 3440 8ee94010 - offset 3441 8ef3cc10 - offset 3442 8efe5810 - offset 3443 8f08e410 - offset 3444 8f137010 - offset 3445 8f1dfc10 - offset 3446 8f288810 - offset 3447 8f331410 - offset 3448 8f3da010 - offset 3449 8f482c10 - offset 3450 8f52b810 - offset 3451 8f5d4410 - offset 3452 8f67d010 - offset 3453 8f725c10 - offset 3454 8f7ce810 - offset 3455 8f877410 - offset 3456 8f920010 - offset 3457 8f9c8c10 - offset 3458 8fa71810 - offset 3459 8fb1a410 - offset 3460 8fbc3010 - offset 3461 8fc6bc10 - offset 3462 8fd14810 - offset 3463 8fdbd410 - offset 3464 8fe66010 - offset 3465 8ff0ec10 - offset 3466 8ffb7810 - offset 3467 90060410 - offset 3468 90109010 - offset 3469 901b1c10 - offset 3470 902da810 - offset 3471 90383410 - offset 3472 9042c010 - offset 3473 904d4c10 - offset 3474 9057d810 - offset 3475 90626410 - offset 3476 906cf010 - offset 3477 90777c10 - offset 3478 90820810 - offset 3479 908c9410 - offset 3480 90972010 - offset 3481 90a1ac10 - offset 3482 90ac3810 - offset 3483 90b6c410 - offset 3484 90c15010 - offset 3485 90cbdc10 - offset 3486 90d66810 - offset 3487 90e0f410 - offset 3488 90eb8010 - offset 3489 90f60c10 - offset 3490 91009810 - offset 3491 910b2410 - offset 3492 9115b010 - offset 3493 91203c10 - offset 3494 912ac810 - offset 3495 91355410 - offset 3496 913fe010 - offset 3497 914a6c10 - offset 3498 9154f810 - offset 3499 915f8410 - offset 3500 916a1010 - offset 3501 91749c10 - offset 3502 917f2810 - offset 3503 9189b410 - offset 3504 91944010 - offset 3505 919ecc10 - offset 3506 91a95810 - offset 3507 91b3e410 - offset 3508 91be7010 - offset 3509 91c8fc10 - offset 3510 91d38810 - offset 3511 91de1410 - offset 3512 91e8a010 - offset 3513 91f32c10 - offset 3514 91fdb810 - offset 3515 92084410 - offset 3516 9212d010 - offset 3517 921d5c10 - offset 3518 9227e810 - offset 3519 92327410 - offset 3520 923d0010 - offset 3521 92478c10 - offset 3522 92521810 - offset 3523 925ca410 - offset 3524 92673010 - offset 3525 9271bc10 - offset 3526 927c4810 - offset 3527 9286d410 - offset 3528 92916010 - offset 3529 929bec10 - offset 3530 92a67810 - offset 3531 92b10410 - offset 3532 92bb9010 - offset 3533 92c61c10 - offset 3534 92d0a810 - offset 3535 92db3410 - offset 3536 92e5c010 - offset 3537 92f04c10 - offset 3538 92fad810 - offset 3539 93056410 - offset 3540 930ff010 - offset 3541 931a7c10 - offset 3542 93250810 - offset 3543 932f9410 - offset 3544 933a2010 - offset 3545 9344ac10 - offset 3546 934f3810 - offset 3547 9359c410 - offset 3548 93645010 - offset 3549 936edc10 - offset 3550 93796810 - offset 3551 9383f410 - offset 3552 938e8010 - offset 3553 93990c10 - offset 3554 93a39810 - offset 3555 93ae2410 - offset 3556 93b8b010 - offset 3557 93c33c10 - offset 3558 93cdc810 - offset 3559 93d85410 - offset 3560 93eae010 - offset 3561 93f56c10 - offset 3562 93fff810 - offset 3563 940a8410 - offset 3564 94151010 - offset 3565 941f9c10 - offset 3566 942a2810 - offset 3567 9434b410 - offset 3568 943f4010 - offset 3569 9449cc10 - offset 3570 94545810 - offset 3571 945ee410 - offset 3572 94697010 - offset 3573 9473fc10 - offset 3574 947e8810 - offset 3575 94891410 - offset 3576 9493a010 - offset 3577 949e2c10 - offset 3578 94a8b810 - offset 3579 94b34410 - offset 3580 94bdd010 - offset 3581 94c85c10 - offset 3582 94d2e810 - offset 3583 94dd7410 - offset 3584 94e80010 - offset 3585 94f28c10 - offset 3586 94fd1810 - offset 3587 9507a410 - offset 3588 95123010 - offset 3589 951cbc10 - offset 3590 95274810 - offset 3591 9531d410 - offset 3592 953c6010 - offset 3593 9546ec10 - offset 3594 95517810 - offset 3595 955c0410 - offset 3596 95669010 - offset 3597 95711c10 - offset 3598 957ba810 - offset 3599 95863410 - offset 3600 9590c010 - offset 3601 959b4c10 - offset 3602 95a5d810 - offset 3603 95b06410 - offset 3604 95baf010 - offset 3605 95c57c10 - offset 3606 95d00810 - offset 3607 95da9410 - offset 3608 95e52010 - offset 3609 95efac10 - offset 3610 95fa3810 - offset 3611 9604c410 - offset 3612 960f5010 - offset 3613 9619dc10 - offset 3614 96246810 - offset 3615 962ef410 - offset 3616 96398010 - offset 3617 96440c10 - offset 3618 964e9810 - offset 3619 96592410 - offset 3620 9663b010 - offset 3621 966e3c10 - offset 3622 9678c810 - offset 3623 96835410 - offset 3624 968de010 - offset 3625 96986c10 - offset 3626 96a2f810 - offset 3627 96ad8410 - offset 3628 96b81010 - offset 3629 96c29c10 - offset 3630 96cd2810 - offset 3631 96d7b410 - offset 3632 96e24010 - offset 3633 96eccc10 - offset 3634 96f75810 - offset 3635 9701e410 - offset 3636 970c7010 - offset 3637 9716fc10 - offset 3638 97218810 - offset 3639 972c1410 - offset 3640 9736a010 - offset 3641 97412c10 - offset 3642 974bb810 - offset 3643 97564410 - offset 3644 9760d010 - offset 3645 976b5c10 - offset 3646 9775e810 - offset 3647 97807410 - offset 3648 978b0010 - offset 3649 97958c10 - offset 3650 97a81810 - offset 3651 97b2a410 - offset 3652 97bd3010 - offset 3653 97c7bc10 - offset 3654 97d24810 - offset 3655 97dcd410 - offset 3656 97e76010 - offset 3657 97f1ec10 - offset 3658 97fc7810 - offset 3659 98070410 - offset 3660 98119010 - offset 3661 981c1c10 - offset 3662 9826a810 - offset 3663 98313410 - offset 3664 983bc010 - offset 3665 98464c10 - offset 3666 9850d810 - offset 3667 985b6410 - offset 3668 9865f010 - offset 3669 98707c10 - offset 3670 987b0810 - offset 3671 98859410 - offset 3672 98902010 - offset 3673 989aac10 - offset 3674 98a53810 - offset 3675 98afc410 - offset 3676 98ba5010 - offset 3677 98c4dc10 - offset 3678 98cf6810 - offset 3679 98d9f410 - offset 3680 98e48010 - offset 3681 98ef0c10 - offset 3682 98f99810 - offset 3683 99042410 - offset 3684 990eb010 - offset 3685 99193c10 - offset 3686 9923c810 - offset 3687 992e5410 - offset 3688 9938e010 - offset 3689 99436c10 - offset 3690 994df810 - offset 3691 99588410 - offset 3692 99631010 - offset 3693 996d9c10 - offset 3694 99782810 - offset 3695 9982b410 - offset 3696 998d4010 - offset 3697 9997cc10 - offset 3698 99a25810 - offset 3699 99ace410 - offset 3700 99b77010 - offset 3701 99c1fc10 - offset 3702 99cc8810 - offset 3703 99d71410 - offset 3704 99e1a010 - offset 3705 99ec2c10 - offset 3706 99f6b810 - offset 3707 9a014410 - offset 3708 9a0bd010 - offset 3709 9a165c10 - offset 3710 9a20e810 - offset 3711 9a2b7410 - offset 3712 9a360010 - offset 3713 9a408c10 - offset 3714 9a4b1810 - offset 3715 9a55a410 - offset 3716 9a603010 - offset 3717 9a6abc10 - offset 3718 9a754810 - offset 3719 9a7fd410 - offset 3720 9a8a6010 - offset 3721 9a94ec10 - offset 3722 9a9f7810 - offset 3723 9aaa0410 - offset 3724 9ab49010 - offset 3725 9abf1c10 - offset 3726 9ac9a810 - offset 3727 9ad43410 - offset 3728 9adec010 - offset 3729 9ae94c10 - offset 3730 9af3d810 - offset 3731 9afe6410 - offset 3732 9b08f010 - offset 3733 9b137c10 - offset 3734 9b1e0810 - offset 3735 9b289410 - offset 3736 9b332010 - offset 3737 9b3dac10 - offset 3738 9b483810 - offset 3739 9b52c410 - offset 3740 9b655010 - offset 3741 9b6fdc10 - offset 3742 9b7a6810 - offset 3743 9b84f410 - offset 3744 9b8f8010 - offset 3745 9b9a0c10 - offset 3746 9ba49810 - offset 3747 9baf2410 - offset 3748 9bb9b010 - offset 3749 9bc43c10 - offset 3750 9bcec810 - offset 3751 9bd95410 - offset 3752 9be3e010 - offset 3753 9bee6c10 - offset 3754 9bf8f810 - offset 3755 9c038410 - offset 3756 9c0e1010 - offset 3757 9c189c10 - offset 3758 9c232810 - offset 3759 9c2db410 - offset 3760 9c384010 - offset 3761 9c42cc10 - offset 3762 9c4d5810 - offset 3763 9c57e410 - offset 3764 9c627010 - offset 3765 9c6cfc10 - offset 3766 9c778810 - offset 3767 9c821410 - offset 3768 9c8ca010 - offset 3769 9c972c10 - offset 3770 9ca1b810 - offset 3771 9cac4410 - offset 3772 9cb6d010 - offset 3773 9cc15c10 - offset 3774 9ccbe810 - offset 3775 9cd67410 - offset 3776 9ce10010 - offset 3777 9ceb8c10 - offset 3778 9cf61810 - offset 3779 9d00a410 - offset 3780 9d0b3010 - offset 3781 9d15bc10 - offset 3782 9d204810 - offset 3783 9d2ad410 - offset 3784 9d356010 - offset 3785 9d3fec10 - offset 3786 9d4a7810 - offset 3787 9d550410 - offset 3788 9d5f9010 - offset 3789 9d6a1c10 - offset 3790 9d74a810 - offset 3791 9d7f3410 - offset 3792 9d89c010 - offset 3793 9d944c10 - offset 3794 9d9ed810 - offset 3795 9da96410 - offset 3796 9db3f010 - offset 3797 9dbe7c10 - offset 3798 9dc90810 - offset 3799 9dd39410 - offset 3800 9dde2010 - offset 3801 9de8ac10 - offset 3802 9df33810 - offset 3803 9dfdc410 - offset 3804 9e085010 - offset 3805 9e12dc10 - offset 3806 9e1d6810 - offset 3807 9e27f410 - offset 3808 9e328010 - offset 3809 9e3d0c10 - offset 3810 9e479810 - offset 3811 9e522410 - offset 3812 9e5cb010 - offset 3813 9e673c10 - offset 3814 9e71c810 - offset 3815 9e7c5410 - offset 3816 9e86e010 - offset 3817 9e916c10 - offset 3818 9e9bf810 - offset 3819 9ea68410 - offset 3820 9eb11010 - offset 3821 9ebb9c10 - offset 3822 9ec62810 - offset 3823 9ed0b410 - offset 3824 9edb4010 - offset 3825 9ee5cc10 - offset 3826 9ef05810 - offset 3827 9efae410 - offset 3828 9f057010 - offset 3829 9f0ffc10 - offset 3830 9f228810 - offset 3831 9f2d1410 - offset 3832 9f37a010 - offset 3833 9f422c10 - offset 3834 9f4cb810 - offset 3835 9f574410 - offset 3836 9f61d010 - offset 3837 9f6c5c10 - offset 3838 9f76e810 - offset 3839 9f817410 - offset 3840 9f8c0010 - offset 3841 9f968c10 - offset 3842 9fa11810 - offset 3843 9faba410 - offset 3844 9fb63010 - offset 3845 9fc0bc10 - offset 3846 9fcb4810 - offset 3847 9fd5d410 - offset 3848 9fe06010 - offset 3849 9feaec10 - offset 3850 9ff57810 - offset 3851 a0000410 - offset 3852 a00a9010 - offset 3853 a0151c10 - offset 3854 a01fa810 - offset 3855 a02a3410 - offset 3856 a034c010 - offset 3857 a03f4c10 - offset 3858 a049d810 - offset 3859 a0546410 - offset 3860 a05ef010 - offset 3861 a0697c10 - offset 3862 a0740810 - offset 3863 a07e9410 - offset 3864 a0892010 - offset 3865 a093ac10 - offset 3866 a09e3810 - offset 3867 a0a8c410 - offset 3868 a0b35010 - offset 3869 a0bddc10 - offset 3870 a0c86810 - offset 3871 a0d2f410 - offset 3872 a0dd8010 - offset 3873 a0e80c10 - offset 3874 a0f29810 - offset 3875 a0fd2410 - offset 3876 a107b010 - offset 3877 a1123c10 - offset 3878 a11cc810 - offset 3879 a1275410 - offset 3880 a131e010 - offset 3881 a13c6c10 - offset 3882 a146f810 - offset 3883 a1518410 - offset 3884 a15c1010 - offset 3885 a1669c10 - offset 3886 a1712810 - offset 3887 a17bb410 - offset 3888 a1864010 - offset 3889 a190cc10 - offset 3890 a19b5810 - offset 3891 a1a5e410 - offset 3892 a1b07010 - offset 3893 a1bafc10 - offset 3894 a1c58810 - offset 3895 a1d01410 - offset 3896 a1daa010 - offset 3897 a1e52c10 - offset 3898 a1efb810 - offset 3899 a1fa4410 - offset 3900 a204d010 - offset 3901 a20f5c10 - offset 3902 a219e810 - offset 3903 a2247410 - offset 3904 a22f0010 - offset 3905 a2398c10 - offset 3906 a2441810 - offset 3907 a24ea410 - offset 3908 a2593010 - offset 3909 a263bc10 - offset 3910 a2764810 - offset 3911 a280d410 - offset 3912 a28b6010 - offset 3913 a295ec10 - offset 3914 a2a07810 - offset 3915 a2ab0410 - offset 3916 a2b59010 - offset 3917 a2c01c10 - offset 3918 a2caa810 - offset 3919 a2d53410 - offset 3920 a2dfc010 - offset 3921 a2ea4c10 - offset 3922 a2f4d810 - offset 3923 a2ff6410 - offset 3924 a309f010 - offset 3925 a3147c10 - offset 3926 a31f0810 - offset 3927 a3299410 - offset 3928 a3342010 - offset 3929 a33eac10 - offset 3930 a3493810 - offset 3931 a353c410 - offset 3932 a35e5010 - offset 3933 a368dc10 - offset 3934 a3736810 - offset 3935 a37df410 - offset 3936 a3888010 - offset 3937 a3930c10 - offset 3938 a39d9810 - offset 3939 a3a82410 - offset 3940 a3b2b010 - offset 3941 a3bd3c10 - offset 3942 a3c7c810 - offset 3943 a3d25410 - offset 3944 a3dce010 - offset 3945 a3e76c10 - offset 3946 a3f1f810 - offset 3947 a3fc8410 - offset 3948 a4071010 - offset 3949 a4119c10 - offset 3950 a41c2810 - offset 3951 a426b410 - offset 3952 a4314010 - offset 3953 a43bcc10 - offset 3954 a4465810 - offset 3955 a450e410 - offset 3956 a45b7010 - offset 3957 a465fc10 - offset 3958 a4708810 - offset 3959 a47b1410 - offset 3960 a485a010 - offset 3961 a4902c10 - offset 3962 a49ab810 - offset 3963 a4a54410 - offset 3964 a4afd010 - offset 3965 a4ba5c10 - offset 3966 a4c4e810 - offset 3967 a4cf7410 - offset 3968 a4da0010 - offset 3969 a4e48c10 - offset 3970 a4ef1810 - offset 3971 a4f9a410 - offset 3972 a5043010 - offset 3973 a50ebc10 - offset 3974 a5194810 - offset 3975 a523d410 - offset 3976 a52e6010 - offset 3977 a538ec10 - offset 3978 a5437810 - offset 3979 a54e0410 - offset 3980 a5589010 - offset 3981 a5631c10 - offset 3982 a56da810 - offset 3983 a5783410 - offset 3984 a582c010 - offset 3985 a58d4c10 - offset 3986 a597d810 - offset 3987 a5a26410 - offset 3988 a5acf010 - offset 3989 a5b77c10 - offset 3990 a5c20810 - offset 3991 a5cc9410 - offset 3992 a5d72010 - offset 3993 a5e1ac10 - offset 3994 a5ec3810 - offset 3995 a5f6c410 - offset 3996 a6015010 - offset 3997 a60bdc10 - offset 3998 a6166810 - offset 3999 a620f410 - offset 4000 a6338010 - offset 4001 a63e0c10 - offset 4002 a6489810 - offset 4003 a6532410 - offset 4004 a65db010 - offset 4005 a6683c10 - offset 4006 a672c810 - offset 4007 a67d5410 - offset 4008 a687e010 - offset 4009 a6926c10 - offset 4010 a69cf810 - offset 4011 a6a78410 - offset 4012 a6b21010 - offset 4013 a6bc9c10 - offset 4014 a6c72810 - offset 4015 a6d1b410 - offset 4016 a6dc4010 - offset 4017 a6e6cc10 - offset 4018 a6f15810 - offset 4019 a6fbe410 - offset 4020 a7067010 - offset 4021 a710fc10 - offset 4022 a71b8810 - offset 4023 a7261410 - offset 4024 a730a010 - offset 4025 a73b2c10 - offset 4026 a745b810 - offset 4027 a7504410 - offset 4028 a75ad010 - offset 4029 a7655c10 - offset 4030 a76fe810 - offset 4031 a77a7410 - offset 4032 a7850010 - offset 4033 a78f8c10 - offset 4034 a79a1810 - offset 4035 a7a4a410 - offset 4036 a7af3010 - offset 4037 a7b9bc10 - offset 4038 a7c44810 - offset 4039 a7ced410 - offset 4040 a7d96010 - offset 4041 a7e3ec10 - offset 4042 a7ee7810 - offset 4043 a7f90410 - offset 4044 a8039010 - offset 4045 a80e1c10 - offset 4046 a818a810 - offset 4047 a8233410 - offset 4048 a82dc010 - offset 4049 a8384c10 - offset 4050 a842d810 - offset 4051 a84d6410 - offset 4052 a857f010 - offset 4053 a8627c10 - offset 4054 a86d0810 - offset 4055 a8779410 - offset 4056 a8822010 - offset 4057 a88cac10 - offset 4058 a8973810 - offset 4059 a8a1c410 - offset 4060 a8ac5010 - offset 4061 a8b6dc10 - offset 4062 a8c16810 - offset 4063 a8cbf410 - offset 4064 a8d68010 - offset 4065 a8e10c10 - offset 4066 a8eb9810 - offset 4067 a8f62410 - offset 4068 a900b010 - offset 4069 a90b3c10 - offset 4070 a915c810 - offset 4071 a9205410 - offset 4072 a92ae010 - offset 4073 a9356c10 - offset 4074 a93ff810 - offset 4075 a94a8410 - offset 4076 a9551010 - offset 4077 a95f9c10 - offset 4078 a96a2810 - offset 4079 a974b410 - offset 4080 a97f4010 - offset 4081 a989cc10 - offset 4082 a9945810 - offset 4083 a99ee410 - offset 4084 a9a97010 - offset 4085 a9b3fc10 - offset 4086 a9be8810 - offset 4087 a9c91410 - offset 4088 a9d3a010 - offset 4089 a9de2c10 - offset 4090 a9f0b810 - offset 4091 a9fb4410 - offset 4092 aa05d010 - offset 4093 aa105c10 - offset 4094 aa1ae810 - offset 4095 aa257410 - offset 4096 aa300010 - offset 4097 aa3a8c10 - offset 4098 aa451810 - offset 4099 aa4fa410 - offset 4100 aa5a3010 - offset 4101 aa64bc10 - offset 4102 aa6f4810 - offset 4103 aa79d410 - offset 4104 aa846010 - offset 4105 aa8eec10 - offset 4106 aa997810 - offset 4107 aaa40410 - offset 4108 aaae9010 - offset 4109 aab91c10 - offset 4110 aac3a810 - offset 4111 aace3410 - offset 4112 aad8c010 - offset 4113 aae34c10 - offset 4114 aaedd810 - offset 4115 aaf86410 - offset 4116 ab02f010 - offset 4117 ab0d7c10 - offset 4118 ab180810 - offset 4119 ab229410 - offset 4120 ab2d2010 - offset 4121 ab37ac10 - offset 4122 ab423810 - offset 4123 ab4cc410 - offset 4124 ab575010 - offset 4125 ab61dc10 - offset 4126 ab6c6810 - offset 4127 ab76f410 - offset 4128 ab818010 - offset 4129 ab8c0c10 - offset 4130 ab969810 - offset 4131 aba12410 - offset 4132 ababb010 - offset 4133 abb63c10 - offset 4134 abc0c810 - offset 4135 abcb5410 - offset 4136 abd5e010 - offset 4137 abe06c10 - offset 4138 abeaf810 - offset 4139 abf58410 - offset 4140 ac001010 - offset 4141 ac0a9c10 - offset 4142 ac152810 - offset 4143 ac1fb410 - offset 4144 ac2a4010 - offset 4145 ac34cc10 - offset 4146 ac3f5810 - offset 4147 ac49e410 - offset 4148 ac547010 - offset 4149 ac5efc10 - offset 4150 ac698810 - offset 4151 ac741410 - offset 4152 ac7ea010 - offset 4153 ac892c10 - offset 4154 ac93b810 - offset 4155 ac9e4410 - offset 4156 aca8d010 - offset 4157 acb35c10 - offset 4158 acbde810 - offset 4159 acc87410 - offset 4160 acd30010 - offset 4161 acdd8c10 - offset 4162 ace81810 - offset 4163 acf2a410 - offset 4164 acfd3010 - offset 4165 ad07bc10 - offset 4166 ad124810 - offset 4167 ad1cd410 - offset 4168 ad276010 - offset 4169 ad31ec10 - offset 4170 ad3c7810 - offset 4171 ad470410 - offset 4172 ad519010 - offset 4173 ad5c1c10 - offset 4174 ad66a810 - offset 4175 ad713410 - offset 4176 ad7bc010 - offset 4177 ad864c10 - offset 4178 ad90d810 - offset 4179 ad9b6410 - offset 4180 adadf010 - offset 4181 adb87c10 - offset 4182 adc30810 - offset 4183 adcd9410 - offset 4184 add82010 - offset 4185 ade2ac10 - offset 4186 aded3810 - offset 4187 adf7c410 - offset 4188 ae025010 - offset 4189 ae0cdc10 - offset 4190 ae176810 - offset 4191 ae21f410 - offset 4192 ae2c8010 - offset 4193 ae370c10 - offset 4194 ae419810 - offset 4195 ae4c2410 - offset 4196 ae56b010 - offset 4197 ae613c10 - offset 4198 ae6bc810 - offset 4199 ae765410 - offset 4200 ae80e010 - offset 4201 ae8b6c10 - offset 4202 ae95f810 - offset 4203 aea08410 - offset 4204 aeab1010 - offset 4205 aeb59c10 - offset 4206 aec02810 - offset 4207 aecab410 - offset 4208 aed54010 - offset 4209 aedfcc10 - offset 4210 aeea5810 - offset 4211 aef4e410 - offset 4212 aeff7010 - offset 4213 af09fc10 - offset 4214 af148810 - offset 4215 af1f1410 - offset 4216 af29a010 - offset 4217 af342c10 - offset 4218 af3eb810 - offset 4219 af494410 - offset 4220 af53d010 - offset 4221 af5e5c10 - offset 4222 af68e810 - offset 4223 af737410 - offset 4224 af7e0010 - offset 4225 af888c10 - offset 4226 af931810 - offset 4227 af9da410 - offset 4228 afa83010 - offset 4229 afb2bc10 - offset 4230 afbd4810 - offset 4231 afc7d410 - offset 4232 afd26010 - offset 4233 afdcec10 - offset 4234 afe77810 - offset 4235 aff20410 - offset 4236 affc9010 - offset 4237 b0071c10 - offset 4238 b011a810 - offset 4239 b01c3410 - offset 4240 b026c010 - offset 4241 b0314c10 - offset 4242 b03bd810 - offset 4243 b0466410 - offset 4244 b050f010 - offset 4245 b05b7c10 - offset 4246 b0660810 - offset 4247 b0709410 - offset 4248 b07b2010 - offset 4249 b085ac10 - offset 4250 b0903810 - offset 4251 b09ac410 - offset 4252 b0a55010 - offset 4253 b0afdc10 - offset 4254 b0ba6810 - offset 4255 b0c4f410 - offset 4256 b0cf8010 - offset 4257 b0da0c10 - offset 4258 b0e49810 - offset 4259 b0ef2410 - offset 4260 b0f9b010 - offset 4261 b1043c10 - offset 4262 b10ec810 - offset 4263 b1195410 - offset 4264 b123e010 - offset 4265 b12e6c10 - offset 4266 b138f810 - offset 4267 b1438410 - offset 4268 b14e1010 - offset 4269 b1589c10 - offset 4270 b16b2810 - offset 4271 b175b410 - offset 4272 b1804010 - offset 4273 b18acc10 - offset 4274 b1955810 - offset 4275 b19fe410 - offset 4276 b1aa7010 - offset 4277 b1b4fc10 - offset 4278 b1bf8810 - offset 4279 b1ca1410 - offset 4280 b1d4a010 - offset 4281 b1df2c10 - offset 4282 b1e9b810 - offset 4283 b1f44410 - offset 4284 b1fed010 - offset 4285 b2095c10 - offset 4286 b213e810 - offset 4287 b21e7410 - offset 4288 b2290010 - offset 4289 b2338c10 - offset 4290 b23e1810 - offset 4291 b248a410 - offset 4292 b2533010 - offset 4293 b25dbc10 - offset 4294 b2684810 - offset 4295 b272d410 - offset 4296 b27d6010 - offset 4297 b287ec10 - offset 4298 b2927810 - offset 4299 b29d0410 - offset 4300 b2a79010 - offset 4301 b2b21c10 - offset 4302 b2bca810 - offset 4303 b2c73410 - offset 4304 b2d1c010 - offset 4305 b2dc4c10 - offset 4306 b2e6d810 - offset 4307 b2f16410 - offset 4308 b2fbf010 - offset 4309 b3067c10 - offset 4310 b3110810 - offset 4311 b31b9410 - offset 4312 b3262010 - offset 4313 b330ac10 - offset 4314 b33b3810 - offset 4315 b345c410 - offset 4316 b3505010 - offset 4317 b35adc10 - offset 4318 b3656810 - offset 4319 b36ff410 - offset 4320 b37a8010 - offset 4321 b3850c10 - offset 4322 b38f9810 - offset 4323 b39a2410 - offset 4324 b3a4b010 - offset 4325 b3af3c10 - offset 4326 b3b9c810 - offset 4327 b3c45410 - offset 4328 b3cee010 - offset 4329 b3d96c10 - offset 4330 b3e3f810 - offset 4331 b3ee8410 - offset 4332 b3f91010 - offset 4333 b4039c10 - offset 4334 b40e2810 - offset 4335 b418b410 - offset 4336 b4234010 - offset 4337 b42dcc10 - offset 4338 b4385810 - offset 4339 b442e410 - offset 4340 b44d7010 - offset 4341 b457fc10 - offset 4342 b4628810 - offset 4343 b46d1410 - offset 4344 b477a010 - offset 4345 b4822c10 - offset 4346 b48cb810 - offset 4347 b4974410 - offset 4348 b4a1d010 - offset 4349 b4ac5c10 - offset 4350 b4b6e810 - offset 4351 b4c17410 - offset 4352 b4cc0010 - offset 4353 b4d68c10 - offset 4354 b4e11810 - offset 4355 b4eba410 - offset 4356 b4f63010 - offset 4357 b500bc10 - offset 4358 b50b4810 - offset 4359 b515d410 - offset 4360 b5286010 - offset 4361 b532ec10 - offset 4362 b53d7810 - offset 4363 b5480410 - offset 4364 b5529010 - offset 4365 b55d1c10 - offset 4366 b567a810 - offset 4367 b5723410 - offset 4368 b57cc010 - offset 4369 b5874c10 - offset 4370 b591d810 - offset 4371 b59c6410 - offset 4372 b5a6f010 - offset 4373 b5b17c10 - offset 4374 b5bc0810 - offset 4375 b5c69410 - offset 4376 b5d12010 - offset 4377 b5dbac10 - offset 4378 b5e63810 - offset 4379 b5f0c410 - offset 4380 b5fb5010 - offset 4381 b605dc10 - offset 4382 b6106810 - offset 4383 b61af410 - offset 4384 b6258010 - offset 4385 b6300c10 - offset 4386 b63a9810 - offset 4387 b6452410 - offset 4388 b64fb010 - offset 4389 b65a3c10 - offset 4390 b664c810 - offset 4391 b66f5410 - offset 4392 b679e010 - offset 4393 b6846c10 - offset 4394 b68ef810 - offset 4395 b6998410 - offset 4396 b6a41010 - offset 4397 b6ae9c10 - offset 4398 b6b92810 - offset 4399 b6c3b410 - offset 4400 b6ce4010 - offset 4401 b6d8cc10 - offset 4402 b6e35810 - offset 4403 b6ede410 - offset 4404 b6f87010 - offset 4405 b702fc10 - offset 4406 b70d8810 - offset 4407 b7181410 - offset 4408 b722a010 - offset 4409 b72d2c10 - offset 4410 b737b810 - offset 4411 b7424410 - offset 4412 b74cd010 - offset 4413 b7575c10 - offset 4414 b761e810 - offset 4415 b76c7410 - offset 4416 b7770010 - offset 4417 b7818c10 - offset 4418 b78c1810 - offset 4419 b796a410 - offset 4420 b7a13010 - offset 4421 b7abbc10 - offset 4422 b7b64810 - offset 4423 b7c0d410 - offset 4424 b7cb6010 - offset 4425 b7d5ec10 - offset 4426 b7e07810 - offset 4427 b7eb0410 - offset 4428 b7f59010 - offset 4429 b8001c10 - offset 4430 b80aa810 - offset 4431 b8153410 - offset 4432 b81fc010 - offset 4433 b82a4c10 - offset 4434 b834d810 - offset 4435 b83f6410 - offset 4436 b849f010 - offset 4437 b8547c10 - offset 4438 b85f0810 - offset 4439 b8699410 - offset 4440 b8742010 - offset 4441 b87eac10 - offset 4442 b8893810 - offset 4443 b893c410 - offset 4444 b89e5010 - offset 4445 b8a8dc10 - offset 4446 b8b36810 - offset 4447 b8bdf410 - offset 4448 b8c88010 - offset 4449 b8d30c10 - offset 4450 b8e59810 - offset 4451 b8f02410 - offset 4452 b8fab010 - offset 4453 b9053c10 - offset 4454 b90fc810 - offset 4455 b91a5410 - offset 4456 b924e010 - offset 4457 b92f6c10 - offset 4458 b939f810 - offset 4459 b9448410 - offset 4460 b94f1010 - offset 4461 b9599c10 - offset 4462 b9642810 - offset 4463 b96eb410 - offset 4464 b9794010 - offset 4465 b983cc10 - offset 4466 b98e5810 - offset 4467 b998e410 - offset 4468 b9a37010 - offset 4469 b9adfc10 - offset 4470 b9b88810 - offset 4471 b9c31410 - offset 4472 b9cda010 - offset 4473 b9d82c10 - offset 4474 b9e2b810 - offset 4475 b9ed4410 - offset 4476 b9f7d010 - offset 4477 ba025c10 - offset 4478 ba0ce810 - offset 4479 ba177410 - offset 4480 ba220010 - offset 4481 ba2c8c10 - offset 4482 ba371810 - offset 4483 ba41a410 - offset 4484 ba4c3010 - offset 4485 ba56bc10 - offset 4486 ba614810 - offset 4487 ba6bd410 - offset 4488 ba766010 - offset 4489 ba80ec10 - offset 4490 ba8b7810 - offset 4491 ba960410 - offset 4492 baa09010 - offset 4493 baab1c10 - offset 4494 bab5a810 - offset 4495 bac03410 - offset 4496 bacac010 - offset 4497 bad54c10 - offset 4498 badfd810 - offset 4499 baea6410 - offset 4500 baf4f010 - offset 4501 baff7c10 - offset 4502 bb0a0810 - offset 4503 bb149410 - offset 4504 bb1f2010 - offset 4505 bb29ac10 - offset 4506 bb343810 - offset 4507 bb3ec410 - offset 4508 bb495010 - offset 4509 bb53dc10 - offset 4510 bb5e6810 - offset 4511 bb68f410 - offset 4512 bb738010 - offset 4513 bb7e0c10 - offset 4514 bb889810 - offset 4515 bb932410 - offset 4516 bb9db010 - offset 4517 bba83c10 - offset 4518 bbb2c810 - offset 4519 bbbd5410 - offset 4520 bbc7e010 - offset 4521 bbd26c10 - offset 4522 bbdcf810 - offset 4523 bbe78410 - offset 4524 bbf21010 - offset 4525 bbfc9c10 - offset 4526 bc072810 - offset 4527 bc11b410 - offset 4528 bc1c4010 - offset 4529 bc26cc10 - offset 4530 bc315810 - offset 4531 bc3be410 - offset 4532 bc467010 - offset 4533 bc50fc10 - offset 4534 bc5b8810 - offset 4535 bc661410 - offset 4536 bc70a010 - offset 4537 bc7b2c10 - offset 4538 bc85b810 - offset 4539 bc904410 - offset 4540 bca2d010 - offset 4541 bcad5c10 - offset 4542 bcb7e810 - offset 4543 bcc27410 - offset 4544 bccd0010 - offset 4545 bcd78c10 - offset 4546 bce21810 - offset 4547 bceca410 - offset 4548 bcf73010 - offset 4549 bd01bc10 - offset 4550 bd0c4810 - offset 4551 bd16d410 - offset 4552 bd216010 - offset 4553 bd2bec10 - offset 4554 bd367810 - offset 4555 bd410410 - offset 4556 bd4b9010 - offset 4557 bd561c10 - offset 4558 bd60a810 - offset 4559 bd6b3410 - offset 4560 bd75c010 - offset 4561 bd804c10 - offset 4562 bd8ad810 - offset 4563 bd956410 - offset 4564 bd9ff010 - offset 4565 bdaa7c10 - offset 4566 bdb50810 - offset 4567 bdbf9410 - offset 4568 bdca2010 - offset 4569 bdd4ac10 - offset 4570 bddf3810 - offset 4571 bde9c410 - offset 4572 bdf45010 - offset 4573 bdfedc10 - offset 4574 be096810 - offset 4575 be13f410 - offset 4576 be1e8010 - offset 4577 be290c10 - offset 4578 be339810 - offset 4579 be3e2410 - offset 4580 be48b010 - offset 4581 be533c10 - offset 4582 be5dc810 - offset 4583 be685410 - offset 4584 be72e010 - offset 4585 be7d6c10 - offset 4586 be87f810 - offset 4587 be928410 - offset 4588 be9d1010 - offset 4589 bea79c10 - offset 4590 beb22810 - offset 4591 bebcb410 - offset 4592 bec74010 - offset 4593 bed1cc10 - offset 4594 bedc5810 - offset 4595 bee6e410 - offset 4596 bef17010 - offset 4597 befbfc10 - offset 4598 bf068810 - offset 4599 bf111410 - offset 4600 bf1ba010 - offset 4601 bf262c10 - offset 4602 bf30b810 - offset 4603 bf3b4410 - offset 4604 bf45d010 - offset 4605 bf505c10 - offset 4606 bf5ae810 - offset 4607 bf657410 - offset 4608 bf700010 - offset 4609 bf7a8c10 - offset 4610 bf851810 - offset 4611 bf8fa410 - offset 4612 bf9a3010 - offset 4613 bfa4bc10 - offset 4614 bfaf4810 - offset 4615 bfb9d410 - offset 4616 bfc46010 - offset 4617 bfceec10 - offset 4618 bfd97810 - offset 4619 bfe40410 - offset 4620 bfee9010 - offset 4621 bff91c10 - offset 4622 c003a810 - offset 4623 c00e3410 - offset 4624 c018c010 - offset 4625 c0234c10 - offset 4626 c02dd810 - offset 4627 c0386410 - offset 4628 c042f010 - offset 4629 c04d7c10 - offset 4630 c0600810 - offset 4631 c06a9410 - offset 4632 c0752010 - offset 4633 c07fac10 - offset 4634 c08a3810 - offset 4635 c094c410 - offset 4636 c09f5010 - offset 4637 c0a9dc10 - offset 4638 c0b46810 - offset 4639 c0bef410 - offset 4640 c0c98010 - offset 4641 c0d40c10 - offset 4642 c0de9810 - offset 4643 c0e92410 - offset 4644 c0f3b010 - offset 4645 c0fe3c10 - offset 4646 c108c810 - offset 4647 c1135410 - offset 4648 c11de010 - offset 4649 c1286c10 - offset 4650 c132f810 - offset 4651 c13d8410 - offset 4652 c1481010 - offset 4653 c1529c10 - offset 4654 c15d2810 - offset 4655 c167b410 - offset 4656 c1724010 - offset 4657 c17ccc10 - offset 4658 c1875810 - offset 4659 c191e410 - offset 4660 c19c7010 - offset 4661 c1a6fc10 - offset 4662 c1b18810 - offset 4663 c1bc1410 - offset 4664 c1c6a010 - offset 4665 c1d12c10 - offset 4666 c1dbb810 - offset 4667 c1e64410 - offset 4668 c1f0d010 - offset 4669 c1fb5c10 - offset 4670 c205e810 - offset 4671 c2107410 - offset 4672 c21b0010 - offset 4673 c2258c10 - offset 4674 c2301810 - offset 4675 c23aa410 - offset 4676 c2453010 - offset 4677 c24fbc10 - offset 4678 c25a4810 - offset 4679 c264d410 - offset 4680 c26f6010 - offset 4681 c279ec10 - offset 4682 c2847810 - offset 4683 c28f0410 - offset 4684 c2999010 - offset 4685 c2a41c10 - offset 4686 c2aea810 - offset 4687 c2b93410 - offset 4688 c2c3c010 - offset 4689 c2ce4c10 - offset 4690 c2d8d810 - offset 4691 c2e36410 - offset 4692 c2edf010 - offset 4693 c2f87c10 - offset 4694 c3030810 - offset 4695 c30d9410 - offset 4696 c3182010 - offset 4697 c322ac10 - offset 4698 c32d3810 - offset 4699 c337c410 - offset 4700 c3425010 - offset 4701 c34cdc10 - offset 4702 c3576810 - offset 4703 c361f410 - offset 4704 c36c8010 - offset 4705 c3770c10 - offset 4706 c3819810 - offset 4707 c38c2410 - offset 4708 c396b010 - offset 4709 c3a13c10 - offset 4710 c3abc810 - offset 4711 c3b65410 - offset 4712 c3c0e010 - offset 4713 c3cb6c10 - offset 4714 c3d5f810 - offset 4715 c3e08410 - offset 4716 c3eb1010 - offset 4717 c3f59c10 - offset 4718 c4002810 - offset 4719 c40ab410 - offset 4720 c41d4010 - offset 4721 c427cc10 - offset 4722 c4325810 - offset 4723 c43ce410 - offset 4724 c4477010 - offset 4725 c451fc10 - offset 4726 c45c8810 - offset 4727 c4671410 - offset 4728 c471a010 - offset 4729 c47c2c10 - offset 4730 c486b810 - offset 4731 c4914410 - offset 4732 c49bd010 - offset 4733 c4a65c10 - offset 4734 c4b0e810 - offset 4735 c4bb7410 - offset 4736 c4c60010 - offset 4737 c4d08c10 - offset 4738 c4db1810 - offset 4739 c4e5a410 - offset 4740 c4f03010 - offset 4741 c4fabc10 - offset 4742 c5054810 - offset 4743 c50fd410 - offset 4744 c51a6010 - offset 4745 c524ec10 - offset 4746 c52f7810 - offset 4747 c53a0410 - offset 4748 c5449010 - offset 4749 c54f1c10 - offset 4750 c559a810 - offset 4751 c5643410 - offset 4752 c56ec010 - offset 4753 c5794c10 - offset 4754 c583d810 - offset 4755 c58e6410 - offset 4756 c598f010 - offset 4757 c5a37c10 - offset 4758 c5ae0810 - offset 4759 c5b89410 - offset 4760 c5c32010 - offset 4761 c5cdac10 - offset 4762 c5d83810 - offset 4763 c5e2c410 - offset 4764 c5ed5010 - offset 4765 c5f7dc10 - offset 4766 c6026810 - offset 4767 c60cf410 - offset 4768 c6178010 - offset 4769 c6220c10 - offset 4770 c62c9810 - offset 4771 c6372410 - offset 4772 c641b010 - offset 4773 c64c3c10 - offset 4774 c656c810 - offset 4775 c6615410 - offset 4776 c66be010 - offset 4777 c6766c10 - offset 4778 c680f810 - offset 4779 c68b8410 - offset 4780 c6961010 - offset 4781 c6a09c10 - offset 4782 c6ab2810 - offset 4783 c6b5b410 - offset 4784 c6c04010 - offset 4785 c6cacc10 - offset 4786 c6d55810 - offset 4787 c6dfe410 - offset 4788 c6ea7010 - offset 4789 c6f4fc10 - offset 4790 c6ff8810 - offset 4791 c70a1410 - offset 4792 c714a010 - offset 4793 c71f2c10 - offset 4794 c729b810 - offset 4795 c7344410 - offset 4796 c73ed010 - offset 4797 c7495c10 - offset 4798 c753e810 - offset 4799 c75e7410 - offset 4800 c7690010 - offset 4801 c7738c10 - offset 4802 c77e1810 - offset 4803 c788a410 - offset 4804 c7933010 - offset 4805 c79dbc10 - offset 4806 c7a84810 - offset 4807 c7b2d410 - offset 4808 c7bd6010 - offset 4809 c7c7ec10 - offset 4810 c7da7810 - offset 4811 c7e50410 - offset 4812 c7ef9010 - offset 4813 c7fa1c10 - offset 4814 c804a810 - offset 4815 c80f3410 - offset 4816 c819c010 - offset 4817 c8244c10 - offset 4818 c82ed810 - offset 4819 c8396410 - offset 4820 c843f010 - offset 4821 c84e7c10 - offset 4822 c8590810 - offset 4823 c8639410 - offset 4824 c86e2010 - offset 4825 c878ac10 - offset 4826 c8833810 - offset 4827 c88dc410 - offset 4828 c8985010 - offset 4829 c8a2dc10 - offset 4830 c8ad6810 - offset 4831 c8b7f410 - offset 4832 c8c28010 - offset 4833 c8cd0c10 - offset 4834 c8d79810 - offset 4835 c8e22410 - offset 4836 c8ecb010 - offset 4837 c8f73c10 - offset 4838 c901c810 - offset 4839 c90c5410 - offset 4840 c916e010 - offset 4841 c9216c10 - offset 4842 c92bf810 - offset 4843 c9368410 - offset 4844 c9411010 - offset 4845 c94b9c10 - offset 4846 c9562810 - offset 4847 c960b410 - offset 4848 c96b4010 - offset 4849 c975cc10 - offset 4850 c9805810 - offset 4851 c98ae410 - offset 4852 c9957010 - offset 4853 c99ffc10 - offset 4854 c9aa8810 - offset 4855 c9b51410 - offset 4856 c9bfa010 - offset 4857 c9ca2c10 - offset 4858 c9d4b810 - offset 4859 c9df4410 - offset 4860 c9e9d010 - offset 4861 c9f45c10 - offset 4862 c9fee810 - offset 4863 ca097410 - offset 4864 ca140010 - offset 4865 ca1e8c10 - offset 4866 ca291810 - offset 4867 ca33a410 - offset 4868 ca3e3010 - offset 4869 ca48bc10 - offset 4870 ca534810 - offset 4871 ca5dd410 - offset 4872 ca686010 - offset 4873 ca72ec10 - offset 4874 ca7d7810 - offset 4875 ca880410 - offset 4876 ca929010 - offset 4877 ca9d1c10 - offset 4878 caa7a810 - offset 4879 cab23410 - offset 4880 cabcc010 - offset 4881 cac74c10 - offset 4882 cad1d810 - offset 4883 cadc6410 - offset 4884 cae6f010 - offset 4885 caf17c10 - offset 4886 cafc0810 - offset 4887 cb069410 - offset 4888 cb112010 - offset 4889 cb1bac10 - offset 4890 cb2e3810 - offset 4891 cb38c410 - offset 4892 cb435010 - offset 4893 cb4ddc10 - offset 4894 cb586810 - offset 4895 cb62f410 - offset 4896 cb6d8010 - offset 4897 cb780c10 - offset 4898 cb829810 - offset 4899 cb8d2410 - offset 4900 cb97b010 - offset 4901 cba23c10 - offset 4902 cbacc810 - offset 4903 cbb75410 - offset 4904 cbc1e010 - offset 4905 cbcc6c10 - offset 4906 cbd6f810 - offset 4907 cbe18410 - offset 4908 cbec1010 - offset 4909 cbf69c10 - offset 4910 cc012810 - offset 4911 cc0bb410 - offset 4912 cc164010 - offset 4913 cc20cc10 - offset 4914 cc2b5810 - offset 4915 cc35e410 - offset 4916 cc407010 - offset 4917 cc4afc10 - offset 4918 cc558810 - offset 4919 cc601410 - offset 4920 cc6aa010 - offset 4921 cc752c10 - offset 4922 cc7fb810 - offset 4923 cc8a4410 - offset 4924 cc94d010 - offset 4925 cc9f5c10 - offset 4926 cca9e810 - offset 4927 ccb47410 - offset 4928 ccbf0010 - offset 4929 ccc98c10 - offset 4930 ccd41810 - offset 4931 ccdea410 - offset 4932 cce93010 - offset 4933 ccf3bc10 - offset 4934 ccfe4810 - offset 4935 cd08d410 - offset 4936 cd136010 - offset 4937 cd1dec10 - offset 4938 cd287810 - offset 4939 cd330410 - offset 4940 cd3d9010 - offset 4941 cd481c10 - offset 4942 cd52a810 - offset 4943 cd5d3410 - offset 4944 cd67c010 - offset 4945 cd724c10 - offset 4946 cd7cd810 - offset 4947 cd876410 - offset 4948 cd91f010 - offset 4949 cd9c7c10 - offset 4950 cda70810 - offset 4951 cdb19410 - offset 4952 cdbc2010 - offset 4953 cdc6ac10 - offset 4954 cdd13810 - offset 4955 cddbc410 - offset 4956 cde65010 - offset 4957 cdf0dc10 - offset 4958 cdfb6810 - offset 4959 ce05f410 - offset 4960 ce108010 - offset 4961 ce1b0c10 - offset 4962 ce259810 - offset 4963 ce302410 - offset 4964 ce3ab010 - offset 4965 ce453c10 - offset 4966 ce4fc810 - offset 4967 ce5a5410 - offset 4968 ce64e010 - offset 4969 ce6f6c10 - offset 4970 ce79f810 - offset 4971 ce848410 - offset 4972 ce8f1010 - offset 4973 ce999c10 - offset 4974 cea42810 - offset 4975 ceaeb410 - offset 4976 ceb94010 - offset 4977 cec3cc10 - offset 4978 cece5810 - offset 4979 ced8e410 - offset 4980 ceeb7010 - offset 4981 cef5fc10 - offset 4982 cf008810 - offset 4983 cf0b1410 - offset 4984 cf15a010 - offset 4985 cf202c10 - offset 4986 cf2ab810 - offset 4987 cf354410 - offset 4988 cf3fd010 - offset 4989 cf4a5c10 - offset 4990 cf54e810 - offset 4991 cf5f7410 - offset 4992 cf6a0010 - offset 4993 cf748c10 - offset 4994 cf7f1810 - offset 4995 cf89a410 - offset 4996 cf943010 - offset 4997 cf9ebc10 - offset 4998 cfa94810 - offset 4999 cfb3d410 - offset 5000 cfbe6010 - offset 5001 cfc8ec10 - offset 5002 cfd37810 - offset 5003 cfde0410 - offset 5004 cfe89010 - offset 5005 cff31c10 - offset 5006 cffda810 - offset 5007 d0083410 - offset 5008 d012c010 - offset 5009 d01d4c10 - offset 5010 d027d810 - offset 5011 d0326410 - offset 5012 d03cf010 - offset 5013 d0477c10 - offset 5014 d0520810 - offset 5015 d05c9410 - offset 5016 d0672010 - offset 5017 d071ac10 - offset 5018 d07c3810 - offset 5019 d086c410 - offset 5020 d0915010 - offset 5021 d09bdc10 - offset 5022 d0a66810 - offset 5023 d0b0f410 - offset 5024 d0bb8010 - offset 5025 d0c60c10 - offset 5026 d0d09810 - offset 5027 d0db2410 - offset 5028 d0e5b010 - offset 5029 d0f03c10 - offset 5030 d0fac810 - offset 5031 d1055410 - offset 5032 d10fe010 - offset 5033 d11a6c10 - offset 5034 d124f810 - offset 5035 d12f8410 - offset 5036 d13a1010 - offset 5037 d1449c10 - offset 5038 d14f2810 - offset 5039 d159b410 - offset 5040 d1644010 - offset 5041 d16ecc10 - offset 5042 d1795810 - offset 5043 d183e410 - offset 5044 d18e7010 - offset 5045 d198fc10 - offset 5046 d1a38810 - offset 5047 d1ae1410 - offset 5048 d1b8a010 - offset 5049 d1c32c10 - offset 5050 d1cdb810 - offset 5051 d1d84410 - offset 5052 d1e2d010 - offset 5053 d1ed5c10 - offset 5054 d1f7e810 - offset 5055 d2027410 - offset 5056 d20d0010 - offset 5057 d2178c10 - offset 5058 d2221810 - offset 5059 d22ca410 - offset 5060 d2373010 - offset 5061 d241bc10 - offset 5062 d24c4810 - offset 5063 d256d410 - offset 5064 d2616010 - offset 5065 d26bec10 - offset 5066 d2767810 - offset 5067 d2810410 - offset 5068 d28b9010 - offset 5069 d2961c10 - offset 5070 d2a8a810 - offset 5071 d2b33410 - offset 5072 d2bdc010 - offset 5073 d2c84c10 - offset 5074 d2d2d810 - offset 5075 d2dd6410 - offset 5076 d2e7f010 - offset 5077 d2f27c10 - offset 5078 d2fd0810 - offset 5079 d3079410 - offset 5080 d3122010 - offset 5081 d31cac10 - offset 5082 d3273810 - offset 5083 d331c410 - offset 5084 d33c5010 - offset 5085 d346dc10 - offset 5086 d3516810 - offset 5087 d35bf410 - offset 5088 d3668010 - offset 5089 d3710c10 - offset 5090 d37b9810 - offset 5091 d3862410 - offset 5092 d390b010 - offset 5093 d39b3c10 - offset 5094 d3a5c810 - offset 5095 d3b05410 - offset 5096 d3bae010 - offset 5097 d3c56c10 - offset 5098 d3cff810 - offset 5099 d3da8410 - offset 5100 d3e51010 - offset 5101 d3ef9c10 - offset 5102 d3fa2810 - offset 5103 d404b410 - offset 5104 d40f4010 - offset 5105 d419cc10 - offset 5106 d4245810 - offset 5107 d42ee410 - offset 5108 d4397010 - offset 5109 d443fc10 - offset 5110 d44e8810 - offset 5111 d4591410 - offset 5112 d463a010 - offset 5113 d46e2c10 - offset 5114 d478b810 - offset 5115 d4834410 - offset 5116 d48dd010 - offset 5117 d4985c10 - offset 5118 d4a2e810 - offset 5119 d4ad7410 - offset 5120 d4b80010 - offset 5121 d4c28c10 - offset 5122 d4cd1810 - offset 5123 d4d7a410 - offset 5124 d4e23010 - offset 5125 d4ecbc10 - offset 5126 d4f74810 - offset 5127 d501d410 - offset 5128 d50c6010 - offset 5129 d516ec10 - offset 5130 d5217810 - offset 5131 d52c0410 - offset 5132 d5369010 - offset 5133 d5411c10 - offset 5134 d54ba810 - offset 5135 d5563410 - offset 5136 d560c010 - offset 5137 d56b4c10 - offset 5138 d575d810 - offset 5139 d5806410 - offset 5140 d58af010 - offset 5141 d5957c10 - offset 5142 d5a00810 - offset 5143 d5aa9410 - offset 5144 d5b52010 - offset 5145 d5bfac10 - offset 5146 d5ca3810 - offset 5147 d5d4c410 - offset 5148 d5df5010 - offset 5149 d5e9dc10 - offset 5150 d5f46810 - offset 5151 d5fef410 - offset 5152 d6098010 - offset 5153 d6140c10 - offset 5154 d61e9810 - offset 5155 d6292410 - offset 5156 d633b010 - offset 5157 d63e3c10 - offset 5158 d648c810 - offset 5159 d6535410 - offset 5160 d665e010 - offset 5161 d6706c10 - offset 5162 d67af810 - offset 5163 d6858410 - offset 5164 d6901010 - offset 5165 d69a9c10 - offset 5166 d6a52810 - offset 5167 d6afb410 - offset 5168 d6ba4010 - offset 5169 d6c4cc10 - offset 5170 d6cf5810 - offset 5171 d6d9e410 - offset 5172 d6e47010 - offset 5173 d6eefc10 - offset 5174 d6f98810 - offset 5175 d7041410 - offset 5176 d70ea010 - offset 5177 d7192c10 - offset 5178 d723b810 - offset 5179 d72e4410 - offset 5180 d738d010 - offset 5181 d7435c10 - offset 5182 d74de810 - offset 5183 d7587410 - offset 5184 d7630010 - offset 5185 d76d8c10 - offset 5186 d7781810 - offset 5187 d782a410 - offset 5188 d78d3010 - offset 5189 d797bc10 - offset 5190 d7a24810 - offset 5191 d7acd410 - offset 5192 d7b76010 - offset 5193 d7c1ec10 - offset 5194 d7cc7810 - offset 5195 d7d70410 - offset 5196 d7e19010 - offset 5197 d7ec1c10 - offset 5198 d7f6a810 - offset 5199 d8013410 - offset 5200 d80bc010 - offset 5201 d8164c10 - offset 5202 d820d810 - offset 5203 d82b6410 - offset 5204 d835f010 - offset 5205 d8407c10 - offset 5206 d84b0810 - offset 5207 d8559410 - offset 5208 d8602010 - offset 5209 d86aac10 - offset 5210 d8753810 - offset 5211 d87fc410 - offset 5212 d88a5010 - offset 5213 d894dc10 - offset 5214 d89f6810 - offset 5215 d8a9f410 - offset 5216 d8b48010 - offset 5217 d8bf0c10 - offset 5218 d8c99810 - offset 5219 d8d42410 - offset 5220 d8deb010 - offset 5221 d8e93c10 - offset 5222 d8f3c810 - offset 5223 d8fe5410 - offset 5224 d908e010 - offset 5225 d9136c10 - offset 5226 d91df810 - offset 5227 d9288410 - offset 5228 d9331010 - offset 5229 d93d9c10 - offset 5230 d9482810 - offset 5231 d952b410 - offset 5232 d95d4010 - offset 5233 d967cc10 - offset 5234 d9725810 - offset 5235 d97ce410 - offset 5236 d9877010 - offset 5237 d991fc10 - offset 5238 d99c8810 - offset 5239 d9a71410 - offset 5240 d9b1a010 - offset 5241 d9bc2c10 - offset 5242 d9c6b810 - offset 5243 d9d14410 - offset 5244 d9dbd010 - offset 5245 d9e65c10 - offset 5246 d9f0e810 - offset 5247 d9fb7410 - offset 5248 da060010 - offset 5249 da108c10 - offset 5250 da231810 - offset 5251 da2da410 - offset 5252 da383010 - offset 5253 da42bc10 - offset 5254 da4d4810 - offset 5255 da57d410 - offset 5256 da626010 - offset 5257 da6cec10 - offset 5258 da777810 - offset 5259 da820410 - offset 5260 da8c9010 - offset 5261 da971c10 - offset 5262 daa1a810 - offset 5263 daac3410 - offset 5264 dab6c010 - offset 5265 dac14c10 - offset 5266 dacbd810 - offset 5267 dad66410 - offset 5268 dae0f010 - offset 5269 daeb7c10 - offset 5270 daf60810 - offset 5271 db009410 - offset 5272 db0b2010 - offset 5273 db15ac10 - offset 5274 db203810 - offset 5275 db2ac410 - offset 5276 db355010 - offset 5277 db3fdc10 - offset 5278 db4a6810 - offset 5279 db54f410 - offset 5280 db5f8010 - offset 5281 db6a0c10 - offset 5282 db749810 - offset 5283 db7f2410 - offset 5284 db89b010 - offset 5285 db943c10 - offset 5286 db9ec810 - offset 5287 dba95410 - offset 5288 dbb3e010 - offset 5289 dbbe6c10 - offset 5290 dbc8f810 - offset 5291 dbd38410 - offset 5292 dbde1010 - offset 5293 dbe89c10 - offset 5294 dbf32810 - offset 5295 dbfdb410 - offset 5296 dc084010 - offset 5297 dc12cc10 - offset 5298 dc1d5810 - offset 5299 dc27e410 - offset 5300 dc327010 - offset 5301 dc3cfc10 - offset 5302 dc478810 - offset 5303 dc521410 - offset 5304 dc5ca010 - offset 5305 dc672c10 - offset 5306 dc71b810 - offset 5307 dc7c4410 - offset 5308 dc86d010 - offset 5309 dc915c10 - offset 5310 dc9be810 - offset 5311 dca67410 - offset 5312 dcb10010 - offset 5313 dcbb8c10 - offset 5314 dcc61810 - offset 5315 dcd0a410 - offset 5316 dcdb3010 - offset 5317 dce5bc10 - offset 5318 dcf04810 - offset 5319 dcfad410 - offset 5320 dd056010 - offset 5321 dd0fec10 - offset 5322 dd1a7810 - offset 5323 dd250410 - offset 5324 dd2f9010 - offset 5325 dd3a1c10 - offset 5326 dd44a810 - offset 5327 dd4f3410 - offset 5328 dd59c010 - offset 5329 dd644c10 - offset 5330 dd6ed810 - offset 5331 dd796410 - offset 5332 dd83f010 - offset 5333 dd8e7c10 - offset 5334 dd990810 - offset 5335 dda39410 - offset 5336 ddae2010 - offset 5337 ddb8ac10 - offset 5338 ddc33810 - offset 5339 ddcdc410 - offset 5340 dde05010 - offset 5341 ddeadc10 - offset 5342 ddf56810 - offset 5343 ddfff410 - offset 5344 de0a8010 - offset 5345 de150c10 - offset 5346 de1f9810 - offset 5347 de2a2410 - offset 5348 de34b010 - offset 5349 de3f3c10 - offset 5350 de49c810 - offset 5351 de545410 - offset 5352 de5ee010 - offset 5353 de696c10 - offset 5354 de73f810 - offset 5355 de7e8410 - offset 5356 de891010 - offset 5357 de939c10 - offset 5358 de9e2810 - offset 5359 dea8b410 - offset 5360 deb34010 - offset 5361 debdcc10 - offset 5362 dec85810 - offset 5363 ded2e410 - offset 5364 dedd7010 - offset 5365 dee7fc10 - offset 5366 def28810 - offset 5367 defd1410 - offset 5368 df07a010 - offset 5369 df122c10 - offset 5370 df1cb810 - offset 5371 df274410 - offset 5372 df31d010 - offset 5373 df3c5c10 - offset 5374 df46e810 - offset 5375 df517410 - offset 5376 df5c0010 - offset 5377 df668c10 - offset 5378 df711810 - offset 5379 df7ba410 - offset 5380 df863010 - offset 5381 df90bc10 - offset 5382 df9b4810 - offset 5383 dfa5d410 - offset 5384 dfb06010 - offset 5385 dfbaec10 - offset 5386 dfc57810 - offset 5387 dfd00410 - offset 5388 dfda9010 - offset 5389 dfe51c10 - offset 5390 dfefa810 - offset 5391 dffa3410 - offset 5392 e004c010 - offset 5393 e00f4c10 - offset 5394 e019d810 - offset 5395 e0246410 - offset 5396 e02ef010 - offset 5397 e0397c10 - offset 5398 e0440810 - offset 5399 e04e9410 - offset 5400 e0592010 - offset 5401 e063ac10 - offset 5402 e06e3810 - offset 5403 e078c410 - offset 5404 e0835010 - offset 5405 e08ddc10 - offset 5406 e0986810 - offset 5407 e0a2f410 - offset 5408 e0ad8010 - offset 5409 e0b80c10 - offset 5410 e0c29810 - offset 5411 e0cd2410 - offset 5412 e0d7b010 - offset 5413 e0e23c10 - offset 5414 e0ecc810 - offset 5415 e0f75410 - offset 5416 e101e010 - offset 5417 e10c6c10 - offset 5418 e116f810 - offset 5419 e1218410 - offset 5420 e12c1010 - offset 5421 e1369c10 - offset 5422 e1412810 - offset 5423 e14bb410 - offset 5424 e1564010 - offset 5425 e160cc10 - offset 5426 e16b5810 - offset 5427 e175e410 - offset 5428 e1807010 - offset 5429 e18afc10 - offset 5430 e19d8810 - offset 5431 e1a81410 - offset 5432 e1b2a010 - offset 5433 e1bd2c10 - offset 5434 e1c7b810 - offset 5435 e1d24410 - offset 5436 e1dcd010 - offset 5437 e1e75c10 - offset 5438 e1f1e810 - offset 5439 e1fc7410 - offset 5440 e2070010 - offset 5441 e2118c10 - offset 5442 e21c1810 - offset 5443 e226a410 - offset 5444 e2313010 - offset 5445 e23bbc10 - offset 5446 e2464810 - offset 5447 e250d410 - offset 5448 e25b6010 - offset 5449 e265ec10 - offset 5450 e2707810 - offset 5451 e27b0410 - offset 5452 e2859010 - offset 5453 e2901c10 - offset 5454 e29aa810 - offset 5455 e2a53410 - offset 5456 e2afc010 - offset 5457 e2ba4c10 - offset 5458 e2c4d810 - offset 5459 e2cf6410 - offset 5460 e2d9f010 - offset 5461 e2e47c10 - offset 5462 e2ef0810 - offset 5463 e2f99410 - offset 5464 e3042010 - offset 5465 e30eac10 - offset 5466 e3193810 - offset 5467 e323c410 - offset 5468 e32e5010 - offset 5469 e338dc10 - offset 5470 e3436810 - offset 5471 e34df410 - offset 5472 e3588010 - offset 5473 e3630c10 - offset 5474 e36d9810 - offset 5475 e3782410 - offset 5476 e382b010 - offset 5477 e38d3c10 - offset 5478 e397c810 - offset 5479 e3a25410 - offset 5480 e3ace010 - offset 5481 e3b76c10 - offset 5482 e3c1f810 - offset 5483 e3cc8410 - offset 5484 e3d71010 - offset 5485 e3e19c10 - offset 5486 e3ec2810 - offset 5487 e3f6b410 - offset 5488 e4014010 - offset 5489 e40bcc10 - offset 5490 e4165810 - offset 5491 e420e410 - offset 5492 e42b7010 - offset 5493 e435fc10 - offset 5494 e4408810 - offset 5495 e44b1410 - offset 5496 e455a010 - offset 5497 e4602c10 - offset 5498 e46ab810 - offset 5499 e4754410 - offset 5500 e47fd010 - offset 5501 e48a5c10 - offset 5502 e494e810 - offset 5503 e49f7410 - offset 5504 e4aa0010 - offset 5505 e4b48c10 - offset 5506 e4bf1810 - offset 5507 e4c9a410 - offset 5508 e4d43010 - offset 5509 e4debc10 - offset 5510 e4e94810 - offset 5511 e4f3d410 - offset 5512 e4fe6010 - offset 5513 e508ec10 - offset 5514 e5137810 - offset 5515 e51e0410 - offset 5516 e5289010 - offset 5517 e5331c10 - offset 5518 e53da810 - offset 5519 e5483410 - offset 5520 e55ac010 - offset 5521 e5654c10 - offset 5522 e56fd810 - offset 5523 e57a6410 - offset 5524 e584f010 - offset 5525 e58f7c10 - offset 5526 e59a0810 - offset 5527 e5a49410 - offset 5528 e5af2010 - offset 5529 e5b9ac10 - offset 5530 e5c43810 - offset 5531 e5cec410 - offset 5532 e5d95010 - offset 5533 e5e3dc10 - offset 5534 e5ee6810 - offset 5535 e5f8f410 - offset 5536 e6038010 - offset 5537 e60e0c10 - offset 5538 e6189810 - offset 5539 e6232410 - offset 5540 e62db010 - offset 5541 e6383c10 - offset 5542 e642c810 - offset 5543 e64d5410 - offset 5544 e657e010 - offset 5545 e6626c10 - offset 5546 e66cf810 - offset 5547 e6778410 - offset 5548 e6821010 - offset 5549 e68c9c10 - offset 5550 e6972810 - offset 5551 e6a1b410 - offset 5552 e6ac4010 - offset 5553 e6b6cc10 - offset 5554 e6c15810 - offset 5555 e6cbe410 - offset 5556 e6d67010 - offset 5557 e6e0fc10 - offset 5558 e6eb8810 - offset 5559 e6f61410 - offset 5560 e700a010 - offset 5561 e70b2c10 - offset 5562 e715b810 - offset 5563 e7204410 - offset 5564 e72ad010 - offset 5565 e7355c10 - offset 5566 e73fe810 - offset 5567 e74a7410 - offset 5568 e7550010 - offset 5569 e75f8c10 - offset 5570 e76a1810 - offset 5571 e774a410 - offset 5572 e77f3010 - offset 5573 e789bc10 - offset 5574 e7944810 - offset 5575 e79ed410 - offset 5576 e7a96010 - offset 5577 e7b3ec10 - offset 5578 e7be7810 - offset 5579 e7c90410 - offset 5580 e7d39010 - offset 5581 e7de1c10 - offset 5582 e7e8a810 - offset 5583 e7f33410 - offset 5584 e7fdc010 - offset 5585 e8084c10 - offset 5586 e812d810 - offset 5587 e81d6410 - offset 5588 e827f010 - offset 5589 e8327c10 - offset 5590 e83d0810 - offset 5591 e8479410 - offset 5592 e8522010 - offset 5593 e85cac10 - offset 5594 e8673810 - offset 5595 e871c410 - offset 5596 e87c5010 - offset 5597 e886dc10 - offset 5598 e8916810 - offset 5599 e89bf410 - offset 5600 e8a68010 - offset 5601 e8b10c10 - offset 5602 e8bb9810 - offset 5603 e8c62410 - offset 5604 e8d0b010 - offset 5605 e8db3c10 - offset 5606 e8e5c810 - offset 5607 e8f05410 - offset 5608 e8fae010 - offset 5609 e9056c10 - offset 5610 e917f810 - offset 5611 e9228410 - offset 5612 e92d1010 - offset 5613 e9379c10 - offset 5614 e9422810 - offset 5615 e94cb410 - offset 5616 e9574010 - offset 5617 e961cc10 - offset 5618 e96c5810 - offset 5619 e976e410 - offset 5620 e9817010 - offset 5621 e98bfc10 - offset 5622 e9968810 - offset 5623 e9a11410 - offset 5624 e9aba010 - offset 5625 e9b62c10 - offset 5626 e9c0b810 - offset 5627 e9cb4410 - offset 5628 e9d5d010 - offset 5629 e9e05c10 - offset 5630 e9eae810 - offset 5631 e9f57410 - offset 5632 ea000010 - offset 5633 ea0a8c10 - offset 5634 ea151810 - offset 5635 ea1fa410 - offset 5636 ea2a3010 - offset 5637 ea34bc10 - offset 5638 ea3f4810 - offset 5639 ea49d410 - offset 5640 ea546010 - offset 5641 ea5eec10 - offset 5642 ea697810 - offset 5643 ea740410 - offset 5644 ea7e9010 - offset 5645 ea891c10 - offset 5646 ea93a810 - offset 5647 ea9e3410 - offset 5648 eaa8c010 - offset 5649 eab34c10 - offset 5650 eabdd810 - offset 5651 eac86410 - offset 5652 ead2f010 - offset 5653 eadd7c10 - offset 5654 eae80810 - offset 5655 eaf29410 - offset 5656 eafd2010 - offset 5657 eb07ac10 - offset 5658 eb123810 - offset 5659 eb1cc410 - offset 5660 eb275010 - offset 5661 eb31dc10 - offset 5662 eb3c6810 - offset 5663 eb46f410 - offset 5664 eb518010 - offset 5665 eb5c0c10 - offset 5666 eb669810 - offset 5667 eb712410 - offset 5668 eb7bb010 - offset 5669 eb863c10 - offset 5670 eb90c810 - offset 5671 eb9b5410 - offset 5672 eba5e010 - offset 5673 ebb06c10 - offset 5674 ebbaf810 - offset 5675 ebc58410 - offset 5676 ebd01010 - offset 5677 ebda9c10 - offset 5678 ebe52810 - offset 5679 ebefb410 - offset 5680 ebfa4010 - offset 5681 ec04cc10 - offset 5682 ec0f5810 - offset 5683 ec19e410 - offset 5684 ec247010 - offset 5685 ec2efc10 - offset 5686 ec398810 - offset 5687 ec441410 - offset 5688 ec4ea010 - offset 5689 ec592c10 - offset 5690 ec63b810 - offset 5691 ec6e4410 - offset 5692 ec78d010 - offset 5693 ec835c10 - offset 5694 ec8de810 - offset 5695 ec987410 - offset 5696 eca30010 - offset 5697 ecad8c10 - offset 5698 ecb81810 - offset 5699 ecc2a410 - offset 5700 ecd53010 - offset 5701 ecdfbc10 - offset 5702 ecea4810 - offset 5703 ecf4d410 - offset 5704 ecff6010 - offset 5705 ed09ec10 - offset 5706 ed147810 - offset 5707 ed1f0410 - offset 5708 ed299010 - offset 5709 ed341c10 - offset 5710 ed3ea810 - offset 5711 ed493410 - offset 5712 ed53c010 - offset 5713 ed5e4c10 - offset 5714 ed68d810 - offset 5715 ed736410 - offset 5716 ed7df010 - offset 5717 ed887c10 - offset 5718 ed930810 - offset 5719 ed9d9410 - offset 5720 eda82010 - offset 5721 edb2ac10 - offset 5722 edbd3810 - offset 5723 edc7c410 - offset 5724 edd25010 - offset 5725 eddcdc10 - offset 5726 ede76810 - offset 5727 edf1f410 - offset 5728 edfc8010 - offset 5729 ee070c10 - offset 5730 ee119810 - offset 5731 ee1c2410 - offset 5732 ee26b010 - offset 5733 ee313c10 - offset 5734 ee3bc810 - offset 5735 ee465410 - offset 5736 ee50e010 - offset 5737 ee5b6c10 - offset 5738 ee65f810 - offset 5739 ee708410 - offset 5740 ee7b1010 - offset 5741 ee859c10 - offset 5742 ee902810 - offset 5743 ee9ab410 - offset 5744 eea54010 - offset 5745 eeafcc10 - offset 5746 eeba5810 - offset 5747 eec4e410 - offset 5748 eecf7010 - offset 5749 eed9fc10 - offset 5750 eee48810 - offset 5751 eeef1410 - offset 5752 eef9a010 - offset 5753 ef042c10 - offset 5754 ef0eb810 - offset 5755 ef194410 - offset 5756 ef23d010 - offset 5757 ef2e5c10 - offset 5758 ef38e810 - offset 5759 ef437410 - offset 5760 ef4e0010 - offset 5761 ef588c10 - offset 5762 ef631810 - offset 5763 ef6da410 - offset 5764 ef783010 - offset 5765 ef82bc10 - offset 5766 ef8d4810 - offset 5767 ef97d410 - offset 5768 efa26010 - offset 5769 efacec10 - offset 5770 efb77810 - offset 5771 efc20410 - offset 5772 efcc9010 - offset 5773 efd71c10 - offset 5774 efe1a810 - offset 5775 efec3410 - offset 5776 eff6c010 - offset 5777 f0014c10 - offset 5778 f00bd810 - offset 5779 f0166410 - offset 5780 f020f010 - offset 5781 f02b7c10 - offset 5782 f0360810 - offset 5783 f0409410 - offset 5784 f04b2010 - offset 5785 f055ac10 - offset 5786 f0603810 - offset 5787 f06ac410 - offset 5788 f0755010 - offset 5789 f07fdc10 - offset 5790 f0926810 - offset 5791 f09cf410 - offset 5792 f0a78010 - offset 5793 f0b20c10 - offset 5794 f0bc9810 - offset 5795 f0c72410 - offset 5796 f0d1b010 - offset 5797 f0dc3c10 - offset 5798 f0e6c810 - offset 5799 f0f15410 - offset 5800 f0fbe010 - offset 5801 f1066c10 - offset 5802 f110f810 - offset 5803 f11b8410 - offset 5804 f1261010 - offset 5805 f1309c10 - offset 5806 f13b2810 - offset 5807 f145b410 - offset 5808 f1504010 - offset 5809 f15acc10 - offset 5810 f1655810 - offset 5811 f16fe410 - offset 5812 f17a7010 - offset 5813 f184fc10 - offset 5814 f18f8810 - offset 5815 f19a1410 - offset 5816 f1a4a010 - offset 5817 f1af2c10 - offset 5818 f1b9b810 - offset 5819 f1c44410 - offset 5820 f1ced010 - offset 5821 f1d95c10 - offset 5822 f1e3e810 - offset 5823 f1ee7410 - offset 5824 f1f90010 - offset 5825 f2038c10 - offset 5826 f20e1810 - offset 5827 f218a410 - offset 5828 f2233010 - offset 5829 f22dbc10 - offset 5830 f2384810 - offset 5831 f242d410 - offset 5832 f24d6010 - offset 5833 f257ec10 - offset 5834 f2627810 - offset 5835 f26d0410 - offset 5836 f2779010 - offset 5837 f2821c10 - offset 5838 f28ca810 - offset 5839 f2973410 - offset 5840 f2a1c010 - offset 5841 f2ac4c10 - offset 5842 f2b6d810 - offset 5843 f2c16410 - offset 5844 f2cbf010 - offset 5845 f2d67c10 - offset 5846 f2e10810 - offset 5847 f2eb9410 - offset 5848 f2f62010 - offset 5849 f300ac10 - offset 5850 f30b3810 - offset 5851 f315c410 - offset 5852 f3205010 - offset 5853 f32adc10 - offset 5854 f3356810 - offset 5855 f33ff410 - offset 5856 f34a8010 - offset 5857 f3550c10 - offset 5858 f35f9810 - offset 5859 f36a2410 - offset 5860 f374b010 - offset 5861 f37f3c10 - offset 5862 f389c810 - offset 5863 f3945410 - offset 5864 f39ee010 - offset 5865 f3a96c10 - offset 5866 f3b3f810 - offset 5867 f3be8410 - offset 5868 f3c91010 - offset 5869 f3d39c10 - offset 5870 f3e62810 - offset 5871 f3f0b410 - offset 5872 f3fb4010 - offset 5873 f405cc10 - offset 5874 f4105810 - offset 5875 f41ae410 - offset 5876 f4257010 - offset 5877 f42ffc10 - offset 5878 f43a8810 - offset 5879 f4451410 - offset 5880 f44fa010 - offset 5881 f45a2c10 - offset 5882 f464b810 - offset 5883 f46f4410 - offset 5884 f479d010 - offset 5885 f4845c10 - offset 5886 f48ee810 - offset 5887 f4997410 - offset 5888 f4a40010 - offset 5889 f4ae8c10 - offset 5890 f4b91810 - offset 5891 f4c3a410 - offset 5892 f4ce3010 - offset 5893 f4d8bc10 - offset 5894 f4e34810 - offset 5895 f4edd410 - offset 5896 f4f86010 - offset 5897 f502ec10 - offset 5898 f50d7810 - offset 5899 f5180410 - offset 5900 f5229010 - offset 5901 f52d1c10 - offset 5902 f537a810 - offset 5903 f5423410 - offset 5904 f54cc010 - offset 5905 f5574c10 - offset 5906 f561d810 - offset 5907 f56c6410 - offset 5908 f576f010 - offset 5909 f5817c10 - offset 5910 f58c0810 - offset 5911 f5969410 - offset 5912 f5a12010 - offset 5913 f5abac10 - offset 5914 f5b63810 - offset 5915 f5c0c410 - offset 5916 f5cb5010 - offset 5917 f5d5dc10 - offset 5918 f5e06810 - offset 5919 f5eaf410 - offset 5920 f5f58010 - offset 5921 f6000c10 - offset 5922 f60a9810 - offset 5923 f6152410 - offset 5924 f61fb010 - offset 5925 f62a3c10 - offset 5926 f634c810 - offset 5927 f63f5410 - offset 5928 f649e010 - offset 5929 f6546c10 - offset 5930 f65ef810 - offset 5931 f6698410 - offset 5932 f6741010 - offset 5933 f67e9c10 - offset 5934 f6892810 - offset 5935 f693b410 - offset 5936 f69e4010 - offset 5937 f6a8cc10 - offset 5938 f6b35810 - offset 5939 f6bde410 - offset 5940 f6c87010 - offset 5941 f6d2fc10 - offset 5942 f6dd8810 - offset 5943 f6e81410 - offset 5944 f6f2a010 - offset 5945 f6fd2c10 - offset 5946 f707b810 - offset 5947 f7124410 - offset 5948 f71cd010 - offset 5949 f7275c10 - offset 5950 f731e810 - offset 5951 f73c7410 - offset 5952 f7470010 - offset 5953 f7518c10 - offset 5954 f75c1810 - offset 5955 f766a410 - offset 5956 f7713010 - offset 5957 f77bbc10 - offset 5958 f7864810 - offset 5959 f790d410 - offset 5960 f7a36010 - offset 5961 f7adec10 - offset 5962 f7b87810 - offset 5963 f7c30410 - offset 5964 f7cd9010 - offset 5965 f7d81c10 - offset 5966 f7e2a810 - offset 5967 f7ed3410 - offset 5968 f7f7c010 - offset 5969 f8024c10 - offset 5970 f80cd810 - offset 5971 f8176410 - offset 5972 f821f010 - offset 5973 f82c7c10 - offset 5974 f8370810 - offset 5975 f8419410 - offset 5976 f84c2010 - offset 5977 f856ac10 - offset 5978 f8613810 - offset 5979 f86bc410 - offset 5980 f8765010 - offset 5981 f880dc10 - offset 5982 f88b6810 - offset 5983 f895f410 - offset 5984 f8a08010 - offset 5985 f8ab0c10 - offset 5986 f8b59810 - offset 5987 f8c02410 - offset 5988 f8cab010 - offset 5989 f8d53c10 - offset 5990 f8dfc810 - offset 5991 f8ea5410 - offset 5992 f8f4e010 - offset 5993 f8ff6c10 - offset 5994 f909f810 - offset 5995 f9148410 - offset 5996 f91f1010 - offset 5997 f9299c10 - offset 5998 f9342810 - offset 5999 f93eb410 - offset 6000 f9494010 - offset 6001 f953cc10 - offset 6002 f95e5810 - offset 6003 f968e410 - offset 6004 f9737010 - offset 6005 f97dfc10 - offset 6006 f9888810 - offset 6007 f9931410 - offset 6008 f99da010 - offset 6009 f9a82c10 - offset 6010 f9b2b810 - offset 6011 f9bd4410 - offset 6012 f9c7d010 - offset 6013 f9d25c10 - offset 6014 f9dce810 - offset 6015 f9e77410 - offset 6016 f9f20010 - offset 6017 f9fc8c10 - offset 6018 fa071810 - offset 6019 fa11a410 - offset 6020 fa1c3010 - offset 6021 fa26bc10 - offset 6022 fa314810 - offset 6023 fa3bd410 - offset 6024 fa466010 - offset 6025 fa50ec10 - offset 6026 fa5b7810 - offset 6027 fa660410 - offset 6028 fa709010 - offset 6029 fa7b1c10 - offset 6030 fa85a810 - offset 6031 fa903410 - offset 6032 fa9ac010 - offset 6033 faa54c10 - offset 6034 faafd810 - offset 6035 faba6410 - offset 6036 fac4f010 - offset 6037 facf7c10 - offset 6038 fada0810 - offset 6039 fae49410 - offset 6040 faef2010 - offset 6041 faf9ac10 - offset 6042 fb043810 - offset 6043 fb0ec410 - offset 6044 fb195010 - offset 6045 fb23dc10 - offset 6046 fb2e6810 - offset 6047 fb38f410 - offset 6048 fb438010 - offset 6049 fb4e0c10 - offset 6050 fb609810 - offset 6051 fb6b2410 - offset 6052 fb75b010 - offset 6053 fb803c10 - offset 6054 fb8ac810 - offset 6055 fb955410 - offset 6056 fb9fe010 - offset 6057 fbaa6c10 - offset 6058 fbb4f810 - offset 6059 fbbf8410 - offset 6060 fbca1010 - offset 6061 fbd49c10 - offset 6062 fbdf2810 - offset 6063 fbe9b410 - offset 6064 fbf44010 - offset 6065 fbfecc10 - offset 6066 fc095810 - offset 6067 fc13e410 - offset 6068 fc1e7010 - offset 6069 fc28fc10 - offset 6070 fc338810 - offset 6071 fc3e1410 - offset 6072 fc48a010 - offset 6073 fc532c10 - offset 6074 fc5db810 - offset 6075 fc684410 - offset 6076 fc72d010 - offset 6077 fc7d5c10 - offset 6078 fc87e810 - offset 6079 fc927410 - offset 6080 fc9d0010 - offset 6081 fca78c10 - offset 6082 fcb21810 - offset 6083 fcbca410 - offset 6084 fcc73010 - offset 6085 fcd1bc10 - offset 6086 fcdc4810 - offset 6087 fce6d410 - offset 6088 fcf16010 - offset 6089 fcfbec10 - offset 6090 fd067810 - offset 6091 fd110410 - offset 6092 fd1b9010 - offset 6093 fd261c10 - offset 6094 fd30a810 - offset 6095 fd3b3410 - offset 6096 fd45c010 - offset 6097 fd504c10 - offset 6098 fd5ad810 - offset 6099 fd656410 - offset 6100 fd6ff010 - offset 6101 fd7a7c10 - offset 6102 fd850810 - offset 6103 fd8f9410 - offset 6104 fd9a2010 - offset 6105 fda4ac10 - offset 6106 fdaf3810 - offset 6107 fdb9c410 - offset 6108 fdc45010 - offset 6109 fdcedc10 - offset 6110 fdd96810 - offset 6111 fde3f410 - offset 6112 fdee8010 - offset 6113 fdf90c10 - offset 6114 fe039810 - offset 6115 fe0e2410 - offset 6116 fe18b010 - offset 6117 fe233c10 - offset 6118 fe2dc810 - offset 6119 fe385410 - offset 6120 fe42e010 - offset 6121 fe4d6c10 - offset 6122 fe57f810 - offset 6123 fe628410 - offset 6124 fe6d1010 - offset 6125 fe779c10 - offset 6126 fe822810 - offset 6127 fe8cb410 - offset 6128 fe974010 - offset 6129 fea1cc10 - offset 6130 feac5810 - offset 6131 feb6e410 - offset 6132 fec17010 - offset 6133 fecbfc10 - offset 6134 fed68810 - offset 6135 fee11410 - offset 6136 feeba010 - offset 6137 fef62c10 - offset 6138 ff00b810 - offset 6139 ff0b4410 - offset 6140 ff1dd010 - offset 6141 ff285c10 - offset 6142 ff32e810 - offset 6143 ff3d7410 - offset 6144 ff480010 - offset 6145 ff528c10 - offset 6146 ff5d1810 - offset 6147 ff67a410 - offset 6148 ff723010 - offset 6149 ff7cbc10 - offset 6150 ff874810 - offset 6151 ff91d410 - offset 6152 ff9c6010 - offset 6153 ffa6ec10 - offset 6154 ffb17810 - offset 6155 ffbc0410 - offset 6156 ffc69010 - offset 6157 ffd11c10 - offset 6158 ffdba810 - offset 6159 ffe63410 - offset 6160 fff0c010 - offset 6161 fffb4c10 - offset 6162 5d810 - offset 6163 106410 - offset 6164 1af010 - offset 6165 257c10 - offset 6166 300810 - offset 6167 3a9410 - offset 6168 452010 - offset 6169 4fac10 - offset 6170 5a3810 - offset 6171 64c410 - offset 6172 6f5010 - offset 6173 79dc10 - offset 6174 846810 - offset 6175 8ef410 - offset 6176 998010 - offset 6177 a40c10 - offset 6178 ae9810 - offset 6179 b92410 - offset 6180 c3b010 - offset 6181 ce3c10 - offset 6182 d8c810 - offset 6183 e35410 - offset 6184 ede010 - offset 6185 f86c10 - offset 6186 102f810 - offset 6187 10d8410 - offset 6188 1181010 - offset 6189 1229c10 - offset 6190 12d2810 - offset 6191 137b410 - offset 6192 1424010 - offset 6193 14ccc10 - offset 6194 1575810 - offset 6195 161e410 - offset 6196 16c7010 - offset 6197 176fc10 - offset 6198 1818810 - offset 6199 18c1410 - offset 6200 196a010 - offset 6201 1a12c10 - offset 6202 1abb810 - offset 6203 1b64410 - offset 6204 1c0d010 - offset 6205 1cb5c10 - offset 6206 1d5e810 - offset 6207 1e07410 - offset 6208 1eb0010 - offset 6209 1f58c10 - offset 6210 2001810 - offset 6211 20aa410 - offset 6212 2153010 - offset 6213 21fbc10 - offset 6214 22a4810 - offset 6215 234d410 - offset 6216 23f6010 - offset 6217 249ec10 - offset 6218 2547810 - offset 6219 25f0410 - offset 6220 2699010 - offset 6221 2741c10 - offset 6222 27ea810 - offset 6223 2893410 - offset 6224 293c010 - offset 6225 29e4c10 - offset 6226 2a8d810 - offset 6227 2b36410 - offset 6228 2bdf010 - offset 6229 2c87c10 - offset 6230 2db0810 - offset 6231 2e59410 - offset 6232 2f02010 - offset 6233 2faac10 - offset 6234 3053810 - offset 6235 30fc410 - offset 6236 31a5010 - offset 6237 324dc10 - offset 6238 32f6810 - offset 6239 339f410 - offset 6240 3448010 - offset 6241 34f0c10 - offset 6242 3599810 - offset 6243 3642410 - offset 6244 36eb010 - offset 6245 3793c10 - offset 6246 383c810 - offset 6247 38e5410 - offset 6248 398e010 - offset 6249 3a36c10 - offset 6250 3adf810 - offset 6251 3b88410 - offset 6252 3c31010 - offset 6253 3cd9c10 - offset 6254 3d82810 - offset 6255 3e2b410 - offset 6256 3ed4010 - offset 6257 3f7cc10 - offset 6258 4025810 - offset 6259 40ce410 - offset 6260 4177010 - offset 6261 421fc10 - offset 6262 42c8810 - offset 6263 4371410 - offset 6264 441a010 - offset 6265 44c2c10 - offset 6266 456b810 - offset 6267 4614410 - offset 6268 46bd010 - offset 6269 4765c10 - offset 6270 480e810 - offset 6271 48b7410 - offset 6272 4960010 - offset 6273 4a08c10 - offset 6274 4ab1810 - offset 6275 4b5a410 - offset 6276 4c03010 - offset 6277 4cabc10 - offset 6278 4d54810 - offset 6279 4dfd410 - offset 6280 4ea6010 - offset 6281 4f4ec10 - offset 6282 4ff7810 - offset 6283 50a0410 - offset 6284 5149010 - offset 6285 51f1c10 - offset 6286 529a810 - offset 6287 5343410 - offset 6288 53ec010 - offset 6289 5494c10 - offset 6290 553d810 - offset 6291 55e6410 - offset 6292 568f010 - offset 6293 5737c10 - offset 6294 57e0810 - offset 6295 5889410 - offset 6296 5932010 - offset 6297 59dac10 - offset 6298 5a83810 - offset 6299 5b2c410 - offset 6300 5bd5010 - offset 6301 5c7dc10 - offset 6302 5d26810 - offset 6303 5dcf410 - offset 6304 5e78010 - offset 6305 5f20c10 - offset 6306 5fc9810 - offset 6307 6072410 - offset 6308 611b010 - offset 6309 61c3c10 - offset 6310 626c810 - offset 6311 6315410 - offset 6312 63be010 - offset 6313 6466c10 - offset 6314 650f810 - offset 6315 65b8410 - offset 6316 6661010 - offset 6317 6709c10 - offset 6318 67b2810 - offset 6319 685b410 - offset 6320 6984010 - offset 6321 6a2cc10 - offset 6322 6ad5810 - offset 6323 6b7e410 - offset 6324 6c27010 - offset 6325 6ccfc10 - offset 6326 6d78810 - offset 6327 6e21410 - offset 6328 6eca010 - offset 6329 6f72c10 - offset 6330 701b810 - offset 6331 70c4410 - offset 6332 716d010 - offset 6333 7215c10 - offset 6334 72be810 - offset 6335 7367410 - offset 6336 7410010 - offset 6337 74b8c10 - offset 6338 7561810 - offset 6339 760a410 - offset 6340 76b3010 - offset 6341 775bc10 - offset 6342 7804810 - offset 6343 78ad410 - offset 6344 7956010 - offset 6345 79fec10 - offset 6346 7aa7810 - offset 6347 7b50410 - offset 6348 7bf9010 - offset 6349 7ca1c10 - offset 6350 7d4a810 - offset 6351 7df3410 - offset 6352 7e9c010 - offset 6353 7f44c10 - offset 6354 7fed810 - offset 6355 8096410 - offset 6356 813f010 - offset 6357 81e7c10 - offset 6358 8290810 - offset 6359 8339410 - offset 6360 83e2010 - offset 6361 848ac10 - offset 6362 8533810 - offset 6363 85dc410 - offset 6364 8685010 - offset 6365 872dc10 - offset 6366 87d6810 - offset 6367 887f410 - offset 6368 8928010 - offset 6369 89d0c10 - offset 6370 8a79810 - offset 6371 8b22410 - offset 6372 8bcb010 - offset 6373 8c73c10 - offset 6374 8d1c810 - offset 6375 8dc5410 - offset 6376 8e6e010 - offset 6377 8f16c10 - offset 6378 8fbf810 - offset 6379 9068410 - offset 6380 9111010 - offset 6381 91b9c10 - offset 6382 9262810 - offset 6383 930b410 - offset 6384 93b4010 - offset 6385 945cc10 - offset 6386 9505810 - offset 6387 95ae410 - offset 6388 9657010 - offset 6389 96ffc10 - offset 6390 97a8810 - offset 6391 9851410 - offset 6392 98fa010 - offset 6393 99a2c10 - offset 6394 9a4b810 - offset 6395 9af4410 - offset 6396 9b9d010 - offset 6397 9c45c10 - offset 6398 9cee810 - offset 6399 9d97410 - offset 6400 9e40010 - offset 6401 9ee8c10 - offset 6402 9f91810 - offset 6403 a03a410 - offset 6404 a0e3010 - offset 6405 a18bc10 - offset 6406 a234810 - offset 6407 a2dd410 - offset 6408 a386010 - offset 6409 a42ec10 - offset 6410 a557810 - offset 6411 a600410 - offset 6412 a6a9010 - offset 6413 a751c10 - offset 6414 a7fa810 - offset 6415 a8a3410 - offset 6416 a94c010 - offset 6417 a9f4c10 - offset 6418 aa9d810 - offset 6419 ab46410 - offset 6420 abef010 - offset 6421 ac97c10 - offset 6422 ad40810 - offset 6423 ade9410 - offset 6424 ae92010 - offset 6425 af3ac10 - offset 6426 afe3810 - offset 6427 b08c410 - offset 6428 b135010 - offset 6429 b1ddc10 - offset 6430 b286810 - offset 6431 b32f410 - offset 6432 b3d8010 - offset 6433 b480c10 - offset 6434 b529810 - offset 6435 b5d2410 - offset 6436 b67b010 - offset 6437 b723c10 - offset 6438 b7cc810 - offset 6439 b875410 - offset 6440 b91e010 - offset 6441 b9c6c10 - offset 6442 ba6f810 - offset 6443 bb18410 - offset 6444 bbc1010 - offset 6445 bc69c10 - offset 6446 bd12810 - offset 6447 bdbb410 - offset 6448 be64010 - offset 6449 bf0cc10 - offset 6450 bfb5810 - offset 6451 c05e410 - offset 6452 c107010 - offset 6453 c1afc10 - offset 6454 c258810 - offset 6455 c301410 - offset 6456 c3aa010 - offset 6457 c452c10 - offset 6458 c4fb810 - offset 6459 c5a4410 - offset 6460 c64d010 - offset 6461 c6f5c10 - offset 6462 c79e810 - offset 6463 c847410 - offset 6464 c8f0010 - offset 6465 c998c10 - offset 6466 ca41810 - offset 6467 caea410 - offset 6468 cb93010 - offset 6469 cc3bc10 - offset 6470 cce4810 - offset 6471 cd8d410 - offset 6472 ce36010 - offset 6473 cedec10 - offset 6474 cf87810 - offset 6475 d030410 - offset 6476 d0d9010 - offset 6477 d181c10 - offset 6478 d22a810 - offset 6479 d2d3410 - offset 6480 d37c010 - offset 6481 d424c10 - offset 6482 d4cd810 - offset 6483 d576410 - offset 6484 d61f010 - offset 6485 d6c7c10 - offset 6486 d770810 - offset 6487 d819410 - offset 6488 d8c2010 - offset 6489 d96ac10 - offset 6490 da13810 - offset 6491 dabc410 - offset 6492 db65010 - offset 6493 dc0dc10 - offset 6494 dcb6810 - offset 6495 dd5f410 - offset 6496 de08010 - offset 6497 deb0c10 - offset 6498 df59810 - offset 6499 e002410 - offset 6500 e12b010 - offset 6501 e1d3c10 - offset 6502 e27c810 - offset 6503 e325410 - offset 6504 e3ce010 - offset 6505 e476c10 - offset 6506 e51f810 - offset 6507 e5c8410 - offset 6508 e671010 - offset 6509 e719c10 - offset 6510 e7c2810 - offset 6511 e86b410 - offset 6512 e914010 - offset 6513 e9bcc10 - offset 6514 ea65810 - offset 6515 eb0e410 - offset 6516 ebb7010 - offset 6517 ec5fc10 - offset 6518 ed08810 - offset 6519 edb1410 - offset 6520 ee5a010 - offset 6521 ef02c10 - offset 6522 efab810 - offset 6523 f054410 - offset 6524 f0fd010 - offset 6525 f1a5c10 - offset 6526 f24e810 - offset 6527 f2f7410 - offset 6528 f3a0010 - offset 6529 f448c10 - offset 6530 f4f1810 - offset 6531 f59a410 - offset 6532 f643010 - offset 6533 f6ebc10 - offset 6534 f794810 - offset 6535 f83d410 - offset 6536 f8e6010 - offset 6537 f98ec10 - offset 6538 fa37810 - offset 6539 fae0410 - offset 6540 fb89010 - offset 6541 fc31c10 - offset 6542 fcda810 - offset 6543 fd83410 - offset 6544 fe2c010 - offset 6545 fed4c10 - offset 6546 ff7d810 - offset 6547 10026410 - offset 6548 100cf010 - offset 6549 10177c10 - offset 6550 10220810 - offset 6551 102c9410 - offset 6552 10372010 - offset 6553 1041ac10 - offset 6554 104c3810 - offset 6555 1056c410 - offset 6556 10615010 - offset 6557 106bdc10 - offset 6558 10766810 - offset 6559 1080f410 - offset 6560 108b8010 - offset 6561 10960c10 - offset 6562 10a09810 - offset 6563 10ab2410 - offset 6564 10b5b010 - offset 6565 10c03c10 - offset 6566 10cac810 - offset 6567 10d55410 - offset 6568 10dfe010 - offset 6569 10ea6c10 - offset 6570 10f4f810 - offset 6571 10ff8410 - offset 6572 110a1010 - offset 6573 11149c10 - offset 6574 111f2810 - offset 6575 1129b410 - offset 6576 11344010 - offset 6577 113ecc10 - offset 6578 11495810 - offset 6579 1153e410 - offset 6580 115e7010 - offset 6581 1168fc10 - offset 6582 11738810 - offset 6583 117e1410 - offset 6584 1188a010 - offset 6585 11932c10 - offset 6586 119db810 - offset 6587 11a84410 - offset 6588 11b2d010 - offset 6589 11bd5c10 - offset 6590 11cfe810 - offset 6591 11da7410 - offset 6592 11e50010 - offset 6593 11ef8c10 - offset 6594 11fa1810 - offset 6595 1204a410 - offset 6596 120f3010 - offset 6597 1219bc10 - offset 6598 12244810 - offset 6599 122ed410 - offset 6600 12396010 - offset 6601 1243ec10 - offset 6602 124e7810 - offset 6603 12590410 - offset 6604 12639010 - offset 6605 126e1c10 - offset 6606 1278a810 - offset 6607 12833410 - offset 6608 128dc010 - offset 6609 12984c10 - offset 6610 12a2d810 - offset 6611 12ad6410 - offset 6612 12b7f010 - offset 6613 12c27c10 - offset 6614 12cd0810 - offset 6615 12d79410 - offset 6616 12e22010 - offset 6617 12ecac10 - offset 6618 12f73810 - offset 6619 1301c410 - offset 6620 130c5010 - offset 6621 1316dc10 - offset 6622 13216810 - offset 6623 132bf410 - offset 6624 13368010 - offset 6625 13410c10 - offset 6626 134b9810 - offset 6627 13562410 - offset 6628 1360b010 - offset 6629 136b3c10 - offset 6630 1375c810 - offset 6631 13805410 - offset 6632 138ae010 - offset 6633 13956c10 - offset 6634 139ff810 - offset 6635 13aa8410 - offset 6636 13b51010 - offset 6637 13bf9c10 - offset 6638 13ca2810 - offset 6639 13d4b410 - offset 6640 13df4010 - offset 6641 13e9cc10 - offset 6642 13f45810 - offset 6643 13fee410 - offset 6644 14097010 - offset 6645 1413fc10 - offset 6646 141e8810 - offset 6647 14291410 - offset 6648 1433a010 - offset 6649 143e2c10 - offset 6650 1448b810 - offset 6651 14534410 - offset 6652 145dd010 - offset 6653 14685c10 - offset 6654 1472e810 - offset 6655 147d7410 - offset 6656 14880010 - offset 6657 14928c10 - offset 6658 149d1810 - offset 6659 14a7a410 - offset 6660 14b23010 - offset 6661 14bcbc10 - offset 6662 14c74810 - offset 6663 14d1d410 - offset 6664 14dc6010 - offset 6665 14e6ec10 - offset 6666 14f17810 - offset 6667 14fc0410 - offset 6668 15069010 - offset 6669 15111c10 - offset 6670 151ba810 - offset 6671 15263410 - offset 6672 1530c010 - offset 6673 153b4c10 - offset 6674 1545d810 - offset 6675 15506410 - offset 6676 155af010 - offset 6677 15657c10 - offset 6678 15700810 - offset 6679 157a9410 - offset 6680 158d2010 - offset 6681 1597ac10 - offset 6682 15a23810 - offset 6683 15acc410 - offset 6684 15b75010 - offset 6685 15c1dc10 - offset 6686 15cc6810 - offset 6687 15d6f410 - offset 6688 15e18010 - offset 6689 15ec0c10 - offset 6690 15f69810 - offset 6691 16012410 - offset 6692 160bb010 - offset 6693 16163c10 - offset 6694 1620c810 - offset 6695 162b5410 - offset 6696 1635e010 - offset 6697 16406c10 - offset 6698 164af810 - offset 6699 16558410 - offset 6700 16601010 - offset 6701 166a9c10 - offset 6702 16752810 - offset 6703 167fb410 - offset 6704 168a4010 - offset 6705 1694cc10 - offset 6706 169f5810 - offset 6707 16a9e410 - offset 6708 16b47010 - offset 6709 16befc10 - offset 6710 16c98810 - offset 6711 16d41410 - offset 6712 16dea010 - offset 6713 16e92c10 - offset 6714 16f3b810 - offset 6715 16fe4410 - offset 6716 1708d010 - offset 6717 17135c10 - offset 6718 171de810 - offset 6719 17287410 - offset 6720 17330010 - offset 6721 173d8c10 - offset 6722 17481810 - offset 6723 1752a410 - offset 6724 175d3010 - offset 6725 1767bc10 - offset 6726 17724810 - offset 6727 177cd410 - offset 6728 17876010 - offset 6729 1791ec10 - offset 6730 179c7810 - offset 6731 17a70410 - offset 6732 17b19010 - offset 6733 17bc1c10 - offset 6734 17c6a810 - offset 6735 17d13410 - offset 6736 17dbc010 - offset 6737 17e64c10 - offset 6738 17f0d810 - offset 6739 17fb6410 - offset 6740 1805f010 - offset 6741 18107c10 - offset 6742 181b0810 - offset 6743 18259410 - offset 6744 18302010 - offset 6745 183aac10 - offset 6746 18453810 - offset 6747 184fc410 - offset 6748 185a5010 - offset 6749 1864dc10 - offset 6750 186f6810 - offset 6751 1879f410 - offset 6752 18848010 - offset 6753 188f0c10 - offset 6754 18999810 - offset 6755 18a42410 - offset 6756 18aeb010 - offset 6757 18b93c10 - offset 6758 18c3c810 - offset 6759 18ce5410 - offset 6760 18e0e010 - offset 6761 18eb6c10 - offset 6762 18f5f810 - offset 6763 19008410 - offset 6764 190b1010 - offset 6765 19159c10 - offset 6766 19202810 - offset 6767 192ab410 - offset 6768 19354010 - offset 6769 193fcc10 - offset 6770 194a5810 - offset 6771 1954e410 - offset 6772 195f7010 - offset 6773 1969fc10 - offset 6774 19748810 - offset 6775 197f1410 - offset 6776 1989a010 - offset 6777 19942c10 - offset 6778 199eb810 - offset 6779 19a94410 - offset 6780 19b3d010 - offset 6781 19be5c10 - offset 6782 19c8e810 - offset 6783 19d37410 - offset 6784 19de0010 - offset 6785 19e88c10 - offset 6786 19f31810 - offset 6787 19fda410 - offset 6788 1a083010 - offset 6789 1a12bc10 - offset 6790 1a1d4810 - offset 6791 1a27d410 - offset 6792 1a326010 - offset 6793 1a3cec10 - offset 6794 1a477810 - offset 6795 1a520410 - offset 6796 1a5c9010 - offset 6797 1a671c10 - offset 6798 1a71a810 - offset 6799 1a7c3410 - offset 6800 1a86c010 - offset 6801 1a914c10 - offset 6802 1a9bd810 - offset 6803 1aa66410 - offset 6804 1ab0f010 - offset 6805 1abb7c10 - offset 6806 1ac60810 - offset 6807 1ad09410 - offset 6808 1adb2010 - offset 6809 1ae5ac10 - offset 6810 1af03810 - offset 6811 1afac410 - offset 6812 1b055010 - offset 6813 1b0fdc10 - offset 6814 1b1a6810 - offset 6815 1b24f410 - offset 6816 1b2f8010 - offset 6817 1b3a0c10 - offset 6818 1b449810 - offset 6819 1b4f2410 - offset 6820 1b59b010 - offset 6821 1b643c10 - offset 6822 1b6ec810 - offset 6823 1b795410 - offset 6824 1b83e010 - offset 6825 1b8e6c10 - offset 6826 1b98f810 - offset 6827 1ba38410 - offset 6828 1bae1010 - offset 6829 1bb89c10 - offset 6830 1bc32810 - offset 6831 1bcdb410 - offset 6832 1bd84010 - offset 6833 1be2cc10 - offset 6834 1bed5810 - offset 6835 1bf7e410 - offset 6836 1c027010 - offset 6837 1c0cfc10 - offset 6838 1c178810 - offset 6839 1c221410 - offset 6840 1c2ca010 - offset 6841 1c372c10 - offset 6842 1c41b810 - offset 6843 1c4c4410 - offset 6844 1c56d010 - offset 6845 1c615c10 - offset 6846 1c6be810 - offset 6847 1c767410 - offset 6848 1c810010 - offset 6849 1c8b8c10 - offset 6850 1c9e1810 - offset 6851 1ca8a410 - offset 6852 1cb33010 - offset 6853 1cbdbc10 - offset 6854 1cc84810 - offset 6855 1cd2d410 - offset 6856 1cdd6010 - offset 6857 1ce7ec10 - offset 6858 1cf27810 - offset 6859 1cfd0410 - offset 6860 1d079010 - offset 6861 1d121c10 - offset 6862 1d1ca810 - offset 6863 1d273410 - offset 6864 1d31c010 - offset 6865 1d3c4c10 - offset 6866 1d46d810 - offset 6867 1d516410 - offset 6868 1d5bf010 - offset 6869 1d667c10 - offset 6870 1d710810 - offset 6871 1d7b9410 - offset 6872 1d862010 - offset 6873 1d90ac10 - offset 6874 1d9b3810 - offset 6875 1da5c410 - offset 6876 1db05010 - offset 6877 1dbadc10 - offset 6878 1dc56810 - offset 6879 1dcff410 - offset 6880 1dda8010 - offset 6881 1de50c10 - offset 6882 1def9810 - offset 6883 1dfa2410 - offset 6884 1e04b010 - offset 6885 1e0f3c10 - offset 6886 1e19c810 - offset 6887 1e245410 - offset 6888 1e2ee010 - offset 6889 1e396c10 - offset 6890 1e43f810 - offset 6891 1e4e8410 - offset 6892 1e591010 - offset 6893 1e639c10 - offset 6894 1e6e2810 - offset 6895 1e78b410 - offset 6896 1e834010 - offset 6897 1e8dcc10 - offset 6898 1e985810 - offset 6899 1ea2e410 - offset 6900 1ead7010 - offset 6901 1eb7fc10 - offset 6902 1ec28810 - offset 6903 1ecd1410 - offset 6904 1ed7a010 - offset 6905 1ee22c10 - offset 6906 1eecb810 - offset 6907 1ef74410 - offset 6908 1f01d010 - offset 6909 1f0c5c10 - offset 6910 1f16e810 - offset 6911 1f217410 - offset 6912 1f2c0010 - offset 6913 1f368c10 - offset 6914 1f411810 - offset 6915 1f4ba410 - offset 6916 1f563010 - offset 6917 1f60bc10 - offset 6918 1f6b4810 - offset 6919 1f75d410 - offset 6920 1f806010 - offset 6921 1f8aec10 - offset 6922 1f957810 - offset 6923 1fa00410 - offset 6924 1faa9010 - offset 6925 1fb51c10 - offset 6926 1fbfa810 - offset 6927 1fca3410 - offset 6928 1fd4c010 - offset 6929 1fdf4c10 - offset 6930 1fe9d810 - offset 6931 1ff46410 - offset 6932 1ffef010 - offset 6933 20097c10 - offset 6934 20140810 - offset 6935 201e9410 - offset 6936 20292010 - offset 6937 2033ac10 - offset 6938 203e3810 - offset 6939 2048c410 - offset 6940 205b5010 - offset 6941 2065dc10 - offset 6942 20706810 - offset 6943 207af410 - offset 6944 20858010 - offset 6945 20900c10 - offset 6946 209a9810 - offset 6947 20a52410 - offset 6948 20afb010 - offset 6949 20ba3c10 - offset 6950 20c4c810 - offset 6951 20cf5410 - offset 6952 20d9e010 - offset 6953 20e46c10 - offset 6954 20eef810 - offset 6955 20f98410 - offset 6956 21041010 - offset 6957 210e9c10 - offset 6958 21192810 - offset 6959 2123b410 - offset 6960 212e4010 - offset 6961 2138cc10 - offset 6962 21435810 - offset 6963 214de410 - offset 6964 21587010 - offset 6965 2162fc10 - offset 6966 216d8810 - offset 6967 21781410 - offset 6968 2182a010 - offset 6969 218d2c10 - offset 6970 2197b810 - offset 6971 21a24410 - offset 6972 21acd010 - offset 6973 21b75c10 - offset 6974 21c1e810 - offset 6975 21cc7410 - offset 6976 21d70010 - offset 6977 21e18c10 - offset 6978 21ec1810 - offset 6979 21f6a410 - offset 6980 22013010 - offset 6981 220bbc10 - offset 6982 22164810 - offset 6983 2220d410 - offset 6984 222b6010 - offset 6985 2235ec10 - offset 6986 22407810 - offset 6987 224b0410 - offset 6988 22559010 - offset 6989 22601c10 - offset 6990 226aa810 - offset 6991 22753410 - offset 6992 227fc010 - offset 6993 228a4c10 - offset 6994 2294d810 - offset 6995 229f6410 - offset 6996 22a9f010 - offset 6997 22b47c10 - offset 6998 22bf0810 - offset 6999 22c99410 - offset 7000 22d42010 - offset 7001 22deac10 - offset 7002 22e93810 - offset 7003 22f3c410 - offset 7004 22fe5010 - offset 7005 2308dc10 - offset 7006 23136810 - offset 7007 231df410 - offset 7008 23288010 - offset 7009 23330c10 - offset 7010 233d9810 - offset 7011 23482410 - offset 7012 2352b010 - offset 7013 235d3c10 - offset 7014 2367c810 - offset 7015 23725410 - offset 7016 237ce010 - offset 7017 23876c10 - offset 7018 2391f810 - offset 7019 239c8410 - offset 7020 23a71010 - offset 7021 23b19c10 - offset 7022 23bc2810 - offset 7023 23c6b410 - offset 7024 23d14010 - offset 7025 23dbcc10 - offset 7026 23e65810 - offset 7027 23f0e410 - offset 7028 23fb7010 - offset 7029 2405fc10 - offset 7030 24188810 - offset 7031 24231410 - offset 7032 242da010 - offset 7033 24382c10 - offset 7034 2442b810 - offset 7035 244d4410 - offset 7036 2457d010 - offset 7037 24625c10 - offset 7038 246ce810 - offset 7039 24777410 - offset 7040 24820010 - offset 7041 248c8c10 - offset 7042 24971810 - offset 7043 24a1a410 - offset 7044 24ac3010 - offset 7045 24b6bc10 - offset 7046 24c14810 - offset 7047 24cbd410 - offset 7048 24d66010 - offset 7049 24e0ec10 - offset 7050 24eb7810 - offset 7051 24f60410 - offset 7052 25009010 - offset 7053 250b1c10 - offset 7054 2515a810 - offset 7055 25203410 - offset 7056 252ac010 - offset 7057 25354c10 - offset 7058 253fd810 - offset 7059 254a6410 - offset 7060 2554f010 - offset 7061 255f7c10 - offset 7062 256a0810 - offset 7063 25749410 - offset 7064 257f2010 - offset 7065 2589ac10 - offset 7066 25943810 - offset 7067 259ec410 - offset 7068 25a95010 - offset 7069 25b3dc10 - offset 7070 25be6810 - offset 7071 25c8f410 - offset 7072 25d38010 - offset 7073 25de0c10 - offset 7074 25e89810 - offset 7075 25f32410 - offset 7076 25fdb010 - offset 7077 26083c10 - offset 7078 2612c810 - offset 7079 261d5410 - offset 7080 2627e010 - offset 7081 26326c10 - offset 7082 263cf810 - offset 7083 26478410 - offset 7084 26521010 - offset 7085 265c9c10 - offset 7086 26672810 - offset 7087 2671b410 - offset 7088 267c4010 - offset 7089 2686cc10 - offset 7090 26915810 - offset 7091 269be410 - offset 7092 26a67010 - offset 7093 26b0fc10 - offset 7094 26bb8810 - offset 7095 26c61410 - offset 7096 26d0a010 - offset 7097 26db2c10 - offset 7098 26e5b810 - offset 7099 26f04410 - offset 7100 26fad010 - offset 7101 27055c10 - offset 7102 270fe810 - offset 7103 271a7410 - offset 7104 27250010 - offset 7105 272f8c10 - offset 7106 273a1810 - offset 7107 2744a410 - offset 7108 274f3010 - offset 7109 2759bc10 - offset 7110 27644810 - offset 7111 276ed410 - offset 7112 27796010 - offset 7113 2783ec10 - offset 7114 278e7810 - offset 7115 27990410 - offset 7116 27a39010 - offset 7117 27ae1c10 - offset 7118 27b8a810 - offset 7119 27c33410 - offset 7120 27d5c010 - offset 7121 27e04c10 - offset 7122 27ead810 - offset 7123 27f56410 - offset 7124 27fff010 - offset 7125 280a7c10 - offset 7126 28150810 - offset 7127 281f9410 - offset 7128 282a2010 - offset 7129 2834ac10 - offset 7130 283f3810 - offset 7131 2849c410 - offset 7132 28545010 - offset 7133 285edc10 - offset 7134 28696810 - offset 7135 2873f410 - offset 7136 287e8010 - offset 7137 28890c10 - offset 7138 28939810 - offset 7139 289e2410 - offset 7140 28a8b010 - offset 7141 28b33c10 - offset 7142 28bdc810 - offset 7143 28c85410 - offset 7144 28d2e010 - offset 7145 28dd6c10 - offset 7146 28e7f810 - offset 7147 28f28410 - offset 7148 28fd1010 - offset 7149 29079c10 - offset 7150 29122810 - offset 7151 291cb410 - offset 7152 29274010 - offset 7153 2931cc10 - offset 7154 293c5810 - offset 7155 2946e410 - offset 7156 29517010 - offset 7157 295bfc10 - offset 7158 29668810 - offset 7159 29711410 - offset 7160 297ba010 - offset 7161 29862c10 - offset 7162 2990b810 - offset 7163 299b4410 - offset 7164 29a5d010 - offset 7165 29b05c10 - offset 7166 29bae810 - offset 7167 29c57410 - offset 7168 29d00010 - offset 7169 29da8c10 - offset 7170 29e51810 - offset 7171 29efa410 - offset 7172 29fa3010 - offset 7173 2a04bc10 - offset 7174 2a0f4810 - offset 7175 2a19d410 - offset 7176 2a246010 - offset 7177 2a2eec10 - offset 7178 2a397810 - offset 7179 2a440410 - offset 7180 2a4e9010 - offset 7181 2a591c10 - offset 7182 2a63a810 - offset 7183 2a6e3410 - offset 7184 2a78c010 - offset 7185 2a834c10 - offset 7186 2a8dd810 - offset 7187 2a986410 - offset 7188 2aa2f010 - offset 7189 2aad7c10 - offset 7190 2ab80810 - offset 7191 2ac29410 - offset 7192 2acd2010 - offset 7193 2ad7ac10 - offset 7194 2ae23810 - offset 7195 2aecc410 - offset 7196 2af75010 - offset 7197 2b01dc10 - offset 7198 2b0c6810 - offset 7199 2b16f410 - offset 7200 2b218010 - offset 7201 2b2c0c10 - offset 7202 2b369810 - offset 7203 2b412410 - offset 7204 2b4bb010 - offset 7205 2b563c10 - offset 7206 2b60c810 - offset 7207 2b6b5410 - offset 7208 2b75e010 - offset 7209 2b806c10 - offset 7210 2b92f810 - offset 7211 2b9d8410 - offset 7212 2ba81010 - offset 7213 2bb29c10 - offset 7214 2bbd2810 - offset 7215 2bc7b410 - offset 7216 2bd24010 - offset 7217 2bdccc10 - offset 7218 2be75810 - offset 7219 2bf1e410 - offset 7220 2bfc7010 - offset 7221 2c06fc10 - offset 7222 2c118810 - offset 7223 2c1c1410 - offset 7224 2c26a010 - offset 7225 2c312c10 - offset 7226 2c3bb810 - offset 7227 2c464410 - offset 7228 2c50d010 - offset 7229 2c5b5c10 - offset 7230 2c65e810 - offset 7231 2c707410 - offset 7232 2c7b0010 - offset 7233 2c858c10 - offset 7234 2c901810 - offset 7235 2c9aa410 - offset 7236 2ca53010 - offset 7237 2cafbc10 - offset 7238 2cba4810 - offset 7239 2cc4d410 - offset 7240 2ccf6010 - offset 7241 2cd9ec10 - offset 7242 2ce47810 - offset 7243 2cef0410 - offset 7244 2cf99010 - offset 7245 2d041c10 - offset 7246 2d0ea810 - offset 7247 2d193410 - offset 7248 2d23c010 - offset 7249 2d2e4c10 - offset 7250 2d38d810 - offset 7251 2d436410 - offset 7252 2d4df010 - offset 7253 2d587c10 - offset 7254 2d630810 - offset 7255 2d6d9410 - offset 7256 2d782010 - offset 7257 2d82ac10 - offset 7258 2d8d3810 - offset 7259 2d97c410 - offset 7260 2da25010 - offset 7261 2dacdc10 - offset 7262 2db76810 - offset 7263 2dc1f410 - offset 7264 2dcc8010 - offset 7265 2dd70c10 - offset 7266 2de19810 - offset 7267 2dec2410 - offset 7268 2df6b010 - offset 7269 2e013c10 - offset 7270 2e0bc810 - offset 7271 2e165410 - offset 7272 2e20e010 - offset 7273 2e2b6c10 - offset 7274 2e35f810 - offset 7275 2e408410 - offset 7276 2e4b1010 - offset 7277 2e559c10 - offset 7278 2e602810 - offset 7279 2e6ab410 - offset 7280 2e754010 - offset 7281 2e7fcc10 - offset 7282 2e8a5810 - offset 7283 2e94e410 - offset 7284 2e9f7010 - offset 7285 2ea9fc10 - offset 7286 2eb48810 - offset 7287 2ebf1410 - offset 7288 2ec9a010 - offset 7289 2ed42c10 - offset 7290 2edeb810 - offset 7291 2ee94410 - offset 7292 2ef3d010 - offset 7293 2efe5c10 - offset 7294 2f08e810 - offset 7295 2f137410 - offset 7296 2f1e0010 - offset 7297 2f288c10 - offset 7298 2f331810 - offset 7299 2f3da410 - offset 7300 2f503010 - offset 7301 2f5abc10 - offset 7302 2f654810 - offset 7303 2f6fd410 - offset 7304 2f7a6010 - offset 7305 2f84ec10 - offset 7306 2f8f7810 - offset 7307 2f9a0410 - offset 7308 2fa49010 - offset 7309 2faf1c10 - offset 7310 2fb9a810 - offset 7311 2fc43410 - offset 7312 2fcec010 - offset 7313 2fd94c10 - offset 7314 2fe3d810 - offset 7315 2fee6410 - offset 7316 2ff8f010 - offset 7317 30037c10 - offset 7318 300e0810 - offset 7319 30189410 - offset 7320 30232010 - offset 7321 302dac10 - offset 7322 30383810 - offset 7323 3042c410 - offset 7324 304d5010 - offset 7325 3057dc10 - offset 7326 30626810 - offset 7327 306cf410 - offset 7328 30778010 - offset 7329 30820c10 - offset 7330 308c9810 - offset 7331 30972410 - offset 7332 30a1b010 - offset 7333 30ac3c10 - offset 7334 30b6c810 - offset 7335 30c15410 - offset 7336 30cbe010 - offset 7337 30d66c10 - offset 7338 30e0f810 - offset 7339 30eb8410 - offset 7340 30f61010 - offset 7341 31009c10 - offset 7342 310b2810 - offset 7343 3115b410 - offset 7344 31204010 - offset 7345 312acc10 - offset 7346 31355810 - offset 7347 313fe410 - offset 7348 314a7010 - offset 7349 3154fc10 - offset 7350 315f8810 - offset 7351 316a1410 - offset 7352 3174a010 - offset 7353 317f2c10 - offset 7354 3189b810 - offset 7355 31944410 - offset 7356 319ed010 - offset 7357 31a95c10 - offset 7358 31b3e810 - offset 7359 31be7410 - offset 7360 31c90010 - offset 7361 31d38c10 - offset 7362 31de1810 - offset 7363 31e8a410 - offset 7364 31f33010 - offset 7365 31fdbc10 - offset 7366 32084810 - offset 7367 3212d410 - offset 7368 321d6010 - offset 7369 3227ec10 - offset 7370 32327810 - offset 7371 323d0410 - offset 7372 32479010 - offset 7373 32521c10 - offset 7374 325ca810 - offset 7375 32673410 - offset 7376 3271c010 - offset 7377 327c4c10 - offset 7378 3286d810 - offset 7379 32916410 - offset 7380 329bf010 - offset 7381 32a67c10 - offset 7382 32b10810 - offset 7383 32bb9410 - offset 7384 32c62010 - offset 7385 32d0ac10 - offset 7386 32db3810 - offset 7387 32e5c410 - offset 7388 32f05010 - offset 7389 32fadc10 - offset 7390 330d6810 - offset 7391 3317f410 - offset 7392 33228010 - offset 7393 332d0c10 - offset 7394 33379810 - offset 7395 33422410 - offset 7396 334cb010 - offset 7397 33573c10 - offset 7398 3361c810 - offset 7399 336c5410 - offset 7400 3376e010 - offset 7401 33816c10 - offset 7402 338bf810 - offset 7403 33968410 - offset 7404 33a11010 - offset 7405 33ab9c10 - offset 7406 33b62810 - offset 7407 33c0b410 - offset 7408 33cb4010 - offset 7409 33d5cc10 - offset 7410 33e05810 - offset 7411 33eae410 - offset 7412 33f57010 - offset 7413 33fffc10 - offset 7414 340a8810 - offset 7415 34151410 - offset 7416 341fa010 - offset 7417 342a2c10 - offset 7418 3434b810 - offset 7419 343f4410 - offset 7420 3449d010 - offset 7421 34545c10 - offset 7422 345ee810 - offset 7423 34697410 - offset 7424 34740010 - offset 7425 347e8c10 - offset 7426 34891810 - offset 7427 3493a410 - offset 7428 349e3010 - offset 7429 34a8bc10 - offset 7430 34b34810 - offset 7431 34bdd410 - offset 7432 34c86010 - offset 7433 34d2ec10 - offset 7434 34dd7810 - offset 7435 34e80410 - offset 7436 34f29010 - offset 7437 34fd1c10 - offset 7438 3507a810 - offset 7439 35123410 - offset 7440 351cc010 - offset 7441 35274c10 - offset 7442 3531d810 - offset 7443 353c6410 - offset 7444 3546f010 - offset 7445 35517c10 - offset 7446 355c0810 - offset 7447 35669410 - offset 7448 35712010 - offset 7449 357bac10 - offset 7450 35863810 - offset 7451 3590c410 - offset 7452 359b5010 - offset 7453 35a5dc10 - offset 7454 35b06810 - offset 7455 35baf410 - offset 7456 35c58010 - offset 7457 35d00c10 - offset 7458 35da9810 - offset 7459 35e52410 - offset 7460 35efb010 - offset 7461 35fa3c10 - offset 7462 3604c810 - offset 7463 360f5410 - offset 7464 3619e010 - offset 7465 36246c10 - offset 7466 362ef810 - offset 7467 36398410 - offset 7468 36441010 - offset 7469 364e9c10 - offset 7470 36592810 - offset 7471 3663b410 - offset 7472 366e4010 - offset 7473 3678cc10 - offset 7474 36835810 - offset 7475 368de410 - offset 7476 36987010 - offset 7477 36a2fc10 - offset 7478 36ad8810 - offset 7479 36b81410 - offset 7480 36caa010 - offset 7481 36d52c10 - offset 7482 36dfb810 - offset 7483 36ea4410 - offset 7484 36f4d010 - offset 7485 36ff5c10 - offset 7486 3709e810 - offset 7487 37147410 - offset 7488 371f0010 - offset 7489 37298c10 - offset 7490 37341810 - offset 7491 373ea410 - offset 7492 37493010 - offset 7493 3753bc10 - offset 7494 375e4810 - offset 7495 3768d410 - offset 7496 37736010 - offset 7497 377dec10 - offset 7498 37887810 - offset 7499 37930410 - offset 7500 379d9010 - offset 7501 37a81c10 - offset 7502 37b2a810 - offset 7503 37bd3410 - offset 7504 37c7c010 - offset 7505 37d24c10 - offset 7506 37dcd810 - offset 7507 37e76410 - offset 7508 37f1f010 - offset 7509 37fc7c10 - offset 7510 38070810 - offset 7511 38119410 - offset 7512 381c2010 - offset 7513 3826ac10 - offset 7514 38313810 - offset 7515 383bc410 - offset 7516 38465010 - offset 7517 3850dc10 - offset 7518 385b6810 - offset 7519 3865f410 - offset 7520 38708010 - offset 7521 387b0c10 - offset 7522 38859810 - offset 7523 38902410 - offset 7524 389ab010 - offset 7525 38a53c10 - offset 7526 38afc810 - offset 7527 38ba5410 - offset 7528 38c4e010 - offset 7529 38cf6c10 - offset 7530 38d9f810 - offset 7531 38e48410 - offset 7532 38ef1010 - offset 7533 38f99c10 - offset 7534 39042810 - offset 7535 390eb410 - offset 7536 39194010 - offset 7537 3923cc10 - offset 7538 392e5810 - offset 7539 3938e410 - offset 7540 39437010 - offset 7541 394dfc10 - offset 7542 39588810 - offset 7543 39631410 - offset 7544 396da010 - offset 7545 39782c10 - offset 7546 3982b810 - offset 7547 398d4410 - offset 7548 3997d010 - offset 7549 39a25c10 - offset 7550 39ace810 - offset 7551 39b77410 - offset 7552 39c20010 - offset 7553 39cc8c10 - offset 7554 39d71810 - offset 7555 39e1a410 - offset 7556 39ec3010 - offset 7557 39f6bc10 - offset 7558 3a014810 - offset 7559 3a0bd410 - offset 7560 3a166010 - offset 7561 3a20ec10 - offset 7562 3a2b7810 - offset 7563 3a360410 - offset 7564 3a409010 - offset 7565 3a4b1c10 - offset 7566 3a55a810 - offset 7567 3a603410 - offset 7568 3a6ac010 - offset 7569 3a754c10 - offset 7570 3a87d810 - offset 7571 3a926410 - offset 7572 3a9cf010 - offset 7573 3aa77c10 - offset 7574 3ab20810 - offset 7575 3abc9410 - offset 7576 3ac72010 - offset 7577 3ad1ac10 - offset 7578 3adc3810 - offset 7579 3ae6c410 - offset 7580 3af15010 - offset 7581 3afbdc10 - offset 7582 3b066810 - offset 7583 3b10f410 - offset 7584 3b1b8010 - offset 7585 3b260c10 - offset 7586 3b309810 - offset 7587 3b3b2410 - offset 7588 3b45b010 - offset 7589 3b503c10 - offset 7590 3b5ac810 - offset 7591 3b655410 - offset 7592 3b6fe010 - offset 7593 3b7a6c10 - offset 7594 3b84f810 - offset 7595 3b8f8410 - offset 7596 3b9a1010 - offset 7597 3ba49c10 - offset 7598 3baf2810 - offset 7599 3bb9b410 - offset 7600 3bc44010 - offset 7601 3bcecc10 - offset 7602 3bd95810 - offset 7603 3be3e410 - offset 7604 3bee7010 - offset 7605 3bf8fc10 - offset 7606 3c038810 - offset 7607 3c0e1410 - offset 7608 3c18a010 - offset 7609 3c232c10 - offset 7610 3c2db810 - offset 7611 3c384410 - offset 7612 3c42d010 - offset 7613 3c4d5c10 - offset 7614 3c57e810 - offset 7615 3c627410 - offset 7616 3c6d0010 - offset 7617 3c778c10 - offset 7618 3c821810 - offset 7619 3c8ca410 - offset 7620 3c973010 - offset 7621 3ca1bc10 - offset 7622 3cac4810 - offset 7623 3cb6d410 - offset 7624 3cc16010 - offset 7625 3ccbec10 - offset 7626 3cd67810 - offset 7627 3ce10410 - offset 7628 3ceb9010 - offset 7629 3cf61c10 - offset 7630 3d00a810 - offset 7631 3d0b3410 - offset 7632 3d15c010 - offset 7633 3d204c10 - offset 7634 3d2ad810 - offset 7635 3d356410 - offset 7636 3d3ff010 - offset 7637 3d4a7c10 - offset 7638 3d550810 - offset 7639 3d5f9410 - offset 7640 3d6a2010 - offset 7641 3d74ac10 - offset 7642 3d7f3810 - offset 7643 3d89c410 - offset 7644 3d945010 - offset 7645 3d9edc10 - offset 7646 3da96810 - offset 7647 3db3f410 - offset 7648 3dbe8010 - offset 7649 3dc90c10 - offset 7650 3dd39810 - offset 7651 3dde2410 - offset 7652 3de8b010 - offset 7653 3df33c10 - offset 7654 3dfdc810 - offset 7655 3e085410 - offset 7656 3e12e010 - offset 7657 3e1d6c10 - offset 7658 3e27f810 - offset 7659 3e328410 - offset 7660 3e451010 - offset 7661 3e4f9c10 - offset 7662 3e5a2810 - offset 7663 3e64b410 - offset 7664 3e6f4010 - offset 7665 3e79cc10 - offset 7666 3e845810 - offset 7667 3e8ee410 - offset 7668 3e997010 - offset 7669 3ea3fc10 - offset 7670 3eae8810 - offset 7671 3eb91410 - offset 7672 3ec3a010 - offset 7673 3ece2c10 - offset 7674 3ed8b810 - offset 7675 3ee34410 - offset 7676 3eedd010 - offset 7677 3ef85c10 - offset 7678 3f02e810 - offset 7679 3f0d7410 - offset 7680 3f180010 - offset 7681 3f228c10 - offset 7682 3f2d1810 - offset 7683 3f37a410 - offset 7684 3f423010 - offset 7685 3f4cbc10 - offset 7686 3f574810 - offset 7687 3f61d410 - offset 7688 3f6c6010 - offset 7689 3f76ec10 - offset 7690 3f817810 - offset 7691 3f8c0410 - offset 7692 3f969010 - offset 7693 3fa11c10 - offset 7694 3faba810 - offset 7695 3fb63410 - offset 7696 3fc0c010 - offset 7697 3fcb4c10 - offset 7698 3fd5d810 - offset 7699 3fe06410 - offset 7700 3feaf010 - offset 7701 3ff57c10 - offset 7702 40000810 - offset 7703 400a9410 - offset 7704 40152010 - offset 7705 401fac10 - offset 7706 402a3810 - offset 7707 4034c410 - offset 7708 403f5010 - offset 7709 4049dc10 - offset 7710 40546810 - offset 7711 405ef410 - offset 7712 40698010 - offset 7713 40740c10 - offset 7714 407e9810 - offset 7715 40892410 - offset 7716 4093b010 - offset 7717 409e3c10 - offset 7718 40a8c810 - offset 7719 40b35410 - offset 7720 40bde010 - offset 7721 40c86c10 - offset 7722 40d2f810 - offset 7723 40dd8410 - offset 7724 40e81010 - offset 7725 40f29c10 - offset 7726 40fd2810 - offset 7727 4107b410 - offset 7728 41124010 - offset 7729 411ccc10 - offset 7730 41275810 - offset 7731 4131e410 - offset 7732 413c7010 - offset 7733 4146fc10 - offset 7734 41518810 - offset 7735 415c1410 - offset 7736 4166a010 - offset 7737 41712c10 - offset 7738 417bb810 - offset 7739 41864410 - offset 7740 4198d010 - offset 7741 41a35c10 - offset 7742 41ade810 - offset 7743 41b87410 - offset 7744 41c30010 - offset 7745 41cd8c10 - offset 7746 41d81810 - offset 7747 41e2a410 - offset 7748 41ed3010 - offset 7749 41f7bc10 - offset 7750 42024810 - offset 7751 420cd410 - offset 7752 42176010 - offset 7753 4221ec10 - offset 7754 422c7810 - offset 7755 42370410 - offset 7756 42419010 - offset 7757 424c1c10 - offset 7758 4256a810 - offset 7759 42613410 - offset 7760 426bc010 - offset 7761 42764c10 - offset 7762 4280d810 - offset 7763 428b6410 - offset 7764 4295f010 - offset 7765 42a07c10 - offset 7766 42ab0810 - offset 7767 42b59410 - offset 7768 42c02010 - offset 7769 42caac10 - offset 7770 42d53810 - offset 7771 42dfc410 - offset 7772 42ea5010 - offset 7773 42f4dc10 - offset 7774 42ff6810 - offset 7775 4309f410 - offset 7776 43148010 - offset 7777 431f0c10 - offset 7778 43299810 - offset 7779 43342410 - offset 7780 433eb010 - offset 7781 43493c10 - offset 7782 4353c810 - offset 7783 435e5410 - offset 7784 4368e010 - offset 7785 43736c10 - offset 7786 437df810 - offset 7787 43888410 - offset 7788 43931010 - offset 7789 439d9c10 - offset 7790 43a82810 - offset 7791 43b2b410 - offset 7792 43bd4010 - offset 7793 43c7cc10 - offset 7794 43d25810 - offset 7795 43dce410 - offset 7796 43e77010 - offset 7797 43f1fc10 - offset 7798 43fc8810 - offset 7799 44071410 - offset 7800 4411a010 - offset 7801 441c2c10 - offset 7802 4426b810 - offset 7803 44314410 - offset 7804 443bd010 - offset 7805 44465c10 - offset 7806 4450e810 - offset 7807 445b7410 - offset 7808 44660010 - offset 7809 44708c10 - offset 7810 447b1810 - offset 7811 4485a410 - offset 7812 44903010 - offset 7813 449abc10 - offset 7814 44a54810 - offset 7815 44afd410 - offset 7816 44ba6010 - offset 7817 44c4ec10 - offset 7818 44cf7810 - offset 7819 44da0410 - offset 7820 44e49010 - offset 7821 44ef1c10 - offset 7822 44f9a810 - offset 7823 45043410 - offset 7824 450ec010 - offset 7825 45194c10 - offset 7826 4523d810 - offset 7827 452e6410 - offset 7828 4538f010 - offset 7829 45437c10 - offset 7830 45560810 - offset 7831 45609410 - offset 7832 456b2010 - offset 7833 4575ac10 - offset 7834 45803810 - offset 7835 458ac410 - offset 7836 45955010 - offset 7837 459fdc10 - offset 7838 45aa6810 - offset 7839 45b4f410 - offset 7840 45bf8010 - offset 7841 45ca0c10 - offset 7842 45d49810 - offset 7843 45df2410 - offset 7844 45e9b010 - offset 7845 45f43c10 - offset 7846 45fec810 - offset 7847 46095410 - offset 7848 4613e010 - offset 7849 461e6c10 - offset 7850 4628f810 - offset 7851 46338410 - offset 7852 463e1010 - offset 7853 46489c10 - offset 7854 46532810 - offset 7855 465db410 - offset 7856 46684010 - offset 7857 4672cc10 - offset 7858 467d5810 - offset 7859 4687e410 - offset 7860 46927010 - offset 7861 469cfc10 - offset 7862 46a78810 - offset 7863 46b21410 - offset 7864 46bca010 - offset 7865 46c72c10 - offset 7866 46d1b810 - offset 7867 46dc4410 - offset 7868 46e6d010 - offset 7869 46f15c10 - offset 7870 46fbe810 - offset 7871 47067410 - offset 7872 47110010 - offset 7873 471b8c10 - offset 7874 47261810 - offset 7875 4730a410 - offset 7876 473b3010 - offset 7877 4745bc10 - offset 7878 47504810 - offset 7879 475ad410 - offset 7880 47656010 - offset 7881 476fec10 - offset 7882 477a7810 - offset 7883 47850410 - offset 7884 478f9010 - offset 7885 479a1c10 - offset 7886 47a4a810 - offset 7887 47af3410 - offset 7888 47b9c010 - offset 7889 47c44c10 - offset 7890 47ced810 - offset 7891 47d96410 - offset 7892 47e3f010 - offset 7893 47ee7c10 - offset 7894 47f90810 - offset 7895 48039410 - offset 7896 480e2010 - offset 7897 4818ac10 - offset 7898 48233810 - offset 7899 482dc410 - offset 7900 48385010 - offset 7901 4842dc10 - offset 7902 484d6810 - offset 7903 4857f410 - offset 7904 48628010 - offset 7905 486d0c10 - offset 7906 48779810 - offset 7907 48822410 - offset 7908 488cb010 - offset 7909 48973c10 - offset 7910 48a1c810 - offset 7911 48ac5410 - offset 7912 48b6e010 - offset 7913 48c16c10 - offset 7914 48cbf810 - offset 7915 48d68410 - offset 7916 48e11010 - offset 7917 48eb9c10 - offset 7918 48f62810 - offset 7919 4900b410 - offset 7920 49134010 - offset 7921 491dcc10 - offset 7922 49285810 - offset 7923 4932e410 - offset 7924 493d7010 - offset 7925 4947fc10 - offset 7926 49528810 - offset 7927 495d1410 - offset 7928 4967a010 - offset 7929 49722c10 - offset 7930 497cb810 - offset 7931 49874410 - offset 7932 4991d010 - offset 7933 499c5c10 - offset 7934 49a6e810 - offset 7935 49b17410 - offset 7936 49bc0010 - offset 7937 49c68c10 - offset 7938 49d11810 - offset 7939 49dba410 - offset 7940 49e63010 - offset 7941 49f0bc10 - offset 7942 49fb4810 - offset 7943 4a05d410 - offset 7944 4a106010 - offset 7945 4a1aec10 - offset 7946 4a257810 - offset 7947 4a300410 - offset 7948 4a3a9010 - offset 7949 4a451c10 - offset 7950 4a4fa810 - offset 7951 4a5a3410 - offset 7952 4a64c010 - offset 7953 4a6f4c10 - offset 7954 4a79d810 - offset 7955 4a846410 - offset 7956 4a8ef010 - offset 7957 4a997c10 - offset 7958 4aa40810 - offset 7959 4aae9410 - offset 7960 4ab92010 - offset 7961 4ac3ac10 - offset 7962 4ace3810 - offset 7963 4ad8c410 - offset 7964 4ae35010 - offset 7965 4aeddc10 - offset 7966 4af86810 - offset 7967 4b02f410 - offset 7968 4b0d8010 - offset 7969 4b180c10 - offset 7970 4b229810 - offset 7971 4b2d2410 - offset 7972 4b37b010 - offset 7973 4b423c10 - offset 7974 4b4cc810 - offset 7975 4b575410 - offset 7976 4b61e010 - offset 7977 4b6c6c10 - offset 7978 4b76f810 - offset 7979 4b818410 - offset 7980 4b8c1010 - offset 7981 4b969c10 - offset 7982 4ba12810 - offset 7983 4babb410 - offset 7984 4bb64010 - offset 7985 4bc0cc10 - offset 7986 4bcb5810 - offset 7987 4bd5e410 - offset 7988 4be07010 - offset 7989 4beafc10 - offset 7990 4bf58810 - offset 7991 4c001410 - offset 7992 4c0aa010 - offset 7993 4c152c10 - offset 7994 4c1fb810 - offset 7995 4c2a4410 - offset 7996 4c34d010 - offset 7997 4c3f5c10 - offset 7998 4c49e810 - offset 7999 4c547410 - offset 8000 4c5f0010 - offset 8001 4c698c10 - offset 8002 4c741810 - offset 8003 4c7ea410 - offset 8004 4c893010 - offset 8005 4c93bc10 - offset 8006 4c9e4810 - offset 8007 4ca8d410 - offset 8008 4cb36010 - offset 8009 4cbdec10 - offset 8010 4cd07810 - offset 8011 4cdb0410 - offset 8012 4ce59010 - offset 8013 4cf01c10 - offset 8014 4cfaa810 - offset 8015 4d053410 - offset 8016 4d0fc010 - offset 8017 4d1a4c10 - offset 8018 4d24d810 - offset 8019 4d2f6410 - offset 8020 4d39f010 - offset 8021 4d447c10 - offset 8022 4d4f0810 - offset 8023 4d599410 - offset 8024 4d642010 - offset 8025 4d6eac10 - offset 8026 4d793810 - offset 8027 4d83c410 - offset 8028 4d8e5010 - offset 8029 4d98dc10 - offset 8030 4da36810 - offset 8031 4dadf410 - offset 8032 4db88010 - offset 8033 4dc30c10 - offset 8034 4dcd9810 - offset 8035 4dd82410 - offset 8036 4de2b010 - offset 8037 4ded3c10 - offset 8038 4df7c810 - offset 8039 4e025410 - offset 8040 4e0ce010 - offset 8041 4e176c10 - offset 8042 4e21f810 - offset 8043 4e2c8410 - offset 8044 4e371010 - offset 8045 4e419c10 - offset 8046 4e4c2810 - offset 8047 4e56b410 - offset 8048 4e614010 - offset 8049 4e6bcc10 - offset 8050 4e765810 - offset 8051 4e80e410 - offset 8052 4e8b7010 - offset 8053 4e95fc10 - offset 8054 4ea08810 - offset 8055 4eab1410 - offset 8056 4eb5a010 - offset 8057 4ec02c10 - offset 8058 4ecab810 - offset 8059 4ed54410 - offset 8060 4edfd010 - offset 8061 4eea5c10 - offset 8062 4ef4e810 - offset 8063 4eff7410 - offset 8064 4f0a0010 - offset 8065 4f148c10 - offset 8066 4f1f1810 - offset 8067 4f29a410 - offset 8068 4f343010 - offset 8069 4f3ebc10 - offset 8070 4f494810 - offset 8071 4f53d410 - offset 8072 4f5e6010 - offset 8073 4f68ec10 - offset 8074 4f737810 - offset 8075 4f7e0410 - offset 8076 4f889010 - offset 8077 4f931c10 - offset 8078 4f9da810 - offset 8079 4fa83410 - offset 8080 4fb2c010 - offset 8081 4fbd4c10 - offset 8082 4fc7d810 - offset 8083 4fd26410 - offset 8084 4fdcf010 - offset 8085 4fe77c10 - offset 8086 4ff20810 - offset 8087 4ffc9410 - offset 8088 50072010 - offset 8089 5011ac10 - offset 8090 501c3810 - offset 8091 5026c410 - offset 8092 50315010 - offset 8093 503bdc10 - offset 8094 50466810 - offset 8095 5050f410 - offset 8096 505b8010 - offset 8097 50660c10 - offset 8098 50709810 - offset 8099 507b2410 - offset 8100 508db010 - offset 8101 50983c10 - offset 8102 50a2c810 - offset 8103 50ad5410 - offset 8104 50b7e010 - offset 8105 50c26c10 - offset 8106 50ccf810 - offset 8107 50d78410 - offset 8108 50e21010 - offset 8109 50ec9c10 - offset 8110 50f72810 - offset 8111 5101b410 - offset 8112 510c4010 - offset 8113 5116cc10 - offset 8114 51215810 - offset 8115 512be410 - offset 8116 51367010 - offset 8117 5140fc10 - offset 8118 514b8810 - offset 8119 51561410 - offset 8120 5160a010 - offset 8121 516b2c10 - offset 8122 5175b810 - offset 8123 51804410 - offset 8124 518ad010 - offset 8125 51955c10 - offset 8126 519fe810 - offset 8127 51aa7410 - offset 8128 51b50010 - offset 8129 51bf8c10 - offset 8130 51ca1810 - offset 8131 51d4a410 - offset 8132 51df3010 - offset 8133 51e9bc10 - offset 8134 51f44810 - offset 8135 51fed410 - offset 8136 52096010 - offset 8137 5213ec10 - offset 8138 521e7810 - offset 8139 52290410 - offset 8140 52339010 - offset 8141 523e1c10 - offset 8142 5248a810 - offset 8143 52533410 - offset 8144 525dc010 - offset 8145 52684c10 - offset 8146 5272d810 - offset 8147 527d6410 - offset 8148 5287f010 - offset 8149 52927c10 - offset 8150 529d0810 - offset 8151 52a79410 - offset 8152 52b22010 - offset 8153 52bcac10 - offset 8154 52c73810 - offset 8155 52d1c410 - offset 8156 52dc5010 - offset 8157 52e6dc10 - offset 8158 52f16810 - offset 8159 52fbf410 - offset 8160 53068010 - offset 8161 53110c10 - offset 8162 531b9810 - offset 8163 53262410 - offset 8164 5330b010 - offset 8165 533b3c10 - offset 8166 5345c810 - offset 8167 53505410 - offset 8168 535ae010 - offset 8169 53656c10 - offset 8170 536ff810 - offset 8171 537a8410 - offset 8172 53851010 - offset 8173 538f9c10 - offset 8174 539a2810 - offset 8175 53a4b410 - offset 8176 53af4010 - offset 8177 53b9cc10 - offset 8178 53c45810 - offset 8179 53cee410 - offset 8180 53d97010 - offset 8181 53e3fc10 - offset 8182 53ee8810 - offset 8183 53f91410 - offset 8184 5403a010 - offset 8185 540e2c10 - offset 8186 5418b810 - offset 8187 54234410 - offset 8188 542dd010 - offset 8189 54385c10 - offset 8190 544ae810 - offset 8191 54557410 - offset 8192 54600010 - offset 8193 546a8c10 - offset 8194 54751810 - offset 8195 547fa410 - offset 8196 548a3010 - offset 8197 5494bc10 - offset 8198 549f4810 - offset 8199 54a9d410 - offset 8200 54b46010 - offset 8201 54beec10 - offset 8202 54c97810 - offset 8203 54d40410 - offset 8204 54de9010 - offset 8205 54e91c10 - offset 8206 54f3a810 - offset 8207 54fe3410 - offset 8208 5508c010 - offset 8209 55134c10 - offset 8210 551dd810 - offset 8211 55286410 - offset 8212 5532f010 - offset 8213 553d7c10 - offset 8214 55480810 - offset 8215 55529410 - offset 8216 555d2010 - offset 8217 5567ac10 - offset 8218 55723810 - offset 8219 557cc410 - offset 8220 55875010 - offset 8221 5591dc10 - offset 8222 559c6810 - offset 8223 55a6f410 - offset 8224 55b18010 - offset 8225 55bc0c10 - offset 8226 55c69810 - offset 8227 55d12410 - offset 8228 55dbb010 - offset 8229 55e63c10 - offset 8230 55f0c810 - offset 8231 55fb5410 - offset 8232 5605e010 - offset 8233 56106c10 - offset 8234 561af810 - offset 8235 56258410 - offset 8236 56301010 - offset 8237 563a9c10 - offset 8238 56452810 - offset 8239 564fb410 - offset 8240 565a4010 - offset 8241 5664cc10 - offset 8242 566f5810 - offset 8243 5679e410 - offset 8244 56847010 - offset 8245 568efc10 - offset 8246 56998810 - offset 8247 56a41410 - offset 8248 56aea010 - offset 8249 56b92c10 - offset 8250 56c3b810 - offset 8251 56ce4410 - offset 8252 56d8d010 - offset 8253 56e35c10 - offset 8254 56ede810 - offset 8255 56f87410 - offset 8256 57030010 - offset 8257 570d8c10 - offset 8258 57181810 - offset 8259 5722a410 - offset 8260 572d3010 - offset 8261 5737bc10 - offset 8262 57424810 - offset 8263 574cd410 - offset 8264 57576010 - offset 8265 5761ec10 - offset 8266 576c7810 - offset 8267 57770410 - offset 8268 57819010 - offset 8269 578c1c10 - offset 8270 5796a810 - offset 8271 57a13410 - offset 8272 57abc010 - offset 8273 57b64c10 - offset 8274 57c0d810 - offset 8275 57cb6410 - offset 8276 57d5f010 - offset 8277 57e07c10 - offset 8278 57eb0810 - offset 8279 57f59410 - offset 8280 58082010 - offset 8281 5812ac10 - offset 8282 581d3810 - offset 8283 5827c410 - offset 8284 58325010 - offset 8285 583cdc10 - offset 8286 58476810 - offset 8287 5851f410 - offset 8288 585c8010 - offset 8289 58670c10 - offset 8290 58719810 - offset 8291 587c2410 - offset 8292 5886b010 - offset 8293 58913c10 - offset 8294 589bc810 - offset 8295 58a65410 - offset 8296 58b0e010 - offset 8297 58bb6c10 - offset 8298 58c5f810 - offset 8299 58d08410 - offset 8300 58db1010 - offset 8301 58e59c10 - offset 8302 58f02810 - offset 8303 58fab410 - offset 8304 59054010 - offset 8305 590fcc10 - offset 8306 591a5810 - offset 8307 5924e410 - offset 8308 592f7010 - offset 8309 5939fc10 - offset 8310 59448810 - offset 8311 594f1410 - offset 8312 5959a010 - offset 8313 59642c10 - offset 8314 596eb810 - offset 8315 59794410 - offset 8316 5983d010 - offset 8317 598e5c10 - offset 8318 5998e810 - offset 8319 59a37410 - offset 8320 59ae0010 - offset 8321 59b88c10 - offset 8322 59c31810 - offset 8323 59cda410 - offset 8324 59d83010 - offset 8325 59e2bc10 - offset 8326 59ed4810 - offset 8327 59f7d410 - offset 8328 5a026010 - offset 8329 5a0cec10 - offset 8330 5a177810 - offset 8331 5a220410 - offset 8332 5a2c9010 - offset 8333 5a371c10 - offset 8334 5a41a810 - offset 8335 5a4c3410 - offset 8336 5a56c010 - offset 8337 5a614c10 - offset 8338 5a6bd810 - offset 8339 5a766410 - offset 8340 5a80f010 - offset 8341 5a8b7c10 - offset 8342 5a960810 - offset 8343 5aa09410 - offset 8344 5aab2010 - offset 8345 5ab5ac10 - offset 8346 5ac03810 - offset 8347 5acac410 - offset 8348 5ad55010 - offset 8349 5adfdc10 - offset 8350 5aea6810 - offset 8351 5af4f410 - offset 8352 5aff8010 - offset 8353 5b0a0c10 - offset 8354 5b149810 - offset 8355 5b1f2410 - offset 8356 5b29b010 - offset 8357 5b343c10 - offset 8358 5b3ec810 - offset 8359 5b495410 - offset 8360 5b53e010 - offset 8361 5b5e6c10 - offset 8362 5b68f810 - offset 8363 5b738410 - offset 8364 5b7e1010 - offset 8365 5b889c10 - offset 8366 5b932810 - offset 8367 5b9db410 - offset 8368 5ba84010 - offset 8369 5bb2cc10 - offset 8370 5bc55810 - offset 8371 5bcfe410 - offset 8372 5bda7010 - offset 8373 5be4fc10 - offset 8374 5bef8810 - offset 8375 5bfa1410 - offset 8376 5c04a010 - offset 8377 5c0f2c10 - offset 8378 5c19b810 - offset 8379 5c244410 - offset 8380 5c2ed010 - offset 8381 5c395c10 - offset 8382 5c43e810 - offset 8383 5c4e7410 - offset 8384 5c590010 - offset 8385 5c638c10 - offset 8386 5c6e1810 - offset 8387 5c78a410 - offset 8388 5c833010 - offset 8389 5c8dbc10 - offset 8390 5c984810 - offset 8391 5ca2d410 - offset 8392 5cad6010 - offset 8393 5cb7ec10 - offset 8394 5cc27810 - offset 8395 5ccd0410 - offset 8396 5cd79010 - offset 8397 5ce21c10 - offset 8398 5ceca810 - offset 8399 5cf73410 - offset 8400 5d01c010 - offset 8401 5d0c4c10 - offset 8402 5d16d810 - offset 8403 5d216410 - offset 8404 5d2bf010 - offset 8405 5d367c10 - offset 8406 5d410810 - offset 8407 5d4b9410 - offset 8408 5d562010 - offset 8409 5d60ac10 - offset 8410 5d6b3810 - offset 8411 5d75c410 - offset 8412 5d805010 - offset 8413 5d8adc10 - offset 8414 5d956810 - offset 8415 5d9ff410 - offset 8416 5daa8010 - offset 8417 5db50c10 - offset 8418 5dbf9810 - offset 8419 5dca2410 - offset 8420 5dd4b010 - offset 8421 5ddf3c10 - offset 8422 5de9c810 - offset 8423 5df45410 - offset 8424 5dfee010 - offset 8425 5e096c10 - offset 8426 5e13f810 - offset 8427 5e1e8410 - offset 8428 5e291010 - offset 8429 5e339c10 - offset 8430 5e3e2810 - offset 8431 5e48b410 - offset 8432 5e534010 - offset 8433 5e5dcc10 - offset 8434 5e685810 - offset 8435 5e72e410 - offset 8436 5e7d7010 - offset 8437 5e87fc10 - offset 8438 5e928810 - offset 8439 5e9d1410 - offset 8440 5ea7a010 - offset 8441 5eb22c10 - offset 8442 5ebcb810 - offset 8443 5ec74410 - offset 8444 5ed1d010 - offset 8445 5edc5c10 - offset 8446 5ee6e810 - offset 8447 5ef17410 - offset 8448 5efc0010 - offset 8449 5f068c10 - offset 8450 5f111810 - offset 8451 5f1ba410 - offset 8452 5f263010 - offset 8453 5f30bc10 - offset 8454 5f3b4810 - offset 8455 5f45d410 - offset 8456 5f506010 - offset 8457 5f5aec10 - offset 8458 5f657810 - offset 8459 5f700410 - offset 8460 5f829010 - offset 8461 5f8d1c10 - offset 8462 5f97a810 - offset 8463 5fa23410 - offset 8464 5facc010 - offset 8465 5fb74c10 - offset 8466 5fc1d810 - offset 8467 5fcc6410 - offset 8468 5fd6f010 - offset 8469 5fe17c10 - offset 8470 5fec0810 - offset 8471 5ff69410 - offset 8472 60012010 - offset 8473 600bac10 - offset 8474 60163810 - offset 8475 6020c410 - offset 8476 602b5010 - offset 8477 6035dc10 - offset 8478 60406810 - offset 8479 604af410 - offset 8480 60558010 - offset 8481 60600c10 - offset 8482 606a9810 - offset 8483 60752410 - offset 8484 607fb010 - offset 8485 608a3c10 - offset 8486 6094c810 - offset 8487 609f5410 - offset 8488 60a9e010 - offset 8489 60b46c10 - offset 8490 60bef810 - offset 8491 60c98410 - offset 8492 60d41010 - offset 8493 60de9c10 - offset 8494 60e92810 - offset 8495 60f3b410 - offset 8496 60fe4010 - offset 8497 6108cc10 - offset 8498 61135810 - offset 8499 611de410 - offset 8500 61287010 - offset 8501 6132fc10 - offset 8502 613d8810 - offset 8503 61481410 - offset 8504 6152a010 - offset 8505 615d2c10 - offset 8506 6167b810 - offset 8507 61724410 - offset 8508 617cd010 - offset 8509 61875c10 - offset 8510 6191e810 - offset 8511 619c7410 - offset 8512 61a70010 - offset 8513 61b18c10 - offset 8514 61bc1810 - offset 8515 61c6a410 - offset 8516 61d13010 - offset 8517 61dbbc10 - offset 8518 61e64810 - offset 8519 61f0d410 - offset 8520 61fb6010 - offset 8521 6205ec10 - offset 8522 62107810 - offset 8523 621b0410 - offset 8524 62259010 - offset 8525 62301c10 - offset 8526 623aa810 - offset 8527 62453410 - offset 8528 624fc010 - offset 8529 625a4c10 - offset 8530 6264d810 - offset 8531 626f6410 - offset 8532 6279f010 - offset 8533 62847c10 - offset 8534 628f0810 - offset 8535 62999410 - offset 8536 62a42010 - offset 8537 62aeac10 - offset 8538 62b93810 - offset 8539 62c3c410 - offset 8540 62ce5010 - offset 8541 62d8dc10 - offset 8542 62e36810 - offset 8543 62edf410 - offset 8544 62f88010 - offset 8545 63030c10 - offset 8546 630d9810 - offset 8547 63182410 - offset 8548 6322b010 - offset 8549 632d3c10 - offset 8550 633fc810 - offset 8551 634a5410 - offset 8552 6354e010 - offset 8553 635f6c10 - offset 8554 6369f810 - offset 8555 63748410 - offset 8556 637f1010 - offset 8557 63899c10 - offset 8558 63942810 - offset 8559 639eb410 - offset 8560 63a94010 - offset 8561 63b3cc10 - offset 8562 63be5810 - offset 8563 63c8e410 - offset 8564 63d37010 - offset 8565 63ddfc10 - offset 8566 63e88810 - offset 8567 63f31410 - offset 8568 63fda010 - offset 8569 64082c10 - offset 8570 6412b810 - offset 8571 641d4410 - offset 8572 6427d010 - offset 8573 64325c10 - offset 8574 643ce810 - offset 8575 64477410 - offset 8576 64520010 - offset 8577 645c8c10 - offset 8578 64671810 - offset 8579 6471a410 - offset 8580 647c3010 - offset 8581 6486bc10 - offset 8582 64914810 - offset 8583 649bd410 - offset 8584 64a66010 - offset 8585 64b0ec10 - offset 8586 64bb7810 - offset 8587 64c60410 - offset 8588 64d09010 - offset 8589 64db1c10 - offset 8590 64e5a810 - offset 8591 64f03410 - offset 8592 64fac010 - offset 8593 65054c10 - offset 8594 650fd810 - offset 8595 651a6410 - offset 8596 6524f010 - offset 8597 652f7c10 - offset 8598 653a0810 - offset 8599 65449410 - offset 8600 654f2010 - offset 8601 6559ac10 - offset 8602 65643810 - offset 8603 656ec410 - offset 8604 65795010 - offset 8605 6583dc10 - offset 8606 658e6810 - offset 8607 6598f410 - offset 8608 65a38010 - offset 8609 65ae0c10 - offset 8610 65b89810 - offset 8611 65c32410 - offset 8612 65cdb010 - offset 8613 65d83c10 - offset 8614 65e2c810 - offset 8615 65ed5410 - offset 8616 65f7e010 - offset 8617 66026c10 - offset 8618 660cf810 - offset 8619 66178410 - offset 8620 66221010 - offset 8621 662c9c10 - offset 8622 66372810 - offset 8623 6641b410 - offset 8624 664c4010 - offset 8625 6656cc10 - offset 8626 66615810 - offset 8627 666be410 - offset 8628 66767010 - offset 8629 6680fc10 - offset 8630 668b8810 - offset 8631 66961410 - offset 8632 66a0a010 - offset 8633 66ab2c10 - offset 8634 66b5b810 - offset 8635 66c04410 - offset 8636 66cad010 - offset 8637 66d55c10 - offset 8638 66dfe810 - offset 8639 66ea7410 - offset 8640 66fd0010 - offset 8641 67078c10 - offset 8642 67121810 - offset 8643 671ca410 - offset 8644 67273010 - offset 8645 6731bc10 - offset 8646 673c4810 - offset 8647 6746d410 - offset 8648 67516010 - offset 8649 675bec10 - offset 8650 67667810 - offset 8651 67710410 - offset 8652 677b9010 - offset 8653 67861c10 - offset 8654 6790a810 - offset 8655 679b3410 - offset 8656 67a5c010 - offset 8657 67b04c10 - offset 8658 67bad810 - offset 8659 67c56410 - offset 8660 67cff010 - offset 8661 67da7c10 - offset 8662 67e50810 - offset 8663 67ef9410 - offset 8664 67fa2010 - offset 8665 6804ac10 - offset 8666 680f3810 - offset 8667 6819c410 - offset 8668 68245010 - offset 8669 682edc10 - offset 8670 68396810 - offset 8671 6843f410 - offset 8672 684e8010 - offset 8673 68590c10 - offset 8674 68639810 - offset 8675 686e2410 - offset 8676 6878b010 - offset 8677 68833c10 - offset 8678 688dc810 - offset 8679 68985410 - offset 8680 68a2e010 - offset 8681 68ad6c10 - offset 8682 68b7f810 - offset 8683 68c28410 - offset 8684 68cd1010 - offset 8685 68d79c10 - offset 8686 68e22810 - offset 8687 68ecb410 - offset 8688 68f74010 - offset 8689 6901cc10 - offset 8690 690c5810 - offset 8691 6916e410 - offset 8692 69217010 - offset 8693 692bfc10 - offset 8694 69368810 - offset 8695 69411410 - offset 8696 694ba010 - offset 8697 69562c10 - offset 8698 6960b810 - offset 8699 696b4410 - offset 8700 6975d010 - offset 8701 69805c10 - offset 8702 698ae810 - offset 8703 69957410 - offset 8704 69a00010 - offset 8705 69aa8c10 - offset 8706 69b51810 - offset 8707 69bfa410 - offset 8708 69ca3010 - offset 8709 69d4bc10 - offset 8710 69df4810 - offset 8711 69e9d410 - offset 8712 69f46010 - offset 8713 69feec10 - offset 8714 6a097810 - offset 8715 6a140410 - offset 8716 6a1e9010 - offset 8717 6a291c10 - offset 8718 6a33a810 - offset 8719 6a3e3410 - offset 8720 6a50c010 - offset 8721 6a5b4c10 - offset 8722 6a65d810 - offset 8723 6a706410 - offset 8724 6a7af010 - offset 8725 6a857c10 - offset 8726 6a900810 - offset 8727 6a9a9410 - offset 8728 6aa52010 - offset 8729 6aafac10 - offset 8730 6aba3810 - offset 8731 6ac4c410 - offset 8732 6acf5010 - offset 8733 6ad9dc10 - offset 8734 6ae46810 - offset 8735 6aeef410 - offset 8736 6af98010 - offset 8737 6b040c10 - offset 8738 6b0e9810 - offset 8739 6b192410 - offset 8740 6b23b010 - offset 8741 6b2e3c10 - offset 8742 6b38c810 - offset 8743 6b435410 - offset 8744 6b4de010 - offset 8745 6b586c10 - offset 8746 6b62f810 - offset 8747 6b6d8410 - offset 8748 6b781010 - offset 8749 6b829c10 - offset 8750 6b8d2810 - offset 8751 6b97b410 - offset 8752 6ba24010 - offset 8753 6baccc10 - offset 8754 6bb75810 - offset 8755 6bc1e410 - offset 8756 6bcc7010 - offset 8757 6bd6fc10 - offset 8758 6be18810 - offset 8759 6bec1410 - offset 8760 6bf6a010 - offset 8761 6c012c10 - offset 8762 6c0bb810 - offset 8763 6c164410 - offset 8764 6c20d010 - offset 8765 6c2b5c10 - offset 8766 6c35e810 - offset 8767 6c407410 - offset 8768 6c4b0010 - offset 8769 6c558c10 - offset 8770 6c601810 - offset 8771 6c6aa410 - offset 8772 6c753010 - offset 8773 6c7fbc10 - offset 8774 6c8a4810 - offset 8775 6c94d410 - offset 8776 6c9f6010 - offset 8777 6ca9ec10 - offset 8778 6cb47810 - offset 8779 6cbf0410 - offset 8780 6cc99010 - offset 8781 6cd41c10 - offset 8782 6cdea810 - offset 8783 6ce93410 - offset 8784 6cf3c010 - offset 8785 6cfe4c10 - offset 8786 6d08d810 - offset 8787 6d136410 - offset 8788 6d1df010 - offset 8789 6d287c10 - offset 8790 6d330810 - offset 8791 6d3d9410 - offset 8792 6d482010 - offset 8793 6d52ac10 - offset 8794 6d5d3810 - offset 8795 6d67c410 - offset 8796 6d725010 - offset 8797 6d7cdc10 - offset 8798 6d876810 - offset 8799 6d91f410 - offset 8800 6d9c8010 - offset 8801 6da70c10 - offset 8802 6db19810 - offset 8803 6dbc2410 - offset 8804 6dc6b010 - offset 8805 6dd13c10 - offset 8806 6ddbc810 - offset 8807 6de65410 - offset 8808 6df0e010 - offset 8809 6dfb6c10 - offset 8810 6e0df810 - offset 8811 6e188410 - offset 8812 6e231010 - offset 8813 6e2d9c10 - offset 8814 6e382810 - offset 8815 6e42b410 - offset 8816 6e4d4010 - offset 8817 6e57cc10 - offset 8818 6e625810 - offset 8819 6e6ce410 - offset 8820 6e777010 - offset 8821 6e81fc10 - offset 8822 6e8c8810 - offset 8823 6e971410 - offset 8824 6ea1a010 - offset 8825 6eac2c10 - offset 8826 6eb6b810 - offset 8827 6ec14410 - offset 8828 6ecbd010 - offset 8829 6ed65c10 - offset 8830 6ee0e810 - offset 8831 6eeb7410 - offset 8832 6ef60010 - offset 8833 6f008c10 - offset 8834 6f0b1810 - offset 8835 6f15a410 - offset 8836 6f203010 - offset 8837 6f2abc10 - offset 8838 6f354810 - offset 8839 6f3fd410 - offset 8840 6f4a6010 - offset 8841 6f54ec10 - offset 8842 6f5f7810 - offset 8843 6f6a0410 - offset 8844 6f749010 - offset 8845 6f7f1c10 - offset 8846 6f89a810 - offset 8847 6f943410 - offset 8848 6f9ec010 - offset 8849 6fa94c10 - offset 8850 6fb3d810 - offset 8851 6fbe6410 - offset 8852 6fc8f010 - offset 8853 6fd37c10 - offset 8854 6fde0810 - offset 8855 6fe89410 - offset 8856 6ff32010 - offset 8857 6ffdac10 - offset 8858 70083810 - offset 8859 7012c410 - offset 8860 701d5010 - offset 8861 7027dc10 - offset 8862 70326810 - offset 8863 703cf410 - offset 8864 70478010 - offset 8865 70520c10 - offset 8866 705c9810 - offset 8867 70672410 - offset 8868 7071b010 - offset 8869 707c3c10 - offset 8870 7086c810 - offset 8871 70915410 - offset 8872 709be010 - offset 8873 70a66c10 - offset 8874 70b0f810 - offset 8875 70bb8410 - offset 8876 70c61010 - offset 8877 70d09c10 - offset 8878 70db2810 - offset 8879 70e5b410 - offset 8880 70f04010 - offset 8881 70facc10 - offset 8882 71055810 - offset 8883 710fe410 - offset 8884 711a7010 - offset 8885 7124fc10 - offset 8886 712f8810 - offset 8887 713a1410 - offset 8888 7144a010 - offset 8889 714f2c10 - offset 8890 7159b810 - offset 8891 71644410 - offset 8892 716ed010 - offset 8893 71795c10 - offset 8894 7183e810 - offset 8895 718e7410 - offset 8896 71990010 - offset 8897 71a38c10 - offset 8898 71ae1810 - offset 8899 71b8a410 - offset 8900 71cb3010 - offset 8901 71d5bc10 - offset 8902 71e04810 - offset 8903 71ead410 - offset 8904 71f56010 - offset 8905 71ffec10 - offset 8906 720a7810 - offset 8907 72150410 - offset 8908 721f9010 - offset 8909 722a1c10 - offset 8910 7234a810 - offset 8911 723f3410 - offset 8912 7249c010 - offset 8913 72544c10 - offset 8914 725ed810 - offset 8915 72696410 - offset 8916 7273f010 - offset 8917 727e7c10 - offset 8918 72890810 - offset 8919 72939410 - offset 8920 729e2010 - offset 8921 72a8ac10 - offset 8922 72b33810 - offset 8923 72bdc410 - offset 8924 72c85010 - offset 8925 72d2dc10 - offset 8926 72dd6810 - offset 8927 72e7f410 - offset 8928 72f28010 - offset 8929 72fd0c10 - offset 8930 73079810 - offset 8931 73122410 - offset 8932 731cb010 - offset 8933 73273c10 - offset 8934 7331c810 - offset 8935 733c5410 - offset 8936 7346e010 - offset 8937 73516c10 - offset 8938 735bf810 - offset 8939 73668410 - offset 8940 73711010 - offset 8941 737b9c10 - offset 8942 73862810 - offset 8943 7390b410 - offset 8944 739b4010 - offset 8945 73a5cc10 - offset 8946 73b05810 - offset 8947 73bae410 - offset 8948 73c57010 - offset 8949 73cffc10 - offset 8950 73da8810 - offset 8951 73e51410 - offset 8952 73efa010 - offset 8953 73fa2c10 - offset 8954 7404b810 - offset 8955 740f4410 - offset 8956 7419d010 - offset 8957 74245c10 - offset 8958 742ee810 - offset 8959 74397410 - offset 8960 74440010 - offset 8961 744e8c10 - offset 8962 74591810 - offset 8963 7463a410 - offset 8964 746e3010 - offset 8965 7478bc10 - offset 8966 74834810 - offset 8967 748dd410 - offset 8968 74986010 - offset 8969 74a2ec10 - offset 8970 74ad7810 - offset 8971 74b80410 - offset 8972 74c29010 - offset 8973 74cd1c10 - offset 8974 74d7a810 - offset 8975 74e23410 - offset 8976 74ecc010 - offset 8977 74f74c10 - offset 8978 7501d810 - offset 8979 750c6410 - offset 8980 7516f010 - offset 8981 75217c10 - offset 8982 752c0810 - offset 8983 75369410 - offset 8984 75412010 - offset 8985 754bac10 - offset 8986 75563810 - offset 8987 7560c410 - offset 8988 756b5010 - offset 8989 7575dc10 - offset 8990 75886810 - offset 8991 7592f410 - offset 8992 759d8010 - offset 8993 75a80c10 - offset 8994 75b29810 - offset 8995 75bd2410 - offset 8996 75c7b010 - offset 8997 75d23c10 - offset 8998 75dcc810 - offset 8999 75e75410 - offset 9000 75f1e010 - offset 9001 75fc6c10 - offset 9002 7606f810 - offset 9003 76118410 - offset 9004 761c1010 - offset 9005 76269c10 - offset 9006 76312810 - offset 9007 763bb410 - offset 9008 76464010 - offset 9009 7650cc10 - offset 9010 765b5810 - offset 9011 7665e410 - offset 9012 76707010 - offset 9013 767afc10 - offset 9014 76858810 - offset 9015 76901410 - offset 9016 769aa010 - offset 9017 76a52c10 - offset 9018 76afb810 - offset 9019 76ba4410 - offset 9020 76c4d010 - offset 9021 76cf5c10 - offset 9022 76d9e810 - offset 9023 76e47410 - offset 9024 76ef0010 - offset 9025 76f98c10 - offset 9026 77041810 - offset 9027 770ea410 - offset 9028 77193010 - offset 9029 7723bc10 - offset 9030 772e4810 - offset 9031 7738d410 - offset 9032 77436010 - offset 9033 774dec10 - offset 9034 77587810 - offset 9035 77630410 - offset 9036 776d9010 - offset 9037 77781c10 - offset 9038 7782a810 - offset 9039 778d3410 - offset 9040 7797c010 - offset 9041 77a24c10 - offset 9042 77acd810 - offset 9043 77b76410 - offset 9044 77c1f010 - offset 9045 77cc7c10 - offset 9046 77d70810 - offset 9047 77e19410 - offset 9048 77ec2010 - offset 9049 77f6ac10 - offset 9050 78013810 - offset 9051 780bc410 - offset 9052 78165010 - offset 9053 7820dc10 - offset 9054 782b6810 - offset 9055 7835f410 - offset 9056 78408010 - offset 9057 784b0c10 - offset 9058 78559810 - offset 9059 78602410 - offset 9060 786ab010 - offset 9061 78753c10 - offset 9062 787fc810 - offset 9063 788a5410 - offset 9064 7894e010 - offset 9065 789f6c10 - offset 9066 78a9f810 - offset 9067 78b48410 - offset 9068 78bf1010 - offset 9069 78c99c10 - offset 9070 78d42810 - offset 9071 78deb410 - offset 9072 78e94010 - offset 9073 78f3cc10 - offset 9074 78fe5810 - offset 9075 7908e410 - offset 9076 79137010 - offset 9077 791dfc10 - offset 9078 79288810 - offset 9079 79331410 - offset 9080 7945a010 - offset 9081 79502c10 - offset 9082 795ab810 - offset 9083 79654410 - offset 9084 796fd010 - offset 9085 797a5c10 - track - track header - version 0 - flags 15 - creation_time 3059582186 - modification_time 3059582186 - track_id 2 - reserved1 0 - duration 9097578 - reserved2 - layer 0 - alternate_group 0 - volume 0.996094 - reserved3 0 - matrix nan nan nan nan nan nan nan nan nan - track_width 0.000000 - track_height 0.000000 - edit atom (edts) - edit list (elst) - version 0 - flags 0 - total_entries 1 - edit list table - duration 9097578 - time 0 - rate 0.000000 - media - media header - version 0 - flags 0 - creation_time 3059582186 - modification_time 3059582186 - time_scale 44100 - duration 13373440 - language 0 - quality 0 - handler reference (hdlr) - version 0 - flags 0 - component_type mhlr - component_subtype soun - component_name Linux Sound Media Handler - media info - is_audio 1 - is_video 0 - sound media header - version 0 - flags 0 - balance 0 - reserved 0 - handler reference (hdlr) - version 0 - flags 0 - component_type dhlr - component_subtype alis - component_name Linux Alias Data Handler - data information (dinf) - data reference (dref) - version 0 - flags 0 - data reference table (dref) - type alis - version 0 - flags 1 - data - sample table - sample description - version 0 - flags 0 - total_entries 1 - format twos - reserved - data_reference 1 - version 0 - revision 0 - vendor lnux - channels 2 - sample_size 16 - compression_id 0 - packet_size 0 - sample_rate 44100.000000 - time to sample - version 0 - flags 0 - total_entries 1 - count 13373440 duration 1 - sync sample - version 0 - flags 0 - total_entries 0 - sample to chunk - version 0 - flags 0 - total_entries 2 - chunk 1 samples 131072 id 1 - chunk 103 samples 4096 id 1 - sample size - version 0 - flags 0 - sample_size 1 - total_entries 13373440 - chunk offset - version 0 - flags 0 - total_entries 103 - offset 0 3b53810 - offset 1 708f810 - offset 2 ac63010 - offset 3 e836810 - offset 4 1240a010 - offset 5 15fdd810 - offset 6 19bb1010 - offset 7 1d784810 - offset 8 21358010 - offset 9 24f2b810 - offset 10 28aff010 - offset 11 2c6d2810 - offset 12 2fc0e810 - offset 13 337e2010 - offset 14 373b5810 - offset 15 3af89010 - offset 16 3eb5c810 - offset 17 42730010 - offset 18 46303810 - offset 19 49ed7010 - offset 20 4daaa810 - offset 21 5167e010 - offset 22 54bba010 - offset 23 5878d810 - offset 24 5c361010 - offset 25 5ff34810 - offset 26 63b08010 - offset 27 676db810 - offset 28 6b2af010 - offset 29 6ee82810 - offset 30 72a56010 - offset 31 76629810 - offset 32 7a1fd010 - offset 33 7d739010 - offset 34 8130c810 - offset 35 84ee0010 - offset 36 88ab3810 - offset 37 8c687010 - offset 38 9025a810 - offset 39 93e2e010 - offset 40 97a01810 - offset 41 9b5d5010 - offset 42 9f1a8810 - offset 43 a26e4810 - offset 44 a62b8010 - offset 45 a9e8b810 - offset 46 ada5f010 - offset 47 b1632810 - offset 48 b5206010 - offset 49 b8dd9810 - offset 50 bc9ad010 - offset 51 c0580810 - offset 52 c4154010 - offset 53 c7d27810 - offset 54 cb263810 - offset 55 cee37010 - offset 56 d2a0a810 - offset 57 d65de010 - offset 58 da1b1810 - offset 59 ddd85010 - offset 60 e1958810 - offset 61 e552c010 - offset 62 e90ff810 - offset 63 eccd3010 - offset 64 f08a6810 - offset 65 f3de2810 - offset 66 f79b6010 - offset 67 fb589810 - offset 68 ff15d010 - offset 69 2d30810 - offset 70 6904010 - offset 71 a4d7810 - offset 72 e0ab010 - offset 73 11c7e810 - offset 74 15852010 - offset 75 18d8e010 - offset 76 1c961810 - offset 77 20535010 - offset 78 24108810 - offset 79 27cdc010 - offset 80 2b8af810 - offset 81 2f483010 - offset 82 33056810 - offset 83 36c2a010 - offset 84 3a7fd810 - offset 85 3e3d1010 - offset 86 4190d010 - offset 87 454e0810 - offset 88 490b4010 - offset 89 4cc87810 - offset 90 5085b010 - offset 91 5442e810 - offset 92 58002010 - offset 93 5bbd5810 - offset 94 5f7a9010 - offset 95 6337c810 - offset 96 66f50010 - offset 97 6a48c010 - offset 98 6e05f810 - offset 99 71c33010 - offset 100 75806810 - offset 101 793da010 - offset 102 7984e810 - color table - seed 0 - flags 0 - size 0 - colors --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/dechunk.c bcast-2000c-mf3/quicktime/dechunk.c *** bcast-2000c/quicktime/dechunk.c Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/dechunk.c Mon Oct 1 05:16:38 2001 *************** *** 7,10 **** --- 7,11 ---- printf(" Movies containing rgb frames are written as ppm images.\n"); exit(1); + return 0; } diff -C2 -r -N bcast-2000c/quicktime/decore2/CVS/Entries bcast-2000c-mf3/quicktime/decore2/CVS/Entries *** bcast-2000c/quicktime/decore2/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/CVS/Entries Fri Dec 7 14:28:28 2001 *************** *** 0 **** --- 1,5 ---- + /divxlicense.txt/1.1/Fri Nov 30 01:09:03 2001// + /gpl.txt/1.1/Fri Nov 30 01:09:03 2001// + /readme.txt/1.1/Fri Nov 30 01:09:03 2001// + D/src//// + D/build//// diff -C2 -r -N bcast-2000c/quicktime/decore2/CVS/Repository bcast-2000c-mf3/quicktime/decore2/CVS/Repository *** bcast-2000c/quicktime/decore2/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/CVS/Repository Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + quicktime/decore2 diff -C2 -r -N bcast-2000c/quicktime/decore2/CVS/Root bcast-2000c-mf3/quicktime/decore2/CVS/Root *** bcast-2000c/quicktime/decore2/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/CVS/Root Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/decore2/build/CVS/Entries bcast-2000c-mf3/quicktime/decore2/build/CVS/Entries *** bcast-2000c/quicktime/decore2/build/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/build/CVS/Entries Fri Dec 7 14:28:23 2001 *************** *** 0 **** --- 1 ---- + D diff -C2 -r -N bcast-2000c/quicktime/decore2/build/CVS/Repository bcast-2000c-mf3/quicktime/decore2/build/CVS/Repository *** bcast-2000c/quicktime/decore2/build/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/build/CVS/Repository Fri Dec 7 14:28:23 2001 *************** *** 0 **** --- 1 ---- + quicktime/decore2/build diff -C2 -r -N bcast-2000c/quicktime/decore2/build/CVS/Root bcast-2000c-mf3/quicktime/decore2/build/CVS/Root *** bcast-2000c/quicktime/decore2/build/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/build/CVS/Root Fri Dec 7 14:28:23 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/decore2/divxlicense.txt bcast-2000c-mf3/quicktime/decore2/divxlicense.txt *** bcast-2000c/quicktime/decore2/divxlicense.txt Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/divxlicense.txt Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,45 ---- + DivX Open License + ================= + Version 2.1 + + This version of the DivX Open License supercedes any prior versions. + + Copyright (C) 2001 Project Mayo. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + + Provided below is our open source license agreement ("License") under which we provide the Codec (defined below) to you free of charge. Please read it carefully. + + BY USING, COPYING, MODIFYING, OR DISTRIBUTING THE CODEC OR A LARGER WORK (DEFINED BELOW), YOU INDICATE YOUR ACCEPTANCE OF THIS LICENSE TO DO SO, AND ALL ITS TERMS AND CONDITIONS. + + For purposes of this Agreement, the "Codec" shall mean the OpenDivX compression/decompression software provided to you by Project Mayo ("Project Mayo") and any derivative work thereof, that is to say, a work containing the Codec or a portion of it, either verbatim or with modifications and/or translated into another language. A "Larger Work" shall mean any work including or integrating the Codec as an object file or linked library. "Encoded Content" shall mean any multimedia content encoded as output of the Codec, even if that Codec is integrated into a Larger Work. + + Permission is granted to you to use the Codec for any purpose, and to copy it, alter it and redistribute it, subject to the following: + + 1. You may modify your copy or copies of the Codec or any portion of it, provided that you cause the modified files to carry prominent notices stating that you changed the files and the date of any such change. + + 2. You may copy, distribute, display and transmit the Codec's source code, in any medium, subject to the following: + + a. You must conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Codec a copy of this License along with the Codec. + + b. You must cause any Codec that you distribute or publish to be licensed as a whole at no charge to all third parties under the terms of this License. However, you may charge a fee for the physical act of transferring a copy of the Codec, and you may at your option offer warranty protection in exchange for a fee. + + c. In each instance in which you attribute ownership or authorship of the Codec you will include an acknowledgement in a location viewable to users of the Codec as follows: "This product includes software developed by or derived from software developed by Project Mayo." In any event, the origin of the Codec must not be misrepresented; you must not claim sole authorship in the Codec. + + d. Each time you redistribute the Codec, the recipient automatically receives a license from Project Mayo to copy, distribute or modify the Codec subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. + + 3. You may copy and distribute the Codec in object code or executable form under the terms of Section 2, provided that you also accompany it with the complete machine-readable source code, or make such source-code freely and publicly available. + + 4. You may incorporate the Codec into a Larger Work and distribute that Larger Work under terms of your choice, provided that: + + a. The terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + + b. You include an acknowledgement in a location viewable to users of a distribution of a Larger Work as follows: "This product includes software developed by or derived from software developed by Project Mayo." + + 5. Any Codec or Larger Works created by you must conform to the MPEG-4 Video Standard, however modules of the Codec that do not derive from MoMuSys can be used and incorporated into a non-MPEG-4 conforming work that otherwise complies with this license. + + 6. Except as provided in section 7 below, you must receive prior express written permission from Project Mayo before you use the names "DivX;-)" or "DivX" (or any names incorporating those names) or the file extensions ".divx" or ".div" to promote or endorse any products derived from the Codec, including, but not limited to Larger Works. + + 7. You must use the ".divx" file extension in any Encoded Content, when tools for this purpose are readily available. For Encoded Content used for a commercial purpose, you must prominently display the "Encoded in DivX" logo on the package of any Encoded Content in a manner immediately visible to viewers and you must include the "Encoded in DivX" video logo at the beginning of any Encoded Content when the means for such display are reasonably available. + + 8. The Codec contains copyrighted materials that are proprietary to Project Mayo, and no rights are granted to you except as expressly provided herein. You may not copy, modify, sublicense, display, distribute or transmit the Codec except as expressly provided under this License. Any act or attempt to copy, modify, sublicense, display, distribute or transmit the Codec other than as permitted herein will automatically terminate your rights under this License. However, parties who have received copies from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + + THIS CODEC IS PROVIDED BY PROJECT MAYO AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL PROJECT MAYO OR ITS CONTRIBUTORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -C2 -r -N bcast-2000c/quicktime/decore2/gpl.txt bcast-2000c-mf3/quicktime/decore2/gpl.txt *** bcast-2000c/quicktime/decore2/gpl.txt Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/gpl.txt Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,340 ---- + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Library General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, and + (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the + Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any + later version", you have the option of following the terms and conditions + either of that version or of any later version published by the Free + Software Foundation. If the Program does not specify a version number of + this License, you may choose any version ever published by the Free Software + Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, the commands you use may + be called something other than `show w' and `show c'; they could even be + mouse-clicks or menu items--whatever suits your program. + + You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the + library. If this is what you want to do, use the GNU Library General + Public License instead of this License. diff -C2 -r -N bcast-2000c/quicktime/decore2/readme.txt bcast-2000c-mf3/quicktime/decore2/readme.txt *** bcast-2000c/quicktime/decore2/readme.txt Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/readme.txt Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,74 ---- + decore2 + + unless otherwise stated, all code is licensed under gpl (refer to gpl.txt) + (c)2001 peter ross + + + stuff, etc. + ----------- + - only supports iframe decoding. handles a subset of the mpeg-4 format + (but works with xvid & divx4.02 encoded video) + - uyvy iframe decoding on my machine is 42 fps; compared to 37 using divx4.02 + - low level modules (quant,idct,transfer) are taken directly from encore2 + - higher level structures (MACROBLOCK, VECTOR, IMAGE) are a bit different + + + api + --- + decore2 is simular to encore2: create, decode and destroy. + + + code overview + ------------- + decoding steps for a single frame are as follows: + + decoder_decode() + { + read VOL header (continue if not found) + read VOP header + + if I_VOP, call decoder_iframe() + if P_VOP, call decoder_iframe() + if N_VOP, swap ref & cur image pointer (N_VOP is when "vop_coded==0") + + color conversion (yuv->whatever) + + swap ref & cur image pointers + } + + + + decoder_iframe() + { + for each macroblock + + read in mb header stuff (quant, cbp) + + for each block + + read dc coeff + dc prediction & ac_direction + + if block coded + read ac coeffs + + ac prediction (& backup for future prediction) + + dequant + idct + transfer 16bit to 8bit + } + + + + decoder_pframe() + { + for each macroblock + + read in mb header stuff (quant, cbp, mvs) + motion prediction + + for each block + + ... todo + } diff -C2 -r -N bcast-2000c/quicktime/decore2/src/CVS/Entries bcast-2000c-mf3/quicktime/decore2/src/CVS/Entries *** bcast-2000c/quicktime/decore2/src/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/CVS/Entries Mon Dec 3 14:48:35 2001 *************** *** 0 **** --- 1,23 ---- + /bitstream.c/1.1/Fri Nov 30 01:09:03 2001// + /colorspace.c/1.1/Fri Nov 30 01:09:03 2001// + /dec_bitstream.h/1.1/Fri Nov 30 01:09:03 2001// + /dec_bitstream.h.bak/1.1/Fri Nov 30 01:09:03 2001// + /dec_colorspace.h/1.1/Fri Nov 30 01:09:03 2001// + /dec_dct.h/1.1/Fri Nov 30 01:09:03 2001// + /dec_image.h/1.1/Fri Nov 30 01:09:03 2001// + /dec_mbcoding.h/1.1/Fri Nov 30 01:09:03 2001// + /dec_mbprediction.h/1.1/Fri Nov 30 01:09:03 2001// + /dec_portab.h/1.1/Fri Nov 30 01:09:03 2001// + /dec_quantize.h/1.1/Fri Nov 30 01:09:03 2001// + /dec_transfer.h/1.1/Fri Nov 30 01:09:03 2001// + /decoder.c/1.1/Fri Nov 30 01:09:03 2001// + /decoder.h/1.1/Fri Nov 30 01:09:03 2001// + /decore2.c/1.1/Fri Nov 30 01:09:03 2001// + /decore2.h/1.1/Fri Nov 30 01:09:03 2001// + /idct.c/1.1/Fri Nov 30 01:09:03 2001// + /image.c/1.1/Fri Nov 30 01:09:03 2001// + /mbcoding.c/1.1/Fri Nov 30 01:09:03 2001// + /mbprediction.c/1.1/Fri Nov 30 01:09:03 2001// + /quantize.c/1.1/Fri Nov 30 01:09:03 2001// + /transfer.c/1.1/Fri Nov 30 01:09:03 2001// + D/intel_mmx//// diff -C2 -r -N bcast-2000c/quicktime/decore2/src/CVS/Repository bcast-2000c-mf3/quicktime/decore2/src/CVS/Repository *** bcast-2000c/quicktime/decore2/src/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/CVS/Repository Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + quicktime/decore2/src diff -C2 -r -N bcast-2000c/quicktime/decore2/src/CVS/Root bcast-2000c-mf3/quicktime/decore2/src/CVS/Root *** bcast-2000c/quicktime/decore2/src/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/CVS/Root Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/decore2/src/bitstream.c bcast-2000c-mf3/quicktime/decore2/src/bitstream.c *** bcast-2000c/quicktime/decore2/src/bitstream.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/bitstream.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,252 ---- + + #include "dec_portab.h" + + //#include "header.h" + #include "dec_bitstream.h" + #include "decoder.h" + + + #define VO_START_CODE 0x8 + #define VOL_START_CODE 0x12 + #define VOP_START_CODE 0x1b6 + + #define SHAPE_RECTANGLE 0 + + + + + #define MARKER() bs_skip(bs, 1) + + + static int __inline log2bin(int value) + { + int n = 0; + while (value) + { + value >>= 1; + n++; + } + return n; + } + + + /* + video object layer + */ + + int bs_vol(BITSTREAM * bs, DECODER * dec) + { + uint32_t vol_ver_id; + uint32_t shape; + uint32_t time_inc_resolution; + uint32_t width; + uint32_t height; + + + bs_bytealign(bs); + + DEBUGI("***vo_startcode", bs_show(bs, 27)); + + if (bs_show(bs,27) == VO_START_CODE) + { + bs_skip(bs, 27); // vo_start_code + bs_skip(bs, 5); // vo_id + + if (bs_show(bs, 28) == VOL_START_CODE) + { + bs_skip(bs, 28); // vol_start_code + bs_skip(bs, 4); // vol_id + + bs_skip(bs, 1); // random_accessible_vol + bs_skip(bs, 8); // video_object_type_indication + + // ? fine granularity scalability + + if (bs_get1(bs)) // is_object_layer_identified + { + vol_ver_id = bs_get(bs,4); // vol_ver_id + bs_skip(bs, 3); // vol_ver_priority + } + else + { + vol_ver_id = 1; + } + DEBUGI("vol_ver_id", vol_ver_id); + + bs_skip(bs, 4); // aspect_ratio_info + // todo: extended_PAR + + if (bs_get1(bs)) // vol_control_parameters + { + // todo + } + + shape = bs_get(bs, 2); // video_object_layer_shape + DEBUGI("shape", shape); + // todo: grayscale shape extension + + MARKER(); + + time_inc_resolution = bs_get(bs, 16); // time_increment_resolution + dec->time_inc_bits = log2bin(time_inc_resolution); + if (dec->time_inc_bits == 0) { + dec->time_inc_bits = 1; + } + DEBUGI("tinc res", time_inc_resolution); + + MARKER(); + + if (bs_get1(bs)) // fixed_vop_rate + { + bs_skip(bs, dec->time_inc_bits); // fixed_time_increment + } + + if (shape == SHAPE_RECTANGLE) + { + MARKER(); + width = bs_get(bs, 13); + DEBUGI("width", width); + MARKER(); + height = bs_get(bs, 13); + DEBUGI("height", height); + MARKER(); + // not sure what to do with width/height + // (verify against those supplied) + // or should at every VOL realloc the buffers??? + } + + bs_skip(bs, 1); // interlaced + bs_skip(bs, 1); // obmc_disable + bs_skip(bs, (vol_ver_id == 1 ? 1 : 2)); // sprite_enable + // todo: sprite enabled + + if (bs_get1(bs)) // not_8_bit + { + dec->quant_bits = bs_get(bs, 4); // quant_precision + bs_skip(bs, 4); // bits_per_pixel + } + else + { + dec->quant_bits = 5; + } + + dec->quant_type = bs_get1(bs); // quant_type + DEBUGI("quant_type", dec->quant_type); + + if (dec->quant_type) + { + bs_skip(bs, 1); // load_intra_quant_mat + bs_skip(bs, 1); // load_inter_quant_mat + //todo + } + + // todo: grayscale stuff + + if (vol_ver_id != 1) + { + bs_skip(bs, 1); // quarter_sample + //todo + } + + bs_skip(bs, 1); // complexity_estimation_disable + // todo: complexity est header + + bs_skip(bs, 1); // resync_marker_disable + bs_skip(bs, 1); // data_partioned + // todo: rvlc + + if (bs_get1(bs)) // scalability + { + // todo: + } + return 0; + } + } + return -1; + } + + + + /* + video object plane + returns coding_type + -1 for error + */ + + int bs_vop(BITSTREAM * bs, DECODER * dec, uint32_t * rounding, uint32_t * quant, uint32_t * fcode) + { + uint32_t coding_type; + + bs_bytealign(bs); + + // bs_skip(bs, 4); + DEBUGI("***vop_startcode", bs_show(bs, 32)); + + if (bs_show(bs, 32) == VOP_START_CODE) + { + bs_skip(bs, 32); // vop_start_code + + coding_type = bs_get(bs, 2); // vop_coding_type + // todo: bvops, svops + DEBUGI("coding_type", coding_type); + + while (bs_get1(bs) == 1) ; // time_base + + MARKER(); + + bs_skip(bs, dec->time_inc_bits); // vop_time_increment + + MARKER(); + + if (bs_get1(bs)) // vop_coded + { + if (coding_type != I_VOP) + { + *rounding = bs_get1(bs); // rounding_type + DEBUGI("rounding", *rounding); + } + + bs_skip(bs, 3); // todo: intra_dc_vlc_threshold + + *quant = bs_get(bs, dec->quant_bits); // vop_quant + DEBUGI("quant", *quant); + + if (coding_type != I_VOP) + { + *fcode = bs_get(bs, 3); // fcode_forward + DEBUGI("fcode", *fcode); + } + } + else + { + return N_VOP; + } + + // todo: handle case where vop isnt coded + + return coding_type; + } + return -1; + } + + + + + + + + void bs_init(BITSTREAM * const bs, void * const bitstream) + { + bs->head = bitstream; + bs->buf = (((uint64_t)bs->head[0]) << 56) | + (((uint64_t)bs->head[1]) << 48) | + (((uint64_t)bs->head[2]) << 40) | + (((uint64_t)bs->head[3]) << 32) | + (((uint64_t)bs->head[4]) << 24) | + (((uint64_t)bs->head[5]) << 16) | + (((uint64_t)bs->head[6]) << 8) | + ((uint64_t)bs->head[7]); + bs->pos = 0; + bs->head += 8; + } + diff -C2 -r -N bcast-2000c/quicktime/decore2/src/colorspace.c bcast-2000c-mf3/quicktime/decore2/src/colorspace.c *** bcast-2000c/quicktime/decore2/src/colorspace.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/colorspace.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,436 ---- + /*---[start projectmayo code]------------------------------------------ */ + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * Andrea Graziani + * + * DivX Advanced Research Center + * + **/ + + + #include "dec_colorspace.h" + + + + + + /*** + + / 2568 0 3343 \ + | 2568 -0c92 -1a1e | / 65536 * 8 + \ 2568 40cf 0 / + + Y -= 16; + U -= 128; + V -= 128; + + R = (0x2568*Y + 0x0000*V + 0x3343*U) / 0x2000; + G = (0x2568*Y - 0x0c92*V - 0x1a1e*U) / 0x2000; + B = (0x2568*Y + 0x40cf*V + 0x0000*U) / 0x2000; + + R = R>255 ? 255 : R; + R = R<0 ? 0 : R; + + G = G>255 ? 255 : G; + G = G<0 ? 0 : G; + + B = B>255 ? 255 : B; + B = B<0 ? 0 : B; + + ***/ + + #define _S(a) (a)>255 ? 255 : (a)<0 ? 0 : (a) + + #define _R(y,u,v) (0x2568*(y) + 0x3343*(u)) /0x2000 + #define _G(y,u,v) (0x2568*(y) - 0x0c92*(v) - 0x1a1e*(u)) /0x2000 + #define _B(y,u,v) (0x2568*(y) + 0x40cf*(v)) /0x2000 + + struct lookuptable + { + int32_t m_plY[256]; + int32_t m_plRV[256]; + int32_t m_plGV[256]; + int32_t m_plGU[256]; + int32_t m_plBU[256]; + }; + static struct lookuptable lut; + + + void init_yuv2rgb() + { + int i; + for(i=0; i<256; i++) + { + if(i>=16) + if(i>240) + lut.m_plY[i]=lut.m_plY[240]; + else + lut.m_plY[i]=298*(i-16); + else + lut.m_plY[i]=0; + if((i>=16) && (i<=240)) + { + lut.m_plRV[i]=408*(i-128); + lut.m_plGV[i]=-208*(i-128); + lut.m_plGU[i]=-100*(i-128); + lut.m_plBU[i]=517*(i-128); + } + else if(i<16) + { + lut.m_plRV[i]=408*(16-128); + lut.m_plGV[i]=-208*(16-128); + lut.m_plGU[i]=-100*(16-128); + lut.m_plBU[i]=517*(16-128); + } + else + { + lut.m_plRV[i]=lut.m_plRV[240]; + lut.m_plGV[i]=lut.m_plGV[240]; + lut.m_plGU[i]=lut.m_plGU[240]; + lut.m_plBU[i]=lut.m_plBU[240]; + } + } + } + + /* all stride values are in _pixels_ */ + + void YV12toYV12_generic(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) + { + int i; + //printf("YV12toYV12_generic 1 %d %d %d\n", width_y, stride_y, height_y); + for(i = 0; i < height_y; i++) + { + memcpy(puc_out + i * _stride_out, + puc_y + i * stride_y, + _stride_out); + } + + //printf("YV12toYV12_generic 1 %d %d %d\n", width_y, stride_y, height_y); + for(i = 0; i < height_y / 2; i++) + { + memcpy(puc_out + _stride_out * height_y + i * _stride_out / 2, + puc_v + i * stride_uv, + _stride_out / 2); + } + + //printf("YV12toYV12_generic 1 %d %d %d\n", width_y, stride_y, height_y); + for(i = 0; i < height_y / 2; i++) + { + memcpy(puc_out + _stride_out * height_y * 5 / 4 + i * _stride_out / 2, + puc_u + i * stride_uv, + _stride_out / 2); + } + //printf("YV12toYV12_generic 2\n"); + } + + + void YV12toRGB32_generic(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) + { + + int x, y; + int stride_diff = 4 * (_stride_out - width_y); + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + for (y=0; y>1] - 128; + v = puc_v[x>>1] - 128; + + _r = _R(y,u,v); + _g = _G(y,u,v); + _b = _B(y,u,v); + + r = _S(_r); + g = _S(_g); + b = _S(_b); + + puc_out[0] = r; + puc_out[1] = g; + puc_out[2] = b; + puc_out[3] = 0; + + puc_out+=4; + } + + puc_y += stride_y; + if (y%2) { + puc_u += stride_uv; + puc_v += stride_uv; + } + puc_out += stride_diff; + } + } + + /***/ + + // This be done more efficiently + // ( we spend almost as much time only in here + // as DivX 3.11 spends on all decoding ) + void YV12toRGB24_generic(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) + { + + int x, y; + int stride_diff = 6*_stride_out - 3*width_y; + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + for (y=0; y>8; \ + else \ + p[i]=(tmp >> 24) ^ 0xff; + Y=lut.m_plY[*pY]; + pY++; + PUT_COMPONENT(puc_out, B+Y, 0); + PUT_COMPONENT(puc_out, G+Y, 1); + PUT_COMPONENT(puc_out, R+Y, 2); + Y=lut.m_plY[*pY]; + pY++; + PUT_COMPONENT(puc_out, B+Y, 3); + PUT_COMPONENT(puc_out, G+Y, 4); + PUT_COMPONENT(puc_out, R+Y, 5); + Y=lut.m_plY[*pY1]; + pY1++; + PUT_COMPONENT(pOut2, B+Y, 0); + PUT_COMPONENT(pOut2, G+Y, 1); + PUT_COMPONENT(pOut2, R+Y, 2); + Y=lut.m_plY[*pY1]; + pY1++; + PUT_COMPONENT(pOut2, B+Y, 3); + PUT_COMPONENT(pOut2, G+Y, 4); + PUT_COMPONENT(pOut2, R+Y, 5); + puc_out+=6; + pOut2+=6; + } + + puc_y += 2*stride_y; + puc_u += stride_uv; + puc_v += stride_uv; + puc_out += stride_diff; + } + } + + + + // conversion from 4:2:0 to yuv2, 16 bit yuv output + // + void yuv_to_yuy2(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int stride_out) + { + int y; + uint8_t* puc_out2; + unsigned int stride_diff = 4 * stride_out - 2 * width_y; // expressed in bytes + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + puc_out2 = puc_out + 2 * stride_out; + for (y=height_y/2; y; y--) { + register uint8_t *py, *py2, *pu, *pv; + register int x; + uint32_t tmp; + + py = puc_y; + py2 = puc_y + stride_y; + pu = puc_u; + pv = puc_v; + for (x=width_y/2; x; x--) { + tmp = *(py++); + tmp |= *(pu++) << 8; + tmp |= *(py++) << 16; + tmp |= *(pv++) << 24; + *(uint32_t*)puc_out=tmp; + puc_out += 4; + + tmp &= 0xFF00FF00; + tmp |= *(py2++); + tmp |= *(py2++) << 16; + *(uint32_t*)puc_out2=tmp; + puc_out2 += 4; + } + + puc_y += 2*stride_y; + puc_u += stride_uv; + puc_v += stride_uv; + + puc_out += stride_diff; + puc_out2 += stride_diff; + } + + } + + + /*---[end projectmayo code]------------------------------------------ */ + + + /* yuv 4:2:0 planar -> yuyv (yuv2) packed + + NOTE: does not flip */ + + void yuv_to_yuyv(uint8_t *dst, int dst_stride, + uint8_t *y_src, uint8_t *v_src, uint8_t * u_src, int y_stride, + int width, int height) + { + int dst_dif = 2*(dst_stride - width); + int y_dif = y_stride - width; + int uv_dif = y_dif / 2; + + int x, y; + + for (y =0; y < height; y+=2) + { + for (x = 0; x < width; x+=2) + { + *dst++ = *y_src++; + *dst = *(dst + 2*dst_stride) = *u_src++; dst++; + *dst++ = *y_src++; + *dst = *(dst + 2*dst_stride) = *v_src++; dst++; + } + dst += dst_dif; + y_src += y_dif; + u_src += uv_dif; + v_src += uv_dif; + + for (x = 0; x < width; x+=2) + { + *dst++ = *y_src++; + dst++; + *dst++ = *y_src++; + dst++; + + } + dst += dst_dif; + y_src += y_dif; + } + } + + + /* yuv 4:2:0 planar -> uyvy packed + + NOTE: does not flip */ + + void yuv_to_uyvy(uint8_t *dst, int dst_stride, + uint8_t *y_src, uint8_t *u_src, uint8_t * v_src, int y_stride, + int width, int height) + { + + int dst_dif = 2*(dst_stride - width); + int y_dif = y_stride - width; + int uv_dif = y_dif / 2; + + int x, y; + + for (y =0; y < height; y+=2) + { + for (x = 0; x < width; x+=2) + { + *dst = *(dst + 2*dst_stride) = *u_src++; dst++; + *dst++ = *y_src++; + *dst = *(dst + 2*dst_stride) = *v_src++; dst++; + *dst++ = *y_src++; + + } + dst += dst_dif; + y_src += y_dif; + u_src += uv_dif; + v_src += uv_dif; + + for (x = 0; x < width; x+=2) + { + dst++; + *dst++ = *y_src++; + dst++; + *dst++ = *y_src++; + } + dst += dst_dif; + y_src += y_dif; + } + } + + + + + diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_bitstream.h bcast-2000c-mf3/quicktime/decore2/src/dec_bitstream.h *** bcast-2000c/quicktime/decore2/src/dec_bitstream.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_bitstream.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,86 ---- + #ifndef DECORE_BITSTREAM_H_ + #define DECORE_BITSTREAM_H_ + + #include "dec_portab.h" + #include "decoder.h" + + + // vop coding types + // intra, prediction, backward, sprite, not_coded + #define I_VOP 0 + #define P_VOP 1 + #define B_VOP 2 + #define S_VOP 3 + #define N_VOP 4 + + typedef struct + { + uint64_t buf; + uint32_t pos; + unsigned char *head; + } BITSTREAM; + + + + // header stuff + int bs_vol(BITSTREAM * bs, DECODER * dec); + int bs_vop(BITSTREAM * bs, DECODER * dec, uint32_t * rounding, uint32_t * quant, uint32_t * fcode); + + + void bs_init(BITSTREAM * const bs, void * const bitstream); + + + + static void refill(BITSTREAM * const bs, const uint32_t bits) + { + while(64 - bs->pos < bits) + { + bs->buf <<= 8; + bs->buf |= *bs->head++; + bs->pos -= 8; + } + } + + + + static uint32_t __inline bs_show(BITSTREAM * const bs, const uint32_t bits) + { + refill(bs, bits); + return (0xffffffff >> (32 - bits)) & + (bs->buf >> (64 - bits - bs->pos)); + } + + + + static __inline void bs_skip(BITSTREAM * const bs, const uint32_t bits) + { + refill(bs, bits); + bs->pos += bits; + } + + + + static __inline void bs_bytealign(BITSTREAM * const bs) + { + bs_skip(bs, (64 - bs->pos) % 8); + } + + + + static uint32_t __inline bs_get(BITSTREAM * const bs, const uint32_t bits) + { + refill(bs, bits); + uint32_t result = (0xffffffff >> (32 - bits)) & + (bs->buf >> (64 - bits - bs->pos)); + bs->pos += bits; + return result; + } + + + static uint32_t __inline bs_get1(BITSTREAM * const bs) + { + return bs_get(bs, 1); + } + + + #endif /* _BITSTREAM_H_ */ \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_bitstream.h.bak bcast-2000c-mf3/quicktime/decore2/src/dec_bitstream.h.bak *** bcast-2000c/quicktime/decore2/src/dec_bitstream.h.bak Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_bitstream.h.bak Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,98 ---- + #ifndef DECORE_BITSTREAM_H_ + #define DECORE_BITSTREAM_H_ + + #include "dec_portab.h" + #include "decoder.h" + + + // vop coding types + // intra, prediction, backward, sprite, not_coded + #define I_VOP 0 + #define P_VOP 1 + #define B_VOP 2 + #define S_VOP 3 + #define N_VOP 4 + + typedef struct + { + uint32_t bufa; + uint32_t bufb; + uint32_t pos; + uint32_t * head; + } BITSTREAM; + + + + // header stuff + int bs_vol(BITSTREAM * bs, DECODER * dec); + int bs_vop(BITSTREAM * bs, DECODER * dec, uint32_t * rounding, uint32_t * quant, uint32_t * fcode); + + + void bs_init(BITSTREAM * const bs, void * const bitstream); + + + + + static uint32_t __inline bs_show(BITSTREAM * const bs, const uint32_t bits) + { + int nbit = (bits + bs->pos) - 32; + if (nbit > 0) + { + return ((bs->bufa & (0xffffffff >> bs->pos)) << nbit) | + (bs->bufb >> (32 - nbit)); + } + else + { + return (bs->bufa & (0xffffffff >> bs->pos)) >> (32 - bs->pos - bits); + } + } + + + + static __inline void bs_skip(BITSTREAM * const bs, const uint32_t bits) + { + bs->pos += bits; + + if (bs->pos >= 32) + { + uint32_t tmp; + + bs->bufa = bs->bufb; + tmp = *(uint32_t *)bs->head; + #ifndef BIG_ENDIAN + BSWAP(tmp); + #endif + bs->bufb = tmp; + bs->head ++; + bs->pos -= 32; + } + } + + + + static __inline void bs_bytealign(BITSTREAM * const bs) + { + uint32_t remainder = bs->pos % 8; + if (remainder) + { + bs_skip(bs, 8 - remainder); + } + } + + + + static uint32_t __inline bs_get(BITSTREAM * const bs, const uint32_t n) + { + uint32_t ret = bs_show(bs, n); + bs_skip(bs, n); + return ret; + } + + + static uint32_t __inline bs_get1(BITSTREAM * const bs) + { + return bs_get(bs, 1); + } + + + #endif /* _BITSTREAM_H_ */ \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_colorspace.h bcast-2000c-mf3/quicktime/decore2/src/dec_colorspace.h *** bcast-2000c/quicktime/decore2/src/dec_colorspace.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_colorspace.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,38 ---- + #include "dec_portab.h" + + + + void init_yuv2rgb(); + + void YV12toRGB32_generic(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out); + + + void YV12toRGB24_generic(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out); + + void YV12toYV12_generic(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out); + + void yuv_to_yuy2(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int stride_out); + + + void yuv_to_yuyv(uint8_t *dst, int dst_stride, + uint8_t *y_src, uint8_t *v_src, uint8_t * u_src, int src_stride, + int width, int height); + + void yuv_to_uyvy(uint8_t *dst, int dst_stride, + uint8_t *y_src, uint8_t *v_src, uint8_t * u_src, int src_stride, + int width, int height); + + + diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_dct.h bcast-2000c-mf3/quicktime/decore2/src/dec_dct.h *** bcast-2000c/quicktime/decore2/src/dec_dct.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_dct.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,15 ---- + #ifndef DEC_DCT_H_ + #define DEC_DCT_H_ + + #include "dec_portab.h" + + + void idct_int32_init(); + void idct_int32 (short * const block); + + + void idct_mmx (short * const src_result); + void idct_sse (short * const src_result); + + #endif /* _DCT_H_ */ + diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_image.h bcast-2000c-mf3/quicktime/decore2/src/dec_image.h *** bcast-2000c/quicktime/decore2/src/dec_image.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_image.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,21 ---- + #ifndef DEC_IMAGE_H_ + #define DEC_IMAGE_H_ + + #include "dec_portab.h" + + #define EDGE_SIZE 32 + + + typedef struct + { + uint8_t * y; + uint8_t * u; + uint8_t * v; + } IMAGE; + + + uint32_t image_create(IMAGE * image, uint32_t edged_width, uint32_t edged_height); + void image_destroy(IMAGE * image, uint32_t edged_width, uint32_t edged_height); + + + #endif /* _IMAGE_H_ */ \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_mbcoding.h bcast-2000c-mf3/quicktime/decore2/src/dec_mbcoding.h *** bcast-2000c/quicktime/decore2/src/dec_mbcoding.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_mbcoding.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,16 ---- + #ifndef DEC_MBCODING_H_ + #define DEC_MBCODING_H_ + + #include "dec_portab.h" + #include "dec_bitstream.h" + #include "decoder.h" + + int get_mcbpc_intra(BITSTREAM * bs); + int get_mcbpc_inter(BITSTREAM * bs); + int get_cbpy(BITSTREAM * bs, int intra); + int get_mv(BITSTREAM * bs, uint32_t scale_fac, uint32_t fcode); + + int get_dc_dif(BITSTREAM * bs, uint32_t dc_size); + int get_intra_coeff(BITSTREAM * bs, int *run, int *last); + + #endif /* _MBCODING_H_ */ \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_mbprediction.h bcast-2000c-mf3/quicktime/decore2/src/dec_mbprediction.h *** bcast-2000c/quicktime/decore2/src/dec_mbprediction.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_mbprediction.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,25 ---- + #include "dec_portab.h" + #include "decoder.h" + + void predict_dc(MACROBLOCK *pMBs, + uint32_t x, uint32_t y, uint32_t x_dim, + uint32_t block, + int16_t dct_codes[64], + uint32_t iDcScaler, + uint32_t current_quant); + + + void predict_ac(MACROBLOCK *pMBs, + uint32_t x, uint32_t y, uint32_t mb_width, + uint32_t block, + int16_t dct_codes[64], + uint32_t iDcScaler, + uint32_t current_quant); + + + void predict_store(MACROBLOCK *pMBs, + uint32_t x, uint32_t y, uint32_t mb_width, + uint32_t block, + int16_t dct_codes[64], + uint32_t iDcScaler, + uint32_t current_quant); diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_portab.h bcast-2000c-mf3/quicktime/decore2/src/dec_portab.h *** bcast-2000c/quicktime/decore2/src/dec_portab.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_portab.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,90 ---- + #ifndef DEC_PORTAB_H_ + #define DEC_PORTAB_H_ + + #ifdef WIN32 + + #include + + #define int8_t char + #define uint8_t unsigned char + #define int16_t short + #define uint16_t unsigned short + #define int32_t int + #define uint32_t unsigned int + #define int64_t __int64 + #define uint64_t unsigned __int64 + + #define DEBUG(S) OutputDebugString((S)); + #define DEBUGI(S,I) { char tmp[100]; wsprintf(tmp, "%s %i\n", (S), (I)); OutputDebugString(tmp); } + #define DEBUGI2(X,A,B) { char tmp[100]; wsprintf(tmp, "%s %i %i\n", (X), (A), (B)); OutputDebugString(tmp); } + #define DEBUGI3(X,A,B,C){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i",(X),(A), (B), (C)); OutputDebugString(tmp); } + #define DEBUGI8(X,A,B,C,D,E,F,G,H){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i %i %i %i %i %i",(X),(A),(B),(C),(D),(E),(F),(G),(H)); OutputDebugString(tmp); } + + + #define EMMS() __asm emms + + // needed for bitstream.h + #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax + + // needed for timer.c + static __inline int64_t read_counter() { + int64_t ts; + uint32_t ts1, ts2; + + __asm { + rdtsc + mov ts1, eax + mov ts2, edx + } + + ts = ((uint64_t) ts2 << 32) | ((uint64_t) ts1); + + return ts; + } + + #elif defined(LINUX) + + #include + + // needed for bitstream.h + #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ) + + // needed for timer.c + static __inline int64_t read_counter() { + int64_t ts; + uint32_t ts1, ts2; + + __asm__ __volatile__("rdtsc\n\t":"=a"(ts1), "=d"(ts2)); + + ts = ((uint64_t) ts2 << 32) | ((uint64_t) ts1); + + return ts; + } + + #define DEBUG(S) {} + #define DEBUGI(S,I) {} + #define DEBUGI2(X,A,B) {} + #define DEBUGI3(X,A,B,C) {} + #define DEBUGI8(X,A,B,C,D,E,F,G,H) {} + #define EMMS() {} + + #else // OTHER OS + + #include + + // needed for bitstream.h + #define BSWAP(a) \ + ((a) = ( ((a)&0xff)<<24) | (((a)&0xff00)<<8) | (((a)>>8)&0xff00) | (((a)>>24)&0xff)) + + // rdtsc command most likely not supported, + // so just dummy code here + static __inline int64_t read_counter() { + return 0; + } + + #define DEBUGI2(X,A,B) { } + + #endif + + #endif // _PORTAB_H_ + diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_quantize.h bcast-2000c-mf3/quicktime/decore2/src/dec_quantize.h *** bcast-2000c/quicktime/decore2/src/dec_quantize.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_quantize.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,34 ---- + #ifndef DEC_QUANTIZE_H_ + #define DEC_QUANTIZE_H_ + + + #include "dec_portab.h" + + + /* plain c */ + + + void dec_dequant_intra(int16_t *data, + const int16_t *coeff, + const uint8_t quant, + const uint8_t dcscalar); + + + void dec_dequant_inter(int16_t *data, + const int16_t *coeff, + const uint8_t quant); + + + /* mmx */ + + void dec_dequant_intra_mmx(int16_t *data, + const int16_t * const coeff, + const uint32_t quant, + const uint32_t dcscalar); + + void dec_dequant_inter_mmx(int16_t * data, + const int16_t * const coeff, + const uint32_t quant); + + + #endif /* _QUANTIZE_H_ */ \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/dec_transfer.h bcast-2000c-mf3/quicktime/decore2/src/dec_transfer.h *** bcast-2000c/quicktime/decore2/src/dec_transfer.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/dec_transfer.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,30 ---- + #ifndef DEC_TRANSFER_H_ + #define DEC_TRANSFER_H_ + + + #include "dec_portab.h" + + + /* plain c */ + + void dec_transfer_16to8copy(uint8_t * const dst, + const int16_t * const src, + uint32_t stride); + + void dec_transfer_16to8add(uint8_t * const dst, + const int16_t * const src, + uint32_t stride); + + + /* mmx */ + + void dec_transfer_16to8copy_mmx(uint8_t * const dst, + const int16_t * const src, + uint32_t stride); + + void dec_transfer_16to8add_mmx(uint8_t * const dst, + const int16_t * const src, + uint32_t stride); + + + #endif /* _TRANSFER_H_ */ \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/decoder.c bcast-2000c-mf3/quicktime/decore2/src/decoder.c *** bcast-2000c/quicktime/decore2/src/decoder.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/decoder.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,641 ---- + #include + + #include "decore2.h" + + #include "decoder.h" + #include "dec_bitstream.h" + + //#include "header.h" + #include "dec_mbcoding.h" + #include "dec_mbprediction.h" + #include "dec_quantize.h" + #include "dec_dct.h" + #include "dec_transfer.h" + #include "dec_colorspace.h" + + + /* shift to mbcoding later */ + + static const uint16_t scan_tables[3][64] = + { + { // zig_zag_scan + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, + 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63 + }, + + { // horizontal_scan + 0, 1, 2, 3, 8, 9, 16, 17, + 10, 11, 4, 5, 6, 7, 15, 14, + 13, 12, 19, 18, 24, 25, 32, 33, + 26, 27, 20, 21, 22, 23, 28, 29, + 30, 31, 34, 35, 40, 41, 48, 49, + 42, 43, 36, 37, 38, 39, 44, 45, + 46, 47, 50, 51, 56, 57, 58, 59, + 52, 53, 54, 55, 60, 61, 62, 63 + }, + + { // vertical_scan + 0, 8, 16, 24, 1, 9, 2, 10, + 17, 25, 32, 40, 48, 56, 57, 49, + 41, 33, 26, 18, 3, 11, 4, 12, + 19, 27, 34, 42, 50, 58, 35, 43, + 51, 59, 20, 28, 5, 13, 6, 14, + 21, 29, 36, 44, 52, 60, 37, 45, + 53, 61, 22, 30, 7, 15, 23, 31, + 38, 46, 54, 62, 39, 47, 55, 63 + } + }; + + + + + int decoder_create(DEC_PARAM * param) + { + DECODER * dec; + + //DEBUG("create_start\n"); + + dec = malloc(sizeof(DECODER)); + if (dec == NULL) + { + return DEC_MEMORY; + } + param->handle = dec; + + dec->width = param->width; + dec->height = param->height; + DEBUGI2("w,h", dec->width, dec->height) + + dec->mb_width = (dec->width + 15) / 16; + dec->mb_height = (dec->height + 15) / 16; + DEBUGI2("mb_w,mb_h", dec->mb_width, dec->mb_height) + + dec->edged_width = 16 * dec->mb_width + 2 * EDGE_SIZE; + dec->edged_height = 16 * dec->mb_height + 2 * EDGE_SIZE; + DEBUGI2("ew,eh", dec->edged_width, dec->edged_height) + + image_create(&dec->cur, dec->edged_width, dec->edged_height); + image_create(&dec->refn, dec->edged_width, dec->edged_height); + image_create(&dec->refh, dec->edged_width, dec->edged_height); + image_create(&dec->refv, dec->edged_width, dec->edged_height); + image_create(&dec->refhv, dec->edged_width, dec->edged_height); + + dec->mbs = malloc(sizeof(MACROBLOCK) * dec->mb_width * dec->mb_height); + if (dec->mbs == NULL) + { + return DEC_MEMORY; + } + + init_yuv2rgb(); + dec_idct_int32_init(); + + return DEC_OK; + } + + + int decoder_destroy(DECODER * dec) + { + free(dec->mbs); + image_destroy(&dec->refhv, dec->edged_width, dec->edged_height); + image_destroy(&dec->refv, dec->edged_width, dec->edged_height); + image_destroy(&dec->refh, dec->edged_width, dec->edged_height); + image_destroy(&dec->refn, dec->edged_width, dec->edged_height); + image_destroy(&dec->cur, dec->edged_width, dec->edged_height); + free(dec); + + return DEC_OK; + } + + #define MODE_INTER 0 + #define MODE_INTER_Q 1 + #define MODE_INTER4V 2 + #define MODE_INTRA 3 + #define MODE_INTRA_Q 4 + #define MODE_INTER4V_Q 5 + #define MODE_STUFFING 7 + + static const int32_t dquant_table[4] = + { + -1, -2, 1, 2 + }; + + + uint32_t get_dc_scaler(uint32_t quant, uint32_t lum) + { + + if(quant > 0 && quant < 5) { + return 8; + } + + if(quant < 25 && !lum) { + return (quant + 13) >> 1; + } + + if(quant < 9) { + return quant << 1; + } + + if(quant < 25) { + return quant + 8; + } + + if(lum) + return (quant << 1) - 16; + else + return quant - 6; + } + + + + #define DEQUANT_INTRA dec_dequant_intra + #define IDCT dec_idct_int32 + #define TRANSFER_16TO8COPY dec_transfer_16to8copy + + + + static int get_dc_size_lum(BITSTREAM * bs) + { + int code; + + if (bs_show(bs, 11) == 1) { + bs_skip(bs, 11); + return 12; + } + if (bs_show(bs, 10) == 1) { + bs_skip(bs, 10); + return 11; + } + if (bs_show(bs, 9) == 1) { + bs_skip(bs, 9); + return 10; + } + if (bs_show(bs, 8) == 1) { + bs_skip(bs, 8); + return 9; + } + if (bs_show(bs, 7) == 1) { + bs_skip(bs, 7); + return 8; + } + if (bs_show(bs, 6) == 1) { + bs_skip(bs, 6); + return 7; + } + if (bs_show(bs, 5) == 1) { + bs_skip(bs, 5); + return 6; + } + if (bs_show(bs, 4) == 1) { + bs_skip(bs, 4); + return 5; + } + + code = bs_show(bs, 3); + + //printf("get_dc_size_lum 1 %x %02x\n", code, bs_show(bs, 16)); + if (code == 1) { + bs_skip(bs, 3); + return 4; + } else if (code == 2) { + bs_skip(bs, 3); + return 3; + } else if (code == 3) { + bs_skip(bs, 3); + //printf("get_dc_size_lum 2 %x %02x\n", code, bs_show(bs, 16)); + return 0; + } + + code = bs_show(bs, 2); + + if (code == 2) { + bs_skip(bs, 2); + return 2; + } else if (code == 3) { + bs_skip(bs, 2); + return 1; + } + //printf("get_dc_size_lum 2 %02x\n", bs_show(bs, 16)); + + return 0; + } + + static int get_dc_size_chrom(BITSTREAM * bs) + { + if (bs_show(bs, 12) == 1) { + bs_skip(bs, 12); + return 12; + } + if (bs_show(bs, 11) == 1) { + bs_skip(bs, 11); + return 11; + } + if (bs_show(bs, 10) == 1) { + bs_skip(bs, 10); + return 10; + } + if (bs_show(bs, 9) == 1) { + bs_skip(bs, 9); + return 9; + } + if (bs_show(bs, 8) == 1) { + bs_skip(bs, 8); + return 8; + } + if (bs_show(bs, 7) == 1) { + bs_skip(bs, 7); + return 7; + } + if (bs_show(bs, 6) == 1) { + bs_skip(bs, 6); + return 6; + } + if (bs_show(bs, 5) == 1) { + bs_skip(bs, 5); + return 5; + } + if (bs_show(bs, 4) == 1) { + bs_skip(bs, 4); + return 4; + } + if (bs_show(bs, 3) == 1) { + bs_skip(bs, 3); + return 3; + } + + return (3 - bs_get(bs, 2)); + } + + + + void decoder_iframe(DECODER * dec, BITSTREAM * bs, int quant) + { + int16_t block[6][64]; + uint32_t x,y; + + //printf("decoder_iframe 1\n"); + for (y = 0; y < dec->mb_height; y++) + { + //printf("decoder_iframe 2\n"); + for (x = 0; x < dec->mb_width; x++) + { + MACROBLOCK * mb = &dec->mbs[y*dec->mb_width + x]; + + uint32_t mcbpc; + uint32_t cbpc; + uint32_t acpred_flag; + uint32_t cbpy; + uint32_t cbp; + uint32_t k; + + //printf("decoder_iframe 3 %02x\n", bs_show(bs, 16)); + + mcbpc = get_mcbpc_intra(bs); + //DEBUGI2("(i,j)",x,y); + mb->mode = mcbpc & 7; + cbpc = (mcbpc >> 4); // & 3; necessary? + //printf("decoder_iframe 4 %02x\n", bs_show(bs, 16)); + + acpred_flag = bs_get1(bs); + //DEBUGI("acpred_flag",acpred_flag); + //printf("decoder_iframe 3\n"); + + if (mb->mode == MODE_STUFFING) + { + DEBUG("-------------STUFFING----------------"); + continue; // ??? + } + //printf("decoder_iframe 3\n"); + + cbpy = get_cbpy(bs, 1); + //DEBUGI("cbpy",cbpy); + cbp = (cbpy << 2) | cbpc; + //printf("decoder_iframe 3\n"); + + mb->quant = quant; + if (mb->mode == MODE_INTRA_Q) + { + mb->quant += dquant_table[bs_get(bs,2)]; + } + //printf("decoder_iframe 3\n"); + //printf("decoder_iframe 5 %02x\n", bs_show(bs, 16)); + + for (k = 0; k < 6; k++) + { + int dc_size; + int dc_dif; + uint32_t dcscalar; + const uint16_t * scan; + + int16_t data[64]; + + bzero(block[k], 64 * sizeof(int16_t)); // clear + + // ac/dc prediction + dcscalar = get_dc_scaler(mb->quant, k < 4); + + // get dc block + //printf("decoder_iframe %02x\n", dcscalar); + + if (k < 4) + { + //printf("decoder_iframe 6 %02x\n", bs_show(bs, 16)); + dc_size = get_dc_size_lum(bs); + //printf("decoder_iframe 7 %02x\n", bs_show(bs, 16)); + } + else + { + dc_size = get_dc_size_chrom(bs); + } + + + + dc_dif = (dc_size ? get_dc_dif(bs, dc_size) : 0 ); + if (dc_size > 8) + { + bs_skip(bs, 1); // marker + } + block[k][0] = dc_dif; + //printf("decoder_iframe 4\n"); + + + + + + + + + + + + + + predict_dc(dec->mbs, x, y, dec->mb_width, k, block[k], dcscalar, mb->quant); + + // DEBUGI3("DC ", block[k][0], block[k][0], 0); + + if (!acpred_flag) + { + mb->acpred_directions[k] = 0; + } + scan = scan_tables[ mb->acpred_directions[k] ]; + //printf("decoder_iframe 6\n"); + + if (cbp & (1 << (5-k))) // coded + { + int p; + int level; + int run; + int last; + + p = 1; + //printf("decoder_iframe 6 %02x\n", bs_show(bs, 12)); + do + { + level = get_intra_coeff(bs, &run, &last); + //printf("decoder_iframe 6.1 %p %d %d\n", bs->pos, run, last); + //printf("decoder_iframe 6.2\n"); + //DEBUGI3("% ", level, run, last); + if (run == -1) + { + DEBUG("invalid run"); + } + p += run; + //printf("decoder_iframe 6.3 %d %d\n", level, p); + block[k][scan[p]] = level; + p++; + + + + + + + + //printf("decoder_iframe 6.4 %d\n", level); + + + + + + + + + + + + } while (!last); + + } + //printf("decoder_iframe 7\n"); + + predict_ac(dec->mbs, x, y, dec->mb_width, k, block[k], dcscalar, mb->quant); + //printf("decoder_iframe 8\n"); + + + DEQUANT_INTRA(data, block[k], mb->quant, dcscalar); + //printf("decoder_iframe 9\n"); + + IDCT(data); + //printf("decoder_iframe 10\n"); + + if (k < 4) + { + TRANSFER_16TO8COPY(dec->cur.y + (16*y*dec->edged_width) + 16*x + (4*(k&2)*dec->edged_width) + 8*(k&1), data, dec->edged_width); + } + else if (k == 4) + { + TRANSFER_16TO8COPY(dec->cur.u+ 8*y*(dec->edged_width/2) + 8*x, data, (dec->edged_width/2)); + } + else + { + TRANSFER_16TO8COPY(dec->cur.v + 8*y*(dec->edged_width/2) + 8*x, data, (dec->edged_width/2)); + } + } + //printf("decoder_iframe 11 %02x\n", bs_show(bs, 16)); + + // if (i == 5) return; + } + } + //printf("decoder_iframe 12\n"); + EMMS(); + } + + + + void decoder_pframe(DECODER * dec, BITSTREAM * bs, int quant, int fcode) + { + // int16_t block[6][64]; + uint32_t x,y; + + for (y = 0; y < dec->mb_height; y++) + { + for (x = 0; x < dec->mb_width; x++) + { + MACROBLOCK * mb = &dec->mbs[y*dec->mb_width + x]; + + if (!bs_get1(bs)) // not_coded + { + uint32_t mcbpc; + uint32_t cbpc; + uint32_t acpred_flag; + uint32_t cbpy; + uint32_t cbp; + uint32_t k; + uint32_t intra; + + + mcbpc = get_mcbpc_inter(bs); + mb->mode = mcbpc & 7; + cbpc = (mcbpc >> 4); // &3 necessary? + + intra = (mb->mode == MODE_INTRA || mb->mode == MODE_INTRA_Q); + + if (intra) + { + acpred_flag = bs_get1(bs); + } + + if (mb->mode == MODE_STUFFING) + { + DEBUG("-------------STUFFING----------------"); + continue; + } + + cbpy = get_cbpy(bs, intra); + cbp = (cbpy << 2) | cbpc; + + mb->quant = quant; + if (mb->mode == MODE_INTER_Q || mb->mode == MODE_INTRA_Q) + { + mb->quant += dquant_table[bs_get(bs,2)]; + } + + if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) + { + mb->mvs[0].x = get_mv(bs, 0, fcode); + mb->mvs[0].y = get_mv(bs, 0, fcode); + } + else if (mb->mode == MODE_INTER4V /* || mb->mode == MODE_INTER4V_Q */) + { + int z; + for (z = 0; z < 4; z++) + { + mb->mvs[z].x = get_mv(bs, 0, fcode); + mb->mvs[z].y = get_mv(bs, 0, fcode); + } + } + else // MODE_INTRA + { + for (k = 0; k < 4; k++) + { + mb->mvs[0].x = 0; + mb->mvs[0].y = 0; + } + } + + // do inter/intra block + } + else + { + + } + // if (i == 5) return; + } + } + EMMS(); + } + + + int decoder_decode(DECODER * dec, DEC_FRAME * frame) + { + BITSTREAM bs; + uint32_t rounding; + uint32_t quant; + uint32_t fcode; + + bs_init(&bs, frame->bitstream); + + bs_vol(&bs, dec); + + switch (bs_vop(&bs, dec, &rounding, &quant, &fcode)) + { + case P_VOP : + // printf("P_VOP\n"); + decoder_pframe(dec, &bs, quant, fcode); + break; + + case I_VOP : + // printf("I_VOP\n"); + decoder_iframe(dec, &bs, quant); + break; + + case N_VOP : + // printf("N_VOP\n"); // vop not coded, + // set image cur=ref and proceed to colorspace + break; + + default : + printf("BAD_VOP\n"); + return DEC_FAIL; + } + + DEBUGI("color",frame->colorspace); + + switch(frame->colorspace) + { + + case DEC_CSP_RGB24 : // force flip + YV12toRGB24_generic(dec->cur.y, dec->edged_width, + dec->cur.u, dec->cur.v, dec->edged_width/2, + frame->dst, dec->width, -(int32_t)dec->height, + frame->stride); + break; + + case DEC_CSP_RGB32 : // force flip + YV12toRGB32_generic(dec->cur.y, dec->edged_width, + dec->cur.u, dec->cur.v, dec->edged_width/2, + frame->dst, dec->width, -(int32_t)dec->height, + frame->stride); + break; + + case DEC_CSP_YUY2 : + yuv_to_yuyv(frame->dst, frame->stride, + dec->cur.y, dec->cur.u, dec->cur.v, dec->edged_width, + dec->width, dec->height); + break; + + case DEC_CSP_UYVY : + yuv_to_uyvy(frame->dst, frame->stride, + dec->cur.y, dec->cur.u, dec->cur.v, dec->edged_width, + dec->width, dec->height); + break; + + case DEC_CSP_YV12 : + YV12toYV12_generic(dec->cur.y, dec->edged_width, + dec->cur.u, dec->cur.v, dec->edged_width/2, + frame->dst, dec->width, dec->height, + frame->stride); + break; + + default : + return DEC_FAIL; + } + + return DEC_OK; + } + + + + /* { + uint32_t z; + for (z = 0; z < 8; z++) + { + DEBUGI8("%", block[k][z*8], block[k][z*8 + 1], block[k][z*8 + 2], block[k][z*8 + 3], + block[k][z*8 + 4], block[k][z*8 + 5], block[k][z*8 + 6], block[k][z*8 + 7]); + } + } */ diff -C2 -r -N bcast-2000c/quicktime/decore2/src/decoder.h bcast-2000c-mf3/quicktime/decore2/src/decoder.h *** bcast-2000c/quicktime/decore2/src/decoder.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/decoder.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,82 ---- + #ifndef _DECODER_H_ + #define _DECODER_H_ + + #include "dec_portab.h" + #include "decore2.h" + #include "dec_image.h" + + + /* Inter-coded macroblock, 1 motion vector */ + #define MODE_INTER 0 + /* Inter-coded macroblock + dquant */ + #define MODE_INTER_Q 1 + /* Inter-coded macroblock, 4 motion vectors */ + #define MODE_INTER4V 2 + /* Intra-coded macroblock */ + #define MODE_INTRA 3 + /* Intra-coded macroblock + dquant */ + #define MODE_INTRA_Q 4 + + + typedef struct + { + int32_t x; + int32_t y; + } VECTOR; + + + #define MBPRED_SIZE 15 + + + typedef struct + { + VECTOR mvs[4]; + + int16_t pred_values[6][MBPRED_SIZE]; + uint8_t acpred_directions[6]; + + uint32_t mode; + uint32_t quant; // absolute quant + + // uint32_t cbp; + } MACROBLOCK; + + + + typedef struct + { + // bitstream + + uint32_t time_inc_bits; + uint32_t quant_bits; + uint32_t quant_type; + + // image + + uint32_t width; + uint32_t height; + uint32_t edged_width; + uint32_t edged_height; + + IMAGE cur; + IMAGE refn; + IMAGE refh; + IMAGE refv; + IMAGE refhv; + + // macroblock + + uint32_t mb_width; + uint32_t mb_height; + MACROBLOCK * mbs; + + + } DECODER; + + + int decoder_create(DEC_PARAM * param); + int decoder_destroy(DECODER * dec); + int decoder_decode(DECODER * dec, DEC_FRAME * frame); + + + #endif /* _DECODER_H_ */ \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/decore2.c bcast-2000c-mf3/quicktime/decore2/src/decore2.c *** bcast-2000c/quicktime/decore2/src/decore2.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/decore2.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,24 ---- + #include "decore2.h" + #include "decoder.h" + + + int decore(void * handle, int dec_opt, void * param1, void * param2) + { + DECODER * dec = (DECODER *) handle; + DEBUGI("decore", dec_opt); + + switch (dec_opt) + { + case DEC_OPT_CREATE: + return decoder_create((DEC_PARAM *) param1); + + case DEC_OPT_DESTROY: + return decoder_destroy(dec); + + case DEC_OPT_DECODE: + return decoder_decode(dec, (DEC_FRAME *) param1); + + default: + return DEC_FAIL; + } + } \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/decore2.h bcast-2000c-mf3/quicktime/decore2/src/decore2.h *** bcast-2000c/quicktime/decore2/src/decore2.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/decore2.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,58 ---- + #ifndef _DECORE2_H_ + #define _DECORE2_H_ + + #ifdef __cplusplus + extern "C" { + #endif + + // options + #define DEC_OPT_DECODE 0 + #define DEC_OPT_CREATE 1 + #define DEC_OPT_DESTROY 2 + + // return values + #define DEC_FAIL -1 + #define DEC_OK 0 + #define DEC_MEMORY 1 + #define DEC_BAD_FORMAT 2 + + // colorspaces + #define DEC_CSP_RGB24 0 + #define DEC_CSP_YV12 1 + #define DEC_CSP_YUY2 2 + #define DEC_CSP_UYVY 3 + #define DEC_CSP_I420 4 + #define DEC_CSP_RGB32 1000 + #define DEC_CSP_YVYU 1002 + + typedef struct + { + int width; + int height; + void *handle; // will be filled by encore + } DEC_PARAM; + + + typedef struct + { + void * bitstream; + int length; + void * dst; + int colorspace; + int stride; + int render; + } DEC_FRAME; + + + int decore(void * handle, + int dec_opt, + void *param1, + void *param2); + + + #ifdef __cplusplus + } + #endif + + + #endif /* _DECORE2_H_ */ \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/idct.c bcast-2000c-mf3/quicktime/decore2/src/idct.c *** bcast-2000c/quicktime/decore2/src/idct.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/idct.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,352 ---- + /* idct.c, inverse fast discrete cosine transform */ + + /* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */ + + /* + * Disclaimer of Warranty + * + * These software programs are available to the user without any license fee or + * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims + * any and all warranties, whether express, implied, or statuary, including any + * implied warranties or merchantability or of fitness for a particular + * purpose. In no event shall the copyright-holder be liable for any + * incidental, punitive, or consequential damages of any kind whatsoever + * arising from the use of these programs. + * + * This disclaimer of warranty extends to the user of these programs and user's + * customers, employees, agents, transferees, successors, and assigns. + * + * The MPEG Software Simulation Group does not represent or warrant that the + * programs furnished hereunder are free of infringement of any third-party + * patents. + * + * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware, + * are subject to royalty fees to patent holders. Many of these patents are + * general enough such that they are unavoidable regardless of implementation + * design. + * + * MPEG2AVI + * -------- + * v0.16B33 renamed the initialization function to init_idct_int32() + * v0.16B32 removed the unused idct_row() and idct_col() functions + * v0.16B3 changed var declarations to static, to enforce data align + * v0.16B22 idct_FAST() renamed to idct_int32() + * also merged idct_FAST() into a single function, to help VC++ + * optimize it. + * + * v0.14 changed int to long, to avoid confusion when compiling on x86 + * platform ( in VC++ "int" -> 32bits ) + */ + + /**********************************************************/ + /* inverse two dimensional DCT, Chen-Wang algorithm */ + /* (cf. IEEE ASSP-32, pp. 803-816, Aug. 1984) */ + /* 32-bit integer arithmetic (8 bit coefficients) */ + /* 11 mults, 29 adds per DCT */ + /* sE, 18.8.91 */ + /**********************************************************/ + /* coefficients extended to 12 bit for IEEE1180-1990 */ + /* compliance sE, 2.1.94 */ + /**********************************************************/ + + /* this code assumes >> to be a two's-complement arithmetic */ + /* right shift: (-2)>>1 == -1 , (-3)>>1 == -2 */ + + //#include + + #define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */ + #define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */ + #define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */ + #define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */ + #define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */ + #define W7 565 /* 2048*sqrt(2)*cos(7*pi/16) */ + + + /* global declarations */ + //void init_idct_int32 (void); + //void idct_int32 (short *block); + + /* private data */ + static short iclip[1024]; /* clipping table */ + static short *iclp; + + /* private prototypes */ + //static void idctrow _ANSI_ARGS_((short *blk)); + //static void idctcol _ANSI_ARGS_((short *blk)); + + /* row (horizontal) IDCT + * + * 7 pi 1 + * dst[k] = sum c[l] * src[l] * cos( -- * ( k + - ) * l ) + * l=0 8 2 + * + * where: c[0] = 128 + * c[1..7] = 128*sqrt(2) + */ + + /* + static void idctrow(blk) + short *blk; + { + int X0, X1, X2, X3, X4, X5, X6, X7, X8; + + // shortcut + if (!((X1 = blk[4]<<11) | (X2 = blk[6]) | (X3 = blk[2]) | + (X4 = blk[1]) | (X5 = blk[7]) | (X6 = blk[5]) | (X7 = blk[3]))) + { + blk[0]=blk[1]=blk[2]=blk[3]=blk[4]=blk[5]=blk[6]=blk[7]=blk[0]<<3; + return; + } + + X0 = (blk[0]<<11) + 128; // for proper rounding in the fourth stage + + // first stage + X8 = W7*(X4+X5); + X4 = X8 + (W1-W7)*X4; + X5 = X8 - (W1+W7)*X5; + X8 = W3*(X6+X7); + X6 = X8 - (W3-W5)*X6; + X7 = X8 - (W3+W5)*X7; + + // second stage + X8 = X0 + X1; + X0 -= X1; + X1 = W6*(X3+X2); + X2 = X1 - (W2+W6)*X2; + X3 = X1 + (W2-W6)*X3; + X1 = X4 + X6; + X4 -= X6; + X6 = X5 + X7; + X5 -= X7; + + // third stage + X7 = X8 + X3; + X8 -= X3; + X3 = X0 + X2; + X0 -= X2; + X2 = (181*(X4+X5)+128)>>8; + X4 = (181*(X4-X5)+128)>>8; + + // fourth stage + blk[0] = (X7+X1)>>8; + blk[1] = (X3+X2)>>8; + blk[2] = (X0+X4)>>8; + blk[3] = (X8+X6)>>8; + blk[4] = (X8-X6)>>8; + blk[5] = (X0-X4)>>8; + blk[6] = (X3-X2)>>8; + blk[7] = (X7-X1)>>8; + }*/ + + /* column (vertical) IDCT + * + * 7 pi 1 + * dst[8*k] = sum c[l] * src[8*l] * cos( -- * ( k + - ) * l ) + * l=0 8 2 + * + * where: c[0] = 1/1024 + * c[1..7] = (1/1024)*sqrt(2) + */ + /* + static void idctcol(blk) + short *blk; + { + int X0, X1, X2, X3, X4, X5, X6, X7, X8; + + // shortcut + if (!((X1 = (blk[8*4]<<8)) | (X2 = blk[8*6]) | (X3 = blk[8*2]) | + (X4 = blk[8*1]) | (X5 = blk[8*7]) | (X6 = blk[8*5]) | (X7 = blk[8*3]))) + { + blk[8*0]=blk[8*1]=blk[8*2]=blk[8*3]=blk[8*4]=blk[8*5]=blk[8*6]=blk[8*7]= + iclp[(blk[8*0]+32)>>6]; + return; + } + + X0 = (blk[8*0]<<8) + 8192; + + // first stage + X8 = W7*(X4+X5) + 4; + X4 = (X8+(W1-W7)*X4)>>3; + X5 = (X8-(W1+W7)*X5)>>3; + X8 = W3*(X6+X7) + 4; + X6 = (X8-(W3-W5)*X6)>>3; + X7 = (X8-(W3+W5)*X7)>>3; + + // second stage + X8 = X0 + X1; + X0 -= X1; + X1 = W6*(X3+X2) + 4; + X2 = (X1-(W2+W6)*X2)>>3; + X3 = (X1+(W2-W6)*X3)>>3; + X1 = X4 + X6; + X4 -= X6; + X6 = X5 + X7; + X5 -= X7; + + // third stage + X7 = X8 + X3; + X8 -= X3; + X3 = X0 + X2; + X0 -= X2; + X2 = (181*(X4+X5)+128)>>8; + X4 = (181*(X4-X5)+128)>>8; + + // fourth stage + blk[8*0] = iclp[(X7+X1)>>14]; + blk[8*1] = iclp[(X3+X2)>>14]; + blk[8*2] = iclp[(X0+X4)>>14]; + blk[8*3] = iclp[(X8+X6)>>14]; + blk[8*4] = iclp[(X8-X6)>>14]; + blk[8*5] = iclp[(X0-X4)>>14]; + blk[8*6] = iclp[(X3-X2)>>14]; + blk[8*7] = iclp[(X7-X1)>>14]; + }*/ + + /* two dimensional inverse discrete cosine transform */ + //void j_rev_dct(block) + //short *block; + + #define CLIP(x) (((x) < -256) ? -256 : (((x) > 255) ? 255 : (x))) + + + + + + void dec_idct_int32(short * const block) + { + + // idct_int32_init() must be called before the first call to this function! + + + /*int i; + long i; + + for (i=0; i<8; i++) + idctrow(block+8*i); + + for (i=0; i<8; i++) + idctcol(block+i);*/ + static short *blk; + static long i, j; + static long X0, X1, X2, X3, X4, X5, X6, X7, X8; + + + for (i=0; i<8; i++) // idct rows + { + blk = block+(i<<3); + if (!((X1 = blk[4]<<11) | (X2 = blk[6]) | (X3 = blk[2]) | + (X4 = blk[1]) | (X5 = blk[7]) | (X6 = blk[5]) | (X7 = blk[3]))) + { + blk[0]=blk[1]=blk[2]=blk[3]=blk[4]=blk[5]=blk[6]=blk[7]=blk[0]<<3; + continue; + } + + X0 = (blk[0]<<11) + 128; // for proper rounding in the fourth stage + + // first stage + X8 = W7*(X4+X5); + X4 = X8 + (W1-W7)*X4; + X5 = X8 - (W1+W7)*X5; + X8 = W3*(X6+X7); + X6 = X8 - (W3-W5)*X6; + X7 = X8 - (W3+W5)*X7; + + // second stage + X8 = X0 + X1; + X0 -= X1; + X1 = W6*(X3+X2); + X2 = X1 - (W2+W6)*X2; + X3 = X1 + (W2-W6)*X3; + X1 = X4 + X6; + X4 -= X6; + X6 = X5 + X7; + X5 -= X7; + + // third stage + X7 = X8 + X3; + X8 -= X3; + X3 = X0 + X2; + X0 -= X2; + X2 = (181*(X4+X5)+128)>>8; + X4 = (181*(X4-X5)+128)>>8; + + // fourth stage + + blk[0] = (short)((X7+X1)>>8); + blk[1] = (short)((X3+X2)>>8); + blk[2] = (short)((X0+X4)>>8); + blk[3] = (short)((X8+X6)>>8); + blk[4] = (short)((X8-X6)>>8); + blk[5] = (short)((X0-X4)>>8); + blk[6] = (short)((X3-X2)>>8); + blk[7] = (short)((X7-X1)>>8); + + } // end for ( i = 0; i < 8; ++i ) IDCT-rows + + + + for (i=0; i<8; i++) // idct columns + { + blk = block + i; + // shortcut + if (!((X1 = (blk[8*4]<<8)) | (X2 = blk[8*6]) | (X3 = blk[8*2]) | + (X4 = blk[8*1]) | (X5 = blk[8*7]) | (X6 = blk[8*5]) | (X7 = blk[8*3]))) + { + blk[8*0]=blk[8*1]=blk[8*2]=blk[8*3]=blk[8*4]= + blk[8*5]=blk[8*6]=blk[8*7] = CLIP((blk[8 * 0] + 32) >> 6); + continue; + } + + X0 = (blk[8*0]<<8) + 8192; + + // first stage + X8 = W7*(X4+X5) + 4; + X4 = (X8+(W1-W7)*X4)>>3; + X5 = (X8-(W1+W7)*X5)>>3; + X8 = W3*(X6+X7) + 4; + X6 = (X8-(W3-W5)*X6)>>3; + X7 = (X8-(W3+W5)*X7)>>3; + + // second stage + X8 = X0 + X1; + X0 -= X1; + X1 = W6*(X3+X2) + 4; + X2 = (X1-(W2+W6)*X2)>>3; + X3 = (X1+(W2-W6)*X3)>>3; + X1 = X4 + X6; + X4 -= X6; + X6 = X5 + X7; + X5 -= X7; + + // third stage + X7 = X8 + X3; + X8 -= X3; + X3 = X0 + X2; + X0 -= X2; + X2 = (181*(X4+X5)+128)>>8; + X4 = (181*(X4-X5)+128)>>8; + + // fourth stage + blk[8*0] = CLIP((X7+X1)>>14); + blk[8*1] = CLIP((X3+X2)>>14); + blk[8*2] = CLIP((X0+X4)>>14); + blk[8*3] = CLIP((X8+X6)>>14); + blk[8*4] = CLIP((X8-X6)>>14); + blk[8*5] = CLIP((X0-X4)>>14); + blk[8*6] = CLIP((X3-X2)>>14); + blk[8*7] = CLIP((X7-X1)>>14); + } + + } // end function idct_int32(block) + + + //void + //idct_int32_init() + void dec_idct_int32_init() + { + int i; + + iclp = iclip+512; + for (i= -512; i<512; i++) + iclp[i] = (i<-256) ? -256 : ((i>255) ? 255 : i); + } \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/image.c bcast-2000c-mf3/quicktime/decore2/src/image.c *** bcast-2000c/quicktime/decore2/src/image.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/image.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,65 ---- + #include + + #include "dec_image.h" + + + #define SAFETY 64 + #define EDGE_SIZE2 (EDGE_SIZE/2) + + uint32_t image_create(IMAGE * image, uint32_t edged_width, uint32_t edged_height) + { + const uint32_t edged_width2 = edged_width / 2; + const uint32_t edged_height2 = edged_height / 2; + // const uint32_t edge_size2 = EDGE_SIZE / 2; + + /* image->plane[_Y_] = malloc(edged_width * edged_height + SAFETY); + if (image->plane[_Y_] == NULL) + { + return -1; + } + + image->plane[_U_] = malloc(edged_width2 * edged_height2 + SAFETY); + if (image->plane[_U_]) + { + free(image->plane[_Y_]); + return -1; + } + image->plane[_V_] = malloc(edged_width2 * edged_height2 + SAFETY); + if (image->plane[_V_]) + { + free(image->plane[_U_]); + free(image->plane[_Y_]); + return -1; + } */ + + //image->plane[_Y_] += EDGE_SIZE * edged_width + EDGE_SIZE; + //image->plane[_U_] += EDGE_SIZE2 * edged_width2 + EDGE_SIZE2; + //image->plane[_V_] += EDGE_SIZE2 * edged_width2 + EDGE_SIZE2; + + + image->y = malloc(edged_width * edged_height + SAFETY); + image->u = malloc(edged_width2 * edged_height2 + SAFETY); + image->v = malloc(edged_width2 * edged_height2 + SAFETY); + + image->y += EDGE_SIZE * edged_width + EDGE_SIZE; + image->u += EDGE_SIZE2 * edged_width2 + EDGE_SIZE2; + image->v += EDGE_SIZE2 * edged_width2 + EDGE_SIZE2; + + return 0; + } + + + void image_destroy(IMAGE * image, uint32_t edged_width, uint32_t edged_height) + { + const uint32_t edged_width2 = edged_width / 2; + const uint32_t edged_height2 = edged_height / 2; + const uint32_t edge_size2 = EDGE_SIZE / 2; + + //free(image->plane[_V_] - (edge_size2 * edged_width2 + edge_size2)); + //free(image->plane[_U_] - (edge_size2 * edged_width2 + edge_size2)); + //free(image->plane[_Y_] - (EDGE_SIZE * edged_width + EDGE_SIZE)); + + free(image->y - (EDGE_SIZE * edged_width + EDGE_SIZE) ); + free(image->u - (EDGE_SIZE2 * edged_width2 + EDGE_SIZE2)); + free(image->v - (EDGE_SIZE2 * edged_width2 + EDGE_SIZE2)); + } diff -C2 -r -N bcast-2000c/quicktime/decore2/src/intel_mmx/CVS/Entries bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/CVS/Entries *** bcast-2000c/quicktime/decore2/src/intel_mmx/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/CVS/Entries Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,4 ---- + /idct_sse.asm/1.1/Fri Nov 30 01:09:03 2001// + /quant_mmx.asm/1.1/Fri Nov 30 01:09:03 2001// + /transfer_mmx.asm/1.1/Fri Nov 30 01:09:03 2001// + D diff -C2 -r -N bcast-2000c/quicktime/decore2/src/intel_mmx/CVS/Repository bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/CVS/Repository *** bcast-2000c/quicktime/decore2/src/intel_mmx/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/CVS/Repository Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + quicktime/decore2/src/intel_mmx diff -C2 -r -N bcast-2000c/quicktime/decore2/src/intel_mmx/CVS/Root bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/CVS/Root *** bcast-2000c/quicktime/decore2/src/intel_mmx/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/CVS/Root Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/decore2/src/intel_mmx/idct_sse.asm bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/idct_sse.asm *** bcast-2000c/quicktime/decore2/src/intel_mmx/idct_sse.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/idct_sse.asm Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,747 ---- + ; Originally provided by Intel at AP-922 + ; http://developer.intel.com/vtune/cbts/strmsimd/922down.htm + ; (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm) + ; but in a limited edition. + ; New macro implements a column part for precise iDCT + ; The routine precision now satisfies IEEE standard 1180-1990. + ; + ; Copyright (c) 2000-2001 Peter Gubanov + ; Rounding trick Copyright (c) 2000 Michel Lespinasse + ; + ; http://www.elecard.com/peter/idct.html + ; http://www.linuxvideo.org/mpeg2dec/ + ; + ;============================================================================= + ; + ; These examples contain code fragments for first stage iDCT 8x8 + ; (for rows) and first stage DCT 8x8 (for columns) + ; + ;============================================================================= + ; + ; 04.11.2001 nasm conversion; peter ross + ; + + bits 32 + + + %define BITS_INV_ACC 5 ; 4 or 5 for IEEE + %define SHIFT_INV_ROW 16 - BITS_INV_ACC + %define SHIFT_INV_COL 1 + BITS_INV_ACC + %define RND_INV_ROW 1024 * (6 - BITS_INV_ACC) ; 1 << (SHIFT_INV_ROW-1) + %define RND_INV_COL 16 * (BITS_INV_ACC - 3) ; 1 << (SHIFT_INV_COL-1) + %define RND_INV_CORR RND_INV_COL - 1 ; correction -1.0 and round + + %define BITS_FRW_ACC 3 ; 2 or 3 for accuracy + %define SHIFT_FRW_COL BITS_FRW_ACC + %define SHIFT_FRW_ROW BITS_FRW_ACC + 17 + %define RND_FRW_ROW 262144 * (BITS_FRW_ACC - 1) ; 1 << (SHIFT_FRW_ROW-1) + + + section .data + + align 16 + + one_corr dw 1, 1, 1, 1 + round_inv_row dd RND_INV_ROW, RND_INV_ROW + round_inv_col dw RND_INV_COL, RND_INV_COL, RND_INV_COL, RND_INV_COL + round_inv_corr dw RND_INV_CORR, RND_INV_CORR, RND_INV_CORR, RND_INV_CORR + round_frw_row dd RND_FRW_ROW, RND_FRW_ROW + tg_1_16 dw 13036, 13036, 13036, 13036 ; tg * (2<<16) + 0.5 + tg_2_16 dw 27146, 27146, 27146, 27146 ; tg * (2<<16) + 0.5 + tg_3_16 dw -21746, -21746, -21746, -21746 ; tg * (2<<16) + 0.5 + cos_4_16 dw -19195, -19195, -19195, -19195 ; cos * (2<<16) + 0.5 + ocos_4_16 dw 23170, 23170, 23170, 23170 ; cos * (2<<15) + 0.5 + + otg_3_16 dw 21895, 21895, 21895, 21895 ; tg * (2<<16) + 0.5 + + %if SHIFT_INV_ROW == 12 ; assume SHIFT_INV_ROW == 12 + rounder_0 dd 65536, 65536 + rounder_4 dd 0, 0 + rounder_1 dd 7195, 7195 + rounder_7 dd 1024, 1024 + rounder_2 dd 4520, 4520 + rounder_6 dd 1024, 1024 + rounder_3 dd 2407, 2407 + rounder_5 dd 240, 240 + + %elif SHIFT_INV_ROW == 11 ; assume SHIFT_INV_ROW == 11 + rounder_0 dd 65536, 65536 + rounder_4 dd 0, 0 + rounder_1 dd 3597, 3597 + rounder_7 dd 512, 512 + rounder_2 dd 2260, 2260 + rounder_6 dd 512, 512 + rounder_3 dd 1203, 1203 + rounder_5 dd 120, 120 + %else + + %error invalid _SHIFT_INV_ROW_ + + %endif + + ;============================================================================= + ; + ; The first stage iDCT 8x8 - inverse DCTs of rows + ; + ;----------------------------------------------------------------------------- + ; The 8-point inverse DCT direct algorithm + ;----------------------------------------------------------------------------- + ; + ; static const short w[32] = { + ; FIX(cos_4_16), FIX(cos_2_16), FIX(cos_4_16), FIX(cos_6_16), + ; FIX(cos_4_16), FIX(cos_6_16), -FIX(cos_4_16), -FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_6_16), -FIX(cos_4_16), FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_2_16), FIX(cos_4_16), -FIX(cos_6_16), + ; FIX(cos_1_16), FIX(cos_3_16), FIX(cos_5_16), FIX(cos_7_16), + ; FIX(cos_3_16), -FIX(cos_7_16), -FIX(cos_1_16), -FIX(cos_5_16), + ; FIX(cos_5_16), -FIX(cos_1_16), FIX(cos_7_16), FIX(cos_3_16), + ; FIX(cos_7_16), -FIX(cos_5_16), FIX(cos_3_16), -FIX(cos_1_16) }; + ; + ; #define DCT_8_INV_ROW(x, y) + ; { + ; int a0, a1, a2, a3, b0, b1, b2, b3; + ; + ; a0 =x[0]*w[0]+x[2]*w[1]+x[4]*w[2]+x[6]*w[3]; + ; a1 =x[0]*w[4]+x[2]*w[5]+x[4]*w[6]+x[6]*w[7]; + ; a2 = x[0] * w[ 8] + x[2] * w[ 9] + x[4] * w[10] + x[6] * w[11]; + ; a3 = x[0] * w[12] + x[2] * w[13] + x[4] * w[14] + x[6] * w[15]; + ; b0 = x[1] * w[16] + x[3] * w[17] + x[5] * w[18] + x[7] * w[19]; + ; b1 = x[1] * w[20] + x[3] * w[21] + x[5] * w[22] + x[7] * w[23]; + ; b2 = x[1] * w[24] + x[3] * w[25] + x[5] * w[26] + x[7] * w[27]; + ; b3 = x[1] * w[28] + x[3] * w[29] + x[5] * w[30] + x[7] * w[31]; + ; + ; y[0] = SHIFT_ROUND ( a0 + b0 ); + ; y[1] = SHIFT_ROUND ( a1 + b1 ); + ; y[2] = SHIFT_ROUND ( a2 + b2 ); + ; y[3] = SHIFT_ROUND ( a3 + b3 ); + ; y[4] = SHIFT_ROUND ( a3 - b3 ); + ; y[5] = SHIFT_ROUND ( a2 - b2 ); + ; y[6] = SHIFT_ROUND ( a1 - b1 ); + ; y[7] = SHIFT_ROUND ( a0 - b0 ); + ; } + ; + ;----------------------------------------------------------------------------- + ; + ; In this implementation the outputs of the iDCT-1D are multiplied + ; for rows 0,4 - by cos_4_16, + ; for rows 1,7 - by cos_1_16, + ; for rows 2,6 - by cos_2_16, + ; for rows 3,5 - by cos_3_16 + ; and are shifted to the left for better accuracy + ; + ; For the constants used, + ; FIX(float_const) = (short) (float_const * (1<<15) + 0.5) + ; + ;============================================================================= + + ;============================================================================= + ; MMX code + ;============================================================================= + + ; Table for rows 0,4 - constants are multiplied by cos_4_16 + + tab_i_04 dw 16384, 16384, 16384, -16384 ; movq-> w06 w04 w02 w00 + dw 21407, 8867, 8867, -21407 ; w07 w05 w03 w01 + dw 16384, -16384, 16384, 16384 ; w14 w12 w10 w08 + dw -8867, 21407, -21407, -8867 ; w15 w13 w11 w09 + dw 22725, 12873, 19266, -22725 ; w22 w20 w18 w16 + dw 19266, 4520, -4520, -12873 ; w23 w21 w19 w17 + dw 12873, 4520, 4520, 19266 ; w30 w28 w26 w24 + dw -22725, 19266, -12873, -22725 ; w31 w29 w27 w25 + + ; Table for rows 1,7 - constants are multiplied by cos_1_16 + + tab_i_17 dw 22725, 22725, 22725, -22725 ; movq-> w06 w04 w02 w00 + dw 29692, 12299, 12299, -29692 ; w07 w05 w03 w01 + dw 22725, -22725, 22725, 22725 ; w14 w12 w10 w08 + dw -12299, 29692, -29692, -12299 ; w15 w13 w11 w09 + dw 31521, 17855, 26722, -31521 ; w22 w20 w18 w16 + dw 26722, 6270, -6270, -17855 ; w23 w21 w19 w17 + dw 17855, 6270, 6270, 26722 ; w30 w28 w26 w24 + dw -31521, 26722, -17855, -31521 ; w31 w29 w27 w25 + + ; Table for rows 2,6 - constants are multiplied by cos_2_16 + + tab_i_26 dw 21407, 21407, 21407, -21407 ; movq-> w06 w04 w02 w00 + dw 27969, 11585, 11585, -27969 ; w07 w05 w03 w01 + dw 21407, -21407, 21407, 21407 ; w14 w12 w10 w08 + dw -11585, 27969, -27969, -11585 ; w15 w13 w11 w09 + dw 29692, 16819, 25172, -29692 ; w22 w20 w18 w16 + dw 25172, 5906, -5906, -16819 ; w23 w21 w19 w17 + dw 16819, 5906, 5906, 25172 ; w30 w28 w26 w24 + dw -29692, 25172, -16819, -29692 ; w31 w29 w27 w25 + + ; Table for rows 3,5 - constants are multiplied by cos_3_16 + + tab_i_35 dw 19266, 19266, 19266, -19266 ; movq-> w06 w04 w02 w00 + dw 25172, 10426, 10426, -25172 ; w07 w05 w03 w01 + dw 19266, -19266, 19266, 19266 ; w14 w12 w10 w08 + dw -10426, 25172, -25172, -10426 ; w15 w13 w11 w09 + dw 26722, 15137, 22654, -26722 ; w22 w20 w18 w16 + dw 22654, 5315, -5315, -15137 ; w23 w21 w19 w17 + dw 15137, 5315, 5315, 22654 ; w30 w28 w26 w24 + dw -26722, 22654, -15137, -26722 ; w31 w29 w27 w25 + + ;----------------------------------------------------------------------------- + + ; + ; DCT_8_INV_ROW_1 INP, OUT, TABLE, ROUNDER + ; + + %macro DCT_8_INV_ROW_1 4 + + movq mm0, [%1] ; 0 ; x3 x2 x1 x0 + + movq mm1, [%1+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [%3] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [%3+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [%3+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [%3+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [%3+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [%4] ; +%4 + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [%3+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [%3+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [%3+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [%4] ; +%4 + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [%2], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [%2+8], mm7 ; 7 ; save y7 y6 y5 y4 + %endmacro + + + + + ;============================================================================= + ; code for Pentium III + ;============================================================================= + + ; %3 for rows 0,4 - constants are multiplied by cos_4_16 + + tab_i_04_sse dw 16384, 21407, 16384, 8867 ; movq-> w05 w04 w01 w00 + dw 16384, 8867, -16384, -21407 ; w07 w06 w03 w02 + dw 16384, -8867, 16384, -21407 ; w13 w12 w09 w08 + dw -16384, 21407, 16384, -8867 ; w15 w14 w11 w10 + dw 22725, 19266, 19266, -4520 ; w21 w20 w17 w16 + dw 12873, 4520, -22725, -12873 ; w23 w22 w19 w18 + dw 12873, -22725, 4520, -12873 ; w29 w28 w25 w24 + dw 4520, 19266, 19266, -22725 ; w31 w30 w27 w26 + + ; %3 for rows 1,7 - constants are multiplied by cos_1_16 + + tab_i_17_sse dw 22725, 29692, 22725, 12299 ; movq-> w05 w04 w01 w00 + dw 22725, 12299, -22725, -29692 ; w07 w06 w03 w02 + dw 22725, -12299, 22725, -29692 ; w13 w12 w09 w08 + dw -22725, 29692, 22725, -12299 ; w15 w14 w11 w10 + dw 31521, 26722, 26722, -6270 ; w21 w20 w17 w16 + dw 17855, 6270, -31521, -17855 ; w23 w22 w19 w18 + dw 17855, -31521, 6270, -17855 ; w29 w28 w25 w24 + dw 6270, 26722, 26722, -31521 ; w31 w30 w27 w26 + + ; %3 for rows 2,6 - constants are multiplied by cos_2_16 + + tab_i_26_sse dw 21407, 27969, 21407, 11585 ; movq-> w05 w04 w01 w00 + dw 21407, 11585, -21407, -27969 ; w07 w06 w03 w02 + dw 21407, -11585, 21407, -27969 ; w13 w12 w09 w08 + dw -21407, 27969, 21407, -11585 ; w15 w14 w11 w10 + dw 29692, 25172, 25172, -5906 ; w21 w20 w17 w16 + dw 16819, 5906, -29692, -16819 ; w23 w22 w19 w18 + dw 16819, -29692, 5906, -16819 ; w29 w28 w25 w24 + dw 5906, 25172, 25172, -29692 ; w31 w30 w27 w26 + + ; %3 for rows 3,5 - constants are multiplied by cos_3_16 + + tab_i_35_sse dw 19266, 25172, 19266, 10426 ; movq-> w05 w04 w01 w00 + dw 19266, 10426, -19266, -25172 ; w07 w06 w03 w02 + dw 19266, -10426, 19266, -25172 ; w13 w12 w09 w08 + dw -19266, 25172, 19266, -10426 ; w15 w14 w11 w10 + dw 26722, 22654, 22654, -5315 ; w21 w20 w17 w16 + dw 15137, 5315, -26722, -15137 ; w23 w22 w19 w18 + dw 15137, -26722, 5315, -15137 ; w29 w28 w25 w24 + dw 5315, 22654, 22654, -26722 ; w31 w30 w27 w26 + + ;----------------------------------------------------------------------------- + + ; + ; DCT_8_INV_ROW_1_sse INP, OUT, TABLE, ROUNDER + ; + + %macro DCT_8_INV_ROW_1_sse 4 + + movq mm0, [%1] ; 0 ; x3 x2 x1 x0 + + movq mm1, [%1+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [%3] ; 3 ; w05 w04 w01 w00 + pshufw mm0, mm0, 10001000b ; x2 x0 x2 x0 + + movq mm4, [%3+8] ; 4 ; w07 w06 w03 w02 + movq mm5, mm1 ; 5 ; x7 x6 x5 x4 + pmaddwd mm3, mm0 ; x2*w05+x0*w04 x2*w01+x0*w00 + + movq mm6, [%3+32] ; 6 ; w21 w20 w17 w16 + pshufw mm1, mm1, 10001000b ; x6 x4 x6 x4 + pmaddwd mm4, mm1 ; x6*w07+x4*w06 x6*w03+x4*w02 + + movq mm7, [%3+40] ; 7 ; w23 w22 w19 w18 + pshufw mm2, mm2, 11011101b ; x3 x1 x3 x1 + pmaddwd mm6, mm2 ; x3*w21+x1*w20 x3*w17+x1*w16 + + pshufw mm5, mm5, 11011101b ; x7 x5 x7 x5 + pmaddwd mm7, mm5 ; x7*w23+x5*w22 x7*w19+x5*w18 + + paddd mm3, [%4] ; +%4 + + pmaddwd mm0, [%3+16] ; x2*w13+x0*w12 x2*w09+x0*w08 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm1, [%3+24] ; x6*w15+x4*w14 x6*w11+x4*w10 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm2, [%3+48] ; x3*w29+x1*w28 x3*w25+x1*w24 + paddd mm6, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + pmaddwd mm5, [%3+56] ; x7*w31+x5*w30 x7*w27+x5*w26 + paddd mm3, mm6 ; a1+b1 a0+b0 + + paddd mm0, [%4] ; +%4 + psrad mm3, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm0, mm1 ; 1 ; a3=sum(even3) a2=sum(even2) + psubd mm4, mm6 ; 6 ; a1-b1 a0-b0 + + movq mm7, mm0 ; 7 ; a3 a2 + paddd mm2, mm5 ; 5 ; b3=sum(odd3) b2=sum(odd2) + + paddd mm0, mm2 ; a3+b3 a2+b2 + psrad mm4, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + + psubd mm7, mm2 ; 2 ; a3-b3 a2-b2 + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + + psrad mm7, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y3 y2 y1 y0 + + packssdw mm7, mm4 ; 4 ; y6 y7 y4 y5 + + movq [%2], mm3 ; 3 ; save y3 y2 y1 y0 + pshufw mm7, mm7, 10110001b ; y7 y6 y5 y4 + + movq [%2+8], mm7 ; 7 ; save y7 y6 y5 y4 + + %endmacro + + + ;============================================================================= + ; + ;============================================================================= + + ;============================================================================= + ; + ; The first stage DCT 8x8 - forward DCTs of columns + ; + ; The %2puts are multiplied + ; for rows 0,4 - on cos_4_16, + ; for rows 1,7 - on cos_1_16, + ; for rows 2,6 - on cos_2_16, + ; for rows 3,5 - on cos_3_16 + ; and are shifted to the left for rise of accuracy + ; + ;----------------------------------------------------------------------------- + ; + ; The 8-point scaled forward DCT algorithm (26a8m) + ; + ;----------------------------------------------------------------------------- + ; + ; #define DCT_8_FRW_COL(x, y) + ;{ + ; short t0, t1, t2, t3, t4, t5, t6, t7; + ; short tp03, tm03, tp12, tm12, tp65, tm65; + ; short tp465, tm465, tp765, tm765; + ; + ; t0 = LEFT_SHIFT ( x[0] + x[7] ); + ; t1 = LEFT_SHIFT ( x[1] + x[6] ); + ; t2 = LEFT_SHIFT ( x[2] + x[5] ); + ; t3 = LEFT_SHIFT ( x[3] + x[4] ); + ; t4 = LEFT_SHIFT ( x[3] - x[4] ); + ; t5 = LEFT_SHIFT ( x[2] - x[5] ); + ; t6 = LEFT_SHIFT ( x[1] - x[6] ); + ; t7 = LEFT_SHIFT ( x[0] - x[7] ); + ; + ; tp03 = t0 + t3; + ; tm03 = t0 - t3; + ; tp12 = t1 + t2; + ; tm12 = t1 - t2; + ; + ; y[0] = tp03 + tp12; + ; y[4] = tp03 - tp12; + ; + ; y[2] = tm03 + tm12 * tg_2_16; + ; y[6] = tm03 * tg_2_16 - tm12; + ; + ; tp65 =(t6 +t5 )*cos_4_16; + ; tm65 =(t6 -t5 )*cos_4_16; + ; + ; tp765 = t7 + tp65; + ; tm765 = t7 - tp65; + ; tp465 = t4 + tm65; + ; tm465 = t4 - tm65; + ; + ; y[1] = tp765 + tp465 * tg_1_16; + ; y[7] = tp765 * tg_1_16 - tp465; + ; y[5] = tm765 * tg_3_16 + tm465; + ; y[3] = tm765 - tm465 * tg_3_16; + ;} + ; + ;============================================================================= + + + ; + ; DCT_8_FRW_COL_4 INP, OUT + ; + + %macro DCT_8_FRW_COL_4 2 + + LOCAL x0, x1, x2, x3, x4, x5, x6, x7 + LOCAL y0, y1, y2, y3, y4, y5, y6, y7 + x0 equ [%1 + 0*16] + x1 equ [%1 + 1*16] + x2 equ [%1 + 2*16] + x3 equ [%1 + 3*16] + x4 equ [%1 + 4*16] + x5 equ [%1 + 5*16] + x6 equ [%1 + 6*16] + x7 equ [%1 + 7*16] + y0 equ [%2 + 0*16] + y1 equ [%2 + 1*16] + y2 equ [%2 + 2*16] + y3 equ [%2 + 3*16] + y4 equ [%2 + 4*16] + y5 equ [%2 + 5*16] + y6 equ [%2 + 6*16] + y7 equ [%2 + 7*16] + movq mm0, x1 ; 0 ; x1 + movq mm1, x6 ; 1 ; x6 + movq mm2, mm0 ; 2 ; x1 + movq mm3, x2 ; 3 ; x2 + paddsw mm0, mm1 ; t1 = x[1] + x[6] + movq mm4, x5 ; 4 ; x5 + psllw mm0, SHIFT_FRW_COL ; t1 + movq mm5, x0 ; 5 ; x0 + paddsw mm4, mm3 ; t2 = x[2] + x[5] + paddsw mm5, x7 ; t0 = x[0] + x[7] + psllw mm4, SHIFT_FRW_COL ; t2 + movq mm6, mm0 ; 6 ; t1 + psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] + movq mm1, [tg_2_16] ; 1 ; tg_2_16 + psubsw mm0, mm4 ; tm12 = t1 - t2 + movq mm7, x3 ; 7 ; x3 + pmulhw mm1, mm0 ; tm12*tg_2_16 + paddsw mm7, x4 ; t3 = x[3] + x[4] + psllw mm5, SHIFT_FRW_COL ; t0 + paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 + psllw mm7, SHIFT_FRW_COL ; t3 + movq mm4, mm5 ; 4 ; t0 + psubsw mm5, mm7 ; tm03 = t0 - t3 + paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 + paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 + por mm1, [one_corr] ; correction y2 +0.5 + psllw mm2, SHIFT_FRW_COL+1 ; t6 + pmulhw mm5, [tg_2_16] ; tm03*tg_2_16 + movq mm7, mm4 ; 7 ; tp03 + psubsw mm3, x5 ; t5 = x[2] - x[5] + psubsw mm4, mm6 ; y4 = tp03 - tp12 + movq y2, mm1 ; 1 ; save y2 + paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 + movq mm1, x3 ; 1 ; x3 + psllw mm3, SHIFT_FRW_COL+1 ; t5 + psubsw mm1, x4 ; t4 = x[3] - x[4] + movq mm6, mm2 ; 6 ; t6 + movq y4, mm4 ; 4 ; save y4 + paddsw mm2, mm3 ; t6 + t5 + pmulhw mm2, [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 + psubsw mm6, mm3 ; 3 ; t6 - t5 + pmulhw mm6, [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 + psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 + por mm5, [one_corr] ; correction y6 +0.5 + psllw mm1, SHIFT_FRW_COL ; t4 + por mm2, [one_corr] ; correction tp65 +0.5 + movq mm4, mm1 ; 4 ; t4 + movq mm3, x0 ; 3 ; x0 + paddsw mm1, mm6 ; tp465 = t4 + tm65 + psubsw mm3, x7 ; t7 = x[0] - x[7] + psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 + movq mm0, [tg_1_16] ; 0 ; tg_1_16 + psllw mm3, SHIFT_FRW_COL ; t7 + movq mm6, [tg_3_16] ; 6 ; tg_3_16 + pmulhw mm0, mm1 ; tp465*tg_1_16 + movq y0, mm7 ; 7 ; save y0 + pmulhw mm6, mm4 ; tm465*tg_3_16 + movq y6, mm5 ; 5 ; save y6 + movq mm7, mm3 ; 7 ; t7 + movq mm5, [tg_3_16] ; 5 ; tg_3_16 + psubsw mm7, mm2 ; tm765 = t7 - tp65 + paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 + pmulhw mm5, mm7 ; tm765*tg_3_16 + paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 + paddsw mm6, mm4 ; tm465*tg_3_16 + pmulhw mm3, [tg_1_16] ; tp765*tg_1_16 + por mm0, [one_corr] ; correction y1 +0.5 + paddsw mm5, mm7 ; tm765*tg_3_16 + psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 + movq y1, mm0 ; 0 ; save y1 + paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 + movq y3, mm7 ; 7 ; save y3 + psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 + movq y5, mm5 ; 5 ; save y5 + movq y7, mm3 ; 3 ; save y7 + %endmacro + + + ; + ; DCT_8_INV_COL_4 INP,OUT + ; + + %macro DCT_8_INV_COL_4 2 + movq mm0, [tg_3_16] + + movq mm3, [%1+16*3] + movq mm1, mm0 ; tg_3_16 + + movq mm5, [%1+16*5] + pmulhw mm0, mm3 ; x3*(tg_3_16-1) + + movq mm4, [tg_1_16] + pmulhw mm1, mm5 ; x5*(tg_3_16-1) + + movq mm7, [%1+16*7] + movq mm2, mm4 ; tg_1_16 + + movq mm6, [%1+16*1] + pmulhw mm4, mm7 ; x7*tg_1_16 + + paddsw mm0, mm3 ; x3*tg_3_16 + pmulhw mm2, mm6 ; x1*tg_1_16 + + paddsw mm1, mm3 ; x3+x5*(tg_3_16-1) + psubsw mm0, mm5 ; x3*tg_3_16-x5 = tm35 + + movq mm3, [ocos_4_16] + paddsw mm1, mm5 ; x3+x5*tg_3_16 = tp35 + + paddsw mm4, mm6 ; x1+tg_1_16*x7 = tp17 + psubsw mm2, mm7 ; x1*tg_1_16-x7 = tm17 + + movq mm5, mm4 ; tp17 + movq mm6, mm2 ; tm17 + + paddsw mm5, mm1 ; tp17+tp35 = b0 + psubsw mm6, mm0 ; tm17-tm35 = b3 + + psubsw mm4, mm1 ; tp17-tp35 = t1 + paddsw mm2, mm0 ; tm17+tm35 = t2 + + movq mm7, [tg_2_16] + movq mm1, mm4 ; t1 + + ; movq [SCRATCH+0], mm5 ; save b0 + movq [%2+3*16], mm5 ; save b0 + paddsw mm1, mm2 ; t1+t2 + + ; movq [SCRATCH+8], mm6 ; save b3 + movq [%2+5*16], mm6 ; save b3 + psubsw mm4, mm2 ; t1-t2 + + movq mm5, [%1+2*16] + movq mm0, mm7 ; tg_2_16 + + movq mm6, [%1+6*16] + pmulhw mm0, mm5 ; x2*tg_2_16 + + pmulhw mm7, mm6 ; x6*tg_2_16 + ; slot + pmulhw mm1, mm3 ; ocos_4_16*(t1+t2) = b1/2 + ; slot + movq mm2, [%1+0*16] + pmulhw mm4, mm3 ; ocos_4_16*(t1-t2) = b2/2 + + psubsw mm0, mm6 ; t2*tg_2_16-x6 = tm26 + movq mm3, mm2 ; x0 + + movq mm6, [%1+4*16] + paddsw mm7, mm5 ; x2+x6*tg_2_16 = tp26 + + paddsw mm2, mm6 ; x0+x4 = tp04 + psubsw mm3, mm6 ; x0-x4 = tm04 + + movq mm5, mm2 ; tp04 + movq mm6, mm3 ; tm04 + + psubsw mm2, mm7 ; tp04-tp26 = a3 + paddsw mm3, mm0 ; tm04+tm26 = a1 + + paddsw mm1, mm1 ; b1 + paddsw mm4, mm4 ; b2 + + paddsw mm5, mm7 ; tp04+tp26 = a0 + psubsw mm6, mm0 ; tm04-tm26 = a2 + + movq mm7, mm3 ; a1 + movq mm0, mm6 ; a2 + + paddsw mm3, mm1 ; a1+b1 + paddsw mm6, mm4 ; a2+b2 + + psraw mm3, SHIFT_INV_COL ; dst1 + psubsw mm7, mm1 ; a1-b1 + + psraw mm6, SHIFT_INV_COL ; dst2 + psubsw mm0, mm4 ; a2-b2 + + ; movq mm1, [SCRATCH+0] ; load b0 + movq mm1, [%2+3*16] ; load b0 + psraw mm7, SHIFT_INV_COL ; dst6 + + movq mm4, mm5 ; a0 + psraw mm0, SHIFT_INV_COL ; dst5 + + movq [%2+1*16], mm3 + paddsw mm5, mm1 ; a0+b0 + + movq [%2+2*16], mm6 + psubsw mm4, mm1 ; a0-b0 + + ; movq mm3, [SCRATCH+8] ; load b3 + movq mm3, [%2+5*16] ; load b3 + psraw mm5, SHIFT_INV_COL ; dst0 + + movq mm6, mm2 ; a3 + psraw mm4, SHIFT_INV_COL ; dst7 + + movq [%2+5*16], mm0 + paddsw mm2, mm3 ; a3+b3 + + movq [%2+6*16], mm7 + psubsw mm6, mm3 ; a3-b3 + + movq [%2+0*16], mm5 + psraw mm2, SHIFT_INV_COL ; dst3 + + movq [%2+7*16], mm4 + psraw mm6, SHIFT_INV_COL ; dst4 + + movq [%2+3*16], mm2 + + movq [%2+4*16], mm6 + %endmacro + + + + section .text + + ;============================================================================= + ; + ; void idct_mmx (short * const src_result); + ; + ;============================================================================= + + align 16 + global _idct_mmx + _idct_mmx + mov eax, dword [esp + 4] + + DCT_8_INV_ROW_1 eax+0, eax+0, tab_i_04, rounder_0 + DCT_8_INV_ROW_1 eax+16, eax+16, tab_i_17, rounder_1 + DCT_8_INV_ROW_1 eax+32, eax+32, tab_i_26, rounder_2 + DCT_8_INV_ROW_1 eax+48, eax+48, tab_i_35, rounder_3 + DCT_8_INV_ROW_1 eax+64, eax+64, tab_i_04, rounder_4 + DCT_8_INV_ROW_1 eax+80, eax+80, tab_i_35, rounder_5 + DCT_8_INV_ROW_1 eax+96, eax+96, tab_i_26, rounder_6 + DCT_8_INV_ROW_1 eax+112, eax+112, tab_i_17, rounder_7 + + DCT_8_INV_COL_4 eax+0,eax+0 + DCT_8_INV_COL_4 eax+8,eax+8 + + ret + + + + ;============================================================================= + ; + ; void idct_sse (short * const src_result); + ; + ;============================================================================= + + align 16 + global _idct_sse + _idct_sse + mov eax, dword [esp + 4] + + DCT_8_INV_ROW_1_sse eax+0, eax+0, tab_i_04_sse, rounder_0 + DCT_8_INV_ROW_1_sse eax+16, eax+16, tab_i_17_sse, rounder_1 + DCT_8_INV_ROW_1_sse eax+32, eax+32, tab_i_26_sse, rounder_2 + DCT_8_INV_ROW_1_sse eax+48, eax+48, tab_i_35_sse, rounder_3 + DCT_8_INV_ROW_1_sse eax+64, eax+64, tab_i_04_sse, rounder_4 + DCT_8_INV_ROW_1_sse eax+80, eax+80, tab_i_35_sse, rounder_5 + DCT_8_INV_ROW_1_sse eax+96, eax+96, tab_i_26_sse, rounder_6 + DCT_8_INV_ROW_1_sse eax+112, eax+112, tab_i_17_sse, rounder_7 + + DCT_8_INV_COL_4 eax+0, eax+0 + DCT_8_INV_COL_4 eax+8, eax+8 + + ret \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/intel_mmx/quant_mmx.asm bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/quant_mmx.asm *** bcast-2000c/quicktime/decore2/src/intel_mmx/quant_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/quant_mmx.asm Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,569 ---- + ;/************************************************************************** + ; * + ; * XVID MPEG-4 VIDEO CODEC + ; * mmx quantization/dequantization + ; * + ; * This program is an implementation of a part of one or more MPEG-4 + ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + ; * to use this software module in hardware or software products are + ; * advised that its use may infringe existing patents or copyrights, and + ; * any such use would be at such party's own risk. The original + ; * developer of this software module and his/her company, and subsequent + ; * editors and their companies, will have no liability for use of this + ; * software or modifications or derivatives thereof. + ; * + ; * This program is free software; you can redistribute it and/or modify + ; * it under the terms of the GNU General Public License as published by + ; * the Free Software Foundation; either version 2 of the License, or + ; * (at your option) any later version. + ; * + ; * This program 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 General Public License for more details. + ; * + ; * You should have received a copy of the GNU General Public License + ; * along with this program; if not, write to the Free Software + ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ; * + ; *************************************************************************/ + + ;/************************************************************************** + ; * + ; * History: + ; * + ; * 04.11.2001 nasm version; (c)2001 peter ross + ; * + ; *************************************************************************/ + + + bits 32 + + + section .data + + + align 16 + + + ;=========================================================================== + ; + ; subtract by Q/2 table + ; + ;=========================================================================== + + %macro MMX_SUB 1 + times 4 dw %1 / 2 + %endmacro + + mmx_sub + MMX_SUB 0 + MMX_SUB 1 + MMX_SUB 2 + MMX_SUB 3 + MMX_SUB 4 + MMX_SUB 5 + MMX_SUB 6 + MMX_SUB 7 + MMX_SUB 8 + MMX_SUB 9 + MMX_SUB 10 + MMX_SUB 11 + MMX_SUB 12 + MMX_SUB 13 + MMX_SUB 14 + MMX_SUB 15 + MMX_SUB 16 + MMX_SUB 17 + MMX_SUB 18 + MMX_SUB 19 + MMX_SUB 20 + MMX_SUB 21 + MMX_SUB 22 + MMX_SUB 23 + MMX_SUB 24 + MMX_SUB 25 + MMX_SUB 26 + MMX_SUB 27 + MMX_SUB 28 + MMX_SUB 29 + MMX_SUB 30 + MMX_SUB 31 + + + + ;=========================================================================== + ; + ; divide by 2Q table + ; + ; use a shift of 16 to take full advantage of _pmulhw_ + ; for q=1, _pmulhw_ will overflow so it is treated seperately + ; (3dnow2 provides _pmulhuw_ which wont cause overflow) + ; + ;=========================================================================== + + %macro MMX_DIV 1 + times 4 dw (1 << 16) / (%1 * 2) + 1 + %endmacro + + mmx_div + MMX_DIV 1 + MMX_DIV 1 + MMX_DIV 2 + MMX_DIV 3 + MMX_DIV 4 + MMX_DIV 5 + MMX_DIV 6 + MMX_DIV 7 + MMX_DIV 8 + MMX_DIV 9 + MMX_DIV 10 + MMX_DIV 11 + MMX_DIV 12 + MMX_DIV 13 + MMX_DIV 14 + MMX_DIV 15 + MMX_DIV 16 + MMX_DIV 17 + MMX_DIV 18 + MMX_DIV 19 + MMX_DIV 20 + MMX_DIV 21 + MMX_DIV 22 + MMX_DIV 23 + MMX_DIV 24 + MMX_DIV 25 + MMX_DIV 26 + MMX_DIV 27 + MMX_DIV 28 + MMX_DIV 29 + MMX_DIV 30 + MMX_DIV 31 + + + + ;=========================================================================== + ; + ; add by (odd(Q) ? Q : Q - 1) table + ; + ;=========================================================================== + + %macro MMX_ADD 1 + %if %1 % 1 != 0 + times 4 dw %1 + %else + times 4 dw %1 - 1 + %endif + %endmacro + + mmx_add + MMX_ADD 0 + MMX_ADD 1 + MMX_ADD 2 + MMX_ADD 3 + MMX_ADD 4 + MMX_ADD 5 + MMX_ADD 6 + MMX_ADD 7 + MMX_ADD 8 + MMX_ADD 9 + MMX_ADD 10 + MMX_ADD 11 + MMX_ADD 12 + MMX_ADD 13 + MMX_ADD 14 + MMX_ADD 15 + MMX_ADD 16 + MMX_ADD 17 + MMX_ADD 18 + MMX_ADD 19 + MMX_ADD 20 + MMX_ADD 21 + MMX_ADD 22 + MMX_ADD 23 + MMX_ADD 24 + MMX_ADD 25 + MMX_ADD 26 + MMX_ADD 27 + MMX_ADD 28 + MMX_ADD 29 + MMX_ADD 30 + MMX_ADD 31 + + + ;=========================================================================== + ; + ; multiple by 2Q table + ; + ;=========================================================================== + + %macro MMX_MUL 1 + times 4 dw %1 * 2 + %endmacro + + mmx_mul + MMX_MUL 0 + MMX_MUL 1 + MMX_MUL 2 + MMX_MUL 3 + MMX_MUL 4 + MMX_MUL 5 + MMX_MUL 6 + MMX_MUL 7 + MMX_MUL 8 + MMX_MUL 9 + MMX_MUL 10 + MMX_MUL 11 + MMX_MUL 12 + MMX_MUL 13 + MMX_MUL 14 + MMX_MUL 15 + MMX_MUL 16 + MMX_MUL 17 + MMX_MUL 18 + MMX_MUL 19 + MMX_MUL 20 + MMX_MUL 21 + MMX_MUL 22 + MMX_MUL 23 + MMX_MUL 24 + MMX_MUL 25 + MMX_MUL 26 + MMX_MUL 27 + MMX_MUL 28 + MMX_MUL 29 + MMX_MUL 30 + MMX_MUL 31 + + + + section .text + + + ;=========================================================================== + ; + ; void quant_intra_mmx(int16_t * coeff, + ; const int16_t const * data, + ; const uint32_t quant, + ; const uint32_t dcscalar); + ; + ;=========================================================================== + + align 16 + global _quant_intra_mmx + _quant_intra_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; coeff + mov esi, [esp + 8 + 8] ; data + mov eax, [esp + 8 + 12] ; quant + + cmp al, 1 + mov ecx, 8 + jz .q1loop + + movq mm7, [mmx_div + eax * 8] + + .loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + pmulhw mm0, mm7 ; mm0 = (mm0 / 2Q) >> 16 + pmulhw mm3, mm7 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 ; + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .loop + + .done + mov ecx, [esp + 8 + 16] ; dcscalar + mov eax, ecx + movsx edx, word [esi - 128] ; data[0] + + shr eax, 1 ; eax = data[0] + dcscalar>>1 + add eax, edx ; + + cdq ; expand eax -> edx:eax + idiv ecx ; eax = edx:eax / dcscalar + + mov [edi - 128], ax ; data[0] = ax + + pop edi + pop esi + + ret + + .q1loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + psrlw mm0, 1 ; mm0 >>= 1 (/2) + psrlw mm3, 1 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .q1loop + jmp short .done + + + + ;=========================================================================== + ; + ; uint32_t quant_inter_mmx(int16_t * coeff, + ; const int16_t const * data, + ; const uint32_t quant); + ; + ;=========================================================================== + + align 16 + global _quant_inter_mmx + _quant_inter_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; coeff + mov esi, [esp + 8 + 8] ; data + mov eax, [esp + 8 + 12] ; quant + + pxor mm5, mm5 ; present + movq mm6, [mmx_sub + eax * 8] ; sub + + cmp al, 1 + mov ecx, 8 + jz .q1loop + + movq mm7, [mmx_div + eax * 8] ; divider + + .loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + psubusw mm0, mm6 ; mm0 -= sub (unsigned, dont go < 0) + psubusw mm3, mm6 ; + pmulhw mm0, mm7 ; mm0 = (mm0 / 2Q) >> 16 + pmulhw mm3, mm7 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + por mm5, mm0 ; set present + por mm5, mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .loop + + .done + movq mm0, mm5 ; pack present into dword + psrlq mm5, 32 + por mm0, mm5 + + movd eax, mm0 ; return present + + pop edi + pop esi + + ret + + .q1loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + psubusw mm0, mm6 ; mm0 -= sub (unsigned, dont go < 0) + psubusw mm3, mm6 ; + psrlw mm0, 1 ; mm0 >>= 1 (/2) + psrlw mm3, 1 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + por mm5, mm0 ; set present + por mm5, mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .q1loop + + jmp short .done + + + + ;=========================================================================== + ; + ; void dequant_intra_mmx(int16_t *data, + ; const int16_t const *coeff, + ; const uint32_t quant, + ; const uint32_t dcscalar); + ; + ;=========================================================================== + + align 16 + global _dequant_intra_mmx + _dequant_intra_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; data + mov esi, [esp + 8 + 8] ; coeff + mov eax, [esp + 8 + 12] ; quant + + movq mm6, [mmx_add + eax * 8] + mov ecx, 8 + movq mm7, [mmx_mul + eax * 8] + + .loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm2, mm2 ; mm2 = 0 + pxor mm5, mm5 ; + pcmpeqw mm2, mm0 ; mm2 = (0 == mm0) + pcmpeqw mm5, mm3 ; + pandn mm2, mm6 ; mm2 = (iszero ? 0 : add) + pandn mm5, mm6 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + pmullw mm0, mm7 ; mm0 *= 2Q + pmullw mm3, mm7 ; + paddw mm0, mm2 ; mm0 += mm2 (add) + paddw mm3, mm5 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .loop + + mov ax, [esi - 128] ; ax = data[0] + imul ax, [esp + 8 + 16] ; eax = data[0] * dcscalar + mov [edi - 128], ax ; data[0] = ax + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; void dequant_inter_mmx(int16_t * data, + ; const int16_t * const coeff, + ; const uint32_t quant); + ; + ;=========================================================================== + + align 16 + global _dequant_inter_mmx + _dequant_inter_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; data + mov esi, [esp + 8 + 8] ; coeff + mov eax, [esp + 8 + 12] ; quant + + movq mm6, [mmx_add + eax * 8] + movq mm7, [mmx_mul + eax * 8] + mov ecx, 8 + + .loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm2, mm2 ; mm2 = 0 + pxor mm5, mm5 ; + pcmpeqw mm2, mm0 ; mm2 = (0 == mm0) + pcmpeqw mm5, mm3 ; + pandn mm2, mm6 ; mm2 = (iszero ? 0 : add) + pandn mm5, mm6 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + pmullw mm0, mm7 ; mm0 *= 2Q + pmullw mm3, mm7 ; + paddw mm0, mm2 ; mm0 += mm2 (add) + paddw mm3, mm5 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .loop + + pop edi + pop esi + + ret \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/intel_mmx/transfer_mmx.asm bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/transfer_mmx.asm *** bcast-2000c/quicktime/decore2/src/intel_mmx/transfer_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/intel_mmx/transfer_mmx.asm Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,175 ---- + ;/************************************************************************** + ; * + ; * XVID MPEG-4 VIDEO CODEC + ; * mmx 8bit<->16bit transfer + ; * + ; * This program is an implementation of a part of one or more MPEG-4 + ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + ; * to use this software module in hardware or software products are + ; * advised that its use may infringe existing patents or copyrights, and + ; * any such use would be at such party's own risk. The original + ; * developer of this software module and his/her company, and subsequent + ; * editors and their companies, will have no liability for use of this + ; * software or modifications or derivatives thereof. + ; * + ; * This program is free software; you can redistribute it and/or modify + ; * it under the terms of the GNU General Public License as published by + ; * the Free Software Foundation; either version 2 of the License, or + ; * (at your option) any later version. + ; * + ; * This program 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 General Public License for more details. + ; * + ; * You should have received a copy of the GNU General Public License + ; * along with this program; if not, write to the Free Software + ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ; * + ; *************************************************************************/ + + ;/************************************************************************** + ; * + ; * History: + ; * + ; * 17.11.2001 bug fix: code declared as .data + ; * 07.11.2001 initial version; (c)2001 peter ross + ; * + ; *************************************************************************/ + + + bits 32 + + + section .text + + + ;=========================================================================== + ; + ; void transfer_8to16copy_mmx(int16_t * const dst, + ; const uint8_t * const src, + ; uint32_t stride); + ; + ;=========================================================================== + + align 16 + global _transfer_8to16copy_mmx + _transfer_8to16copy_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + mov ecx, [esp + 8 + 12] ; stride + + pxor mm7, mm7 ; mm7 = zero + + mov eax, 8 + + .loop + movq mm0, [esi] + movq mm1, mm0 + punpcklbw mm0, mm7 ; mm01 = unpack([src]) + punpckhbw mm1, mm7 + + movq [edi], mm0 ; [dst] = mm01 + movq [edi + 8], mm1 + + add edi, 16 + add esi, ecx + dec eax + jnz .loop + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; void transfer_16to8copy_mmx(uint8_t * const dst, + ; const int16_t * const src, + ; uint32_t stride); + ; + ;=========================================================================== + + align 16 + global _transfer_16to8copy_mmx + _transfer_16to8copy_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + mov ecx, [esp + 8 + 12] ; stride + + mov eax, 8 + + .loop + movq mm0, [esi] + packuswb mm0, [esi + 8] ; mm0 = pack([src]) + + movq [edi], mm0 ; [dst] = mm0 + + add esi, 16 + add edi, ecx + dec eax + jnz .loop + + pop edi + pop esi + + ret + + + ;=========================================================================== + ; + ; void transfer_16to8add_mmx(uint8_t * const dst, + ; const int16_t * const src, + ; uint32_t stride); + ; + ;=========================================================================== + + align 16 + global _transfer_16to8add_mmx + _transfer_16to8add_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + mov ecx, [esp + 8 + 12] ; stride + + pxor mm7, mm7 + + mov eax, 8 + + .loop + movq mm0, [edi] + movq mm1, mm0 + punpcklbw mm0, mm7 ; mm23 = unpack([dst]) + punpckhbw mm1, mm7 + + movq mm2, [esi] ; mm01 = [src] + movq mm3, [esi + 8] + + paddsw mm0, mm2 ; mm01 += mm23 + paddsw mm1, mm3 + + packuswb mm0, mm1 ; [dst] = pack(mm01) + movq [edi], mm0 + + add esi, 16 + add edi, ecx + dec eax + jnz .loop + + pop edi + pop esi + + ret \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/mbcoding.c bcast-2000c-mf3/quicktime/decore2/src/mbcoding.c *** bcast-2000c/quicktime/decore2/src/mbcoding.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/mbcoding.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,653 ---- + /*---[start projectmayo code]------------------------------------------ */ + // most of this was modifed + + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * Andrea Graziani + * + * DivX Advanced Research Center + * + **/ + + #include "dec_mbcoding.h" + + #include + + #define ESCAPE 7167 + + typedef struct + { + uint32_t code; + uint32_t len; + } VLC; + + + + VLC mcbpc_intra_table[32] = { + {-1,0}, + {20,6}, {36,6}, {52,6}, {4,4}, {4,4}, {4,4}, + {4,4}, {19,3}, {19,3}, {19,3}, {19,3}, {19,3}, + {19,3}, {19,3}, {19,3}, {35,3}, {35,3}, {35,3}, + {35,3}, {35,3}, {35,3}, {35,3}, {35,3}, {51,3}, + {51,3}, {51,3}, {51,3}, {51,3}, {51,3}, {51,3}, + {51,3}, + }; + + VLC mcbpc_inter_table[256] = { + {-1,0}, + {255,9}, {52,9}, {36,9}, {20,9}, {49,9}, {35,8}, {35,8}, {19,8}, {19,8}, + {50,8}, {50,8}, {51,7}, {51,7}, {51,7}, {51,7}, {34,7}, {34,7}, {34,7}, + {34,7}, {18,7}, {18,7}, {18,7}, {18,7}, {33,7}, {33,7}, {33,7}, {33,7}, + {17,7}, {17,7}, {17,7}, {17,7}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, + {4,6}, {4,6}, {4,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6}, + {48,6}, {48,6}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, + {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, + }; + + + VLC cbpy_table[48] = + { + {-1,0}, {-1,0}, {6,6}, {9,6}, {8,5}, {8,5}, {4,5}, {4,5}, + {2,5}, {2,5}, {1,5}, {1,5}, {0,4}, {0,4}, {0,4}, {0,4}, + {12,4}, {12,4}, {12,4}, {12,4}, {10,4}, {10,4}, {10,4}, {10,4}, + {14,4}, {14,4}, {14,4}, {14,4}, {5,4}, {5,4}, {5,4}, {5,4}, + {13,4}, {13,4}, {13,4}, {13,4}, {3,4}, {3,4}, {3,4}, {3,4}, + {11,4}, {11,4}, {11,4}, {11,4}, {7,4}, {7,4}, {7,4}, {7,4}, + }; + + + VLC MVtab0[14] = + { + {3,4}, {-3,4}, {2,3}, {2,3}, {-2,3}, {-2,3}, {1,2}, {1,2}, {1,2}, {1,2}, + {-1,2}, {-1,2}, {-1,2}, {-1,2} + }; + + VLC MVtab1[96] = + { + {12,10}, {-12,10}, {11,10}, {-11,10}, {10,9}, {10,9}, {-10,9}, {-10,9}, + {9,9}, {9,9}, {-9,9}, {-9,9}, {8,9}, {8,9}, {-8,9}, {-8,9}, {7,7}, {7,7}, + {7,7}, {7,7}, {7,7}, {7,7}, {7,7}, {7,7}, {-7,7}, {-7,7}, {-7,7}, {-7,7}, + {-7,7}, {-7,7}, {-7,7}, {-7,7}, {6,7}, {6,7}, {6,7}, {6,7}, {6,7}, {6,7}, + {6,7}, {6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, + {-6,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {-5,7}, + {-5,7}, {-5,7}, {-5,7}, {-5,7}, {-5,7}, {-5,7}, {-5,7}, {4,6}, {4,6}, {4,6}, + {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, + {4,6}, {4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, + {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6} + }; + + VLC MVtab2[124] = + { + {32,12}, {-32,12}, {31,12}, {-31,12}, {30,11}, {30,11}, {-30,11}, {-30,11}, + {29,11}, {29,11}, {-29,11}, {-29,11}, {28,11}, {28,11}, {-28,11}, {-28,11}, + {27,11}, {27,11}, {-27,11}, {-27,11}, {26,11}, {26,11}, {-26,11}, {-26,11}, + {25,11}, {25,11}, {-25,11}, {-25,11}, {24,10}, {24,10}, {24,10}, {24,10}, + {-24,10}, {-24,10}, {-24,10}, {-24,10}, {23,10}, {23,10}, {23,10}, {23,10}, + {-23,10}, {-23,10}, {-23,10}, {-23,10}, {22,10}, {22,10}, {22,10}, {22,10}, + {-22,10}, {-22,10}, {-22,10}, {-22,10}, {21,10}, {21,10}, {21,10}, {21,10}, + {-21,10}, {-21,10}, {-21,10}, {-21,10}, {20,10}, {20,10}, {20,10}, {20,10}, + {-20,10}, {-20,10}, {-20,10}, {-20,10}, {19,10}, {19,10}, {19,10}, {19,10}, + {-19,10}, {-19,10}, {-19,10}, {-19,10}, {18,10}, {18,10}, {18,10}, {18,10}, + {-18,10}, {-18,10}, {-18,10}, {-18,10}, {17,10}, {17,10}, {17,10}, {17,10}, + {-17,10}, {-17,10}, {-17,10}, {-17,10}, {16,10}, {16,10}, {16,10}, {16,10}, + {-16,10}, {-16,10}, {-16,10}, {-16,10}, {15,10}, {15,10}, {15,10}, {15,10}, + {-15,10}, {-15,10}, {-15,10}, {-15,10}, {14,10}, {14,10}, {14,10}, {14,10}, + {-14,10}, {-14,10}, {-14,10}, {-14,10}, {13,10}, {13,10}, {13,10}, {13,10}, + {-13,10}, {-13,10}, {-13,10}, {-13,10} + }; + + + VLC tableB16_1[112] = + { + {4353, 7}, {4289, 7}, {385, 7}, {4417, 7}, {449, 7}, {130, 7}, {67, 7}, {9, 7}, {4098, 6}, {4098, 6}, + {321, 6}, {321, 6}, {4225, 6}, {4225, 6}, {4161, 6}, {4161, 6}, {257, 6}, {257, 6}, {193, 6}, {193, 6}, + {8, 6}, {8, 6}, {7, 6}, {7, 6}, {66, 6}, {66, 6}, {6, 6}, {6, 6}, {129, 5}, {129, 5}, + {129, 5}, {129, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, {4, 5}, {4, 5}, {4, 5}, {4, 5}, + {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, + {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {65, 4}, {65, 4}, {65, 4}, {65, 4}, + {65, 4}, {65, 4}, {65, 4}, {65, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4}, + {3, 4}, {3, 4} + }; + + VLC tableB16_2[96] = + { + {18, 10}, {17, 10}, {4993, 9}, {4993, 9}, {4929, 9}, {4929, 9}, {4865, 9}, {4865, 9}, {4801, 9}, {4801, 9}, + {4737, 9}, {4737, 9}, {4162, 9}, {4162, 9}, {4100, 9}, {4100, 9}, {769, 9}, {769, 9}, {705, 9}, {705, 9}, + {450, 9}, {450, 9}, {386, 9}, {386, 9}, {322, 9}, {322, 9}, {195, 9}, {195, 9}, {131, 9}, {131, 9}, + {70, 9}, {70, 9}, {69, 9}, {69, 9}, {16, 9}, {16, 9}, {258, 9}, {258, 9}, {15, 9}, {15, 9}, + {14, 9}, {14, 9}, {13, 9}, {13, 9}, {4609, 8}, {4609, 8}, {4609, 8}, {4609, 8}, {4545, 8}, {4545, 8}, + {4545, 8}, {4545, 8}, {4481, 8}, {4481, 8}, {4481, 8}, {4481, 8}, {4099, 8}, {4099, 8}, {4099, 8}, {4099, 8}, + {641, 8}, {641, 8}, {641, 8}, {641, 8}, {577, 8}, {577, 8}, {577, 8}, {577, 8}, {513, 8}, {513, 8}, + {513, 8}, {513, 8}, {4673, 8}, {4673, 8}, {4673, 8}, {4673, 8}, {194, 8}, {194, 8}, {194, 8}, {194, 8}, + {68, 8}, {68, 8}, {68, 8}, {68, 8}, {12, 8}, {12, 8}, {12, 8}, {12, 8}, {11, 8}, {11, 8}, + {11, 8}, {11, 8}, {10, 8}, {10, 8}, {10, 8}, {10, 8} + }; + + VLC tableB16_3[120] = + { + {4103, 11}, {4103, 11}, {4102, 11}, {4102, 11}, {22, 11}, {22, 11}, {21, 11}, {21, 11}, {4226, 10}, {4226, 10}, + {4226, 10}, {4226, 10}, {4163, 10}, {4163, 10}, {4163, 10}, {4163, 10}, {4101, 10}, {4101, 10}, {4101, 10}, {4101, 10}, + {833, 10}, {833, 10}, {833, 10}, {833, 10}, {323, 10}, {323, 10}, {323, 10}, {323, 10}, {514, 10}, {514, 10}, + {514, 10}, {514, 10}, {259, 10}, {259, 10}, {259, 10}, {259, 10}, {196, 10}, {196, 10}, {196, 10}, {196, 10}, + {132, 10}, {132, 10}, {132, 10}, {132, 10}, {71, 10}, {71, 10}, {71, 10}, {71, 10}, {20, 10}, {20, 10}, + {20, 10}, {20, 10}, {19, 10}, {19, 10}, {19, 10}, {19, 10}, {23, 11}, {23, 11}, {24, 11}, {24, 11}, + {72, 11}, {72, 11}, {578, 11}, {578, 11}, {4290, 11}, {4290, 11}, {4354, 11}, {4354, 11}, {5057, 11}, {5057, 11}, + {5121, 11}, {5121, 11}, {25, 12}, {26, 12}, {27, 12}, {73, 12}, {387, 12}, {74, 12}, {133, 12}, {451, 12}, + {897, 12}, {4104, 12}, {4418, 12}, {4482, 12}, {5185, 12}, {5249, 12}, {5313, 12}, {5377, 12}, {7167, 7}, {7167, 7}, + {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, + {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, + {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7} + }; + + // tables to decode Table B17 VLC + + VLC tableB17_1[112] = + { + {4225,7}, {4209,7}, {4193,7}, {4177,7}, {193,7}, {177,7}, {161,7}, {4,7}, {4161,6}, {4161,6}, + {4145,6}, {4145,6}, {4129,6}, {4129,6}, {4113,6}, {4113,6}, {145,6}, {145,6}, {129,6}, {129,6}, + {113,6}, {113,6}, {97,6}, {97,6}, {18,6}, {18,6}, {3,6}, {3,6}, {81,5}, {81,5}, + {81,5}, {81,5}, {65,5}, {65,5}, {65,5}, {65,5}, {49,5}, {49,5}, {49,5}, {49,5}, + {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {1,2}, {1,2}, + {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, + {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, + {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, + {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, + {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {33,4}, {33,4}, {33,4}, {33,4}, + {33,4}, {33,4}, {33,4}, {33,4}, {2,4}, {2,4}, {2,4}, {2,4}, {2,4}, {2,4}, + {2,4}, {2,4} + }; + + VLC tableB17_2[96] = + { + {9,10}, {8,10}, {4481,9}, {4481,9}, {4465,9}, {4465,9}, {4449,9}, {4449,9}, {4433,9}, {4433,9}, + {4417,9}, {4417,9}, {4401,9}, {4401,9}, {4385,9}, {4385,9}, {4369,9}, {4369,9}, {4098,9}, {4098,9}, + {353,9}, {353,9}, {337,9}, {337,9}, {321,9}, {321,9}, {305,9}, {305,9}, {289,9}, {289,9}, + {273,9}, {273,9}, {257,9}, {257,9}, {241,9}, {241,9}, {66,9}, {66,9}, {50,9}, {50,9}, + {7,9}, {7,9}, {6,9}, {6,9}, {4353,8}, {4353,8}, {4353,8}, {4353,8}, {4337,8}, {4337,8}, + {4337,8}, {4337,8}, {4321,8}, {4321,8}, {4321,8}, {4321,8}, {4305,8}, {4305,8}, {4305,8}, {4305,8}, + {4289,8}, {4289,8}, {4289,8}, {4289,8}, {4273,8}, {4273,8}, {4273,8}, {4273,8}, {4257,8}, {4257,8}, + {4257,8}, {4257,8}, {4241,8}, {4241,8}, {4241,8}, {4241,8}, {225,8}, {225,8}, {225,8}, {225,8}, + {209,8}, {209,8}, {209,8}, {209,8}, {34,8}, {34,8}, {34,8}, {34,8}, {19,8}, {19,8}, + {19,8}, {19,8}, {5,8}, {5,8}, {5,8}, {5,8} + }; + + VLC tableB17_3[120] = + { + {4114,11}, {4114,11}, {4099,11}, {4099,11}, {11,11}, {11,11}, {10,11}, {10,11}, {4545,10}, {4545,10}, + {4545,10}, {4545,10}, {4529,10}, {4529,10}, {4529,10}, {4529,10}, {4513,10}, {4513,10}, {4513,10}, {4513,10}, + {4497,10}, {4497,10}, {4497,10}, {4497,10}, {146,10}, {146,10}, {146,10}, {146,10}, {130,10}, {130,10}, + {130,10}, {130,10}, {114,10}, {114,10}, {114,10}, {114,10}, {98,10}, {98,10}, {98,10}, {98,10}, + {82,10}, {82,10}, {82,10}, {82,10}, {51,10}, {51,10}, {51,10}, {51,10}, {35,10}, {35,10}, + {35,10}, {35,10}, {20,10}, {20,10}, {20,10}, {20,10}, {12,11}, {12,11}, {21,11}, {21,11}, + {369,11}, {369,11}, {385,11}, {385,11}, {4561,11}, {4561,11}, {4577,11}, {4577,11}, {4593,11}, {4593,11}, + {4609,11}, {4609,11}, {22,12}, {36,12}, {67,12}, {83,12}, {99,12}, {162,12}, {401,12}, {417,12}, + {4625,12}, {4641,12}, {4657,12}, {4673,12}, {4689,12}, {4705,12}, {4721,12}, {4737,12}, {7167,7}, {7167,7}, + {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, + {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, + {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7} + }; + + + + /* Table B-19 -- ESCL(a), LMAX values of intra macroblocks */ + int get_b19_lmax(int last, int run) { + if (!last){ /* LAST == 0 */ + if (run == 0) { + return 27; + } else if (run == 1) { + return 10; + } else if (run == 2) { + return 5; + } else if (run == 3) { + return 4; + } else if (run <= 7) { + return 3; + } else if (run <= 9) { + return 2; + } else if (run <= 14) { + return 1; + } else { /* illegal? */ + return 0; + } + } else { /* LAST == 1 */ + if (run == 0) { + return 8; + } else if (run == 1) { + return 3; + } else if (run <= 6) { + return 2; + } else if (run <= 20) { + return 1; + } else { /* illegal? */ + return 0; + } + } + } + + + + /* Table B-20 -- ESCL(b), LMAX values of inter macroblocks */ + int get_b20_lmax(int last, int run) { + if (!last){ /* LAST == 0 */ + if (run == 0) { + return 12; + } else if (run == 1) { + return 6; + } else if (run == 2) { + return 4; + } else if (run <= 6) { + return 3; + } else if (run <= 10) { + return 2; + } else if (run <= 26) { + return 1; + } else { /* illegal? */ + return 0; + } + } else { /* LAST == 1 */ + if (run == 0) { + return 3; + } else if (run == 1) { + return 2; + } else if (run <= 40) { + return 1; + } else { /* illegal? */ + return 0; + } + } + } + + /***/ + + /* Table B-21 -- ESCR(a), RMAX values of intra macroblocks */ + int get_b21_rmax(int last, int level) { + if (!last){ /* LAST == 0 */ + if (level == 1) { + return 14; + } else if (level == 2) { + return 9; + } else if (level == 3) { + return 7; + } else if (level == 4) { + return 3; + } else if (level == 5) { + return 2; + } else if (level <= 10) { + return 1; + } else if (level <= 27) { + return 0; + } else { /* illegal? */ + return 0; + } + } else { /* LAST == 1 */ + if (level == 1) { + return 20; + } else if (level == 2) { + return 6; + } else if (level == 3) { + return 1; + } else if (level <= 8) { + return 0; + } else { /* illegal? */ + return 0; + } + } + } + + /***/ + + /* Table B-22 -- ESCR(b), RMAX values of inter macroblocks */ + + int get_b22_rmax(int last, int level) { + if (!last){ /* LAST == 0 */ + if (level == 1) { + return 26; + } else if (level == 2) { + return 10; + } else if (level == 3) { + return 6; + } else if (level == 4) { + return 2; + } else if (level <= 6) { + return 1; + } else if (level <= 12) { + return 0; + } else { /* illegal? */ + return 0; + } + } else { /* LAST == 1 */ + if (level == 1) { + return 40; + } else if (level == 2) { + return 1; + } else if (level == 3) { + return 0; + } else { /* illegal? */ + return 0; + } + } + } + + /***/ + + + + VLC * get_b16_table(int code) + { + //printf("get_b16_table %d\n", code); + + + if (code >= 512) { + return &tableB16_1[(code >> 5) - 16]; + + } else if (code >= 128) { + return &tableB16_2[(code >> 2) - 32]; + + } else if (code >= 8) { + return &tableB16_3[code - 8]; + } + + return NULL; + } + + + + + VLC * get_b17_table(int code) + { + + if (code >= 512) { + return &tableB17_1[(code >> 5) - 16]; + + } else if (code >= 128) { + return &tableB17_2[(code >> 2) - 32]; + + } else if (code >= 8) { + return &tableB17_3[code - 8]; + } + + return NULL; + } + + + + + int get_mcbpc_intra(BITSTREAM * bs) + { + uint32_t code; + + while ( (code = bs_show(bs, 9)) == 1 ) + { + bs_skip(bs, 9); + } + + if (code < 8) { + return -1; + } + + code >>= 3; + if (code >= 32) { + bs_skip(bs, 1); + return 3; + } + + bs_skip(bs, mcbpc_intra_table[code].len); + + return mcbpc_intra_table[code].code; + } + + + + + int get_mcbpc_inter(BITSTREAM * bs) + { + uint32_t code; + + while ( (code = bs_show(bs, 9)) == 1 ) + { + bs_skip(bs, 9); + } + + if (code == 0) { + return -1; + } + + if (code >= 256) + { + bs_skip(bs, 1); + return 0; + } + + bs_skip(bs, mcbpc_inter_table[code].len); + return mcbpc_inter_table[code].code; + } + + + + int get_cbpy(BITSTREAM * bs, int intra) + { + int cbpy; + int code = bs_show(bs, 6); + + if (code < 2) { + return -1; + } + + if (code >= 48) { + bs_skip(bs, 2); + cbpy = 15; + } else { + bs_skip(bs, cbpy_table[code].len); + cbpy = cbpy_table[code].code; + } + + if (!intra) + { + cbpy = 15 - cbpy; + } + + return cbpy; + } + int get_mv_data(BITSTREAM * bs) + { + uint32_t code; + + if (bs_get1(bs)) { + return 0; // hor_mv_data == 0 + } + + code = bs_show(bs, 12); + + if (code >= 512) + { + code = (code >> 8) - 2; + bs_skip(bs, MVtab0[code].len); + return MVtab0[code].code; + } + + if (code >= 128) + { + code = (code >> 2) - 32; + bs_skip(bs, MVtab1[code].len); + return MVtab1[code].code; + } + + code -= 4; + + bs_skip(bs, MVtab2[code].len); + return MVtab2[code].code; + } + + + + int get_mv(BITSTREAM * bs, uint32_t scale_fac, uint32_t fcode) + { + int data; + int res; + int mv; + + data = get_mv_data(bs); + + if (scale_fac == 1 || data == 0) + { + return data; + } + + res = bs_get(bs, fcode - 1); + mv = ((abs(data) - 1) * scale_fac) + res + 1; + if (data < 0) + { + mv = -mv; + } + + return mv; + } + + + + int get_dc_dif(BITSTREAM * bs, uint32_t dc_size) + { + int code = bs_get(bs, dc_size); + int msb = code >> (dc_size - 1); + + if (msb == 0) { + return (-1 * (code^((1 << dc_size) - 1))); + } + return code; + } + + + // coeff stuff + + + int get_intra_coeff(BITSTREAM * bs, int *run, int *last) + { + VLC * tab = NULL; + int level; + + //printf("get_intra_coeff 1 %02x\n", bs_show(bs, 12)); + tab = get_b16_table(bs_show(bs, 12)); + //printf("get_intra_coeff 2 %p\n", tab); + + if (!tab) { + *run = + *last = -1; + return -1; + } + bs_skip(bs, tab->len); + //printf("get_intra_coeff 3\n"); + + if (tab->code != ESCAPE) { + + //printf("get_intra_coeff 4\n"); + *run = (tab->code >> 6) & 63; + *last = (tab->code >> 12) & 1; + level = tab->code & 63; + //printf("get_intra_coeff 5\n"); + return bs_get1(bs) ? -level : level; + + } else { + /* this value is escaped - see para 7.4.1.3 */ + /* assuming short_video_header == 0 */ + switch (bs_show(bs, 2)) { + case 0x0 : + case 0x1 : + //printf("get_intra_coeff 6\n"); + bs_skip(bs, 1); + tab = get_b16_table(bs_show(bs, 12)); + if (!tab) { + return -1; + } + bs_skip(bs, tab->len); + + *run = (tab->code >> 6) & 63; + level = tab->code & 63; + *last = (tab->code >> 12) & 1; + level += get_b19_lmax(*last, *run); + //printf("get_intra_coeff 7\n"); + return bs_get1(bs) ? -level : level; + + case 0x2 : + //printf("get_intra_coeff 8\n"); + bs_skip(bs, 2); + tab = get_b16_table(bs_show(bs, 12)); + if (!tab) { + return -1; + break; + } + bs_skip(bs, tab->len); + *run = (tab->code >> 6) & 63; + level = tab->code & 63; + *last = (tab->code >> 12) & 1; + *run += get_b21_rmax(*last, level) + 1; + //printf("get_intra_coeff 9\n"); + return bs_get1(bs) ? -level : level; + + case 0x3 : + //printf("get_intra_coeff 10\n"); + bs_skip(bs, 2); + *last = bs_get(bs, 1); + *run = bs_get(bs, 6); // table B-18 + bs_skip(bs, 1); // marker + level = bs_get(bs, 12); // table B-18 + level = (level & 0x800) ? (level | (-1 ^ 0xfff)) : level; + bs_skip(bs, 1); // marker + //printf("get_intra_coeff 11\n"); + return level; + } + } + + return -1; + } + + + /*---[end projectmayo code]------------------------------------------ */ \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/mbprediction.c bcast-2000c-mf3/quicktime/decore2/src/mbprediction.c *** bcast-2000c/quicktime/decore2/src/mbprediction.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/mbprediction.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,429 ---- + #include "decoder.h" + #include "dec_mbprediction.h" + + + + #define MIN(X, Y) ((X)<(Y)?(X):(Y)) + #define MAX(X, Y) ((X)>(Y)?(X):(Y)) + + #define _div_div(a, b) (a>0) ? (a+(b>>1))/b : (a-(b>>1))/b + + static int __inline rescale(int predict_quant, int current_quant, int coeff) + { + return (coeff != 0) ? _div_div((coeff) * (predict_quant), (current_quant)) : 0; + } + + + static const int16_t default_acdc_values[15] = { + 1024, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 + }; + + + + + + /* + perform dc/ac prediction on a single block + + returns how much is saved by performing ac prediction + + [ diag ] [ top ] + [ left ] [ current ] + + + NOTE: modified slightly, since we must perform dc prediction, + coeff decoding, _then_ ac predicition. + */ + + + void predict_dc(MACROBLOCK *pMBs, + uint32_t x, uint32_t y, uint32_t mb_width, + uint32_t block, + int16_t dct_codes[64], + uint32_t iDcScaler, + uint32_t current_quant) + { + int16_t *left, *top, *diag, *current; + + int32_t left_quant = current_quant; + int32_t top_quant = current_quant; + + const int16_t *pLeft = default_acdc_values; + const int16_t *pTop = default_acdc_values; + const int16_t *pDiag = default_acdc_values; + + int16_t *pCurrent; + int32_t S1 = 0, S2 = 0; + uint32_t index = x + y * mb_width; // current macroblock + int16_t dc_pred; + uint8_t *acpred_direction = &pMBs[index].acpred_directions[block]; + uint32_t i; + + left = top = diag = current = 0; + + // grab left,top and diag macroblocks + + // left macroblock + + if(x && (pMBs[index - 1].mode == MODE_INTRA + || pMBs[index - 1].mode == MODE_INTRA_Q)) { + + left = pMBs[index - 1].pred_values[0]; + left_quant = pMBs[index - 1].quant; + //DEBUGI("LEFT", *(left+MBPRED_SIZE)); + } + + // top macroblock + + if(y && (pMBs[index - mb_width].mode == MODE_INTRA + || pMBs[index - mb_width].mode == MODE_INTRA_Q)) { + + top = pMBs[index - mb_width].pred_values[0]; + top_quant = pMBs[index - mb_width].quant; + //DEBUG("TOP"); + } + + // diag macroblock + + if(x && y && (pMBs[index - 1 - mb_width].mode == MODE_INTRA + || pMBs[index - 1 - mb_width].mode == MODE_INTRA_Q)) { + + diag = pMBs[index - 1 - mb_width].pred_values[0]; + //DEBUG("DIAG"); + } + + current = pMBs[index].pred_values[0]; + pCurrent = current + block * MBPRED_SIZE; + + + // now grab pLeft, pTop, pDiag _blocks_ + + switch (block) { + + case 0: + if(left) + pLeft = left + MBPRED_SIZE; + + if(top) + pTop = top + (MBPRED_SIZE << 1); + + if(diag) + pDiag = diag + 3 * MBPRED_SIZE; + + break; + + case 1: + pLeft = current; + left_quant = current_quant; + // pLeft[8] = 0; + + //DEBUG("--BLOCK1--"); + //DEBUGI2("pLeft[0],q:", pLeft[0], left_quant); + //DEBUGI8("pLeft[1-7]:", pLeft[1], pLeft[2], pLeft[3], pLeft[4], pLeft[5], pLeft[6], pLeft[7], 12345); + //DEBUGI8("pLeft[8-14]:", pLeft[8], pLeft[9], pLeft[10], pLeft[11], pLeft[12], pLeft[13], pLeft[14], 12345); + + + if(top) { + pTop = top + 3 * MBPRED_SIZE; + pDiag = top + (MBPRED_SIZE << 1); + } + break; + + case 2: + if(left) { + pLeft = left + 3 * MBPRED_SIZE; + pDiag = left + MBPRED_SIZE; + } + + pTop = current; + top_quant = current_quant; + + break; + + case 3: + pLeft = current + (MBPRED_SIZE << 1); + left_quant = current_quant; + + pTop = current + MBPRED_SIZE; + top_quant = current_quant; + + pDiag = current; + + break; + + case 4: + if(left) + pLeft = left + (MBPRED_SIZE << 2); + + if(top) + pTop = top + (MBPRED_SIZE << 2); + + if(diag) + pDiag = diag + (MBPRED_SIZE << 2); + + break; + + case 5: + if(left) + pLeft = left + 5 * MBPRED_SIZE; + if(top) + pTop = top + 5 * MBPRED_SIZE; + if(diag) + pDiag = diag + 5 * MBPRED_SIZE; + break; + } + + + // determine ac prediction direction & ac/dc predictor + // dc prediction is placed in dc_pred + // ac predictions are placed in pCurrent[] (for use later) + + if(abs(pLeft[0] - pDiag[0]) < abs(pDiag[0] - pTop[0])) { + *acpred_direction = 1; // vertical + dc_pred = _div_div(pTop[0], iDcScaler); + for (i = 1; i < 8; i++) + { + pCurrent[i] = rescale(top_quant, current_quant, pTop[i]); + } + //DEBUG("VERT"); + } + else + { + *acpred_direction = 2; // horizontal + //DEBUGI3("! ", dct_codes[0], pLeft[0], iDcScaler); + //DEBUGI3("(i,j.k)", x, y, block); + dc_pred = _div_div(pLeft[0], iDcScaler); + for (i = 1; i < 8; i++) + { + pCurrent[i+7] = rescale(left_quant, current_quant, pLeft[i + 7]); + } + //DEBUGI2("left_quant, current_quant", left_quant, current_quant); + //DEBUGI8("pCur[8-14]:", pCurrent[8], pCurrent[9], pCurrent[10], pCurrent[11], pCurrent[12], pCurrent[13], pCurrent[14], 12345); + + //DEBUG("HORIZ"); + } + dct_codes[0] = (dct_codes[0] + dc_pred); // * iDcScaler; + // DO THIS LATER ; + + + // DEBUGI("dcp", dc_pred); + + // apply prediction + /* dct_codes[0] = (dct_codes[0] + dc_pred) * iDcScaler; + if (*acpred_direction == 1) + { + for (i = 1; i < 8; i++) + { + dct_codes[i] = _rescale(top_quant, current_quant, pTop[i]); + } + } + else + { + for (i = 1; i < 8; i++) + { + dct_codes[i*8] = _rescale(left_quant, current_quant,pLeft[i + 7]); + } + } */ + + // backup final coeffs + + } + + + + // dc prediction & backup + + void predict_ac(MACROBLOCK *pMBs, + uint32_t x, uint32_t y, uint32_t mb_width, + uint32_t block, + int16_t dct_codes[64], + uint32_t iDcScaler, + uint32_t current_quant) + { + int16_t *current; + int16_t *pCurrent; + uint32_t index = x + y * mb_width; // current macroblock + uint32_t i; + + uint8_t acpred_direction = pMBs[index].acpred_directions[block]; + + current = pMBs[index].pred_values[0]; + pCurrent = current + block * MBPRED_SIZE; + + + pCurrent[0] = dct_codes[0] * iDcScaler; + if (acpred_direction == 1) + { + for (i = 1; i < 8; i++) + { + int level = dct_codes[i] + pCurrent[i]; + dct_codes[i] = level; + pCurrent[i] = level; + pCurrent[i+7] = dct_codes[i*8]; + + } + } + else if (acpred_direction == 2) + { + for (i = 1; i < 8; i++) + { + int level = dct_codes[i*8] + pCurrent[i+7]; + dct_codes[i*8] = level; + pCurrent[i+7] = level; + pCurrent[i] = dct_codes[i]; + } + } + else + { + //DEBUG("X"); + for (i = 1; i < 8; i++) + { + pCurrent[i] = dct_codes[i]; + pCurrent[i+7] = dct_codes[i*8]; + } + } + } + + + + + // -------------------------------------------------------------- + // motion preidiction stuff + + /* calculate the pmv (predicted motion vector) + (take the median of surrounding motion vectors) + + (x,y) = the macroblock + block = the block within the macroblock + */ + void get_pmv(const MACROBLOCK * const pMBs, + const uint32_t x, const uint32_t y, + const uint32_t x_dim, + const uint32_t block, + int32_t * const pred_x, int32_t * const pred_y) + /* + PLEASE NOTE: + This function has been duplicated in MBMotionEstComp and MBPrediction + to enforce modularity + */ + { + int x1, x2, x3; + int y1, y2, y3; + int xin1, xin2, xin3; + int yin1, yin2, yin3; + int vec1, vec2, vec3; + + uint32_t index = x + y * x_dim; + + // first row (special case) + if (y == 0 && (block == 0 || block == 1)) + { + if (x == 0 && block == 0) // first column + { + *pred_x = 0; + *pred_y = 0; + return; + } + if (block == 1) + { + VECTOR mv = pMBs[index].mvs[0]; + *pred_x = mv.x; + *pred_y = mv.y; + return; + } + // else + { + VECTOR mv = pMBs[index - 1].mvs[1]; + *pred_x = mv.x; + *pred_y = mv.y; + return; + } + } + + /* + MODE_INTER, vm18 page 48 + MODE_INTER4V vm18 page 51 + + (x,y-1) (x+1,y-1) + [ | ] [ | ] + [ 2 | 3 ] [ 2 | ] + + (x-1,y) (x,y) (x+1,y) + [ | 1 ] [ 0 | 1 ] [ 0 | ] + [ | 3 ] [ 2 | 3 ] [ | ] + */ + + switch (block) + { + case 0: + xin1 = x - 1; yin1 = y; vec1 = 1; + xin2 = x; yin2 = y - 1; vec2 = 2; + xin3 = x + 1; yin3 = y - 1; vec3 = 2; + break; + case 1: + xin1 = x; yin1 = y; vec1 = 0; + xin2 = x; yin2 = y - 1; vec2 = 3; + xin3 = x + 1; yin3 = y - 1; vec3 = 2; + break; + case 2: + xin1 = x - 1; yin1 = y; vec1 = 3; + xin2 = x; yin2 = y; vec2 = 0; + xin3 = x; yin3 = y; vec3 = 1; + break; + default: + xin1 = x; yin1 = y; vec1 = 2; + xin2 = x; yin2 = y; vec2 = 0; + xin3 = x; yin3 = y; vec3 = 1; + } + + + if (xin1 < 0 || /* yin1 < 0 || */ xin1 >= (int32_t)x_dim) + { + x1 = 0; + y1 = 0; + } + else + { + const VECTOR * const mv = &(pMBs[xin1 + yin1 * x_dim].mvs[vec1]); + x1 = mv->x; + y1 = mv->y; + } + + if (xin2 < 0 || /* yin2 < 0 || */ xin2 >= (int32_t)x_dim) + { + x2 = 0; + y2 = 0; + } + else + { + const VECTOR * const mv = &(pMBs[xin2 + yin2 * x_dim].mvs[vec2]); + x2 = mv->x; + y2 = mv->y; + } + + if (xin3 < 0 || /* yin3 < 0 || */ xin3 >= (int32_t)x_dim) + { + x3 = 0; + y3 = 0; + } + else + { + const VECTOR * const mv = &(pMBs[xin3 + yin3 * x_dim].mvs[vec3]); + x3 = mv->x; + y3 = mv->y; + } + + // median + + *pred_x = MIN(MAX(x1, x2), MIN(MAX(x2, x3), MAX(x1, x3))); + *pred_y = MIN(MAX(y1, y2), MIN(MAX(y2, y3), MAX(y1, y3))); + } + + void predict_motion(MACROBLOCK * mbs, uint32_t i, uint32_t j, uint32_t mb_width) + { + MACROBLOCK * mb = &mbs[j*mb_width + i]; + + //.... + } \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/quantize.c bcast-2000c-mf3/quicktime/decore2/src/quantize.c *** bcast-2000c/quicktime/decore2/src/quantize.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/quantize.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,226 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * quantization/dequantization + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 02.11.2001 added const to function args + * 28.10.2001 total rewrite + * + *************************************************************************/ + + + #include "dec_quantize.h" + + + /* mutliply+shift division table + you would think 16-bit shift would be faster(?) + (we only need 13bits precision) + */ + + #define SCALEBITS 16 + #define FIX(X) ((1L << SCALEBITS) / (X) + 1) + + static const uint32_t multipliers[32] = + { + 0, FIX(2), FIX(4), FIX(6), + FIX(8), FIX(10), FIX(12), FIX(14), + FIX(16), FIX(18), FIX(20), FIX(22), + FIX(24), FIX(26), FIX(28), FIX(30), + FIX(32), FIX(34), FIX(36), FIX(38), + FIX(40), FIX(42), FIX(44), FIX(46), + FIX(48), FIX(50), FIX(52), FIX(54), + FIX(56), FIX(58), FIX(60), FIX(62) + }; + + + + /* quantize intra-block + + coeff [out] quantized coefficients + data [in] data block + quant quantizer [1,31] + dcscalar dcscalar + + h.263 intra, + level = sign(cof) * (|cof| / (2 x q)) + + NOTE: expects data input range [-2048,2047] + */ + + + void dec_quant_intra(int16_t * coeff, const int16_t * data, const uint8_t quant, const uint8_t dcscalar) + { + const uint32_t mult = multipliers[quant]; + const uint16_t quant_m_2 = quant << 1; + uint32_t i; + + *coeff++ = (*data++ + (dcscalar / 2)) / dcscalar; + + for (i = 63; i; i--) { + int16_t acLevel = *data++; + + if (acLevel < 0) { + acLevel = -acLevel; + if (acLevel < quant_m_2) { + *coeff++ = 0; + continue; + } + acLevel = (acLevel * mult) >> SCALEBITS; + *coeff++ = -acLevel; + } else { + if (acLevel < quant_m_2) { + *coeff++ = 0; + continue; + } + *coeff++ = (acLevel * mult) >> SCALEBITS; + } + } + } + + + + /* dequantize intra-block + + data [out] dequantized data block + coeff [in] quantized coefficients + quant quantizer [1,31] + dcscalar dcscalar + + NOTE: does not limit output range [-128,127] + + */ + + + void dec_dequant_intra(int16_t *data, const int16_t *coeff, const uint8_t quant, const uint8_t dcscalar) + { + const uint16_t quant_m_2 = quant << 1; + const uint16_t quant_add = (quant & 1 ? quant : quant - 1); + uint32_t i; + + *data++ = *coeff++ * dcscalar; + + for (i = 63; i; i--) { + int16_t acLevel = *coeff++; + if (acLevel < 0) { + *data++ = (acLevel * quant_m_2) - quant_add; + } else if (acLevel > 0) { + *data++ = (acLevel * quant_m_2) + quant_add; + } else { + *data++ = 0; + } + } + } + + + + + /* quantize inter-block + + coeff [out] quantized coefficients + data [in] data block + quant quantizer [1,31] + + returns !0 if any non-zero coefficients found + + h.263 inter, + level = sign(cof) * (|cof| - q/2) / (2 x q) + + NOTE: expects data input range [-2048,2047] + */ + + int dec_quant_inter(int16_t *coeff, const int16_t *data, const uint8_t quant) + { + const uint32_t mult = multipliers[quant]; + const uint16_t quant_m_2 = quant << 1; + const uint16_t quant_d_2 = quant >> 1; + int present = 0; + uint32_t i; + + for (i = 64; i; i--) { + int16_t acLevel = *data++; + + if (acLevel < 0) { + acLevel = (-acLevel) - quant_d_2; + if (acLevel < quant_m_2) { + *coeff++ = 0; + continue; + } + present = 1; + + acLevel = (acLevel * mult) >> SCALEBITS; + *coeff++ = -acLevel; + } else { + acLevel -= quant_d_2; + if (acLevel < quant_m_2) { + *coeff++ = 0; + continue; + } + present = 1; + + *coeff++ = (acLevel * mult) >> SCALEBITS; + } + } + return present; + } + + + + /* dequantize inter-block + + data [out] dequantized data block + coeff [in] quantized coefficients + quant quantizer [1,31] + dcscalar dcscalar + + NOTE: does not limit output range [-128,127] + + */ + + + void dec_dequant_inter(int16_t *data, const int16_t *coeff, const uint8_t quant) + { + const uint16_t quant_m_2 = quant << 1; + const uint16_t quant_add = (quant & 1 ? quant : quant - 1); + uint32_t i; + + for (i = 64; i; i--) { + int16_t acLevel = *coeff++; + + if (acLevel < 0) { + *data++ = (acLevel * quant_m_2) - quant_add; + } else if (acLevel > 0) { + *data++ = (acLevel * quant_m_2) + quant_add; + } else { + *data++ = 0; + } + } + } \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore2/src/transfer.c bcast-2000c-mf3/quicktime/decore2/src/transfer.c *** bcast-2000c/quicktime/decore2/src/transfer.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore2/src/transfer.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,94 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * 8bit<->16bit transfer + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 07.11.2001 initial version; (c)2001 peter ross + * + *************************************************************************/ + + + #include "dec_transfer.h" + + + void dec_transfer_8to16copy(int16_t * const dst, + const uint8_t * const src, + uint32_t stride) + { + uint32_t i, j; + + for (j = 0; j < 8; j++) { + for (i = 0; i < 8; i++) { + dst[j * 8 + i] = (int16_t)src[j * stride + i]; + } + } + } + + + void dec_transfer_16to8copy(uint8_t * const dst, + const int16_t * const src, + uint32_t stride) + { + uint32_t i, j; + + for (j = 0; j < 8; j++) { + for (i = 0; i < 8; i++) { + int16_t pixel = src[j * 8 + i]; + if (pixel < 0) { + pixel = 0; + } else if (pixel > 255) { + pixel = 255; + } + dst[j * stride + i] = (uint8_t)pixel; + } + } + } + + + void dec_transfer_16to8add(uint8_t * const dst, + const int16_t * const src, + uint32_t stride) + { + uint32_t i, j; + + for (j = 0; j < 8; j++) { + for (i = 0; i < 8; i++) { + int16_t pixel = (int16_t)dst[j * stride + i] + src[j * 8 + i]; + if (pixel < 0) { + pixel = 0; + } else if (pixel > 255) { + pixel = 255; + } + dst[j * stride + i] = (uint8_t)pixel; + } + } + } \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/decore50/CVS/Entries bcast-2000c-mf3/quicktime/decore50/CVS/Entries *** bcast-2000c/quicktime/decore50/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/CVS/Entries Mon Dec 17 14:28:24 2001 *************** *** 0 **** --- 1,48 ---- + D/att_mmx//// + D/intel_mmx//// + /basic_prediction.h/1.2/Mon Dec 3 13:48:32 2001// + /clearblock.c/1.2/Mon Dec 3 13:48:32 2001// + /clearblock.h/1.2/Mon Dec 3 13:48:32 2001// + /debug.c/1.2/Mon Dec 3 13:48:32 2001// + /debug.h/1.2/Mon Dec 3 13:48:32 2001// + /gen_draw.c/1.2/Mon Dec 3 13:48:32 2001// + /gen_draw.h/1.2/Mon Dec 3 13:48:32 2001// + /gen_usetime.c/1.2/Mon Dec 3 13:48:32 2001// + /gen_usetime.h/1.2/Mon Dec 3 13:48:32 2001// + /global.h/1.2/Mon Dec 3 13:48:32 2001// + /idct.c/1.3/Mon Dec 3 13:48:32 2001// + /idct.h/1.2/Mon Dec 3 13:48:32 2001// + /mp4_block.c/1.3/Mon Dec 3 13:48:32 2001// + /mp4_block.h/1.2/Mon Dec 3 13:48:32 2001// + /mp4_decoder.c/1.2/Mon Dec 3 13:48:32 2001// + /mp4_decoder.h/1.2/Mon Dec 3 13:48:32 2001// + /mp4_iquant.c/1.2/Mon Dec 3 13:48:32 2001// + /mp4_iquant.h/1.2/Mon Dec 3 13:48:32 2001// + /mp4_mblock.h/1.2/Mon Dec 3 13:48:32 2001// + /mp4_predict.c/1.2/Mon Dec 3 13:48:32 2001// + /mp4_predict.h/1.2/Mon Dec 3 13:48:32 2001// + /mp4_tables.c/1.2/Mon Dec 3 13:48:32 2001// + /mp4_vars.c/1.2/Mon Dec 3 13:48:32 2001// + /mp4_vld.c/1.3/Mon Dec 3 13:48:32 2001// + /mp4_vld.h/1.2/Mon Dec 3 13:48:32 2001// + /portab.h/1.2/Mon Dec 3 13:48:32 2001// + /postprocess.c/1.2/Mon Dec 3 13:48:32 2001// + /postprocess.h/1.2/Mon Dec 3 13:48:32 2001// + /store.c/1.2/Mon Dec 3 13:48:32 2001// + /store.h/1.2/Mon Dec 3 13:48:32 2001// + /timer.h/1.2/Mon Dec 3 13:48:32 2001// + /transferidct.c/1.2/Mon Dec 3 13:48:32 2001// + /transferidct.h/1.2/Mon Dec 3 13:48:32 2001// + /basic_prediction.c/1.3/Fri Dec 7 14:33:59 2001// + /getbits.c/1.4/Fri Dec 7 14:22:46 2001// + /mp4_header.c/1.3/Fri Dec 7 14:14:44 2001// + /mp4_header.h/1.3/Fri Dec 7 14:15:26 2001// + /mp4_mblock.c/1.5/Fri Dec 7 14:29:20 2001// + /mp4_recon.c/1.3/Fri Dec 7 14:33:09 2001// + /decore.c/1.3/Thu Dec 13 15:12:01 2001// + /decore.h/1.3/Thu Dec 13 15:11:29 2001// + /mp4_picture.c/1.4/Thu Dec 13 15:12:22 2001// + /mp4_vars.h/1.4/Thu Dec 13 15:16:54 2001// + /yuv2rgb.c/1.4/Thu Dec 13 15:14:07 2001// + /yuv2rgb.h/1.3/Thu Dec 13 15:17:07 2001// + /getbits.h/1.8/Mon Dec 17 13:28:22 2001// diff -C2 -r -N bcast-2000c/quicktime/decore50/CVS/Repository bcast-2000c-mf3/quicktime/decore50/CVS/Repository *** bcast-2000c/quicktime/decore50/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/CVS/Repository Fri Nov 30 18:08:19 2001 *************** *** 0 **** --- 1 ---- + quicktime/decore50 diff -C2 -r -N bcast-2000c/quicktime/decore50/CVS/Root bcast-2000c-mf3/quicktime/decore50/CVS/Root *** bcast-2000c/quicktime/decore50/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/CVS/Root Fri Nov 30 18:08:19 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/decore50/att_mmx/CVS/Entries bcast-2000c-mf3/quicktime/decore50/att_mmx/CVS/Entries *** bcast-2000c/quicktime/decore50/att_mmx/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/att_mmx/CVS/Entries Wed Dec 5 18:22:04 2001 *************** *** 0 **** --- 1,2 ---- + /basic_prediction_mmx.c/1.1/Thu Apr 19 18:12:00 2001// + D diff -C2 -r -N bcast-2000c/quicktime/decore50/att_mmx/CVS/Repository bcast-2000c-mf3/quicktime/decore50/att_mmx/CVS/Repository *** bcast-2000c/quicktime/decore50/att_mmx/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/att_mmx/CVS/Repository Fri Nov 30 18:09:27 2001 *************** *** 0 **** --- 1 ---- + quicktime/decore50/att_mmx diff -C2 -r -N bcast-2000c/quicktime/decore50/att_mmx/CVS/Root bcast-2000c-mf3/quicktime/decore50/att_mmx/CVS/Root *** bcast-2000c/quicktime/decore50/att_mmx/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/att_mmx/CVS/Root Fri Nov 30 18:09:27 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/decore50/att_mmx/basic_prediction_mmx.c bcast-2000c-mf3/quicktime/decore50/att_mmx/basic_prediction_mmx.c *** bcast-2000c/quicktime/decore50/att_mmx/basic_prediction_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/att_mmx/basic_prediction_mmx.c Thu Apr 19 20:12:00 2001 *************** *** 0 **** --- 1,680 ---- + /************************************************************************** + * * + * This code has been developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advanced Research Center + * + **/ + + #include "basic_prediction.h" + + // Purpose: specialized basic motion compensation routines + void CopyBlock(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy; + + long *lpSrc = (long *) Src; + long *lpDst = (long *) Dst; + int lpStride = Stride >> 2; + + for (dy = 0; dy < 8; dy++) { + lpDst[0] = lpSrc[0]; + lpDst[1] = lpSrc[1]; + lpSrc += lpStride; + lpDst += lpStride; + } + } + #define CopyBlockHorLoop \ + "movb (%%esi), %%al\n" \ + "incl %%esi\n" \ + "movb (%%esi), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "incl %%eax\n" \ + "shrl $1, %%eax\n" \ + "movb %%al, (%%edi)\n" \ + "incl %%edi\n" + + // input: esi + // output: edi + // modifies: eax, ebx, edx + #define CopyBlockHorLoopFast \ + "movl (%%esi), %%edx\n" \ + "movl 1(%%esi), %%ebx\n"\ + "movl %%edx, %%eax\n" \ + "xorl %%ebx, %%edx\n" \ + "shrl $1, %%edx\n" \ + "adcl %%ebx, %%eax\n" \ + "rcrl $1, %%eax\n" \ + "andl $0x808080, %%edx\n"\ + "addl %%edx, %%eax\n" \ + "movl %%eax, (%%edi)\n" \ + "addl $4, %%esi\n" \ + "addl $4, %%edi\n" + + #define CopyBlockVerLoopFast \ + "movl (%%esi), %%edx\n" \ + "movl (%%esi,%%ecx), %%ebx\n"\ + "movl %%edx, %%eax\n" \ + "xorl %%ebx, %%edx\n" \ + "shrl $1, %%edx\n" \ + "adcl %%ebx, %%eax\n" \ + "rcrl $1, %%eax\n" \ + "andl $0x808080, %%edx\n"\ + "addl %%edx, %%eax\n" \ + "movl %%eax, (%%edi)\n" \ + "addl $4, %%esi\n" \ + "addl $4, %%edi\n" + + + #define CopyBlockHorLoopRound \ + "movb (%%esi), %%al\n" \ + "incl %%esi\n" \ + "movb (%%esi), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "shrl $1, %%eax\n" \ + "movb %%al, (%%edi)\n" \ + "incl %%edi\n" + + #define CopyBlockVerLoop \ + "movb (%%esi), %%al\n" \ + "movb (%%esi,%%ebx), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "incl %%eax\n" \ + "shrl $1, %%eax\n" \ + "movb %%al, (%%edi)\n" \ + "incl %%esi\n" \ + "incl %%edi\n" + + #define CopyBlockVerLoopRound \ + "movb (%%esi), %%al\n" \ + "movb (%%esi,%%ebx), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "shrl $1, %%eax\n" \ + "movb %%al, (%%edi)\n" \ + "incl %%esi\n" \ + "incl %%edi\n" + + #define CopyBlockHorVerLoop(STEP) \ + "movb " #STEP "(%%esi), %%al\n" \ + "movb " #STEP "+1(%%esi), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "movb " #STEP "(%%esi, %%ebx), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "movb " #STEP "+1(%%esi, %%ebx), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "addl $2, %%eax\n" \ + "shrl $2, %%eax\n" \ + "movb %%al, " #STEP "(%%edi)\n" + + #define CopyBlockHorVerLoopRound(STEP) \ + "movb " #STEP "(%%esi), %%al\n" \ + "movb " #STEP "+1(%%esi), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "movb " #STEP "(%%esi, %%ebx), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "movb " #STEP "+1(%%esi, %%ebx), %%cl\n" \ + "addl %%ecx, %%eax\n" \ + "incl %%eax\n" \ + "shrl $2, %%eax\n" \ + "movb %%al, " #STEP "(%%edi)\n" + + /**/ + + void CopyBlockHor(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "movl %2, %%esi\n" + "movl %3, %%edi\n" + "pushl %%ebx\n" + "1:\n" + "pushl %%edx\n" + + CopyBlockHorLoopFast + CopyBlockHorLoopFast + + "popl %%edx\n" + "addl %%ecx, %%esi\n" + "addl %%ecx, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "c"(Stride-8), "d"(8), "g" (Src), "g"(Dst) + : "esi", "edi" + ); + } + void CopyBlockVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "movl %2, %%esi\n" + "movl %3, %%edi\n" + "pushl %%ebx\n" + "1:\n" + "pushl %%edx\n" + + CopyBlockVerLoopFast + CopyBlockVerLoopFast + + "popl %%edx\n" + "addl %%ecx, %%esi\n" + "subl $8, %%esi\n" + "addl %%ecx, %%edi\n" + "subl $8, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "c"(Stride), "d"(8), "g" (Src), "g"(Dst) + : "esi", "edi" + ); + } + /* + void CopyBlockHor(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "pushl %%ebx\n" + "movl %1, %%ebx\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "1:\n" + + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + + "addl %%ebx, %%esi\n" + "addl %%ebx, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride-8), "c"(0), "d"(8), "g" (Src), "g"(Dst) + ); + } + */ + void CopyBlockHorRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "movl %1, %%eax\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "pushl %%ebx\n" + "movl %%eax, %%ebx\n" + "xorl %%eax, %%eax\n" + "1:\n" + + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + + "addl %%ebx, %%esi\n" + "addl %%ebx, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride-8), "c"(0), "d"(8), "g" (Src), "g"(Dst) + : "esi", "edi" + ); + } + + /**/ + /* + void CopyBlockVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "pushl %%ebx\n" + "movl %1, %%ebx\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "1:\n" + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + + "addl %%ebx, %%esi\n" + "subl $8, %%esi\n" + "addl %%ebx, %%edi\n" + "subl $8, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride), "c"(0), "d"(8), "g" (Src), "g"(Dst) + ); + } + */ + /**/ + void CopyBlockVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "movl %1, %%eax\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "pushl %%ebx\n" + "movl %%eax, %%ebx\n" + "xorl %%eax, %%eax\n" + "1:\n" + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + + "addl %%ebx, %%esi\n" + "subl $8, %%esi\n" + "addl %%ebx, %%edi\n" + "subl $8, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride), "c"(0), "d"(8), "g" (Src), "g"(Dst) + : "esi", "edi" + ); + }/**/ + void CopyBlockHorVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 8; dy++) { + for (dx = 0; dx < 8; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1] + + Src[dx+Stride] + Src[dx+Stride+1] +2) >> 2; // horver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyBlockHorVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 8; dy++) { + for (dx = 0; dx < 8; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1] + + Src[dx+Stride] + Src[dx+Stride+1] +1) >> 2; // horver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /** *** **/ + void CopyMBlock(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ + ( + "movl %0, %%eax\n" + "movl %2, %%esi\n" + "movl %3, %%edi\n" + "pushl %%ebx\n" + "movl %%eax, %%ebx\n" + "1:\n" + + "movl (%%esi), %%eax\n" + "movl %%eax, (%%edi)\n" + "addl $4, %%esi\n" + "addl $4, %%edi\n" + + "movl (%%esi), %%eax\n" + "movl %%eax, (%%edi)\n" + "addl $4, %%esi\n" + "addl $4, %%edi\n" + + "movl (%%esi), %%eax\n" + "movl %%eax, (%%edi)\n" + "addl $4, %%esi\n" + "addl $4, %%edi\n" + + "movl (%%esi), %%eax\n" + "movl %%eax, (%%edi)\n" + + "addl %%ebx, %%esi\n" + "addl %%ebx, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "g"(Stride-12), "d"(16), "g" (Src), "g" (Dst) + : "esi", "edi" + ); + } + /**/ + + void CopyMBlockHor(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "movl %2, %%esi\n" + "movl %3, %%edi\n" + "pushl %%ebx\n" + "1:\n" + "pushl %%edx\n" + + CopyBlockHorLoopFast + CopyBlockHorLoopFast + CopyBlockHorLoopFast + CopyBlockHorLoopFast + + "popl %%edx\n" + "addl %%ecx, %%esi\n" + "addl %%ecx, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "c"(Stride-16), "d"(16), "g" (Src), "g"(Dst) + : "esi", "edi" + ); + } + void CopyMBlockVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "movl %2, %%esi\n" + "movl %3, %%edi\n" + "pushl %%ebx\n" + "1:\n" + "pushl %%edx\n" + + CopyBlockVerLoopFast + CopyBlockVerLoopFast + CopyBlockVerLoopFast + CopyBlockVerLoopFast + + "popl %%edx\n" + "addl %%ecx, %%esi\n" + "subl $16, %%esi\n" + "addl %%ecx, %%edi\n" + "subl $16, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "c"(Stride), "d"(16), "g" (Src), "g"(Dst) + : "esi", "edi" + ); + } + /* + void CopyMBlockHor(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "pushl %%ebx\n" + "movl %1, %%ebx\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "1:\n" + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + CopyBlockHorLoop + + "addl %%ebx, %%esi\n" + "addl %%ebx, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride-16), "c"(0), "d"(16), "g" (Src), "g"(Dst) + ); + } + */ + /* + void CopyMBlockVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "pushl %%ebx\n" + "movl %1, %%ebx\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "1:\n" + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + CopyBlockVerLoop + + "addl %%ebx, %%esi\n" + "subl $16, %%esi\n" + "addl %%ebx, %%edi\n" + "subl $16, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride), "c"(0), "d"(16), "g" (Src), "g"(Dst) + ); + } + */ + void CopyMBlockHorRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "movl %1, %%eax\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "pushl %%ebx\n" + "movl %%eax, %%ebx\n" + "xorl %%eax, %%eax\n" + "1:\n" + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + CopyBlockHorLoopRound + + "addl %%ebx, %%esi\n" + "addl %%ebx, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride-16), "c"(0), "d"(16), "g" (Src), "g"(Dst) + : "esi", "edi" + ); + } + void CopyMBlockVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ ( + "movl %1, %%eax\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "pushl %%ebx\n" + "movl %%eax, %%ebx\n" + "xorl %%eax, %%eax\n" + "1:\n" + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + CopyBlockVerLoopRound + + "addl %%ebx, %%esi\n" + "subl $16, %%esi\n" + "addl %%ebx, %%edi\n" + "subl $16, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride), "c"(0), "d"(16), "g" (Src), "g"(Dst) + : "esi", "edi" + ); + } + /**/ + void CopyMBlockHorVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ + ( + "movl %1, %%eax\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "pushl %%ebx\n" + "movl %%eax, %%ebx\n" + "xorl %%eax, %%eax\n" + "1:\n" + CopyBlockHorVerLoop(0) + CopyBlockHorVerLoop(1) + CopyBlockHorVerLoop(2) + CopyBlockHorVerLoop(3) + CopyBlockHorVerLoop(4) + CopyBlockHorVerLoop(5) + CopyBlockHorVerLoop(6) + CopyBlockHorVerLoop(7) + CopyBlockHorVerLoop(8) + CopyBlockHorVerLoop(9) + CopyBlockHorVerLoop(10) + CopyBlockHorVerLoop(11) + CopyBlockHorVerLoop(12) + CopyBlockHorVerLoop(13) + CopyBlockHorVerLoop(14) + CopyBlockHorVerLoop(15) + + "addl %%ebx, %%esi\n" + "addl %%ebx, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride), "c" (0), "d" (16), "g" (Src), "g" (Dst) + : "esi", "edi" + ); + } + + void CopyMBlockHorVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + __asm__ + ( + "movl %1, %%eax\n" + "movl %4, %%esi\n" + "movl %5, %%edi\n" + "pushl %%ebx\n" + "movl %%eax, %%ebx\n" + "xorl %%eax, %%eax\n" + "1:\n" + CopyBlockHorVerLoopRound(0) + CopyBlockHorVerLoopRound(1) + CopyBlockHorVerLoopRound(2) + CopyBlockHorVerLoopRound(3) + CopyBlockHorVerLoopRound(4) + CopyBlockHorVerLoopRound(5) + CopyBlockHorVerLoopRound(6) + CopyBlockHorVerLoopRound(7) + CopyBlockHorVerLoopRound(8) + CopyBlockHorVerLoopRound(9) + CopyBlockHorVerLoopRound(10) + CopyBlockHorVerLoopRound(11) + CopyBlockHorVerLoopRound(12) + CopyBlockHorVerLoopRound(13) + CopyBlockHorVerLoopRound(14) + CopyBlockHorVerLoopRound(15) + + "addl %%ebx, %%esi\n" + "addl %%ebx, %%edi\n" + "decl %%edx\n" + "jnz 1b\n" + "popl %%ebx\n" + : + : "a"(0), "g"(Stride), "c" (0), "d" (16), "g" (Src), "g" (Dst) + : "esi", "edi" + ); + } diff -C2 -r -N bcast-2000c/quicktime/decore50/basic_prediction.c bcast-2000c-mf3/quicktime/decore50/basic_prediction.c *** bcast-2000c/quicktime/decore50/basic_prediction.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/basic_prediction.c Fri Dec 7 15:33:59 2001 *************** *** 0 **** --- 1,290 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + + #include "basic_prediction.h" + + /* + + half_flag[t] + + t = 0 horizontal component + t = 1 vertical component + + */ + + // Purpose: specialized basic motion compensation routines + void CopyBlock(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy; + + #ifdef BIG_ENDIAN + char *lpSrc = (char *) Src; + char *lpDst = (char *) Dst; + int lpStride = Stride; + + for (dy = 0; dy < 8; dy++) { + lpDst[0] = lpSrc[0]; + lpDst[1] = lpSrc[1]; + lpDst[2] = lpSrc[2]; + lpDst[3] = lpSrc[3]; + lpDst[4] = lpSrc[4]; + lpDst[5] = lpSrc[5]; + lpDst[6] = lpSrc[6]; + lpDst[7] = lpSrc[7]; + lpSrc += lpStride; + lpDst += lpStride; + } + #else + long *lpSrc = (long *) Src; + long *lpDst = (long *) Dst; + int lpStride = Stride >> 2; + + for (dy = 0; dy < 8; dy++) { + lpDst[0] = lpSrc[0]; + lpDst[1] = lpSrc[1]; + lpSrc += lpStride; + lpDst += lpStride; + } + #endif + } + /**/ + void CopyBlockHor(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 8; dy++) { + for (dx = 0; dx < 8; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1]+1) >> 1; // hor interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyBlockVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 8; dy++) { + for (dx = 0; dx < 8; dx++) { + Dst[dx] = (Src[dx] + Src[dx+Stride] +1) >> 1; // ver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyBlockHorVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 8; dy++) { + for (dx = 0; dx < 8; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1] + + Src[dx+Stride] + Src[dx+Stride+1] +2) >> 2; // horver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyBlockHorRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + + + for (dy = 0; dy < 8; dy++) + { + + + for (dx = 0; dx < 8; dx++) \ + { + Dst[dx] = (Src[dx] + Src[dx+1]) >> 1; // hor interpolation with rounding + } + + + + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyBlockVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 8; dy++) { + for (dx = 0; dx < 8; dx++) { + Dst[dx] = (Src[dx] + Src[dx+Stride]) >> 1; // ver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyBlockHorVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 8; dy++) { + for (dx = 0; dx < 8; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1] + + Src[dx+Stride] + Src[dx+Stride+1] +1) >> 2; // horver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /** *** **/ + void CopyMBlock(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy; + + #ifdef BIG_ENDIAN + char *lpSrc = (char *) Src; + char *lpDst = (char *) Dst; + int lpStride = Stride; + + for (dy = 0; dy < 16; dy++) { + lpDst[0] = lpSrc[0]; + lpDst[1] = lpSrc[1]; + lpDst[2] = lpSrc[2]; + lpDst[3] = lpSrc[3]; + lpDst[4] = lpSrc[4]; + lpDst[5] = lpSrc[5]; + lpDst[6] = lpSrc[6]; + lpDst[7] = lpSrc[7]; + lpDst[8] = lpSrc[8]; + lpDst[9] = lpSrc[9]; + lpDst[10] = lpSrc[10]; + lpDst[11] = lpSrc[11]; + lpDst[12] = lpSrc[12]; + lpDst[13] = lpSrc[13]; + lpDst[14] = lpSrc[14]; + lpDst[15] = lpSrc[15]; + lpSrc += lpStride; + lpDst += lpStride; + } + #else + long *lpSrc = (long *) Src; + long *lpDst = (long *) Dst; + int lpStride = Stride >> 2; + + for (dy = 0; dy < 16; dy++) { + lpDst[0] = lpSrc[0]; + lpDst[1] = lpSrc[1]; + lpDst[2] = lpSrc[2]; + lpDst[3] = lpSrc[3]; + lpSrc += lpStride; + lpDst += lpStride; + } + #endif + } + /**/ + void CopyMBlockHor(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 16; dy++) { + for (dx = 0; dx < 16; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1]+1) >> 1; // hor interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyMBlockVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 16; dy++) { + for (dx = 0; dx < 16; dx++) { + Dst[dx] = (Src[dx] + Src[dx+Stride] +1) >> 1; // ver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyMBlockHorVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 16; dy++) { + for (dx = 0; dx < 16; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1] + + Src[dx+Stride] + Src[dx+Stride+1] +2) >> 2; // horver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyMBlockHorRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 16; dy++) { + for (dx = 0; dx < 16; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1]) >> 1; // hor interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyMBlockVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 16; dy++) { + for (dx = 0; dx < 16; dx++) { + Dst[dx] = (Src[dx] + Src[dx+Stride]) >> 1; // ver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyMBlockHorVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 16; dy++) { + for (dx = 0; dx < 16; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1] + + Src[dx+Stride] + Src[dx+Stride+1] +1) >> 2; // horver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } diff -C2 -r -N bcast-2000c/quicktime/decore50/basic_prediction.h bcast-2000c-mf3/quicktime/decore50/basic_prediction.h *** bcast-2000c/quicktime/decore50/basic_prediction.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/basic_prediction.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,49 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + **/ + + #ifndef _BASIC_PREDICTION_H_ + #define _BASIC_PREDICTION_H_ + + void CopyBlock(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyBlockHor(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyBlockVer(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyBlockHorVer(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyBlockHorRound(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyBlockVerRound(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyBlockHorVerRound(unsigned char * Src, unsigned char * Dst, int Stride); + /**/ + void CopyMBlock(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyMBlockHor(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyMBlockVer(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyMBlockHorVer(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyMBlockHorRound(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyMBlockVerRound(unsigned char * Src, unsigned char * Dst, int Stride); + void CopyMBlockHorVerRound(unsigned char * Src, unsigned char * Dst, int Stride); + + #endif // _BASIC_PREDICTION_H_ diff -C2 -r -N bcast-2000c/quicktime/decore50/clearblock.c bcast-2000c-mf3/quicktime/decore50/clearblock.c *** bcast-2000c/quicktime/decore50/clearblock.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/clearblock.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,53 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + /// clearblock.c // + + #include "portab.h" + + /** + * + **/ + + // zeros a memory block + // + void clearblock (short *psBlock) + { + uint32_t* pu32_b; + int i; + + pu32_b = (uint32_t *) psBlock; + + for (i = 0; i < 4; i++) + { + pu32_b[0] = pu32_b[1] = pu32_b[2] = pu32_b[3] = + pu32_b[4] = pu32_b[5] = pu32_b[6] = pu32_b[7] = 0; + pu32_b += 8; // 16 coeff zeroed + } + } diff -C2 -r -N bcast-2000c/quicktime/decore50/clearblock.h bcast-2000c-mf3/quicktime/decore50/clearblock.h *** bcast-2000c/quicktime/decore50/clearblock.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/clearblock.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,37 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // _clearblock_h_ // + + #ifndef _CLEARBLOCK_H_ + #define _CLEARBLOCK_H_ + + extern void clearblock (short *psBlock); + + #endif // _CLEARBLOCK_H_ diff -C2 -r -N bcast-2000c/quicktime/decore50/debug.c bcast-2000c-mf3/quicktime/decore50/debug.c *** bcast-2000c/quicktime/decore50/debug.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/debug.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,116 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // debug.c // + + #include + #include + + #include "mp4_vars.h" + + #include "debug.h" + + /** + * + **/ + + #ifndef _DECORE + #ifdef _DEBUG + + static int siPrintPic_start = 0; + static int siPrintPic_end = 0; + static int siPrintMba_start = 0; + static int siPrintMba_end = 0; + + /***/ + + void _SetPrintCond(int picnum_start, int picnum_end, + int mba_start, int mba_end) + { + siPrintPic_start = picnum_start; + siPrintPic_end = picnum_end; + siPrintMba_start = mba_start; + siPrintMba_end = mba_end; + } + + /*** + extern FILE *debug_file; + + void _Print(const char * format, ...) + { + if ((mp4_hdr.picnum >= siPrintPic_start) && + (mp4_hdr.picnum <= siPrintPic_end)) + { + if ((mp4_hdr.mba >= siPrintMba_start) && + (mp4_hdr.mba <= siPrintMba_end)) + { + va_list arglist; + va_start(arglist, format); + fprintf(debug_file, format, arglist); + va_end(arglist); + fflush(debug_file); + } + } + } + ***/ + + void _Print(const char * format, ...) + { + if ((mp4_state->hdr.picnum >= siPrintPic_start) && + (mp4_state->hdr.picnum <= siPrintPic_end)) + { + if ((mp4_state->hdr.mba >= siPrintMba_start) && + (mp4_state->hdr.mba <= siPrintMba_end)) + { + va_list arglist; + va_start(arglist, format); + vprintf(format, arglist); + va_end(arglist); + } + } + } + + void _Break(int picnum, int mba) + { + if ((mp4_state->hdr.picnum == picnum) && (mp4_state->hdr.mba == mba)) { + int iBreak = 0; + // exit(0); + } + } + + void _Error(const char * format, ...) + { + va_list arglist; + va_start(arglist, format); + vprintf(format, arglist); + va_end(arglist); + } + + #endif + #endif diff -C2 -r -N bcast-2000c/quicktime/decore50/debug.h bcast-2000c-mf3/quicktime/decore50/debug.h *** bcast-2000c/quicktime/decore50/debug.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/debug.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,61 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani + * + * DivX Advanced Research Center + * + **/ + // debug.h // + + #ifndef _DEBUG_H_ + #define _DEBUG_H_ + + #ifndef _DECORE + #ifdef _DEBUG + + extern void _SetPrintCond( + int picnum_start, int picnum_end, + int mba_start, int mba_end); + extern void _Print(const char * format, ...); + extern void _Break(int picnum, int mba); + extern void _Error(const char * format, ...); + + #else + + #define _SetPrintCond(a, b, c, d) + #define _Break(a, b) + #define _Print + #define _Error + + #endif // _DEBUG + #else + + #define _SetPrintCond(a, b, c, d) + #define _Break(a, b) + #define _Print + #define _Error + + #endif // ! _DECORE + #endif // _DEBUG_H_ diff -C2 -r -N bcast-2000c/quicktime/decore50/decore.c bcast-2000c-mf3/quicktime/decore50/decore.c *** bcast-2000c/quicktime/decore50/decore.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/decore.c Thu Dec 13 16:12:01 2001 *************** *** 0 **** --- 1,558 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani + * Adam Li + * Jonathan White + * + * DivX Advanced Research Center + * + **/ + // decore.c // + + #include + #include + + #if ( (defined (WIN32)) && (! defined (_DECORE)) ) + #include + #include + #include + #endif + + #include "gen_usetime.h" + #include "debug.h" + #include "mp4_vars.h" + #include "getbits.h" + #include "yuv2rgb.h" + #include "decore.h" + + /** + * + **/ + + /***/ + + static int flag_firstpicture = 1; + + /***/ + + int STDCALL decore(unsigned long handle, unsigned long dec_opt, + void *param1, void *param2) + { + if (handle) + { + switch (dec_opt) + { + case DEC_OPT_MEMORY_REQS: + { + DEC_PARAM *dec_param = (DEC_PARAM *)param1; + DEC_MEM_REQS *dec_mem_reqs = (DEC_MEM_REQS *)param2; + + int coded_y_size = ((dec_param->x_dim + 64) * (dec_param->y_dim + 64)); + int coded_c_size = (((dec_param->x_dim>>1) + 64) * ((dec_param->y_dim>>1) + 64)); + int display_y_size = (dec_param->x_dim * dec_param->y_dim); + int display_c_size = ((dec_param->x_dim * dec_param->y_dim) >> 2); + int edged_size = coded_y_size + (2 * coded_c_size); + int display_size = display_y_size + (2 * display_c_size); + + dec_mem_reqs->mp4_edged_ref_buffers_size = edged_size; + dec_mem_reqs->mp4_edged_for_buffers_size = edged_size; + dec_mem_reqs->mp4_display_buffers_size = display_size; + dec_mem_reqs->mp4_state_size = sizeof(MP4_STATE); + dec_mem_reqs->mp4_tables_size = sizeof(MP4_TABLES); + dec_mem_reqs->mp4_stream_size = sizeof(MP4_STREAM); + + return DEC_OK; + } + case DEC_OPT_INIT: + { + DEC_PARAM *dec_param = (DEC_PARAM *) param1; + + decore_init(dec_param->x_dim, + dec_param->y_dim, + dec_param->output_format, + dec_param->time_incr, + dec_param->buffers); // init decoder resources + + return DEC_OK; + } + break; + case DEC_OPT_RELEASE: + { + decore_release(); + + return DEC_OK; + } + break; + case DEC_OPT_SETPP: + { + DEC_SET *dec_set = (DEC_SET *) param1; + int postproc_level = dec_set->postproc_level; + + if ((postproc_level < 0) | (postproc_level > 100)) + return DEC_BAD_FORMAT; + + if (postproc_level < 1) { + mp4_state->post_flag = 0; + return DEC_OK; + } + else + { + mp4_state->post_flag = 1; + + if (postproc_level < 10) { + mp4_state->pp_options = PP_DEBLOCK_Y_H; + } + else if (postproc_level < 20) { + mp4_state->pp_options = PP_DEBLOCK_Y_H | PP_DEBLOCK_Y_V; + } + else if (postproc_level < 30) { + mp4_state->pp_options = PP_DEBLOCK_Y_H | PP_DEBLOCK_Y_V | PP_DERING_Y; + } + else if (postproc_level < 40) { + mp4_state->pp_options = PP_DEBLOCK_Y_H | PP_DEBLOCK_Y_V | PP_DERING_Y | PP_DEBLOCK_C_H; + } + else if (postproc_level < 50) { + mp4_state->pp_options = PP_DEBLOCK_Y_H | PP_DEBLOCK_Y_V | PP_DERING_Y | + PP_DEBLOCK_C_H | PP_DEBLOCK_C_V; + } + else { + mp4_state->pp_options = PP_DEBLOCK_Y_H | PP_DEBLOCK_Y_V | PP_DERING_Y | + PP_DEBLOCK_C_H | PP_DEBLOCK_C_V | PP_DERING_C; + } + } + + return DEC_OK; + } + break; + case DEC_OPT_SETOUT: + { + DEC_PARAM *dec_param = (DEC_PARAM *) param1; + + decore_setoutput(dec_param->output_format); + + return DEC_OK; + } + break; + default: + { + DEC_FRAME *dec_frame = (DEC_FRAME *) param1; + + if (decore_frame(dec_frame->bitstream, dec_frame->length, + dec_frame->bmp, dec_frame->stride, dec_frame->render_flag)) + return DEC_OK; + else + return DEC_EXIT; + } + break; + } + } + return DEC_BAD_FORMAT; + } + + /***/ + + int decore_alloc(DEC_BUFFERS buffers); + + static int decore_init(int hor_size, + int ver_size, + int output_format, + int time_inc, + DEC_BUFFERS buffers) + { + mp4_state = (MP4_STATE *) buffers.mp4_state; + mp4_tables = (MP4_TABLES *) buffers.mp4_tables; + ld = (MP4_STREAM *) buffers.mp4_stream; + + #ifndef _DECORE + // open input file + if ((ld->infile = open (mp4_state->infilename, O_RDONLY | O_BINARY)) < 0) { + _Print ("Input file %s not found\n", mp4_state->infilename); + exit(91); + } + initbits (NULL, 0); + mp4_state->juice_flag = 0; + #else + mp4_state->juice_flag = 1; + #endif // _DECORE + + mp4_state->post_flag = 0; + + // read first vol and vop + mp4_state->hdr.width = hor_size; + mp4_state->hdr.height = ver_size; + + mp4_state->hdr.quant_precision = 5; + mp4_state->hdr.bits_per_pixel = 8; + + mp4_state->hdr.quant_type = 0; + + if (flag_firstpicture == 1) { + mp4_state->hdr.time_increment_resolution = 15; + flag_firstpicture = 0; + } + mp4_state->hdr.complexity_estimation_disable = 1; + + decore_alloc (buffers); + decore_setoutput (output_format); + + return 1; + } + + /***/ + + int decore_alloc(DEC_BUFFERS buffers) + { + mp4_state->hdr.picnum = 0; + mp4_state->hdr.mb_xsize = mp4_state->hdr.width / 16; + mp4_state->hdr.mb_ysize = mp4_state->hdr.height / 16; + mp4_state->hdr.mba_size = mp4_state->hdr.mb_xsize * mp4_state->hdr.mb_ysize; + + // set picture dimension global vars + { + mp4_state->horizontal_size = mp4_state->hdr.width; + mp4_state->vertical_size = mp4_state->hdr.height; + + mp4_state->mb_width = mp4_state->horizontal_size / 16; + mp4_state->mb_height = mp4_state->vertical_size / 16; + + mp4_state->coded_picture_width = mp4_state->horizontal_size + 64; + mp4_state->coded_picture_height = mp4_state->vertical_size + 64; + mp4_state->chrom_width = mp4_state->coded_picture_width >> 1; + mp4_state->chrom_height = mp4_state->coded_picture_height >> 1; + } + + // init decoder + initdecoder (buffers); + + return 1; + } + + /***/ + + int decore_frame(unsigned char *stream, int length, unsigned char *bmp[], + unsigned int stride, int render_flag) + { + #ifndef _DECORE + mp4_state->juice_flag = 0; + _SetPrintCond(0, 1000, 0, 1000); + _Print("- Picture %d\r", mp4_state->hdr.picnum); + #else + initbits (stream, length); + #endif // _DECORE + + // mp4_state->hdr.time_increment_resolution = 15; // [Ag][Review] This must be passed by the app! + //printf("decore_frame 1\n"); + + getvolhdr(); + getgophdr(); + + //printf("decore_frame 1\n"); + if (! getvophdr()) // read vop header + return 0; + //printf("decore_frame 1\n"); + + get_mp4picture(bmp, stride, render_flag); // decode vop + mp4_state->hdr.picnum++; + //printf("decore_frame 2\n"); + + return 1; + } + + /***/ + + static int decore_release() + { + // closedecoder(); // [Ag][Review] + + /* + I have to check and close the decoder only when it is really been opened: + for some reason VirtualDub first of all wants to close the decoder and this + cause a free(nothing) and a crash. + */ + #ifndef _DECORE + close (ld->infile); + #endif // _DECORE + + return 1; + } + + /***/ + + int decore_setoutput(int output_format) + { + mp4_state->flag_invert = +1; + + switch (output_format) + { + case DEC_RGB32: + mp4_state->convert_yuv = yuv2rgb_32; + mp4_state->flag_invert = -1; + break; + case DEC_RGB32_INV: + mp4_state->convert_yuv = yuv2rgb_32; + mp4_state->flag_invert = +1; + break; + case DEC_RGB24: + mp4_state->convert_yuv = yuv2rgb_24; + mp4_state->flag_invert = -1; + break; + case DEC_RGB24_INV: + mp4_state->convert_yuv = yuv2rgb_24; + mp4_state->flag_invert = +1; + break; + case DEC_RGB555: + mp4_state->convert_yuv = yuv2rgb_555; + mp4_state->flag_invert = -1; + break; + case DEC_RGB555_INV: + mp4_state->convert_yuv = yuv2rgb_555; + mp4_state->flag_invert = +1; + break; + case DEC_RGB565: + mp4_state->convert_yuv = yuv2rgb_565; + mp4_state->flag_invert = -1; + break; + case DEC_RGB565_INV: + mp4_state->convert_yuv = yuv2rgb_565; + mp4_state->flag_invert = +1; + break; + case DEC_420: + mp4_state->convert_yuv = yuv12_out; + break; + case DEC_YUV2: + mp4_state->convert_yuv = yuy2_out; + break; + case DEC_UYVY: + mp4_state->convert_yuv = uyvy_out; + break; + } + + return 1; + } + + /** + * for a console application + **/ + + #ifndef _DECORE + + /***/ + + static int dec_reinit(); + + static void options (int *argcp, char **argvp[]); + static void optionhelp (int *argcp); + + /*** + + int main (int argc, char *argv[]) + { + char * infilename = argv[1]; + mp4_state->output_flag = mp4_state->juice_flag = mp4_state->post_flag = 0; + + // decode args from input line + optionhelp (&argc); + options (&argc, &argv); + + // startTimer(); + + dec_init(infilename, mp4_state->juice_hor, mp4_state->juice_ver); // init decoder resources + + _SetPrintCond(0, 1000, 0, 1000); + + while (dec_frame()) // cycle on decoding engine + ; + + // stopTimer(); + // displayTimer(mp4_hdr.picnum); + + dec_release(); // release decoder resources + + return 0; + } + + ***/ + + int main (int argc, char *argv[]) + { + char * infilename = argv[1]; + char outputfilename[256] = "Test.yuv"; + + DEC_MEM_REQS decMemReqs; + DEC_PARAM decParam; + + decParam.x_dim = 352; + decParam.y_dim = 288; + decParam.output_format = 0; + decParam.time_incr = 0; + + decore(1, DEC_OPT_MEMORY_REQS, &decParam, &decMemReqs); + + decParam.buffers.mp4_edged_ref_buffers = malloc(decMemReqs.mp4_edged_ref_buffers_size); + decParam.buffers.mp4_edged_for_buffers = malloc(decMemReqs.mp4_edged_for_buffers_size); + decParam.buffers.mp4_display_buffers = malloc(decMemReqs.mp4_display_buffers_size); + decParam.buffers.mp4_state = malloc(decMemReqs.mp4_state_size); + decParam.buffers.mp4_tables = malloc(decMemReqs.mp4_tables_size); + decParam.buffers.mp4_stream = malloc(decMemReqs.mp4_stream_size); + + memset(decParam.buffers.mp4_state, 0, decMemReqs.mp4_state_size); + memset(decParam.buffers.mp4_tables, 0, decMemReqs.mp4_tables_size); + memset(decParam.buffers.mp4_stream, 0, decMemReqs.mp4_stream_size); + + ((MP4_STATE *) decParam.buffers.mp4_state)->infilename = infilename; + ((MP4_STATE *) decParam.buffers.mp4_state)->outputname = outputfilename; + + decore(1, DEC_OPT_INIT, &decParam, NULL); + + startTimer(); + + // decode frames + { + DEC_FRAME decFrame; + + decFrame.bitstream = NULL; + decFrame.bmp = NULL; + decFrame.length = 0; + decFrame.render_flag = 0; + + while ( decore(1, 0, &decFrame, NULL) == DEC_OK ) + ; + } + + stopTimer(); + displayTimer(mp4_state->hdr.picnum); + + return 1; + } + + /***/ + + static void options (int *argcp, char **argvp[]) + { + (*argvp)++; + (*argcp)--; + + while (*argcp > 1 && (*argvp)[1][0] == '-') + { + switch (toupper ((*argvp)[1][1])) + { + case 'O': + mp4_state->output_flag = 1; + mp4_state->outputname = (*argvp)[2]; + (*argvp) += 2; + (*argcp) -= 2; + break; + case 'J': + mp4_state->juice_flag = 1; + mp4_state->juice_hor = atoi ((*argvp)[2]); + mp4_state->juice_ver = atoi ((*argvp)[3]); + (*argvp) += 3; + (*argcp) -= 3; + break; + default: + printf ("Error: Undefined option -%c ignored\n", (*argvp)[1][1]); + } + } + } + + /***/ + + static void optionhelp(int *argcp) + { + if (*argcp < 2) + { + _Print ("Usage: opendivx_dec bitstream {options} \n"); + _Print ("Options: -o {outputfilename} YUV concatenated file output\n"); + _Print (" -j {hor_size ver_size} juice stream and its picture format\n"); + exit (0); + } + } + + /*** + + int dec_init(char *infilename, int hor_size, int ver_size, DEC_BUFFERS buffers) + { + mp4_state = (MP4_STATE *) buffers.mp4_state; + mp4_tables = (MP4_TABLES *) buffers.mp4_tables; + + // open input file + if ((mp4_state->ld.infile = open (infilename, O_RDONLY | O_BINARY)) < 0) { + _Print ("Input file %s not found\n", infilename); + exit(91); + } + + initbits (NULL); + + // read header info (contains info to correctly initialize the decoder) + getvolhdr(); + + getgophdr(); + getvophdr(); // read vop header + + decore_alloc(buffers); + + return 1; + } + + + + int dec_frame() + { + // decoded vop + get_mp4picture(NULL, 0, 0); + mp4_state->hdr.picnum++; + + _Print("- Picture %d\r", mp4_state->hdr.picnum); + + // read next vop header + getvolhdr(); + getgophdr(); + return getvophdr(); + } + + + + int dec_release() + { + close (mp4_state->ld.infile); + decore_release(); + + return 1; + } + + ***/ + + int dec_reinit() + { + if (ld->infile != 0) + lseek (ld->infile, 0l, 0); + initbits (NULL, 0); + + return 1; + } + + /***/ + + #endif // !_DECORE diff -C2 -r -N bcast-2000c/quicktime/decore50/decore.h bcast-2000c-mf3/quicktime/decore50/decore.h *** bcast-2000c/quicktime/decore50/decore.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/decore.h Thu Dec 13 16:11:29 2001 *************** *** 0 **** --- 1,152 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. Those intending to * + * use this software module in hardware or software products are advised * + * that its use may infringe existing patents or copyrights, and any such * + * use would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec and Filter a license to this * + * software module or modifications thereof for use in hardware or * + * software products claiming conformance to the MPEG-4 Video Standard * + * as described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Adam Li + * Andrea Graziani + * Jonathan White + * + * DivX Advanced Research Center + * + **/ + // decore.h // + + // This is the header file describing + // the entrance function of the encoder core + // or the encore ... + + #ifdef __cplusplus + extern "C" { + #endif + + #ifndef _DECORE_H_ + #define _DECORE_H_ + + #ifdef WIN32 + #define STDCALL _stdcall + #else + #define STDCALL + #endif + + #if ( (! defined (WIN32)) && (! defined (LINUX)) ) + #define BIG_ENDIAN + #endif + + /** + * + **/ + + // decore options + #define DEC_OPT_MEMORY_REQS 0x00004000 + #define DEC_OPT_INIT 0x00008000 + #define DEC_OPT_RELEASE 0x00010000 + #define DEC_OPT_SETPP 0x00020000 // set postprocessing mode + #define DEC_OPT_SETOUT 0x00040000 // set output mode + + // decore return values + #define DEC_OK 0 + #define DEC_MEMORY 1 + #define DEC_BAD_FORMAT 2 + #define DEC_EXIT 3 + + // decore YUV color format + #define DEC_YUV2 1 + #define DEC_UYVY 2 + #define DEC_420 3 + + // decore RGB color format + #define DEC_RGB32 4 + #define DEC_RGB24 5 + #define DEC_RGB555 6 + #define DEC_RGB565 7 + + #define DEC_RGB32_INV 8 + #define DEC_RGB24_INV 9 + #define DEC_RGB555_INV 10 + #define DEC_RGB565_INV 11 + + /* this is necessary for the max resolution (juice resolution) */ + #define DEC_MBC 128 + #define DEC_MBR 128 + + /** + * + **/ + + typedef struct _DEC_MEM_REQS_ + { + unsigned long mp4_edged_ref_buffers_size; + unsigned long mp4_edged_for_buffers_size; + unsigned long mp4_display_buffers_size; + unsigned long mp4_state_size; + unsigned long mp4_tables_size; + unsigned long mp4_stream_size; + } DEC_MEM_REQS; + + typedef struct _DEC_BUFFERS_ + { + void * mp4_edged_ref_buffers; + void * mp4_edged_for_buffers; + void * mp4_display_buffers; + void * mp4_state; + void * mp4_tables; + void * mp4_stream; + } DEC_BUFFERS; + + typedef struct _DEC_PARAM_ + { + int x_dim; // x dimension of the frames to be decoded + int y_dim; // y dimension of the frames to be decoded + int output_format; // output color format + int time_incr; + DEC_BUFFERS buffers; + } DEC_PARAM; + + typedef struct _DEC_FRAME_ + { + void *bmp[3]; // the decoded bitmap + void *bitstream; // the decoder buffer + long length; // the lenght of the decoder stream + int render_flag; // 1: the frame is going to be rendered + unsigned int stride; // decoded bitmap stride + } DEC_FRAME; + + typedef struct _DEC_SET_ + { + int postproc_level; // valid interval are [0..100] + } DEC_SET; + + /** + * + **/ + + // the prototype of the decore() - main decore engine entrance + // + int STDCALL decore( + unsigned long handle, // handle - the handle of the calling entity, must be unique + unsigned long dec_opt, // dec_opt - the option for docoding, see below + void *param1, // param1 - the parameter 1 (it's actually meaning depends on dec_opt + void *param2); // param2 - the parameter 2 (it's actually meaning depends on dec_opt + + #endif // _DECORE_H_ + #ifdef __cplusplus + } + #endif diff -C2 -r -N bcast-2000c/quicktime/decore50/gen_draw.c bcast-2000c-mf3/quicktime/decore50/gen_draw.c *** bcast-2000c/quicktime/decore50/gen_draw.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/gen_draw.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,153 ---- + // gen_draw.c // + + #include "mp4_decoder.h" + + #include "gen_draw.h" + + /** + * + **/ + + extern int MV[2][6][MBR+1][MBC+2]; // motion vectors + extern int modemap[MBR+1][MBC+2]; // macroblock modes + + /***/ + + static void colorBlock_mv(unsigned char *buff, int stride, int mb_xpos, int mb_ypos, int bnum, int xsize, int ysize); + static void drawline(int stride, int x0, int y0, int dx, int dy, unsigned char *buff, char colour, int xsize, int ysize); + static void check_and_colour(unsigned char *buff, int x0, int y0, int xsize, int ysize, char colour); + + /***/ + + // Purpose: draw motion vectors in a displayable buffer + void colorBuffer_mv(unsigned char *buff, int stride, int xsize, int ysize) + { + int mb_xsize, mb_ysize; + int mb_xpos, mb_ypos; + int bnum; + + mb_xsize = xsize>>4; + mb_ysize = ysize>>4; + + for (mb_ypos = 0; mb_ypos < mb_ysize; mb_ypos++) + { + for (mb_xpos = 0; mb_xpos < mb_xsize; mb_xpos++) + { + switch (modemap[mb_xpos+1][mb_ypos+1]) + { + case MODE_INTER: case MODE_INTER_Q: + { + colorBlock_mv(buff, stride, mb_xpos, mb_ypos, -1, xsize, ysize); + } + break; + case MODE_INTER4V: case MODE_INTER4V_Q: + { + for (bnum = 0; bnum < 4; bnum++) + { + colorBlock_mv(buff, stride, mb_xpos, mb_ypos, bnum, xsize, ysize); + } + } + break; + default: + break; + } + } + } + } + + /***/ + + // Purpose: draw motion vector for this block, bnum is -1 if it's an entire macroblock + static void colorBlock_mv(unsigned char *buff, int stride, int mb_xpos, int mb_ypos, int bnum, int xsize, int ysize) + { + int mvx, mvy; + int xpos = mb_xpos<<4; + int ypos = mb_ypos<<4; + + if (bnum == -1) { + xpos += 8; + ypos += 8; + bnum = 0; // retrieve correct block number for MV extraction + } + else { + xpos += (bnum & 1) ? 12 : 4; + ypos += (bnum & 2) ? 12 : 4; + } + + mvx = MV[0][bnum][mb_xpos+1][mb_ypos+1]; + mvy = MV[1][bnum][mb_xpos+1][mb_ypos+1]; + + drawline(stride, xpos, ypos, mvx, mvy, buff, 0, xsize, ysize); + } + + /***/ + + // John Funnell < johnf@mail.nu > + // Purpose: line drawing function - pilfered from the Net + static void drawline(int stride, int x0, int y0, int dx, int dy, unsigned char *buff, char colour, int xsize, int ysize) { + int y1 = y0 + dy; + int x1 = x0 + dx; + int stepx, stepy; + int fraction; + + if (dy < 0) { + dy = -dy; stepy = -stride; + } + else { + stepy = stride; + } + if (dx < 0) { + dx = -dx; stepx = -1; + } else { + stepx = 1; + } + + // retrieve pixel coord + dy <<= 1; + dx <<= 1; + + // retrieve image coordinates + y0 *= stride; + y1 *= stride; + + check_and_colour(buff, x0, y0, xsize, ysize, colour); + if (dx > dy) { + fraction = dy - (dx >> 1); + while (x0 != x1) { + if (fraction >= 0) { + y0 += stepy; + fraction -= dx; + } + x0 += stepx; + fraction += dy; + check_and_colour(buff, x0, y0, xsize, ysize, colour); + } + } else { + fraction = dx - (dy >> 1); + while (y0 != y1) { + if (fraction >= 0) { + x0 += stepx; + fraction -= dy; + } + y0 += stepy; + fraction += dx; + check_and_colour(buff, x0, y0, xsize, ysize, colour); + } + } + } + + /***/ + + static void check_and_colour(unsigned char *buff, int x0, int y0, int xsize, int ysize, char colour) + { + if (x0 < 0) + return; + if (x0 > xsize) + return; + if (y0 < 0) + return; + if (y0 > (xsize*(ysize-1))) + return; + + buff[x0+y0] = colour; + } diff -C2 -r -N bcast-2000c/quicktime/decore50/gen_draw.h bcast-2000c-mf3/quicktime/decore50/gen_draw.h *** bcast-2000c/quicktime/decore50/gen_draw.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/gen_draw.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,11 ---- + // gen_draw.h // + + #ifndef _GEN_DRAW_H_ + #define _GEN_DRAW_H_ + + #endif // _GEN_DRAW_H_ + + /*** *** ***/ + + // Purpose: draw motion vectors in a displayable buffer + extern void colorBuffer_mv(unsigned char *buff, int stride, int xsize, int ysize); diff -C2 -r -N bcast-2000c/quicktime/decore50/gen_usetime.c bcast-2000c-mf3/quicktime/decore50/gen_usetime.c *** bcast-2000c/quicktime/decore50/gen_usetime.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/gen_usetime.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,38 ---- + // gen_usetime.c // + + #include + #include + + /** + * + **/ + + static int runtime; + static int startTime, stopTime; + + /***/ + + void startTimer() + { + startTime = timeGetTime (); + } + + /***/ + + void stopTimer() + { + stopTime = timeGetTime (); + runtime = (stopTime - startTime); + } + + /***/ + + void displayTimer(int picnum) + { + printf ("%d.%02d seconds, %d frames, %d.%02d fps\n", + runtime / 100, runtime % 100, + picnum, ((10000 * picnum + runtime / 2) / runtime) / 100, + ((10000 * picnum + runtime / 2) / runtime) % 100); + } + + /***/ diff -C2 -r -N bcast-2000c/quicktime/decore50/gen_usetime.h bcast-2000c-mf3/quicktime/decore50/gen_usetime.h *** bcast-2000c/quicktime/decore50/gen_usetime.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/gen_usetime.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,13 ---- + // gen_usetime.h // + + #ifndef _GEN_USETIME_H_ + #define _GEN_USETIME_H_ + + #endif // _GEN_USETIME_H_ + + /*** *** ***/ + + extern void startTimer(); + extern void stopTimer(); + extern void displayTimer(int picnum); + diff -C2 -r -N bcast-2000c/quicktime/decore50/getbits.c bcast-2000c-mf3/quicktime/decore50/getbits.c *** bcast-2000c/quicktime/decore50/getbits.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/getbits.c Fri Dec 7 15:22:46 2001 *************** *** 0 **** --- 1,104 ---- + /************************************************************************ + * + * getbits.c, bit level routines for tmndecode (H.263 decoder) + * Copyright (C) 1995, 1996 Telenor R&D, Norway + * + * Contacts: + * Robert Danielsen + * + * Telenor Research and Development http://www.nta.no/brukere/DVC/ + * P.O.Box 83 tel.: +47 63 84 84 00 + * N-2007 Kjeller, Norway fax.: +47 63 81 00 76 + * + * Copyright (C) 1997 University of BC, Canada + * Modified by: Michael Gallant + * Guy Cote + * Berna Erol + * + * Contacts: + * Michael Gallant + * + * UBC Image Processing Laboratory http://www.ee.ubc.ca/image + * 2356 Main Mall tel.: +1 604 822 4051 + * Vancouver BC Canada V6T1Z4 fax.: +1 604 822 5949 + * + ************************************************************************/ + + /* Disclaimer of Warranty + * + * These software programs are available to the user without any license fee + * or royalty on an "as is" basis. The University of British Columbia + * disclaims any and all warranties, whether express, implied, or + * statuary, including any implied warranties or merchantability or of + * fitness for a particular purpose. In no event shall the + * copyright-holder be liable for any incidental, punitive, or + * consequential damages of any kind whatsoever arising from the use of + * these programs. + * + * This disclaimer of warranty extends to the user of these programs and + * user's customers, employees, agents, transferees, successors, and + * assigns. + * + * The University of British Columbia does not represent or warrant that the + * programs furnished hereunder are free of infringement of any + * third-party patents. + * + * Commercial implementations of H.263, including shareware, are subject to + * royalty fees to patent holders. Many of these patents are general + * enough such that they are unavoidable regardless of implementation + * design. + * + */ + + + /* based on mpeg2decode, (C) 1994, MPEG Software Simulation Group and + * mpeg2play, (C) 1994 Stefan Eckart + * + */ + + /** + * Copyright (C) 2001 - Project Mayo + * + * adapted by Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + + #include + + #include "mp4_vars.h" + + #include "getbits.h" + + #define SE_CODE 31 + + + /* initialize buffer, call once before first getbits or showbits */ + + void initbits (unsigned char * stream, int length) + { + ld->incnt = 0; + ld->bitcnt = 0; + ld->rdptr = ld->rdbfr + 2048; + + #ifdef _DECORE + ld->rdptr = stream; + ld->length = length; + #endif + + + + + + + + + ld->head = stream; + ld->buf = 0; + ld->pos = 64; + //printf("initbits %llx\n", ld->buf); + } + + /* return next n bits (right adjusted) */ + diff -C2 -r -N bcast-2000c/quicktime/decore50/getbits.h bcast-2000c-mf3/quicktime/decore50/getbits.h *** bcast-2000c/quicktime/decore50/getbits.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/getbits.h Mon Dec 17 14:28:22 2001 *************** *** 0 **** --- 1,333 ---- + /************************************************************************** + * * + * This code has been developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advanced Research Center + * + **/ + + #ifndef _DECORE_GETBITS_H + #define _DECORE_GETBITS_H + + void initbits (unsigned char * stream, int length); + void fillbfr (void); + + /***/ + + //#if defined(LINUX) + #if 0 + + // 486+ specific instruction + // anybody want to use decore on 386? + #define _SWAP(a,b) b=*(int*)a; \ + __asm__ ( "bswapl %0\n" : "=g" (b) : "0" (b) ) + + + + #elif defined(WIN32) + + + + #define _SWAP(a,b) \ + b=*(int*)a; __asm mov eax,b __asm bswap eax __asm mov b, eax + + + #else + + + #define _SWAP(a,b) (b=((a[0] << 24) | (a[1] << 16) | (a[2] << 8) | a[3])) + + + #endif + + #ifdef WIN32 + #include + #endif + + /***/ + + + + + + + + #if 1 + + + static void refill(int bits) + { + while(64 - ld->pos < bits) + { + ld->buf <<= 8; + ld->buf |= *ld->head++; + ld->pos -= 8; + } + } + + + + + + + static __inline unsigned int showbits (int bits) + { + uint32_t result; + refill(bits); + + + + result = (uint64_t)(0xffffffffffffffffLL >> (64 - bits)) & + (uint64_t)(ld->buf >> (64 - bits - ld->pos)); + + //printf("showbits %d %x\n", bits, result); + return result; + } + + + static __inline void flushbits (int bits) + { + refill(bits); + ld->pos += bits; + //printf("flushbits %d\n", bits); + } + + + static __inline unsigned int getbits (int bits) + { + uint32_t result; + refill(bits); + result = (uint64_t)(0xffffffffffffffffLL >> (64 - bits)) & + (uint64_t)(ld->buf >> (64 - bits - ld->pos)); + ld->pos += bits; + //printf("getbits %d %x\n", bits, result); + return result; + } + + + static __inline unsigned char getbits1 () + { + uint32_t result; + return getbits(1); + + + refill(1); + + result = 0x1 & (ld->buf >> (63 - ld->pos)); + ld->pos++; + + return result; + } + + + // Purpose: look nbit forward for an alignement + static int __inline bytealigned(int nbit) + { + return (((ld->pos + nbit) % 8) == 0); + } + + static int __inline nextbits_bytealigned(int nbit) + { + int code; + int skipcnt = 0; + + if (bytealigned(skipcnt)) + { + // stuffing bits + if (showbits(8) == 127) { + skipcnt += 8; + } + } + else + { + // bytealign + while (! bytealigned(skipcnt)) { + skipcnt += 1; + } + } + + code = showbits(nbit + skipcnt); + return ((code << skipcnt) >> skipcnt); + } + + + + + + + + + + + + + + + #else + + + + + + + + + + static __inline unsigned int showbits (int n) + { + int rbit = 32 - ld->bitcnt; + unsigned int b; + _SWAP(ld->rdptr, b); + // return ((b & msk[rbit]) >> (rbit-n)); + // Is it platform independent??? + //printf("showbits %d %x\n", n, (b & (0xFFFFFFFFU >> (ld->bitcnt))) >> (rbit-n)); + + return (b & (0xFFFFFFFFU >> (ld->bitcnt))) >> (rbit-n); + } + + static __inline unsigned int showbits_r (int n) + { + int rbit = 32 - ld->bitcnt; + unsigned int b; + _SWAP(ld->rdptr, b); + // return ((b & msk[rbit]) >> (rbit-n)); + // Is it platform independent??? + //printf("showbits %d %x\n", n, (b & (0xFFFFFFFFU >> (ld->bitcnt))) >> (rbit-n)); + + return (b & (0xFFFFFFFFU >> (ld->bitcnt))) >> (rbit-n); + } + + static __inline void flushbits (int n) + { + ld->bitcnt += n; + if (ld->bitcnt >= 8) { + ld->rdptr += ld->bitcnt / 8; + ld->bitcnt = ld->bitcnt % 8; + } + //printf("flushbits %d\n", n); + } + + static __inline void flushbits_r (int n) + { + ld->bitcnt += n; + if (ld->bitcnt >= 8) { + ld->rdptr += ld->bitcnt / 8; + ld->bitcnt = ld->bitcnt % 8; + } + //printf("flushbits %d\n", n); + } + + + static __inline unsigned int getbits (int n) + { + unsigned int l; + + l = showbits_r (n); + flushbits_r (n); + //printf("getbits %d %x\n", n, l); + + return l; + } + + + + + + + + + + + + + /***/ + + // Purpose: look nbit forward for an alignement + static int __inline bytealigned(int nbit) + { + return (((ld->bitcnt + nbit) % 8) == 0); + } + + /***/ + + static int __inline nextbits_bytealigned(int nbit) + { + int code; + int skipcnt = 0; + + if (bytealigned(skipcnt)) + { + // stuffing bits + if (showbits(8) == 127) { + skipcnt += 8; + } + } + else + { + // bytealign + while (! bytealigned(skipcnt)) { + skipcnt += 1; + } + } + + code = showbits(nbit + skipcnt); + return ((code << skipcnt) >> skipcnt); + } + + + /* return next bit (could be made faster than getbits(1)) */ + + + static unsigned char getbits1 () + { + return getbits (1); + } + + + + + + #endif + + + + + + /***/ + + static int __inline nextbits(int nbit) + { + return showbits(nbit); + } + + + + + + + + + + #endif /* _DECORE_GETBITS_H */ diff -C2 -r -N bcast-2000c/quicktime/decore50/global.h bcast-2000c-mf3/quicktime/decore50/global.h *** bcast-2000c/quicktime/decore50/global.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/global.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,92 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // global.h // + + /** + * This file is not longer needed !!! + **/ + + /* GLOBAL is defined in only one file */ + + #include + + #ifndef GLOBAL + #define EXTERN extern + #else + #define EXTERN + #endif + + + /** + * mp4 stuff + **/ + + #include "mp4_header.h" + + EXTERN int juice_flag, + output_flag; + EXTERN char * outputname; + EXTERN int flag_invert; + EXTERN int post_flag, + pp_options; + EXTERN mp4_header mp4_hdr; + EXTERN struct _base + { + // bit input + int infile; + unsigned char rdbfr[2051]; + unsigned char *rdptr; + unsigned char inbfr[16]; + int incnt; + int bitcnt; + // block data + short block[6][64]; + } base, *ld; + EXTERN int MV[2][6][MBR+1][MBC+2]; + EXTERN int modemap[MBR+1][MBC+2]; + EXTERN int quant_store[MBR+1][MBC+1]; // [Review] + EXTERN struct _ac_dc + { + int dc_store_lum[2*MBR+1][2*MBC+1]; + int ac_left_lum[2*MBR+1][2*MBC+1][7]; + int ac_top_lum[2*MBR+1][2*MBC+1][7]; + + int dc_store_chr[2][MBR+1][MBC+1]; + int ac_left_chr[2][MBR+1][MBC+1][7]; + int ac_top_chr[2][MBR+1][MBC+1][7]; + + int predict_dir; + + } ac_dc, *coeff_pred; + EXTERN unsigned char *edged_ref[3], + *edged_for[3], + *frame_ref[3], + *frame_for[3], + *display_frame[3]; diff -C2 -r -N bcast-2000c/quicktime/decore50/idct.c bcast-2000c-mf3/quicktime/decore50/idct.c *** bcast-2000c/quicktime/decore50/idct.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/idct.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,233 ---- + /************************************************************************ + * + * idct.c, inverse fast DCT for tmndecode (H.263 decoder) + * Copyright (C) 1995, 1996 Telenor R&D, Norway + * + * Contacts: + * Robert Danielsen + * + * Telenor Research and Development http://www.nta.no/brukere/DVC/ + * P.O.Box 83 tel.: +47 63 84 84 00 + * N-2007 Kjeller, Norway fax.: +47 63 81 00 76 + * + * Copyright (C) 1997 University of BC, Canada + * Modified by: Michael Gallant + * Guy Cote + * Berna Erol + * + * Contacts: + * Michael Gallant + * + * UBC Image Processing Laboratory http://www.ee.ubc.ca/image + * 2356 Main Mall tel.: +1 604 822 4051 + * Vancouver BC Canada V6T1Z4 fax.: +1 604 822 5949 + * + ************************************************************************/ + + /* Disclaimer of Warranty + * + * These software programs are available to the user without any license fee + * or royalty on an "as is" basis. The University of British Columbia + * disclaims any and all warranties, whether express, implied, or + * statuary, including any implied warranties or merchantability or of + * fitness for a particular purpose. In no event shall the + * copyright-holder be liable for any incidental, punitive, or + * consequential damages of any kind whatsoever arising from the use of + * these programs. + * + * This disclaimer of warranty extends to the user of these programs and + * user's customers, employees, agents, transferees, successors, and + * assigns. + * + * The University of British Columbia does not represent or warrant that the + * programs furnished hereunder are free of infringement of any + * third-party patents. + * + * Commercial implementations of H.263, including shareware, are subject to + * royalty fees to patent holders. Many of these patents are general + * enough such that they are unavoidable regardless of implementation + * design. + * + */ + + + + /* based on mpeg2decode, (C) 1994, MPEG Software Simulation Group and + * mpeg2play, (C) 1994 Stefan Eckart + * + */ + + + /**********************************************************/ + /* inverse two dimensional DCT, Chen-Wang algorithm */ + /* (cf. IEEE ASSP-32, pp. 803-816, Aug. 1984) */ + /* 32-bit integer arithmetic (8 bit coefficients) */ + /* 11 mults, 29 adds per DCT */ + /* sE, 18.8.91 */ + /**********************************************************/ + /* coefficients extended to 12 bit for IEEE1180-1990 */ + /* compliance sE, 2.1.94 */ + /**********************************************************/ + + /* this code assumes >> to be a two's-complement arithmetic */ + /* right shift: (-2)>>1 == -1 , (-3)>>1 == -2 */ + + + #include "mp4_vars.h" + + + void init_idct (); + + + #define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */ + #define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */ + #define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */ + #define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */ + #define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */ + #define W7 565 /* 2048*sqrt(2)*cos(7*pi/16) */ + + + /* row (horizontal) IDCT + * + * 7 pi 1 dst[k] = sum c[l] * src[l] * cos( -- * + * ( k + - ) * l ) l=0 8 2 + * + * where: c[0] = 128 c[1..7] = 128*sqrt(2) + */ + + static void idctrow (short *blk) + { + int x0, x1, x2, x3, x4, x5, x6, x7, x8; + + /* shortcut */ + if (!((x1 = blk[4] << 11) | (x2 = blk[6]) | (x3 = blk[2]) | + (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) + { + blk[0] = blk[1] = blk[2] = blk[3] = blk[4] = blk[5] = blk[6] = blk[7] = blk[0] << 3; + return; + } + x0 = (blk[0] << 11) + 128; /* for proper rounding in the fourth stage */ + + /* first stage */ + x8 = W7 * (x4 + x5); + x4 = x8 + (W1 - W7) * x4; + x5 = x8 - (W1 + W7) * x5; + x8 = W3 * (x6 + x7); + x6 = x8 - (W3 - W5) * x6; + x7 = x8 - (W3 + W5) * x7; + + /* second stage */ + x8 = x0 + x1; + x0 -= x1; + x1 = W6 * (x3 + x2); + x2 = x1 - (W2 + W6) * x2; + x3 = x1 + (W2 - W6) * x3; + x1 = x4 + x6; + x4 -= x6; + x6 = x5 + x7; + x5 -= x7; + + /* third stage */ + x7 = x8 + x3; + x8 -= x3; + x3 = x0 + x2; + x0 -= x2; + x2 = (181 * (x4 + x5) + 128) >> 8; + x4 = (181 * (x4 - x5) + 128) >> 8; + + /* fourth stage */ + blk[0] = (x7 + x1) >> 8; + blk[1] = (x3 + x2) >> 8; + blk[2] = (x0 + x4) >> 8; + blk[3] = (x8 + x6) >> 8; + blk[4] = (x8 - x6) >> 8; + blk[5] = (x0 - x4) >> 8; + blk[6] = (x3 - x2) >> 8; + blk[7] = (x7 - x1) >> 8; + } + + /* column (vertical) IDCT + * + * 7 pi 1 dst[8*k] = sum c[l] * src[8*l] * + * cos( -- * ( k + - ) * l ) l=0 8 2 + * + * where: c[0] = 1/1024 c[1..7] = (1/1024)*sqrt(2) + */ + + + + + + #define CLIP(x) (((x) < -256) ? -256 : (((x) > 0xff) ? 0xff : (x))) + static void idctcol (short *blk) + { + int x0, x1, x2, x3, x4, x5, x6, x7, x8; + + /* shortcut */ + if (!((x1 = (blk[8 * 4] << 8)) | (x2 = blk[8 * 6]) | (x3 = blk[8 * 2]) | + (x4 = blk[8 * 1]) | (x5 = blk[8 * 7]) | (x6 = blk[8 * 5]) | (x7 = blk[8 * 3]))) + { + //printf("idctcol 1\n"); + int result = (blk[8 * 0] + 32) >> 6; + blk[8 * 0] = blk[8 * 1] = blk[8 * 2] = blk[8 * 3] = blk[8 * 4] = blk[8 * 5] = blk[8 * 6] = blk[8 * 7] = + CLIP(result); + //printf("idctcol 2\n"); + return; + } + x0 = (blk[8 * 0] << 8) + 8192; + + /* first stage */ + x8 = W7 * (x4 + x5) + 4; + x4 = (x8 + (W1 - W7) * x4) >> 3; + x5 = (x8 - (W1 + W7) * x5) >> 3; + x8 = W3 * (x6 + x7) + 4; + x6 = (x8 - (W3 - W5) * x6) >> 3; + x7 = (x8 - (W3 + W5) * x7) >> 3; + + /* second stage */ + x8 = x0 + x1; + x0 -= x1; + x1 = W6 * (x3 + x2) + 4; + x2 = (x1 - (W2 + W6) * x2) >> 3; + x3 = (x1 + (W2 - W6) * x3) >> 3; + x1 = x4 + x6; + x4 -= x6; + x6 = x5 + x7; + x5 -= x7; + + /* third stage */ + x7 = x8 + x3; + x8 -= x3; + x3 = x0 + x2; + x0 -= x2; + x2 = (181 * (x4 + x5) + 128) >> 8; + x4 = (181 * (x4 - x5) + 128) >> 8; + + /* fourth stage */ + blk[8 * 0] = CLIP((x7 + x1) >> 14); + blk[8 * 1] = CLIP((x3 + x2) >> 14); + blk[8 * 2] = CLIP((x0 + x4) >> 14); + blk[8 * 3] = CLIP((x8 + x6) >> 14); + blk[8 * 4] = CLIP((x8 - x6) >> 14); + blk[8 * 5] = CLIP((x0 - x4) >> 14); + blk[8 * 6] = CLIP((x3 - x2) >> 14); + blk[8 * 7] = CLIP((x7 - x1) >> 14); + } + + /* + two dimensional inverse discrete cosine transform + this is a reference implementation - no speed optimized + */ + void idct (short *block) + { + int i; + + //printf("idct 1 %p\n", block); + for (i = 0; i < 8; i++) + idctrow (block + 8 * i); + //printf("idct 2\n"); + + for (i = 0; i < 8; i++) + idctcol (block + i); + //printf("idct 3\n"); + } diff -C2 -r -N bcast-2000c/quicktime/decore50/idct.h bcast-2000c-mf3/quicktime/decore50/idct.h *** bcast-2000c/quicktime/decore50/idct.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/idct.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,10 ---- + // idct.h // + + #ifndef _IDCT_H_ + #define _IDCT_H_ + + #ifdef _INTEL_IDCT_ + #define Fast_IDCT idct + #endif // _INTEL_IDCT_ + + #endif // _IDCT_H_ diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/CVS/Entries bcast-2000c-mf3/quicktime/decore50/intel_mmx/CVS/Entries *** bcast-2000c/quicktime/decore50/intel_mmx/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/CVS/Entries Fri Nov 30 18:09:51 2001 *************** *** 0 **** --- 1,6 ---- + D/postprocess//// + /IDCT_MMX.C/1.1/Fri Jan 19 14:34:12 2001// + /basic_prediction_mmx.c/1.1/Sat Jan 20 12:17:06 2001// + /clearblock_mmx.c/1.1/Tue Apr 3 07:09:06 2001// + /transferIDCT_mmx.c/1.1/Thu Mar 1 06:32:58 2001// + /yuv2rgb_mmx.c/1.1/Tue Apr 24 03:27:14 2001// diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/CVS/Repository bcast-2000c-mf3/quicktime/decore50/intel_mmx/CVS/Repository *** bcast-2000c/quicktime/decore50/intel_mmx/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/CVS/Repository Fri Nov 30 18:09:27 2001 *************** *** 0 **** --- 1 ---- + quicktime/decore50/intel_mmx diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/CVS/Root bcast-2000c-mf3/quicktime/decore50/intel_mmx/CVS/Root *** bcast-2000c/quicktime/decore50/intel_mmx/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/CVS/Root Fri Nov 30 18:09:27 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/IDCT_MMX.C bcast-2000c-mf3/quicktime/decore50/intel_mmx/IDCT_MMX.C *** bcast-2000c/quicktime/decore50/intel_mmx/IDCT_MMX.C Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/IDCT_MMX.C Fri Jan 19 15:34:12 2001 *************** *** 0 **** --- 1,533 ---- + /* + ; + ; MMX iDCT + ; + ; Originally provided by Intel at AP-922 + ; http://developer.intel.com/vtune/cbts/strmsimd/922down.htm + ; (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm) + ; but in a limited edition. + ; New macro implements a column part for precise iDCT + ; The routine precision now satisfies IEEE standard 1180-1990. + ; + ; Copyright (c) 2000-2001 Peter Gubanov + ; Rounding trick Copyright (c) 2000 Michel Lespinasse + ; + ; http://www.elecard.com/peter/idct.html + ; http://www.linuxvideo.org/mpeg2dec/ + ; + ; Conversion to MS-style inline C format (c) 2001 DivX Networks Inc. John Funnell + ; + ; Version v1.0.0 10 January 2001 + ; + */ + + + /* + if you are not setting the name of you MMX idct function with compile flag MMX_IDCT_NAME, + then you need to choose a name to insert in here: + */ + #define DEFAULT_FUNCTION_NAME idct + + + + #ifndef MMX_IDCT_NAME + #define MMX_IDCT_NAME DEFAULT_FUNCTION_NAME + #endif + + + + /* some types */ + #define int16_t short + #define int32_t int + #define uint64_t unsigned __int64 + + #define MPTR qword ptr + + + /* some conversions from readable integer constants to qwords */ + #define SHORT4_TO_QWORD(A, B, C, D) ( \ + ( ( ((uint64_t)(A)) & ((uint64_t)(0xffff)) ) << 0 ) | \ + ( ( ((uint64_t)(B)) & ((uint64_t)(0xffff)) ) << 16 ) | \ + ( ( ((uint64_t)(C)) & ((uint64_t)(0xffff)) ) << 32 ) | \ + ( ( ((uint64_t)(D)) & ((uint64_t)(0xffff)) ) << 48 ) ) + + #define INT2_TO_QWORD(A, B) ( \ + ( ( ((uint64_t)(A)) & ((uint64_t)(0xffffffff)) ) << 0 ) | \ + ( ( ((uint64_t)(B)) & ((uint64_t)(0xffffffff)) ) << 32 ) ) + + + + + #define BITS_INV_ACC 5 /* 4 or 5 for IEEE */ + #define SHIFT_INV_ROW (16 - BITS_INV_ACC) + #define SHIFT_INV_COL (1 + BITS_INV_ACC) + #define RND_INV_ROW (1024 * (6 - BITS_INV_ACC)) /* 1 << (SHIFT_INV_ROW-1) */ + #define RND_INV_COL (16 * (BITS_INV_ACC - 3)) /* 1 << (SHIFT_INV_COL-1) */ + #define RND_INV_CORR (RND_INV_COL - 1) /* correction -1.0 and round */ + #define BITS_FRW_ACC 3 /* 2 or 3 for accuracy */ + #define SHIFT_FRW_COL BITS_FRW_ACC + #define SHIFT_FRW_ROW (BITS_FRW_ACC + 17) + #define RND_FRW_ROW (262144 * (BITS_FRW_ACC - 1)) /* 1 << (SHIFT_FRW_ROW-1) */ + + + + + + + const uint64_t tg_1_16 = SHORT4_TO_QWORD( 13036, 13036, 13036, 13036 ); + const uint64_t tg_2_16 = SHORT4_TO_QWORD( 27146, 27146, 27146, 27146 ); + const uint64_t tg_3_16 = SHORT4_TO_QWORD(-21746, -21746, -21746, -21746 ); + const uint64_t ocos_4_16 = SHORT4_TO_QWORD( 23170, 23170, 23170, 23170 ); + + + + + /* rounding value that is added before the row transform's rounding */ + + + #if SHIFT_INV_ROW == 12 + const uint64_t rounder[8] = { + INT2_TO_QWORD( 65536, 65536), /* rounder_0 */ + INT2_TO_QWORD( 7195, 7195), /* rounder_1 */ + INT2_TO_QWORD( 4520, 4520), /* rounder_2 */ + INT2_TO_QWORD( 2407, 2407), /* rounder_3 */ + INT2_TO_QWORD( 0, 0), /* rounder_4 */ + INT2_TO_QWORD( 240, 240), /* rounder_5 */ + INT2_TO_QWORD( 1024, 1024), /* rounder_6 */ + INT2_TO_QWORD( 1024, 1024) /* rounder_7 */ + }; + #elif SHIFT_INV_ROW == 11 + const uint64_t rounder[2*8] = { + INT2_TO_QWORD( 65536, 65536), /* rounder_0 */ + INT2_TO_QWORD( 3597, 3597), /* rounder_1 */ + INT2_TO_QWORD( 2260, 2260), /* rounder_2 */ + INT2_TO_QWORD( 1203, 1203), /* rounder_3 */ + INT2_TO_QWORD( 0, 0), /* rounder_4 */ + INT2_TO_QWORD( 120, 120), /* rounder_5 */ + INT2_TO_QWORD( 512, 512), /* rounder_6 */ + INT2_TO_QWORD( 512, 512) /* rounder_7 */ + }; + #endif + + + + /* + ;============================================================================= + ; + ; The first stage iDCT 8x8 - inverse DCTs of rows + ; + ;----------------------------------------------------------------------------- + ; The 8-point inverse DCT direct algorithm + ;----------------------------------------------------------------------------- + ; + ; static const short w[32] = { + ; FIX(cos_4_16), FIX(cos_2_16), FIX(cos_4_16), FIX(cos_6_16), + ; FIX(cos_4_16), FIX(cos_6_16), -FIX(cos_4_16), -FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_6_16), -FIX(cos_4_16), FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_2_16), FIX(cos_4_16), -FIX(cos_6_16), + ; FIX(cos_1_16), FIX(cos_3_16), FIX(cos_5_16), FIX(cos_7_16), + ; FIX(cos_3_16), -FIX(cos_7_16), -FIX(cos_1_16), -FIX(cos_5_16), + ; FIX(cos_5_16), -FIX(cos_1_16), FIX(cos_7_16), FIX(cos_3_16), + ; FIX(cos_7_16), -FIX(cos_5_16), FIX(cos_3_16), -FIX(cos_1_16) }; + ; + ; #define DCT_8_INV_ROW(x, y) + ;{ + ; int a0, a1, a2, a3, b0, b1, b2, b3; + ; + ; a0 =x[0]*w[0]+x[2]*w[1]+x[4]*w[2]+x[6]*w[3]; + ; a1 =x[0]*w[4]+x[2]*w[5]+x[4]*w[6]+x[6]*w[7]; + ; a2 = x[0] * w[ 8] + x[2] * w[ 9] + x[4] * w[10] + x[6] * w[11]; + ; a3 = x[0] * w[12] + x[2] * w[13] + x[4] * w[14] + x[6] * w[15]; + ; b0 = x[1] * w[16] + x[3] * w[17] + x[5] * w[18] + x[7] * w[19]; + ; b1 = x[1] * w[20] + x[3] * w[21] + x[5] * w[22] + x[7] * w[23]; + ; b2 = x[1] * w[24] + x[3] * w[25] + x[5] * w[26] + x[7] * w[27]; + ; b3 = x[1] * w[28] + x[3] * w[29] + x[5] * w[30] + x[7] * w[31]; + ; + ; y[0] = SHIFT_ROUND ( a0 + b0 ); + ; y[1] = SHIFT_ROUND ( a1 + b1 ); + ; y[2] = SHIFT_ROUND ( a2 + b2 ); + ; y[3] = SHIFT_ROUND ( a3 + b3 ); + ; y[4] = SHIFT_ROUND ( a3 - b3 ); + ; y[5] = SHIFT_ROUND ( a2 - b2 ); + ; y[6] = SHIFT_ROUND ( a1 - b1 ); + ; y[7] = SHIFT_ROUND ( a0 - b0 ); + ;} + ; + ;----------------------------------------------------------------------------- + ; + ; In this implementation the outputs of the iDCT-1D are multiplied + ; for rows 0,4 - by cos_4_16, + ; for rows 1,7 - by cos_1_16, + ; for rows 2,6 - by cos_2_16, + ; for rows 3,5 - by cos_3_16 + ; and are shifted to the left for better accuracy + ; + ; For the constants used, + ; FIX(float_const) = (short) (float_const * (1<<15) + 0.5) + ; + ;============================================================================= + */ + + + /* + ;============================================================================= + ; code for MMX + ;============================================================================= + ; Table for rows 0,4 - constants are multiplied by cos_4_16 + */ + const uint64_t tab_i_04[8*8] = { + /* Table for rows 0,4 - constants are multiplied by cos_4_16 */ + SHORT4_TO_QWORD( 16384, 16384, 16384, -16384 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 21407, 8867, 8867, -21407 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 16384, -16384, 16384, 16384 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD( -8867, 21407, -21407, -8867 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 22725, 12873, 19266, -22725 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 19266, 4520, -4520, -12873 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 12873, 4520, 4520, 19266 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-22725, 19266, -12873, -22725 ), /* w31 w29 w27 w25 */ + /* Table for rows 1,7 - constants are multiplied by cos_1_16 */ + SHORT4_TO_QWORD( 22725, 22725, 22725, -22725 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 29692, 12299, 12299, -29692 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 22725, -22725, 22725, 22725 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-12299, 29692, -29692, -12299 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 31521, 17855, 26722, -31521 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 26722, 6270, -6270, -17855 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 17855, 6270, 6270, 26722 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-31521, 26722, -17855, -31521 ), /* w31 w29 w27 w25 */ + /* Table for rows 2,6 - constants are multiplied by cos_2_16 */ + SHORT4_TO_QWORD( 21407, 21407, 21407, -21407 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 27969, 11585, 11585, -27969 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 21407, -21407, 21407, 21407 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-11585, 27969, -27969, -11585 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 29692, 16819, 25172, -29692 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 25172, 5906, -5906, -16819 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 16819, 5906, 5906, 25172 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-29692, 25172, -16819, -29692 ), /* w31 w29 w27 w25 */ + /* Table for rows 3,5 - constants are multiplied by cos_3_16 */ + SHORT4_TO_QWORD( 19266, 19266, 19266, -19266 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 25172, 10426, 10426, -25172 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 19266, -19266, 19266, 19266 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-10426, 25172, -25172, -10426 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 26722, 15137, 22654, -26722 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 22654, 5315, -5315, -15137 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 15137, 5315, 5315, 22654 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-26722, 22654, -15137, -26722 ), /* w31 w29 w27 w25 */ + /* Table for rows 0,4 - constants are multiplied by cos_4_16 */ + SHORT4_TO_QWORD( 16384, 16384, 16384, -16384 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 21407, 8867, 8867, -21407 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 16384, -16384, 16384, 16384 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-8867, 21407, -21407, -8867 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 22725, 12873, 19266, -22725 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 19266, 4520, -4520, -12873 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 12873, 4520, 4520, 19266 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-22725, 19266, -12873, -22725 ), /* w31 w29 w27 w25 */ + /* Table for rows 3,5 - constants are multiplied by cos_3_16 */ + SHORT4_TO_QWORD( 19266, 19266, 19266, -19266 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 25172, 10426, 10426, -25172 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 19266, -19266, 19266, 19266 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-10426, 25172, -25172, -10426 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 26722, 15137, 22654, -26722 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 22654, 5315, -5315, -15137 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 15137, 5315, 5315, 22654 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-26722, 22654, -15137, -26722 ), /* w31 w29 w27 w25 */ + /* Table for rows 2,6 - constants are multiplied by cos_2_16 */ + SHORT4_TO_QWORD( 21407, 21407, 21407, -21407 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 27969, 11585, 11585, -27969 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 21407, -21407, 21407, 21407 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-11585, 27969, -27969, -11585 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 29692, 16819, 25172, -29692 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 25172, 5906, -5906, -16819 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 16819, 5906, 5906, 25172 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-29692, 25172, -16819, -29692 ), /* w31 w29 w27 w25 */ + /* Table for rows 1,7 - constants are multiplied by cos_1_16 */ + SHORT4_TO_QWORD( 22725, 22725, 22725, -22725 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 29692, 12299, 12299, -29692 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 22725, -22725, 22725, 22725 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-12299, 29692, -29692, -12299 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 31521, 17855, 26722, -31521 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 26722, 6270, -6270, -17855 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 17855, 6270, 6270, 26722 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-31521, 26722, -17855, -31521 ), /* w31 w29 w27 w25 */ + }; + + + + uint64_t tempMatrix[64/4]; + + + #define INP eax + #define ROUNDER ebx + #define TABLE ecx + #define OUTP edx + + + + + + /* the function itself */ + void MMX_IDCT_NAME + (int16_t *block) { + __asm { + + push eax + push ebx + push ecx + push edx + push edi + + mov INP, block + lea OUTP, [tempMatrix] + lea TABLE, [tab_i_04] + lea ROUNDER, [rounder] + + mov edi, -8; ; i=-8 + + align 16 + + rowloop: + + movq mm0, MPTR [INP] ; 0 ; x3 x2 x1 x0 + + movq mm1, MPTR [INP+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, MPTR [TABLE] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, MPTR [TABLE+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, MPTR [TABLE+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, MPTR [TABLE+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, MPTR [TABLE+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, MPTR [ROUNDER] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, MPTR [TABLE+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, MPTR [TABLE+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, MPTR [TABLE+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, MPTR [ROUNDER] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq MPTR [OUTP], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq MPTR [OUTP+8], mm7 ; 7 ; save y7 y6 y5 y4 + + + add INP, 16 ; add 1 row to input pointer + add ROUNDER, 8 ; go to next rounding values + add OUTP, 16 ; add 1 row to output pointer + add TABLE,64 ; move to next section of table + + add edi, 1 + jne rowloop; + + + /* column code starts here... */ + + + lea INP, [tempMatrix] + mov OUTP, block + mov edi, -2; ; i=-2 + + align 16 + colloop: + + // movq mm0, MPTR [tg_3_16] + movq mm0, tg_3_16 + + movq mm3, MPTR [INP+16*3] + movq mm1, mm0 ; tg_3_16 + + movq mm5, MPTR [INP+16*5] + pmulhw mm0, mm3 ; x3*(tg_3_16-1) + + // movq mm4, MPTR [tg_1_16] + movq mm4, tg_1_16 + pmulhw mm1, mm5 ; x5*(tg_3_16-1) + + movq mm7, MPTR [INP+16*7] + movq mm2, mm4 ; tg_1_16 + + movq mm6, MPTR [INP+16*1] + pmulhw mm4, mm7 ; x7*tg_1_16 + + paddsw mm0, mm3 ; x3*tg_3_16 + pmulhw mm2, mm6 ; x1*tg_1_16 + + paddsw mm1, mm3 ; x3+x5*(tg_3_16-1) + psubsw mm0, mm5 ; x3*tg_3_16-x5 = tm35 + + // movq mm3, MPTR [ocos_4_16] + movq mm3, ocos_4_16 + paddsw mm1, mm5 ; x3+x5*tg_3_16 = tp35 + + paddsw mm4, mm6 ; x1+tg_1_16*x7 = tp17 + psubsw mm2, mm7 ; x1*tg_1_16-x7 = tm17 + + movq mm5, mm4 ; tp17 + movq mm6, mm2 ; tm17 + + paddsw mm5, mm1 ; tp17+tp35 = b0 + psubsw mm6, mm0 ; tm17-tm35 = b3 + + psubsw mm4, mm1 ; tp17-tp35 = t1 + paddsw mm2, mm0 ; tm17+tm35 = t2 + + // movq mm7, MPTR [tg_2_16] + movq mm7, tg_2_16 + movq mm1, mm4 ; t1 + + ; movq MPTR [SCRATCH+0], mm5 ; save b0 + movq MPTR [OUTP+3*16], mm5 ; save b0 + paddsw mm1, mm2 ; t1+t2 + + ; movq MPTR [SCRATCH+8], mm6 ; save b3 + movq MPTR [OUTP+5*16], mm6 ; save b3 + psubsw mm4, mm2 ; t1-t2 + + movq mm5, MPTR [INP+2*16] + movq mm0, mm7 ; tg_2_16 + + movq mm6, MPTR [INP+6*16] + pmulhw mm0, mm5 ; x2*tg_2_16 + + pmulhw mm7, mm6 ; x6*tg_2_16 + ; slot + pmulhw mm1, mm3 ; ocos_4_16*(t1+t2) = b1/2 + ; slot + movq mm2, MPTR [INP+0*16] + pmulhw mm4, mm3 ; ocos_4_16*(t1-t2) = b2/2 + + psubsw mm0, mm6 ; t2*tg_2_16-x6 = tm26 + movq mm3, mm2 ; x0 + + movq mm6, MPTR [INP+4*16] + paddsw mm7, mm5 ; x2+x6*tg_2_16 = tp26 + + paddsw mm2, mm6 ; x0+x4 = tp04 + psubsw mm3, mm6 ; x0-x4 = tm04 + + movq mm5, mm2 ; tp04 + movq mm6, mm3 ; tm04 + + psubsw mm2, mm7 ; tp04-tp26 = a3 + paddsw mm3, mm0 ; tm04+tm26 = a1 + + paddsw mm1, mm1 ; b1 + paddsw mm4, mm4 ; b2 + + paddsw mm5, mm7 ; tp04+tp26 = a0 + psubsw mm6, mm0 ; tm04-tm26 = a2 + + movq mm7, mm3 ; a1 + movq mm0, mm6 ; a2 + + paddsw mm3, mm1 ; a1+b1 + paddsw mm6, mm4 ; a2+b2 + + psraw mm3, SHIFT_INV_COL ; dst1 + psubsw mm7, mm1 ; a1-b1 + + psraw mm6, SHIFT_INV_COL ; dst2 + psubsw mm0, mm4 ; a2-b2 + + ; movq mm1, MPTR [SCRATCH+0] ; load b0 + movq mm1, MPTR [OUTP+3*16] ; load b0 + psraw mm7, SHIFT_INV_COL ; dst6 + + movq mm4, mm5 ; a0 + psraw mm0, SHIFT_INV_COL ; dst5 + + movq MPTR [OUTP+1*16], mm3 + paddsw mm5, mm1 ; a0+b0 + + movq MPTR [OUTP+2*16], mm6 + psubsw mm4, mm1 ; a0-b0 + + ; movq mm3, MPTR [SCRATCH+8] ; load b3 + movq mm3, MPTR [OUTP+5*16] ; load b3 + psraw mm5, SHIFT_INV_COL ; dst0 + + movq mm6, mm2 ; a3 + psraw mm4, SHIFT_INV_COL ; dst7 + + movq MPTR [OUTP+5*16], mm0 + paddsw mm2, mm3 ; a3+b3 + + movq MPTR [OUTP+6*16], mm7 + psubsw mm6, mm3 ; a3-b3 + + movq MPTR [OUTP+0*16], mm5 + psraw mm2, SHIFT_INV_COL ; dst3 + + movq MPTR [OUTP+7*16], mm4 + psraw mm6, SHIFT_INV_COL ; dst4 + + movq MPTR [OUTP+3*16], mm2 + + movq MPTR [OUTP+4*16], mm6 + + lea INP, [tempMatrix] + mov OUTP, block + add INP, 8 ; add 4 cols to input pointer + add OUTP, 8 ; add 4 cols to output pointer + + add edi, 1 + jne colloop + + pop edi + pop edx + pop ecx + pop ebx + pop eax + + emms + + }; /* __asm */ + + }; diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/basic_prediction_mmx.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/basic_prediction_mmx.c *** bcast-2000c/quicktime/decore50/intel_mmx/basic_prediction_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/basic_prediction_mmx.c Sat Jan 20 13:17:06 2001 *************** *** 0 **** --- 1,1600 ---- + /************************************************************************** + * * + * This code has been developed by Juice. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Juice + * + * DivX Advanced Research Center + * + **/ + + #include "basic_prediction.h" + + // Purpose: specialized basic motion compensation routines + void CopyBlock(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy; + + long *lpSrc = (long *) Src; + long *lpDst = (long *) Dst; + int lpStride = Stride >> 2; + + for (dy = 0; dy < 8; dy++) { + lpDst[0] = lpSrc[0]; + lpDst[1] = lpSrc[1]; + lpSrc += lpStride; + lpDst += lpStride; + } + } + /**/ + void CopyBlockHor(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + sub ebx, 7 + xor ecx, ecx + mov edx, 8 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again10: + // 0 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 1 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 2 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 3 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 4 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 5 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 6 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 7 + mov al, [esi] + mov cl, [esi+1] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + + add esi, ebx + add edi, ebx + dec edx + jnz start_again10 + } + } + + /**/ + void CopyBlockVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + xor ecx, ecx + mov edx, 8 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again10: + // 0 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 1 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 2 + //xor eax, eax + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 3 + //xor eax, eax + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 4 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 5 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 6 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 7 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + + add esi, ebx + sub esi, 7 + add edi, ebx + sub edi, 7 + dec edx + jnz start_again10 + } + } + /**/ + void CopyBlockHorVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 8; dy++) { + for (dx = 0; dx < 8; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1] + + Src[dx+Stride] + Src[dx+Stride+1] +2) >> 2; // horver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /**/ + void CopyBlockHorRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + sub ebx, 7 + xor ecx, ecx + mov edx, 8 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again1: + // 0 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 1 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 2 + //xor eax, eax + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 3 + //xor eax, eax + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 4 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 5 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 6 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 7 + mov al, [esi] + mov cl, [esi+1] + add eax, ecx + shr eax, 1 + mov [edi], al + + add esi, ebx + add edi, ebx + dec edx + jnz start_again1 + } + } + /**/ + void CopyBlockVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + xor ecx, ecx + mov edx, 8 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again1: + // 0 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 1 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 2 + //xor eax, eax + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 3 + //xor eax, eax + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 4 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 5 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 6 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 7 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + + add esi, ebx + sub esi, 7 + add edi, ebx + sub edi, 7 + dec edx + jnz start_again1 + } + } + /**/ + void CopyBlockHorVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + int dy, dx; + + for (dy = 0; dy < 8; dy++) { + for (dx = 0; dx < 8; dx++) { + Dst[dx] = (Src[dx] + Src[dx+1] + + Src[dx+Stride] + Src[dx+Stride+1] +1) >> 2; // horver interpolation with rounding + } + Src += Stride; + Dst += Stride; + } + } + /** *** **/ + void CopyMBlock(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + mov ebx, Stride + sub ebx, 12 + mov edx, 16 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again: + mov eax, [esi] + mov [edi], eax + add esi, 4 + add edi, 4 + + mov eax, [esi] + mov [edi], eax + add esi, 4 + add edi, 4 + + mov eax, [esi] + mov [edi], eax + add esi, 4 + add edi, 4 + + mov eax, [esi] + mov [edi], eax + + add esi, ebx + add edi, ebx + dec edx + jnz start_again + } + } + /**/ + void CopyMBlockHor(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + sub ebx, 15 + xor ecx, ecx + mov edx, 16 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again0: + // 0 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 1 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 2 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 3 + //xor eax, eax + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 4 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 5 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 6 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 7 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 8 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 9 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 10 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + // 11 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + //12 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + //13 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + //14 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc edi + + //15 + mov al, [esi] + mov cl, [esi+1] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + + add esi, ebx + add edi, ebx + dec edx + jnz start_again0 + } + } + /**/ + void CopyMBlockVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + xor ecx, ecx + mov edx, 16 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again0: + // 0 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 1 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 2 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 3 + //xor eax, eax + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 4 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 5 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 6 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 7 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 8 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 9 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 10 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 11 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + //12 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + //13 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + //14 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + inc esi + inc edi + + //15 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + inc eax + shr eax, 1 + mov [edi], al + + add esi, ebx + sub esi, 15 + add edi, ebx + sub edi, 15 + dec edx + jnz start_again0 + } + } + /**/ + void CopyMBlockHorVer(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + xor ecx, ecx + mov edx, 16 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again1: + // 0 + //xor eax, eax + mov al, [esi] + mov cl, [esi+1] + add eax, ecx + mov cl, [esi+ebx] + add eax, ecx + mov cl, [esi+ebx+1] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi], al + + // 1 + //xor eax, eax + mov al, [esi+1] + mov cl, [esi+2] + add eax, ecx + mov cl, [esi+ebx+1] + add eax, ecx + mov cl, [esi+ebx+2] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+1], al + + // 2 + mov al, [esi+2] + mov cl, [esi+3] + add eax, ecx + mov cl, [esi+ebx+2] + add eax, ecx + mov cl, [esi+ebx+3] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+2], al + + // 3 + mov al, [esi+3] + mov cl, [esi+4] + add eax, ecx + mov cl, [esi+ebx+3] + add eax, ecx + mov cl, [esi+ebx+4] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+3], al + + // 4 + //xor eax, eax + mov al, [esi+4] + mov cl, [esi+5] + add eax, ecx + mov cl, [esi+ebx+4] + add eax, ecx + mov cl, [esi+ebx+5] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+4], al + + // 5 + //xor eax, eax + mov al, [esi+5] + mov cl, [esi+6] + add eax, ecx + mov cl, [esi+ebx+5] + add eax, ecx + mov cl, [esi+ebx+6] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+5], al + + // 6 + mov al, [esi+6] + mov cl, [esi+7] + add eax, ecx + mov cl, [esi+ebx+6] + add eax, ecx + mov cl, [esi+ebx+7] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+6], al + + // 7 + mov al, [esi+7] + mov cl, [esi+8] + add eax, ecx + mov cl, [esi+ebx+7] + add eax, ecx + mov cl, [esi+ebx+8] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+7], al + + // 8 + mov al, [esi+8] + mov cl, [esi+9] + add eax, ecx + mov cl, [esi+ebx+8] + add eax, ecx + mov cl, [esi+ebx+9] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+8], al + + // 9 + mov al, [esi+9] + mov cl, [esi+10] + add eax, ecx + mov cl, [esi+ebx+9] + add eax, ecx + mov cl, [esi+ebx+10] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+9], al + + // 10 + mov al, [esi+10] + mov cl, [esi+11] + add eax, ecx + mov cl, [esi+ebx+10] + add eax, ecx + mov cl, [esi+ebx+11] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+10], al + + // 11 + mov al, [esi+11] + mov cl, [esi+12] + add eax, ecx + mov cl, [esi+ebx+11] + add eax, ecx + mov cl, [esi+ebx+12] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+11], al + + //12 + mov al, [esi+12] + mov cl, [esi+13] + add eax, ecx + mov cl, [esi+ebx+12] + add eax, ecx + mov cl, [esi+ebx+13] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+12], al + + //13 + //xor eax, eax + mov al, [esi+13] + mov cl, [esi+14] + add eax, ecx + mov cl, [esi+ebx+13] + add eax, ecx + mov cl, [esi+ebx+14] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+13], al + + //14 + mov al, [esi+14] + mov cl, [esi+15] + add eax, ecx + mov cl, [esi+ebx+14] + add eax, ecx + mov cl, [esi+ebx+15] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+14], al + + //15 + mov al, [esi+15] + mov cl, [esi+16] + add eax, ecx + mov cl, [esi+ebx+15] + add eax, ecx + mov cl, [esi+ebx+16] + add eax, ecx + add eax, 2 + shr eax, 2 + mov [edi+15], al + + add esi, ebx + add edi, ebx + dec edx + jnz start_again1 + } + } + /**/ + void CopyMBlockHorRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + sub ebx, 15 + xor ecx, ecx + mov edx, 16 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again: + // 0 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 1 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 2 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 3 + //xor eax, eax + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 4 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 5 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 6 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 7 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 8 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 9 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 10 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + // 11 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + //12 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + //13 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + //14 + mov al, [esi] + inc esi + mov cl, [esi] + add eax, ecx + shr eax, 1 + mov [edi], al + inc edi + + //15 + mov al, [esi] + mov cl, [esi+1] + add eax, ecx + shr eax, 1 + mov [edi], al + + add esi, ebx + add edi, ebx + dec edx + jnz start_again + } + } + /**/ + void CopyMBlockVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + xor ecx, ecx + mov edx, 16 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again: + // 0 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 1 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 2 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 3 + //xor eax, eax + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 4 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 5 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 6 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 7 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 8 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 9 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 10 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + // 11 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + //12 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + //13 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + //14 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + inc esi + inc edi + + //15 + mov al, [esi] + mov cl, [esi+ebx] + add eax, ecx + shr eax, 1 + mov [edi], al + + add esi, ebx + sub esi, 15 + add edi, ebx + sub edi, 15 + dec edx + jnz start_again + } + } + /**/ + void CopyMBlockHorVerRound(unsigned char * Src, unsigned char * Dst, int Stride) + { + _asm { + xor eax, eax + mov ebx, Stride + xor ecx, ecx + mov edx, 16 + mov esi, dword ptr [Src] + mov edi, dword ptr [Dst] + + start_again: + // 0 + mov al, [esi] + mov cl, [esi+1] + add eax, ecx + mov cl, [esi+ebx] + add eax, ecx + mov cl, [esi+ebx+1] + add eax, ecx + inc eax + shr eax, 2 + mov [edi], al + + // 1 + mov al, [esi+1] + mov cl, [esi+2] + add eax, ecx + mov cl, [esi+ebx+1] + add eax, ecx + mov cl, [esi+ebx+2] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+1], al + + // 2 + mov al, [esi+2] + mov cl, [esi+3] + add eax, ecx + mov cl, [esi+ebx+2] + add eax, ecx + mov cl, [esi+ebx+3] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+2], al + + // 3 + mov al, [esi+3] + mov cl, [esi+4] + add eax, ecx + mov cl, [esi+ebx+3] + add eax, ecx + mov cl, [esi+ebx+4] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+3], al + + // 4 + mov al, [esi+4] + mov cl, [esi+5] + add eax, ecx + mov cl, [esi+ebx+4] + add eax, ecx + mov cl, [esi+ebx+5] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+4], al + + // 5 + mov al, [esi+5] + mov cl, [esi+6] + add eax, ecx + mov cl, [esi+ebx+5] + add eax, ecx + mov cl, [esi+ebx+6] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+5], al + + // 6 + mov al, [esi+6] + mov cl, [esi+7] + add eax, ecx + mov cl, [esi+ebx+6] + add eax, ecx + mov cl, [esi+ebx+7] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+6], al + + // 7 + mov al, [esi+7] + mov cl, [esi+8] + add eax, ecx + mov cl, [esi+ebx+7] + add eax, ecx + mov cl, [esi+ebx+8] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+7], al + + // 8 + mov al, [esi+8] + mov cl, [esi+9] + add eax, ecx + mov cl, [esi+ebx+8] + add eax, ecx + mov cl, [esi+ebx+9] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+8], al + + // 9 + mov al, [esi+9] + mov cl, [esi+10] + add eax, ecx + mov cl, [esi+ebx+9] + add eax, ecx + mov cl, [esi+ebx+10] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+9], al + + // 10 + mov al, [esi+10] + mov cl, [esi+11] + add eax, ecx + mov cl, [esi+ebx+10] + add eax, ecx + mov cl, [esi+ebx+11] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+10], al + + // 11 + mov al, [esi+11] + mov cl, [esi+12] + add eax, ecx + mov cl, [esi+ebx+11] + add eax, ecx + mov cl, [esi+ebx+12] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+11], al + + //12 + mov al, [esi+12] + mov cl, [esi+13] + add eax, ecx + mov cl, [esi+ebx+12] + add eax, ecx + mov cl, [esi+ebx+13] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+12], al + + //13 + mov al, [esi+13] + mov cl, [esi+14] + add eax, ecx + mov cl, [esi+ebx+13] + add eax, ecx + mov cl, [esi+ebx+14] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+13], al + + //14 + mov al, [esi+14] + mov cl, [esi+15] + add eax, ecx + mov cl, [esi+ebx+14] + add eax, ecx + mov cl, [esi+ebx+15] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+14], al + + //15 + //xor eax, eax + mov al, [esi+15] + mov cl, [esi+16] + add eax, ecx + mov cl, [esi+ebx+15] + add eax, ecx + mov cl, [esi+ebx+16] + add eax, ecx + inc eax + shr eax, 2 + mov [edi+15], al + + add esi, ebx + add edi, ebx + dec edx + jnz start_again + } + } diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/clearblock_mmx.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/clearblock_mmx.c *** bcast-2000c/quicktime/decore50/intel_mmx/clearblock_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/clearblock_mmx.c Tue Apr 3 09:09:06 2001 *************** *** 0 **** --- 1,48 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // clearblock.c // + + + void clearblock (short *psblock) + { + _asm + { + mov edx, -16 // clear loop counter + mov esi, psblock // capture block address + + pxor mm0, mm0 // mm0 = 0x00 + lq1: + movq qword ptr [esi], mm0 // copy output to destination + add esi, 8 + inc edx + jnz lq1 + emms + } + } diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/CVS/Entries bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/CVS/Entries *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/CVS/Entries Fri Nov 30 18:09:52 2001 *************** *** 0 **** --- 1,18 ---- + /DO_EMMS.C/1.1/Fri Jan 19 14:34:14 2001// + /deblock_horiz.c/1.1/Tue Feb 20 04:07:48 2001// + /deblock_horiz_DC_on.c/1.1/Fri Jan 19 14:34:12 2001// + /deblock_horiz_default_filter.c/1.1/Fri Jan 19 14:34:12 2001// + /deblock_horiz_lpf9.c/1.1/Fri Jan 19 14:34:12 2001// + /deblock_horiz_useDC.c/1.1/Fri Jan 19 14:34:12 2001// + /deblock_vert.c/1.1/Tue Feb 20 04:07:58 2001// + /deblock_vert_DC_on.c/1.1/Fri Jan 19 14:34:12 2001// + /deblock_vert_choose_p1p2.c/1.1/Fri Jan 19 14:34:12 2001// + /deblock_vert_copy_and_unpack.c/1.1/Fri Jan 19 14:34:12 2001// + /deblock_vert_default_filter.c/1.1/Fri Jan 19 14:34:12 2001// + /deblock_vert_lpf9.c/1.1/Fri Jan 19 14:34:14 2001// + /deblock_vert_useDC.c/1.1/Fri Jan 19 14:34:14 2001// + /fast_copy.c/1.1/Tue Feb 20 04:07:58 2001// + /postprocess.c/1.1/Sat Feb 17 08:39:44 2001// + /postprocess.h/1.1/Fri Jan 19 14:34:14 2001// + /postprocess_mmx.h/1.1/Sat Feb 17 08:39:44 2001// + D diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/CVS/Repository bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/CVS/Repository *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/CVS/Repository Fri Nov 30 18:09:39 2001 *************** *** 0 **** --- 1 ---- + quicktime/decore50/intel_mmx/postprocess diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/CVS/Root bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/CVS/Root *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/CVS/Root Fri Nov 30 18:09:39 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/DO_EMMS.C bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/DO_EMMS.C *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/DO_EMMS.C Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/DO_EMMS.C Fri Jan 19 15:34:14 2001 *************** *** 0 **** --- 1,47 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + void do_emms() { + __asm { + emms + }; + } diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_horiz.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_horiz.c *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_horiz.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_horiz.c Tue Feb 20 05:07:48 2001 *************** *** 0 **** --- 1,140 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* this is to help us inline our functions */ + #ifdef PP_COMPONENTS_INLINE + #ifndef INLINE + #define INLINE static __inline + #endif + #include "deblock_horiz_DC_on.c" + #include "deblock_horiz_useDC.c" + #include "deblock_horiz_default_filter.c" + #include "deblock_horiz_lpf9.c" + #endif + + /* this is a horizontal deblocking filter - i.e. it will smooth _vertical_ block edges */ + void deblock_horiz(uint8_t *image, int width, int stride, QP_STORE_T *QP_store, int QP_stride, int chromaFlag) { + int x, y; + int QP; + uint8_t *v; + int useDC, DC_on; + #ifdef PREFETCH_AHEAD_H + void *prefetch_addr; + #endif + + y = 0; + + /* loop over image's pixel rows , four at a time */ + // for (y=0; y + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* John Funnell, December 2000 */ + + + /* decide whether the DC filter should be turned on accoding to QP */ + INLINE int deblock_horiz_DC_on(uint8_t *v, int stride, int QP) { + /* 99% of the time, this test turns out the same as the |max-min| strategy in the standard */ + return (ABS(v[1]-v[8]) < 2*QP); + } diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_horiz_default_filter.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_horiz_default_filter.c *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_horiz_default_filter.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_horiz_default_filter.c Fri Jan 19 15:34:12 2001 *************** *** 0 **** --- 1,126 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* John Funnell, December 2000 */ + + + /* horizontal deblocking filter used in default (non-DC) mode */ + INLINE void deblock_horiz_default_filter(uint8_t *v, int stride, int QP) { + int a3_0, a3_1, a3_2, d; + int q1, q; + int y; + + /* + scalar implementation for the time being - going to MMX may be complex for + little gain? I have some ideas how do go to MMX but anyone's welcome to try! + + The compiler used for this module can make a big difference to performance. + this seems to be fastest when compiled using pgcc. I haven't tried the + latest Intel compiler yet. + + I suspect that the benefits from SIMD here are neglible since the scalar + version is easily able to break out of the loop and save CPU time. SIMD + would have a lot more inertia and may have to complete all calculations + even if they are not needed. Still, branches are expensive so, well + SIMD/MMX is worth a try! + + JF + */ + + for (y=0; y<4; y++) { + + q1 = v[4] - v[5]; + q = q1 / 2; + if (q) { + + a3_0 = q1; + a3_0 += a3_0 << 2; + a3_0 = 2*(v[3]-v[6]) - a3_0; + + /* apply the 'delta' function first and check there is a difference to avoid wasting time */ + if (ABS(a3_0) < 8*QP) { + a3_1 = v[3]-v[2]; + a3_2 = v[7]-v[8]; + a3_1 += a3_1 << 2; + a3_2 += a3_2 << 2; + a3_1 += (v[1]-v[4]) << 1; + a3_2 += (v[5]-v[8]) << 1; + d = ABS(a3_0) - MIN(ABS(a3_1), ABS(a3_2)); + + if (d > 0) { /* energy across boundary is greater than in one or both of the blocks */ + d += d<<2; + d = (d + 32) >> 6; + + if (d > 0) { + + //d *= SIGN(-a3_0); + + /* clip d in the range 0 ... q */ + if (q > 0) { + if (a3_0 < 0) { + //d = d<0 ? 0 : d; + d = d>q ? q : d; + v[4] -= d; + v[5] += d; + } + } else { + if (a3_0 > 0) { + //d = d>0 ? 0 : d; + d = (-d) + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* John Funnell, December 2000 */ + + + const static uint64_t mm64_0008 = 0x0008000800080008; + const static uint64_t mm64_0101 = 0x0101010101010101; + static uint64_t mm64_temp; + const static uint64_t mm64_coefs[18] = { + 0x0001000200040006, /* p1 left */ 0x0000000000000001, /* v1 right */ + 0x0001000200020004, /* v1 left */ 0x0000000000010001, /* v2 right */ + 0x0002000200040002, /* v2 left */ 0x0000000100010002, /* v3 right */ + 0x0002000400020002, /* v3 left */ 0x0001000100020002, /* v4 right */ + 0x0004000200020001, /* v4 left */ 0x0001000200020004, /* v5 right */ + 0x0002000200010001, /* v5 left */ 0x0002000200040002, /* v6 right */ + 0x0002000100010000, /* v6 left */ 0x0002000400020002, /* v7 right */ + 0x0001000100000000, /* v7 left */ 0x0004000200020001, /* v8 right */ + 0x0001000000000000, /* v8 left */ 0x0006000400020001 /* p2 right */ + }; + static uint32_t mm32_p1p2; + static uint8_t *pmm1; + + + + + /* The 9-tap low pass filter used in "DC" regions */ + /* I'm not sure that I like this implementation any more...! */ + INLINE void deblock_horiz_lpf9(uint8_t *v, int stride, int QP) { + int y, p1, p2; + #ifdef PP_SELF_CHECK + uint8_t selfcheck[9]; + int psum; + uint8_t *vv; + int i; + #endif + + for (y=0; y<4; y++) { + p1 = (ABS(v[0+y*stride]-v[1+y*stride]) < QP ) ? v[0+y*stride] : v[1+y*stride]; + p2 = (ABS(v[8+y*stride]-v[9+y*stride]) < QP ) ? v[9+y*stride] : v[8+y*stride]; + + mm32_p1p2 = 0x0101 * ((p2 << 16) + p1); + + #ifdef PP_SELF_CHECK + /* generate a self-check version of the filter result in selfcheck[9] */ + /* low pass filtering (LPF9: 1 1 2 2 4 2 2 1 1) */ + vv = &(v[y*stride]); + psum = p1 + p1 + p1 + vv[1] + vv[2] + vv[3] + vv[4] + 4; + selfcheck[1] = (((psum + vv[1]) << 1) - (vv[4] - vv[5])) >> 4; + psum += vv[5] - p1; + selfcheck[2] = (((psum + vv[2]) << 1) - (vv[5] - vv[6])) >> 4; + psum += vv[6] - p1; + selfcheck[3] = (((psum + vv[3]) << 1) - (vv[6] - vv[7])) >> 4; + psum += vv[7] - p1; + selfcheck[4] = (((psum + vv[4]) << 1) + p1 - vv[1] - (vv[7] - vv[8])) >> 4; + psum += vv[8] - vv[1]; + selfcheck[5] = (((psum + vv[5]) << 1) + (vv[1] - vv[2]) - vv[8] + p2) >> 4; + psum += p2 - vv[2]; + selfcheck[6] = (((psum + vv[6]) << 1) + (vv[2] - vv[3])) >> 4; + psum += p2 - vv[3]; + selfcheck[7] = (((psum + vv[7]) << 1) + (vv[3] - vv[4])) >> 4; + psum += p2 - vv[4]; + selfcheck[8] = (((psum + vv[8]) << 1) + (vv[4] - vv[5])) >> 4; + #endif + + pmm1 = (&(v[y*stride-3])); /* this is 64-aligned */ + + /* mm7 = 0, mm6 is left hand accumulator, mm5 is right hand acc */ + __asm { + push eax + push ebx + mov eax, pmm1 + lea ebx, mm64_coefs + + #ifdef PREFETCH_ENABLE + prefetcht0 32[ebx] + #endif + + movd mm0, mm32_p1p2 /* mm0 = ________p2p2p1p1 0w1 2 3 4 5 6 7 */ + punpcklbw mm0, mm0 /* mm0 = p2p2p2p2p1p1p1p1 0m1 2 3 4 5 6 7 */ + + movq mm2, qword ptr [eax] /* mm2 = v4v3v2v1xxxxxxxx 0 1 2w3 4 5 6 7 */ + pxor mm7, mm7 /* mm7 = 0000000000000000 0 1 2 3 4 5 6 7w */ + + movq mm6, mm64_0008 /* mm6 = 0008000800080008 0 1 2 3 4 5 6w7 */ + punpckhbw mm2, mm2 /* mm2 = v4__v3__v2__v1__ 0 1 2m3 4 5 6 7 */ + + movq mm64_temp, mm0 /*temp = p2p2p2p2p1p1p1p1 0r1 2 3 4 5 6 7 */ + + punpcklbw mm0, mm7 /* mm0 = __p1__p1__p1__p1 0m1 2 3 4 5 6 7 */ + movq mm5, mm6 /* mm5 = 0008000800080008 0 1 2 3 4 5w6r7 */ + + pmullw mm0, [ebx] /* mm0 *= mm64_coefs[0] 0m1 2 3 4 5 6 7 */ + + movq mm1, mm2 /* mm1 = v4v4v3v3v2v2v1v1 0 1w2r3 4 5 6 7 */ + punpcklbw mm2, mm2 /* mm2 = v2v2v2v2v1v1v1v1 0 1 2m3 4 5 6 7 */ + + punpckhbw mm1, mm1 /* mm1 = v4v4v4v4v3v3v3v3 0 1m2 3 4 5 6 7 */ + + #ifdef PREFETCH_ENABLE + prefetcht0 32[ebx] + #endif + + movq mm3, mm2 /* mm3 = v2v2v2v2v1v1v1v1 0 1 2r3w4 5 6 7 */ + punpcklbw mm2, mm7 /* mm2 = __v1__v1__v1__v1 0 1 2m3 4 5 6 7 */ + + punpckhbw mm3, mm7 /* mm3 = __v2__v2__v2__v2 0 1 2 3m4 5 6 7 */ + paddw mm6, mm0 /* mm6 += mm0 0r1 2 3 4 5 6m7 */ + + movq mm0, mm2 /* mm0 = __v1__v1__v1__v1 0w1 2r3 4 5 6 7 */ + + pmullw mm0, 8[ebx] /* mm2 *= mm64_coefs[1] 0m1 2 3 4 5 6 7 */ + movq mm4, mm3 /* mm4 = __v2__v2__v2__v2 0 1 2 3r4w5 6 7 */ + + pmullw mm2, 16[ebx] /* mm2 *= mm64_coefs[2] 0 1 2m3 4 5 6 7 */ + + pmullw mm3, 32[ebx] /* mm3 *= mm64_coefs[4] 0 1 2 3m4 5 6 7 */ + + pmullw mm4, 24[ebx] /* mm3 *= mm64_coefs[3] 0 1 2 3 4m5 6 7 */ + paddw mm5, mm0 /* mm5 += mm0 0r1 2 3 4 5m6 7 */ + + paddw mm6, mm2 /* mm6 += mm2 0 1 2r3 4 5 6m7 */ + movq mm2, mm1 /* mm2 = v4v4v4v4v3v3v3v3 0 1 2 3 4 5 6 7 */ + + punpckhbw mm2, mm7 /* mm2 = __v4__v4__v4__v4 0 1 2m3 4 5 6 7r */ + paddw mm5, mm4 /* mm5 += mm4 0 1 2 3 4r5m6 7 */ + + punpcklbw mm1, mm7 /* mm1 = __v3__v3__v3__v3 0 1m2 3 4 5 6 7r */ + paddw mm6, mm3 /* mm6 += mm3 0 1 2 3r4 5 6m7 */ + + #ifdef PREFETCH_ENABLE + prefetcht0 64[ebx] + #endif + movq mm0, mm1 /* mm0 = __v3__v3__v3__v3 0w1 2 3 4 5 6 7 */ + + pmullw mm1, 48[ebx] /* mm1 *= mm64_coefs[6] 0 1m2 3 4 5 6 7 */ + + pmullw mm0, 40[ebx] /* mm0 *= mm64_coefs[5] 0m1 2 3 4 5 6 7 */ + movq mm4, mm2 /* mm4 = __v4__v4__v4__v4 0 1 2r3 4w5 6 7 */ + + pmullw mm2, 64[ebx] /* mm2 *= mm64_coefs[8] 0 1 2 3 4 5 6 7 */ + paddw mm6, mm1 /* mm6 += mm1 0 1 2 3 4 5 6 7 */ + + pmullw mm4, 56[ebx] /* mm4 *= mm64_coefs[7] 0 1 2 3 4m5 6 7 */ + pxor mm3, mm3 /* mm3 = 0000000000000000 0 1 2 3w4 5 6 7 */ + + movq mm1, 8[eax] /* mm1 = xxxxxxxxv8v7v6v5 0 1w2 3 4 5 6 7 */ + paddw mm5, mm0 /* mm5 += mm0 0r1 2 3 4 5 6 7 */ + + punpcklbw mm1, mm1 /* mm1 = v8v8v7v7v6v6v5v5 0 1m2 3m4 5 6 7 */ + paddw mm6, mm2 /* mm6 += mm2 0 1 2r3 4 5 6 7 */ + + #ifdef PREFETCH_ENABLE + prefetcht0 96[ebx] + #endif + + movq mm2, mm1 /* mm2 = v8v8v7v7v6v6v5v5 0 1r2w3 4 5 6 7 */ + paddw mm5, mm4 /* mm5 += mm4 0 1 2 3 4r5 6 7 */ + + punpcklbw mm2, mm2 /* mm2 = v6v6v6v6v5v5v5v5 0 1 2m3 4 5 6 7 */ + punpckhbw mm1, mm1 /* mm1 = v8v8v8v8v7v7v7v7 0 1m2 3 4 5 6 7 */ + + movq mm3, mm2 /* mm3 = v6v6v6v6v5v5v5v5 0 1 2r3w4 5 6 7 */ + punpcklbw mm2, mm7 /* mm2 = __v5__v5__v5__v5 0 1 2m3 4 5 6 7r */ + + punpckhbw mm3, mm7 /* mm3 = __v6__v6__v6__v6 0 1 2 3m4 5 6 7r */ + movq mm0, mm2 /* mm0 = __v5__v5__v5__v5 0w1 2b3 4 5 6 7 */ + + pmullw mm0, 72[ebx] /* mm0 *= mm64_coefs[9] 0m1 2 3 4 5 6 7 */ + movq mm4, mm3 /* mm4 = __v6__v6__v6__v6 0 1 2 3 4w5 6 7 */ + + pmullw mm2, 80[ebx] /* mm2 *= mm64_coefs[10] 0 1 2m3 4 5 6 7 */ + + pmullw mm3, 96[ebx] /* mm3 *= mm64_coefs[12] 0 1 2 3m4 5 6 7 */ + + pmullw mm4, 88[ebx] /* mm4 *= mm64_coefs[11] 0 1 2 3 4m5 6 7 */ + paddw mm5, mm0 /* mm5 += mm0 0r1 2 3 4 5 6 7 */ + + paddw mm6, mm2 /* mm6 += mm2 0 1 2r3 4 5 6 7 */ + movq mm2, mm1 /* mm2 = v8v8v8v8v7v7v7v7 0 1r2w3 4 5 6 7 */ + + paddw mm6, mm3 /* mm6 += mm3 0 1 2 3r4 5 6 7 */ + punpcklbw mm1, mm7 /* mm1 = __v7__v7__v7__v7 0 1m2 3 4 5 6 7r */ + + paddw mm5, mm4 /* mm5 += mm4 0 1 2 3 4r5 6 7 */ + punpckhbw mm2, mm7 /* mm2 = __v8__v8__v8__v8 0 1 2m3 4 5 6 7 */ + + #ifdef PREFETCH_ENABLE + prefetcht0 128[ebx] + #endif + + movq mm3, mm64_temp /* mm0 = p2p2p2p2p1p1p1p1 0 1 2 3w4 5 6 7 */ + movq mm0, mm1 /* mm0 = __v7__v7__v7__v7 0w1r2 3 4 5 6 7 */ + + pmullw mm0, 104[ebx] /* mm0 *= mm64_coefs[13] 0m1b2 3 4 5 6 7 */ + movq mm4, mm2 /* mm4 = __v8__v8__v8__v8 0 1 2r3 4w5 6 7 */ + + pmullw mm1, 112[ebx] /* mm1 *= mm64_coefs[14] 0 1w2 3 4 5 6 7 */ + punpckhbw mm3, mm7 /* mm0 = __p2__p2__p2__p2 0 1 2 3 4 5 6 7 */ + + pmullw mm2, 128[ebx] /* mm2 *= mm64_coefs[16] 0 1b2m3 4 5 6 7 */ + + pmullw mm4, 120[ebx] /* mm4 *= mm64_coefs[15] 0 1b2 3 4m5 6 7 */ + paddw mm5, mm0 /* mm5 += mm0 0r1 2 3 4 5m6 7 */ + + pmullw mm3, 136[ebx] /* mm0 *= mm64_coefs[17] 0 1 2 3m4 5 6 7 */ + paddw mm6, mm1 /* mm6 += mm1 0 1w2 3 4 5 6m7 */ + + paddw mm6, mm2 /* mm6 += mm2 0 1 2r3 4 5 6m7 */ + + paddw mm5, mm4 /* mm5 += mm4 0 1 2 3 4r5m6 7 */ + psrlw mm6, 4 /* mm6 /= 16 0 1 2 3 4 5 6m7 */ + + paddw mm5, mm3 /* mm6 += mm0 0 1 2 3r4 5m6 7 */ + + psrlw mm5, 4 /* mm5 /= 16 0 1 2 3 4 5m6 7 */ + + packuswb mm6, mm5 /* pack result into mm6 0 1 2 3 4 5r6m7 */ + + movq 4[eax], mm6 /* v[] = mm6 0 1 2 3 4 5 6r7 */ + + pop ebx + pop eax + + + + + }; + + #ifdef PP_SELF_CHECK + for (i=1; i<=8; i++) { + if (selfcheck[i] != v[i+y*stride]) { + printf("ERROR: MMX version of horiz lpf9 is incorrect at %d\n", i); + } + } + #endif + + } + + } diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_horiz_useDC.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_horiz_useDC.c *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_horiz_useDC.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_horiz_useDC.c Fri Jan 19 15:34:12 2001 *************** *** 0 **** --- 1,177 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* John Funnell, December 2000 */ + + /* decide DC mode or default mode for the horizontal filter */ + INLINE int deblock_horiz_useDC(uint8_t *v, int stride) { + const uint64_t mm64_mask = 0x00fefefefefefefe; + uint32_t mm32_result; + uint64_t *pmm1; + int eq_cnt, useDC; + #ifdef PP_SELF_CHECK + int eq_cnt2, j, k; + #endif + + pmm1 = (uint64_t *)(&(v[1])); /* this is a 32-bit aligned pointer, not 64-aligned */ + + __asm { + push eax + mov eax, pmm1 + + /* first load some constants into mm4, mm5, mm6, mm7 */ + movq mm6, mm64_mask /*mm6 = 0x00fefefefefefefe */ + pxor mm4, mm4 /*mm4 = 0x0000000000000000 */ + + movq mm1, qword ptr [eax] /* mm1 = *pmm 0 1 2 3 4 5 6 7 */ + add eax, stride /* eax += stride/8 0 1 2 3 4 5 6 7 */ + + movq mm5, mm1 /* mm5 = mm1 0 1 2 3 4 5 6 7 */ + psrlq mm1, 8 /* mm1 >>= 8 0 1 2 3 4 5 6 7 */ + + movq mm2, mm5 /* mm2 = mm5 0 1 2 3 4 5 6 7 */ + psubusb mm5, mm1 /* mm5 -= mm1 0 1 2 3 4 5 6 7 */ + + movq mm3, qword ptr [eax] /* mm3 = *pmm 0 1 2 3 4 5 6 7 */ + psubusb mm1, mm2 /* mm1 -= mm2 0 1 2 3 4 5 6 7 */ + + add eax, stride /* eax += stride/8 0 1 2 3 4 5 6 7 */ + por mm5, mm1 /* mm5 |= mm1 0 1 2 3 4 5 6 7 */ + + movq mm0, mm3 /* mm0 = mm3 0 1 2 3 4 5 6 7 */ + pand mm5, mm6 /* mm5 &= 0xfefefefefefefefe */ + + pxor mm7, mm7 /*mm7 = 0x0000000000000000 */ + pcmpeqb mm5, mm4 /* are the bytes of mm5 == 0 ? */ + + movq mm1, qword ptr [eax] /* mm3 = *pmm 0 1 2 3 4 5 6 7 */ + psubb mm7, mm5 /* mm7 has running total of eqcnts */ + + psrlq mm3, 8 /* mm3 >>= 8 0 1 2 3 4 5 6 7 */ + movq mm5, mm0 /* mm5 = mm0 0 1 2 3 4 5 6 7 */ + + psubusb mm0, mm3 /* mm0 -= mm3 0 1 2 3 4 5 6 7 */ + + add eax, stride /* eax += stride/8 0 1 2 3 4 5 6 7 */ + psubusb mm3, mm5 /* mm3 -= mm5 0 1 2 3 4 5 6 7 */ + + movq mm5, qword ptr [eax] /* mm5 = *pmm 0 1 2 3 4 5 6 7 */ + por mm0, mm3 /* mm0 |= mm3 0 1 2 3 4 5 6 7 */ + + movq mm3, mm1 /* mm3 = mm1 0 1 2 3 4 5 6 7 */ + pand mm0, mm6 /* mm0 &= 0xfefefefefefefefe */ + + psrlq mm1, 8 /* mm1 >>= 8 0 1 2 3 4 5 6 7 */ + pcmpeqb mm0, mm4 /* are the bytes of mm0 == 0 ? */ + + movq mm2, mm3 /* mm2 = mm3 0 1 2 3 4 5 6 7 */ + psubb mm7, mm0 /* mm7 has running total of eqcnts */ + + psubusb mm3, mm1 /* mm3 -= mm1 0 1 2 3 4 5 6 7 */ + + psubusb mm1, mm2 /* mm1 -= mm2 0 1 2 3 4 5 6 7 */ + + por mm3, mm1 /* mm3 |= mm1 0 1 2 3 4 5 6 7 */ + movq mm1, mm5 /* mm1 = mm5 0 1 2 3 4 5 6 7 */ + + pand mm3, mm6 /* mm3 &= 0xfefefefefefefefe */ + psrlq mm5, 8 /* mm5 >>= 8 0 1 2 3 4 5 6 7 */ + + pcmpeqb mm3, mm4 /* are the bytes of mm3 == 0 ? */ + movq mm0, mm1 /* mm0 = mm1 0 1 2 3 4 5 6 7 */ + + psubb mm7, mm3 /* mm7 has running total of eqcnts */ + psubusb mm1, mm5 /* mm1 -= mm5 0 1 2 3 4 5 6 7 */ + + psubusb mm5, mm0 /* mm5 -= mm0 0 1 2 3 4 5 6 7 */ + por mm1, mm5 /* mm1 |= mm5 0 1 2 3 4 5 6 7 */ + + pand mm1, mm6 /* mm1 &= 0xfefefefefefefefe */ + + pcmpeqb mm1, mm4 /* are the bytes of mm1 == 0 ? */ + + psubb mm7, mm1 /* mm7 has running total of eqcnts */ + + movq mm1, mm7 /* mm1 = mm7 0 1w2 3 4 5 6 7r */ + psllq mm7, 8 /* mm7 >>= 24 0 1 2 3 4 5 6 7m */ + + psrlq mm1, 24 /* mm7 >>= 24 0 1 2 3 4 5 6 7m */ + + paddb mm7, mm1 /* mm7 has running total of eqcnts */ + + movq mm1, mm7 /* mm1 = mm7 0 1w2 3 4 5 6 7r */ + psrlq mm7, 16 /* mm7 >>= 16 0 1 2 3 4 5 6 7m */ + + paddb mm7, mm1 /* mm7 has running total of eqcnts */ + + movq mm1, mm7 /* mm1 = mm7 0 1w2 3 4 5 6 7r */ + psrlq mm7, 8 /* mm7 >>= 8 0 1 2 3 4 5 6 7m */ + + paddb mm7, mm1 /* mm7 has running total of eqcnts */ + + movd mm32_result, mm7 + + pop eax + + + + + + }; + + eq_cnt = mm32_result & 0xff; + + #ifdef PP_SELF_CHECK + eq_cnt2 = 0; + for (k=0; k<4; k++) { + for (j=1; j<=7; j++) { + if (ABS(v[j+k*stride]-v[1+j+k*stride]) <= 1) eq_cnt2++; + } + } + if (eq_cnt2 != eq_cnt) printf("ERROR: MMX version of useDC is incorrect\n"); + #endif + + useDC = eq_cnt >= DEBLOCK_HORIZ_USEDC_THR; + + return useDC; + } + diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert.c *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert.c Tue Feb 20 05:07:58 2001 *************** *** 0 **** --- 1,185 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* top level function for vertical deblock that loops from left to right along a line */ + + /* John Funnell, December 2000 */ + + + /* this is to help us inline our functions */ + #ifdef PP_COMPONENTS_INLINE + #ifndef INLINE + #define INLINE static __inline + #endif + #include "deblock_vert_DC_on.c" + #include "deblock_vert_choose_p1p2.c" + #include "deblock_vert_copy_and_unpack.c" + #include "deblock_vert_default_filter.c" + #include "deblock_vert_lpf9.c" + #include "deblock_vert_useDC.c" + #endif + + + /* this is a vertical deblocking filter - i.e. it will smooth _horizontal_ block edges */ + void deblock_vert( uint8_t *image, int width, int stride, QP_STORE_T *QP_store, int QP_stride, int chromaFlag) { + uint64_t v_local[20]; + uint64_t p1p2[4]; + int Bx, x, y; + int QP, QPx16; + uint8_t *v; + int useDC, DC_on; + #ifdef PREFETCH_AHEAD_V + void *prefetch_addr; + #endif + + y = 0; + + /* loop over image's block boundary rows */ + // for (y=8; y + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + + /* John Funnell, December 2000 */ + + + + /* decide whether the DC filter should be turned on accoding to QP */ + INLINE int deblock_vert_DC_on(uint8_t *v, int stride, int QP) { + uint64_t QP_x_2; + uint8_t *ptr1; + uint8_t *ptr2; + int DC_on; + #ifdef PP_SELF_CHECK + int i, DC_on2; + #endif + + ptr1 = &(v[1*stride]); + ptr2 = &(v[8*stride]); + + #ifdef PP_SELF_CHECK + DC_on2 = 1; + for (i=0; i<8; i++) { + if (ABS(v[i+1*stride]-v[i+8*stride]) > 2 *QP) DC_on2 = 0; + } + #endif + + /* load 2*QP into every byte in QP_x_2 */ + ((uint32_t *)(&QP_x_2))[0] = + ((uint32_t *)(&QP_x_2))[1] = 0x02020202 * QP; + + /* MMX assembler to compute DC_on */ + __asm { + push eax + push ebx + + mov eax, ptr1 + mov ebx, ptr2 + + movq mm0, [eax] /* mm0 = v[l1] */ + movq mm1, mm0 /* mm1 = v[l1] */ + movq mm2, [ebx] /* mm2 = v[l8] */ + psubusb mm0, mm2 /* mm0 -= mm2 */ + psubusb mm2, mm1 /* mm2 -= mm1 */ + por mm0, mm2 /* mm0 |= mm2 */ + psubusb mm0, QP_x_2 /* mm0 -= 2 * QP */ + movq mm1, mm0 /* mm1 = mm0 */ + psrlq mm0, 32 /* shift mm0 right 32 bits */ + por mm0, mm1 /* */ + movd DC_on, mm0 /* this is actually !DC_on */ + + pop ebx + pop eax + + }; + + DC_on = !DC_on; /* the above assembler computes the opposite sense! */ + + #ifdef PP_SELF_CHECK + if (DC_on != DC_on2) { + printf("ERROR: MMX version of DC_on is incorrect\n"); + } + #endif + + return DC_on; + } + + diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert_choose_p1p2.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert_choose_p1p2.c *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert_choose_p1p2.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert_choose_p1p2.c Fri Jan 19 15:34:12 2001 *************** *** 0 **** --- 1,149 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* John Funnell, December 2000 */ + + + + /* This function chooses the "endstops" for the vertial LPF9 filter: p1 and p2 */ + /* We also convert these to 16-bit values here */ + INLINE void deblock_vert_choose_p1p2(uint8_t *v, int stride, uint64_t *p1p2, int QP) { + uint64_t *pmm1, *pmm2; + uint64_t mm_b_qp; + #ifdef PP_SELF_CHECK + int i; + #endif + + /* load QP into every one of the 8 bytes in mm_b_qp */ + ((uint32_t *)&mm_b_qp)[0] = + ((uint32_t *)&mm_b_qp)[1] = 0x01010101 * QP; + + pmm1 = (uint64_t *)(&(v[0*stride])); + pmm2 = (uint64_t *)(&(v[8*stride])); + + __asm { + push eax + push ebx + push ecx + + mov eax, pmm1 + mov ebx, pmm2 + mov ecx, p1p2 + + /* p1 */ + pxor mm7, mm7 /* mm7 = 0 */ + movq mm0, [eax] /* mm0 = *pmm1 = v[l0] */ + movq mm2, mm0 /* mm2 = mm0 = v[l0] */ + add eax, stride /* pmm1 += stride */ + movq mm1, [eax] /* mm1 = *pmm1 = v[l1] */ + movq mm3, mm1 /* mm3 = mm1 = v[l1] */ + psubusb mm0, mm1 /* mm0 -= mm1 */ + psubusb mm1, mm2 /* mm1 -= mm2 */ + por mm0, mm1 /* mm0 |= mm1 */ + psubusb mm0, mm_b_qp /* mm0 -= QP */ + /* now a zero byte in mm0 indicates use v0 else use v1 */ + pcmpeqb mm0, mm7 /* zero bytes to ff others to 00 */ + movq mm1, mm0 /* make a copy of mm0 */ + /* now ff byte in mm0 indicates use v0 else use v1 */ + pandn mm0, mm3 /* mask v1 into 00 bytes in mm0 */ + pand mm1, mm2 /* mask v0 into ff bytes in mm0 */ + por mm0, mm1 /* mm0 |= mm1 */ + movq mm1, mm0 /* make a copy of mm0 */ + /* Now we have our result, p1, in mm0. Next, unpack. */ + punpcklbw mm0, mm7 /* low bytes to mm0 */ + punpckhbw mm1, mm7 /* high bytes to mm1 */ + /* Store p1 in memory */ + movq [ecx], mm0 /* low words to p1p2[0] */ + movq 8[ecx], mm1 /* high words to p1p2[1] */ + /* p2 */ + movq mm1, [ebx] /* mm1 = *pmm2 = v[l8] */ + movq mm3, mm1 /* mm3 = mm1 = v[l8] */ + add ebx, stride /* pmm2 += stride */ + movq mm0, [ebx] /* mm0 = *pmm2 = v[l9] */ + movq mm2, mm0 /* mm2 = mm0 = v[l9] */ + psubusb mm0, mm1 /* mm0 -= mm1 */ + psubusb mm1, mm2 /* mm1 -= mm2 */ + por mm0, mm1 /* mm0 |= mm1 */ + psubusb mm0, mm_b_qp /* mm0 -= QP */ + /* now a zero byte in mm0 indicates use v0 else use v1 */ + pcmpeqb mm0, mm7 /* zero bytes to ff others to 00 */ + movq mm1, mm0 /* make a copy of mm0 */ + /* now ff byte in mm0 indicates use v0 else use v1 */ + pandn mm0, mm3 /* mask v1 into 00 bytes in mm0 */ + pand mm1, mm2 /* mask v0 into ff bytes in mm0 */ + por mm0, mm1 /* mm0 |= mm1 */ + movq mm1, mm0 /* make a copy of mm0 */ + /* Now we have our result, p2, in mm0. Next, unpack. */ + punpcklbw mm0, mm7 /* low bytes to mm0 */ + punpckhbw mm1, mm7 /* high bytes to mm1 */ + /* Store p2 in memory */ + movq 16[ecx], mm0 /* low words to p1p2[2] */ + movq 24[ecx], mm1 /* high words to p1p2[3] */ + + pop ecx + pop ebx + pop eax + + + + }; + + #ifdef PP_SELF_CHECK + /* check p1 and p2 have been calculated correctly */ + /* p2 */ + for (i=0; i<8; i++) { + if ( ((ABS(v[9*stride+i] - v[8*stride+i]) - QP > 0) ? v[8*stride+i] : v[9*stride+i]) + != ((uint16_t *)(&(p1p2[2])))[i] ) { + printf("ERROR: problem with P2\n"); + } + } + /* p1 */ + for (i=0; i<8; i++) { + if ( ((ABS(v[0*stride+i] - v[1*stride+i]) - QP > 0) ? v[1*stride+i] : v[0*stride+i]) + != ((uint16_t *)(&(p1p2[0])))[i] ) { + printf("ERROR: problem with P1\n"); + } + } + #endif + + } + diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert_copy_and_unpack.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert_copy_and_unpack.c *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert_copy_and_unpack.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert_copy_and_unpack.c Fri Jan 19 15:34:12 2001 *************** *** 0 **** --- 1,128 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + + /* John Funnell, December 2000 */ + + + + /* function using MMX to copy an 8-pixel wide column and unpack to 16-bit values */ + /* n is the number of rows to copy - this muxt be even */ + INLINE void deblock_vert_copy_and_unpack(int stride, uint8_t *source, uint64_t *dest, int n) { + uint64_t *pmm1 = (uint64_t *)source; + uint64_t *pmm2 = (uint64_t *)dest; + int i = -n / 2; + #ifdef PP_SELF_CHECK + int j, k; + #endif + + /* copy block to local store whilst unpacking to 16-bit values */ + __asm { + push edi + push eax + push ebx + + mov edi, i + mov eax, pmm1 + mov ebx, pmm2 + + pxor mm7, mm7 /* set mm7 = 0 */ + deblock_v_L1: /* now p1 is in mm1 */ + movq mm0, [eax] /* mm0 = v[0*stride] */ + + #ifdef PREFETCH_ENABLE + prefetcht0 0[ebx] + #endif + add eax, stride /* p_data += stride */ + movq mm1, mm0 /* mm1 = v[0*stride] */ + punpcklbw mm0, mm7 /* unpack low bytes (left hand 4) */ + + movq mm2, [eax] /* mm2 = v[0*stride] */ + punpckhbw mm1, mm7 /* unpack high bytes (right hand 4)*/ + + movq mm3, mm2 /* mm3 = v[0*stride] */ + punpcklbw mm2, mm7 /* unpack low bytes (left hand 4) */ + + movq [ebx], mm0 /* v_local[n] = mm0 (left) */ + add eax, stride /* p_data += stride */ + + movq 8[ebx], mm1 /* v_local[n+8] = mm1 (right) */ + punpckhbw mm3, mm7 /* unpack high bytes (right hand 4)*/ + + movq 16[ebx], mm2 /* v_local[n+16] = mm2 (left) */ + + movq 24[ebx], mm3 /* v_local[n+24] = mm3 (right) */ + + add ebx, 32 /* p_data2 += 8 */ + + add i, 1 /* increment loop counter */ + jne deblock_v_L1 + + + pop ebx + pop eax + pop edi + + + + + + + + + }; + + #ifdef PP_SELF_CHECK + /* check that MMX copy has worked correctly */ + for (k=0; k + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* John Funnell, December 2000 */ + + + + /* Vertical deblocking filter for use in non-flat picture regions */ + INLINE void deblock_vert_default_filter(uint8_t *v, int stride, int QP) { + uint64_t *pmm1; + const uint64_t mm_0020 = 0x0020002000200020; + uint64_t mm_8_x_QP; + int i; + + #ifdef PP_SELF_CHECK + /* define semi-constants to enable us to move up and down the picture easily... */ + int l1 = 1 * stride; + int l2 = 2 * stride; + int l3 = 3 * stride; + int l4 = 4 * stride; + int l5 = 5 * stride; + int l6 = 6 * stride; + int l7 = 7 * stride; + int l8 = 8 * stride; + int x, y, a3_0_SC, a3_1_SC, a3_2_SC, d_SC, q_SC; + uint8_t selfcheck[8][2]; + #endif + + #ifdef PP_SELF_CHECK + /* compute selfcheck matrix for later comparison */ + for (x=0; x<8; x++) { + a3_0_SC = 2*v[l3+x] - 5*v[l4+x] + 5*v[l5+x] - 2*v[l6+x]; + a3_1_SC = 2*v[l1+x] - 5*v[l2+x] + 5*v[l3+x] - 2*v[l4+x]; + a3_2_SC = 2*v[l5+x] - 5*v[l6+x] + 5*v[l7+x] - 2*v[l8+x]; + q_SC = (v[l4+x] - v[l5+x]) / 2; + + if (ABS(a3_0_SC) < 8*QP) { + + d_SC = ABS(a3_0_SC) - MIN(ABS(a3_1_SC), ABS(a3_2_SC)); + if (d_SC < 0) d_SC=0; + + d_SC = (5*d_SC + 32) >> 6; + d_SC *= SIGN(-a3_0_SC); + + //printf("d_SC[%d] preclip=%d\n", x, d_SC); + /* clip d in the range 0 ... q */ + if (q_SC > 0) { + d_SC = d_SC<0 ? 0 : d_SC; + d_SC = d_SC>q_SC ? q_SC : d_SC; + } else { + d_SC = d_SC>0 ? 0 : d_SC; + d_SC = d_SC a3_1 ? L 0r1m2 3 4 5 6 7 */ + + add ecx, stride /* ecx += stride 0 1 2 3 4 5 6 7 */ + pxor mm0, mm1 /* mm0 = ABS(a3_1) step 1 L 0m1r2 3 4 5 6 7 */ + + psubw mm0, mm1 /* mm0 = ABS(a3_1) step 2 L 0m1r2 3 4 5 6 7 */ + + movd mm1, [ecx] /* mm1 = v5v5v5v5v5v5v5v5 0 1w2 3 4 5 6 7 */ + + punpcklbw mm1, mm7 /* mm1 = __v5__v5__v5__v5 L 0 1m2 3 4 5 6 7r */ + + + add ecx, stride /* ecx += stride 0 1 2 3 4 5 6 7 */ + psubw mm3, mm1 /* mm3 = v4 - v5 L 0 1r2 3m4 5 6 7 */ + + movd mm4, [ecx] /* mm4 = v6v6v6v6v6v6v6v6 0 1 2 3 4w5 6 7 */ + + punpcklbw mm4, mm7 /* mm4 = __v6__v6__v6__v6 L 0 1 2 3 4m5 6 7r */ + + add ecx, stride /* ecx += stride 0 1 2 3 4 5 6 7 */ + + movd mm5, [ecx] /* mm5 = v7v7v7v7v7v7v7v7 0 1 2 3 4 5w6 7 */ + psubw mm2, mm4 /* mm2 = v3 - v6 L 0 1 2m3 4r5 6 7 */ + + punpcklbw mm5, mm7 /* mm5 = __v7__v7__v7__v7 L 0 1 2 3 4 5m6 7r */ + + add ecx, stride /* ecx += stride 0 1 2 3 4 5 6 7 */ + psubw mm5, mm4 /* mm5 = v7 - v6 L 0 1 2 3 4r5m6 7 */ + + movq mm4, mm5 /* mm4 = v7 - v6 L 0 1 2 3 4w5r6 7 */ + + psllw mm4, 2 /* mm4 = 4 * (v7 - v6) L 0 1 2 3 4 5m6 7 */ + + paddw mm5, mm4 /* mm5 = 5 * (v7 - v6) L 0 1 2 3 4r5m6 7 */ + + movd mm4, [ecx] /* mm4 = v8v8v8v8v8v8v8v8 0 1 2 3 4w5 6 7 */ + + punpcklbw mm4, mm7 /* mm4 = __v8__v8__v8__v8 L 0 1 2 3 4m5 6 7r */ + + + + psubw mm1, mm4 /* mm1 = v5 - v8 L 0 1m2 3 4r5 6 7 */ + + pxor mm4, mm4 /* mm4 = 0000000000000000 0 1 2 3 4w5 6 7 */ + psllw mm1, 1 /* mm1 = 2 * (v5 - v8) L 0 1m2 3 4 5 6 7 */ + + paddw mm1, mm5 /* mm1 = a3_2 L 0 1m2 3 4 5r6 7 */ + + pcmpgtw mm4, mm1 /* is 0 > a3_2 ? L 0 1r2 3 4m5 6 7 */ + + pxor mm1, mm4 /* mm1 = ABS(a3_2) step 1 L 0 1m2 3 4r5 6 7 */ + + psubw mm1, mm4 /* mm1 = ABS(a3_2) step 2 L 0 1m2 3 4r5 6 7 */ + /* at this point, mm0 = ABS(a3_1), mm1 = ABS(a3_2), mm2 = v3 - v6, mm3 = v4 - v5 */ + + movq mm4, mm1 /* mm4 = ABS(a3_2) L 0 1r2 3 4w5 6 7 */ + + pcmpgtw mm1, mm0 /* is ABS(a3_2) > ABS(a3_1) 0r1m2 3 4 5 6 7 */ + + pand mm0, mm1 /* min() step 1 L 0m1r2 3 4 5 6 7 */ + + pandn mm1, mm4 /* min() step 2 L 0 1m2 3 4r5 6 7 */ + + por mm0, mm1 /* min() step 3 L 0m1r2 3 4 5 6 7 */ + /* at this point, mm0 = MIN( ABS(a3_1), ABS(a3_2), mm2 = v3 - v6, mm3 = v4 - v5 */ + movq mm1, mm3 /* mm1 = v4 - v5 L 0 1w2 3r4 5 6 7 */ + psllw mm3, 2 /* mm3 = 4 * (v4 - v5) L 0 1 2 3m4 5 6 7 */ + + paddw mm3, mm1 /* mm3 = 5 * (v4 - v5) L 0 1r2 3m4 5 6 7 */ + psllw mm2, 1 /* mm2 = 2 * (v3 - v6) L 0 1 2m3 4 5 6 7 */ + + psubw mm2, mm3 /* mm2 = a3_0 L 0 1 2m3r4 5 6 7 */ + /* at this point, mm0 = MIN( ABS(a3_1), ABS(a3_2), mm1 = v4 - v5, mm2 = a3_0 */ + movq mm4, mm2 /* mm4 = a3_0 L 0 1 2r3 4w5 6 7 */ + pxor mm3, mm3 /* mm3 = 0000000000000000 0 1 2 3w4 5 6 7 */ + + pcmpgtw mm3, mm2 /* is 0 > a3_0 ? L 0 1 2r3m4 5 6 7 */ + + movq mm2, mm_8_x_QP /* mm4 = 8*QP 0 1 2w3 4 5 6 7 */ + pxor mm4, mm3 /* mm4 = ABS(a3_0) step 1 L 0 1 2 3r4m5 6 7 */ + + psubw mm4, mm3 /* mm4 = ABS(a3_0) step 2 L 0 1 2 3r4m5 6 7 */ + + /* compare a3_0 against 8*QP */ + pcmpgtw mm2, mm4 /* is 8*QP > ABS(d) ? L 0 1 2m3 4r5 6 7 */ + + pand mm2, mm4 /* if no, d = 0 L 0 1 2m3 4r5 6 7 */ + + movq mm4, mm2 /* mm2 = a3_0 L 0 1 2r3 4w5 6 7 */ + + /* at this point, mm0 = MIN( ABS(a3_1), ABS(a3_2), mm1 = v4 - v5, mm2 = a3_0 , mm3 = SGN(a3_0), mm4 = ABS(a3_0) */ + psubusw mm4, mm0 /* mm0 = (A3_0 - a3_0) L 0r1 2 3 4m5 6 7 */ + + movq mm0, mm4 /* mm0=ABS(d) L 0w1 2 3 4r5 6 7 */ + + psllw mm0, 2 /* mm0 = 4 * (A3_0-a3_0) L 0m1 2 3 4 5 6 7 */ + + paddw mm0, mm4 /* mm0 = 5 * (A3_0-a3_0) L 0m1 2 3 4r5 6 7 */ + + paddw mm0, mm_0020 /* mm0 += 32 L 0m1 2 3 4 5 6 7 */ + + psraw mm0, 6 /* mm0 >>= 6 L 0m1 2 3 4 5 6 7 */ + /* at this point, mm0 = ABS(d), mm1 = v4 - v5, mm3 = SGN(a3_0) */ + + pxor mm2, mm2 /* mm2 = 0000000000000000 0 1 2w3 4 5 6 7 */ + + pcmpgtw mm2, mm1 /* is 0 > (v4 - v5) ? L 0 1r2m3 4 5 6 7 */ + + pxor mm1, mm2 /* mm1 = ABS(mm1) step 1 L 0 1m2r3 4 5 6 7 */ + + psubw mm1, mm2 /* mm1 = ABS(mm1) step 2 L 0 1m2r3 4 5 6 7 */ + + psraw mm1, 1 /* mm1 >>= 2 L 0 1m2 3 4 5 6 7 */ + /* OK at this point, mm0 = ABS(d), mm1 = ABS(q), mm2 = SGN(q), mm3 = SGN(-d) */ + movq mm4, mm2 /* mm4 = SGN(q) L 0 1 2r3 4w5 6 7 */ + + pxor mm4, mm3 /* mm4 = SGN(q) ^ SGN(-d) L 0 1 2 3r4m5 6 7 */ + + movq mm5, mm0 /* mm5 = ABS(d) L 0r1 2 3 4 5w6 7 */ + + pcmpgtw mm5, mm1 /* is ABS(d) > ABS(q) ? L 0 1r2 3 4 5m6 7 */ + + pand mm1, mm5 /* min() step 1 L 0m1 2 3 4 5r6 7 */ + + pandn mm5, mm0 /* min() step 2 L 0 1r2 3 4 5m6 7 */ + + por mm1, mm5 /* min() step 3 L 0m1 2 3 4 5r6 7 */ + + pand mm1, mm4 /* if signs differ, set 0 L 0m1 2 3 4r5 6 7 */ + + pxor mm1, mm2 /* Apply sign step 1 L 0m1 2r3 4 5 6 7 */ + + psubw mm1, mm2 /* Apply sign step 2 L 0m1 2r3 4 5 6 7 */ + /* at this point we have d in mm1 */ + + + + pop ecx + + + + }; + + if (i==0) { + __asm { + movq mm6, mm1 + }; + } + + } + + /* add d to rows l4 and l5 in memory... */ + pmm1 = (uint64_t *)(&(v[4*stride])); + __asm { + push ecx + mov ecx, pmm1 + packsswb mm6, mm1 + movq mm0, [ecx] + psubb mm0, mm6 + movq [ecx], mm0 + add ecx, stride /* %0 += stride 0 1 2 3 4 5 6 7 */ + paddb mm6, [ecx] + movq [ecx], mm6 + pop ecx + + + + + }; + + + + #ifdef PP_SELF_CHECK + /* do selfcheck */ + for (x=0; x<8; x++) { + for (y=0; y<2; y++) { + if (selfcheck[x][y] != v[l4+x+y*stride]) { + printf("ERROR: problem with vertical default filter in col %d, row %d\n", x, y); + printf("%d should be %d\n", v[l4+x+y*stride], selfcheck[x][y]); + + } + } + } + #endif + + + + + } + + + + + diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert_lpf9.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert_lpf9.c *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert_lpf9.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert_lpf9.c Fri Jan 19 15:34:14 2001 *************** *** 0 **** --- 1,434 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* John Funnell, December 2000 */ + + + const static uint64_t mm_fours = 0x0004000400040004; + + + /* Vertical 9-tap low-pass filter for use in "DC" regions of the picture */ + INLINE void deblock_vert_lpf9(uint64_t *v_local, uint64_t *p1p2, uint8_t *v, int stride) { + + #ifdef PP_SELF_CHECK + int j, k; + uint8_t selfcheck[64], *vv; + int p1, p2, psum; + /* define semi-constants to enable us to move up and down the picture easily... */ + int l1 = 1 * stride; + int l2 = 2 * stride; + int l3 = 3 * stride; + int l4 = 4 * stride; + int l5 = 5 * stride; + int l6 = 6 * stride; + int l7 = 7 * stride; + int l8 = 8 * stride; + #endif + + + #ifdef PP_SELF_CHECK + /* generate a self-check version of the filter result in selfcheck[64] */ + for (j=0; j<8; j++) { /* loop left->right */ + vv = &(v[j]); + p1 = ((uint16_t *)(&(p1p2[0+j/4])))[j%4]; /* yuck! */ + p2 = ((uint16_t *)(&(p1p2[2+j/4])))[j%4]; /* yuck! */ + /* the above may well be endian-fussy */ + psum = p1 + p1 + p1 + vv[l1] + vv[l2] + vv[l3] + vv[l4] + 4; + selfcheck[j+8*0] = (((psum + vv[l1]) << 1) - (vv[l4] - vv[l5])) >> 4; + psum += vv[l5] - p1; + selfcheck[j+8*1] = (((psum + vv[l2]) << 1) - (vv[l5] - vv[l6])) >> 4; + psum += vv[l6] - p1; + selfcheck[j+8*2] = (((psum + vv[l3]) << 1) - (vv[l6] - vv[l7])) >> 4; + psum += vv[l7] - p1; + selfcheck[j+8*3] = (((psum + vv[l4]) << 1) + p1 - vv[l1] - (vv[l7] - vv[l8])) >> 4; + psum += vv[l8] - vv[l1]; + selfcheck[j+8*4] = (((psum + vv[l5]) << 1) + (vv[l1] - vv[l2]) - vv[l8] + p2) >> 4; + psum += p2 - vv[l2]; + selfcheck[j+8*5] = (((psum + vv[l6]) << 1) + (vv[l2] - vv[l3])) >> 4; + psum += p2 - vv[l3]; + selfcheck[j+8*6] = (((psum + vv[l7]) << 1) + (vv[l3] - vv[l4])) >> 4; + psum += p2 - vv[l4]; + selfcheck[j+8*7] = (((psum + vv[l8]) << 1) + (vv[l4] - vv[l5])) >> 4; + } + #endif + + /* vertical DC filter in MMX + mm2 - p1/2 left + mm3 - p1/2 right + mm4 - psum left + mm5 - psum right */ + /* alternate between using mm0/mm1 and mm6/mm7 to accumlate left/right */ + + __asm { + push eax + push ebx + push ecx + + mov eax, p1p2 + mov ebx, v_local + mov ecx, v + + /* load p1 left into mm2 and p1 right into mm3 */ + movq mm2, [eax] /* mm2 = p1p2[0] 0 1 2w3 4 5 6 7 */ + add ecx, stride /* ecx points at v[1*stride] 0 1 2 3 4 5 6 7 */ + + movq mm3, 8[eax] /* mm3 = p1p2[1] 0 1 2 3w4 5 6 7 */ + + movq mm4, mm_fours /* mm4 = 0x0004000400040004 0 1 2 3 4w5 6 7 */ + /* psum = p1 + p1 + p1 + vv[1] + vv[2] + vv[3] + vv[4] + 4 */ + /* psum left will be in mm4, right in mm5 */ + movq mm5, mm4 /* mm5 = 0x0004000400040004 0 1 2 3 4 5w6 7 */ + + paddsw mm4, 16[ebx] /* mm4 += vv[1] left 0 1 2 3 4m5 6 7 */ + paddw mm5, mm3 /* mm5 += p2 left 0 1 2 3r4 5m6 7 */ + + paddsw mm4, 32[ebx] /* mm4 += vv[2] left 0 1 2 3 4m5 6 7 */ + paddw mm5, mm3 /* mm5 += p2 left 0 1 2 3r4 5m6 7 */ + + paddsw mm4, 48[ebx] /* mm4 += vv[3] left 0 1 2 3 4m5 6 7 */ + paddw mm5, mm3 /* mm5 += p2 left 0 1 2 3r4 5m6 7 */ + + paddsw mm5, 24[ebx] /* mm5 += vv[1] right 0 1 2 3 4 5m6 7 */ + paddw mm4, mm2 /* mm4 += p1 left 0 1 2r3 4m5 6 7 */ + + paddsw mm5, 40[ebx] /* mm5 += vv[2] right 0 1 2 3 4 5m6 7 */ + paddw mm4, mm2 /* mm4 += p1 left 0 1 2r3 4m5 6 7 */ + + paddsw mm5, 56[ebx] /* mm5 += vv[3] right 0 1 2 3 4 5m6 7 */ + paddw mm4, mm2 /* mm4 += p1 left 0 1 2r3 4m5 6 7 */ + + paddsw mm4, 64[ebx] /* mm4 += vv[4] left 0 1 2 3 4m5 6 7 */ + + paddsw mm5, 72[ebx] /* mm5 += vv[4] right 0 1 2 3 4 5m6 7 */ + /* v[1] = (((psum + vv[1]) << 1) - (vv[4] - vv[5])) >> 4 */ + /* compute this in mm0 (left) and mm1 (right) */ + movq mm0, mm4 /* mm0 = psum left 0w1 2 3 4 5 6 7 */ + + paddsw mm0, 16[ebx] /* mm0 += vv[1] left 0m1 2 3 4 5 6 7 */ + movq mm1, mm5 /* mm1 = psum right 0 1w2 3 4 5r6 7 */ + + paddsw mm1, 24[ebx] /* mm1 += vv[1] right 0 1 2 3 4 5 6 7 */ + psllw mm0, 1 /* mm0 <<= 1 0m1 2 3 4 5 6 7 */ + + psubsw mm0, 64[ebx] /* mm0 -= vv[4] left 0m1 2 3 4 5 6 7 */ + psllw mm1, 1 /* mm1 <<= 1 0 1 2 3 4 5 6 7 */ + + psubsw mm1, 72[ebx] /* mm1 -= vv[4] right 0 1m2 3 4 5 6 7 */ + + paddsw mm0, 80[ebx] /* mm0 += vv[5] left 0m1 2 3 4 5 6 7 */ + + paddsw mm1, 88[ebx] /* mm1 += vv[5] right 0 1m2 3 4 5 6 7 */ + psrlw mm0, 4 /* mm0 >>= 4 0m1 2 3 4 5 6 7 */ + /* psum += vv[5] - p1 */ + paddsw mm4, 80[ebx] /* mm4 += vv[5] left 0 1 2 3 4m5 6 7 */ + psrlw mm1, 4 /* mm1 >>= 4 0 1m2 3 4 5 6 7 */ + + paddsw mm5, 88[ebx] /* mm5 += vv[5] right 0 1 2 3 4 5 6 7 */ + psubsw mm4, [eax] /* mm4 -= p1 left 0 1 2 3 4 5 6 7 */ + + packuswb mm0, mm1 /* pack mm1, mm0 to mm0 0m1 2 3 4 5 6 7 */ + psubsw mm5, 8[eax] /* mm5 -= p1 right 0 1 2 3 4 5 6 7 */ + + /* v[2] = (((psum + vv[2]) << 1) - (vv[5] - vv[6])) >> 4 */ + /* compute this in mm6 (left) and mm7 (right) */ + movq mm6, mm4 /* mm6 = psum left 0 1 2 3 4 5 6 7 */ + + paddsw mm6, 32[ebx] /* mm6 += vv[2] left 0 1 2 3 4 5 6 7 */ + movq mm7, mm5 /* mm7 = psum right 0 1 2 3 4 5 6 7 */ + + paddsw mm7, 40[ebx] /* mm7 += vv[2] right 0 1 2 3 4 5 6 7 */ + psllw mm6, 1 /* mm6 <<= 1 0 1 2 3 4 5 6 7 */ + + psubsw mm6, 80[ebx] /* mm6 -= vv[5] left 0 1 2 3 4 5 6 7 */ + psllw mm7, 1 /* mm7 <<= 1 0 1 2 3 4 5 6 7 */ + + psubsw mm7, 88[ebx] /* mm7 -= vv[5] right 0 1 2 3 4 5 6 7 */ + + movq [ecx], mm0 /* v[1*stride] = mm0 0 1 2 3 4 5 6 7 */ + + paddsw mm6, 96[ebx] /* mm6 += vv[6] left 0 1 2 3 4 5 6 7 */ + add ecx, stride /* ecx points at v[2*stride] 0 1 2 3 4 5 6 7 */ + + paddsw mm7, 104[ebx] /* mm7 += vv[6] right 0 1 2 3 4 5 6 7 */ + /* psum += vv[6] - p1 */ + + paddsw mm4, 96[ebx] /* mm4 += vv[6] left 0 1 2 3 4 5 6 7 */ + psrlw mm6, 4 /* mm6 >>= 4 0 1 2 3 4 5 6 7 */ + + paddsw mm5, 104[ebx] /* mm5 += vv[6] right 0 1 2 3 4 5 6 7 */ + psrlw mm7, 4 /* mm7 >>= 4 0 1 2 3 4 5 6 7 */ + + psubsw mm4, [eax] /* mm4 -= p1 left 0 1 2 3 4 5 6 7 */ + packuswb mm6, mm7 /* pack mm7, mm6 to mm6 0 1 2 3 4 5 6 7 */ + + psubsw mm5, 8[eax] /* mm5 -= p1 right 0 1 2 3 4 5 6 7 */ + /* v[3] = (((psum + vv[3]) << 1) - (vv[6] - vv[7])) >> 4 */ + /* compute this in mm0 (left) and mm1 (right) */ + + movq mm0, mm4 /* mm0 = psum left 0 1 2 3 4 5 6 7 */ + + paddsw mm0, 48[ebx] /* mm0 += vv[3] left 0 1 2 3 4 5 6 7 */ + movq mm1, mm5 /* mm1 = psum right 0 1 2 3 4 5 6 7 */ + + paddsw mm1, 56[ebx] /* mm1 += vv[3] right 0 1 2 3 4 5 6 7 */ + psllw mm0, 1 /* mm0 <<= 1 0 1 2 3 4 5 6 7 */ + + psubsw mm0, 96[ebx] /* mm0 -= vv[6] left 0 1 2 3 4 5 6 7 */ + psllw mm1, 1 /* mm1 <<= 1 0 1 2 3 4 5 6 7 */ + + psubsw mm1, 104[ebx] /* mm1 -= vv[6] right 0 1 2 3 4 5 6 7 */ + + movq [ecx], mm6 /* v[2*stride] = mm6 0 1 2 3 4 5 6 7 */ + paddsw mm0, 112[ebx] /* mm0 += vv[7] left 0 1 2 3 4 5 6 7 */ + + paddsw mm1, 120[ebx] /* mm1 += vv[7] right 0 1 2 3 4 5 6 7 */ + add ecx, stride /* ecx points at v[3*stride] 0 1 2 3 4 5 6 7 */ + + /* psum += vv[7] - p1 */ + paddsw mm4, 112[ebx] /* mm4 += vv[5] left 0 1 2 3 4 5 6 7 */ + psrlw mm0, 4 /* mm0 >>= 4 0 1 2 3 4 5 6 7 */ + + paddsw mm5, 120[ebx] /* mm5 += vv[5] right 0 1 2 3 4 5 6 7 */ + psrlw mm1, 4 /* mm1 >>= 4 0 1 2 3 4 5 6 7 */ + + psubsw mm4, [eax] /* mm4 -= p1 left 0 1 2 3 4 5 6 7 */ + packuswb mm0, mm1 /* pack mm1, mm0 to mm0 0 1 2 3 4 5 6 7 */ + + psubsw mm5, 8[eax] /* mm5 -= p1 right 0 1 2 3 4 5 6 7 */ + /* v[4] = (((psum + vv[4]) << 1) + p1 - vv[1] - (vv[7] - vv[8])) >> 4 */ + /* compute this in mm6 (left) and mm7 (right) */ + movq [ecx], mm0 /* v[3*stride] = mm0 0 1 2 3 4 5 6 7 */ + movq mm6, mm4 /* mm6 = psum left 0 1 2 3 4 5 6 7 */ + + paddsw mm6, 64[ebx] /* mm6 += vv[4] left 0 1 2 3 4 5 6 7 */ + movq mm7, mm5 /* mm7 = psum right 0 1 2 3 4 5 6 7 */ + + paddsw mm7, 72[ebx] /* mm7 += vv[4] right 0 1 2 3 4 5 6 7 */ + psllw mm6, 1 /* mm6 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm6, [eax] /* mm6 += p1 left 0 1 2 3 4 5 6 7 */ + psllw mm7, 1 /* mm7 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm7, 8[eax] /* mm7 += p1 right 0 1 2 3 4 5 6 7 */ + + psubsw mm6, 16[ebx] /* mm6 -= vv[1] left 0 1 2 3 4 5 6 7 */ + + psubsw mm7, 24[ebx] /* mm7 -= vv[1] right 0 1 2 3 4 5 6 7 */ + + psubsw mm6, 112[ebx] /* mm6 -= vv[7] left 0 1 2 3 4 5 6 7 */ + + psubsw mm7, 120[ebx] /* mm7 -= vv[7] right 0 1 2 3 4 5 6 7 */ + + paddsw mm6, 128[ebx] /* mm6 += vv[8] left 0 1 2 3 4 5 6 7 */ + add ecx, stride /* ecx points at v[4*stride] 0 1 2 3 4 5 6 7 */ + + paddsw mm7, 136[ebx] /* mm7 += vv[8] right 0 1 2 3 4 5 6 7 */ + /* psum += vv[8] - vv[1] */ + + paddsw mm4, 128[ebx] /* mm4 += vv[5] left 0 1 2 3 4 5 6 7 */ + psrlw mm6, 4 /* mm6 >>= 4 0 1 2 3 4 5 6 7 */ + + paddsw mm5, 136[ebx] /* mm5 += vv[5] right 0 1 2 3 4 5 6 7 */ + psrlw mm7, 4 /* mm7 >>= 4 0 1 2 3 4 5 6 7 */ + + psubsw mm4, 16[ebx] /* mm4 -= vv[1] left 0 1 2 3 4 5 6 7 */ + packuswb mm6, mm7 /* pack mm7, mm6 to mm6 0 1 2 3 4 5 6 7 */ + + psubsw mm5, 24[ebx] /* mm5 -= vv[1] right 0 1 2 3 4 5 6 7 */ + /* v[5] = (((psum + vv[5]) << 1) + (vv[1] - vv[2]) - vv[8] + p2) >> 4 */ + /* compute this in mm0 (left) and mm1 (right) */ + movq mm0, mm4 /* mm0 = psum left 0 1 2 3 4 5 6 7 */ + + paddsw mm0, 80[ebx] /* mm0 += vv[5] left 0 1 2 3 4 5 6 7 */ + movq mm1, mm5 /* mm1 = psum right 0 1 2 3 4 5 6 7 */ + + paddsw mm1, 88[ebx] /* mm1 += vv[5] right 0 1 2 3 4 5 6 7 */ + psllw mm0, 1 /* mm0 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm0, 16[eax] /* mm0 += p2 left 0 1 2 3 4 5 6 7 */ + psllw mm1, 1 /* mm1 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm1, 24[eax] /* mm1 += p2 right 0 1 2 3 4 5 6 7 */ + + paddsw mm0, 16[ebx] /* mm0 += vv[1] left 0 1 2 3 4 5 6 7 */ + movq [ecx], mm6 /* v[4*stride] = mm6 0 1 2 3 4 5 6 7 */ + + paddsw mm1, 24[ebx] /* mm1 += vv[1] right 0 1 2 3 4 5 6 7 */ + + psubsw mm0, 32[ebx] /* mm0 -= vv[2] left 0 1 2 3 4 5 6 7 */ + + psubsw mm1, 40[ebx] /* mm1 -= vv[2] right 0 1 2 3 4 5 6 7 */ + + psubsw mm0, 128[ebx] /* mm0 -= vv[8] left 0 1 2 3 4 5 6 7 */ + + psubsw mm1, 136[ebx] /* mm1 -= vv[8] right 0 1 2 3 4 5 6 7 */ + /* psum += p2 - vv[2] */ + paddsw mm4, 16[eax] /* mm4 += p2 left 0 1 2 3 4 5 6 7 */ + add ecx, stride /* ecx points at v[5*stride] 0 1 2 3 4 5 6 7 */ + + paddsw mm5, 24[eax] /* mm5 += p2 right 0 1 2 3 4 5 6 7 */ + + psubsw mm4, 32[ebx] /* mm4 -= vv[2] left 0 1 2 3 4 5 6 7 */ + + psubsw mm5, 40[ebx] /* mm5 -= vv[2] right 0 1 2 3 4 5 6 7 */ + /* v[6] = (((psum + vv[6]) << 1) + (vv[2] - vv[3])) >> 4 */ + /* compute this in mm6 (left) and mm7 (right) */ + movq mm6, mm4 /* mm6 = psum left 0 1 2 3 4 5 6 7 */ + + paddsw mm6, 96[ebx] /* mm6 += vv[6] left 0 1 2 3 4 5 6 7 */ + movq mm7, mm5 /* mm7 = psum right 0 1 2 3 4 5 6 7 */ + + paddsw mm7, 104[ebx] /* mm7 += vv[6] right 0 1 2 3 4 5 6 7 */ + psllw mm6, 1 /* mm6 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm6, 32[ebx] /* mm6 += vv[2] left 0 1 2 3 4 5 6 7 */ + psllw mm7, 1 /* mm7 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm7, 40[ebx] /* mm7 += vv[2] right 0 1 2 3 4 5 6 7 */ + psrlw mm0, 4 /* mm0 >>= 4 0 1 2 3 4 5 6 7 */ + + psubsw mm6, 48[ebx] /* mm6 -= vv[3] left 0 1 2 3 4 5 6 7 */ + psrlw mm1, 4 /* mm1 >>= 4 0 1 2 3 4 5 6 7 */ + + psubsw mm7, 56[ebx] /* mm7 -= vv[3] right 0 1 2 3 4 5 6 7 */ + packuswb mm0, mm1 /* pack mm1, mm0 to mm0 0 1 2 3 4 5 6 7 */ + + movq [ecx], mm0 /* v[5*stride] = mm0 0 1 2 3 4 5 6 7 */ + /* psum += p2 - vv[3] */ + + paddsw mm4, 16[eax] /* mm4 += p2 left 0 1 2 3 4 5 6 7 */ + psrlw mm6, 4 /* mm6 >>= 4 0 1 2 3 4 5 6 7 */ + + paddsw mm5, 24[eax] /* mm5 += p2 right 0 1 2 3 4 5 6 7 */ + psrlw mm7, 4 /* mm7 >>= 4 0 1 2 3 4 5 6 7 */ + + psubsw mm4, 48[ebx] /* mm4 -= vv[3] left 0 1 2 3 4 5 6 7 */ + add ecx, stride /* ecx points at v[6*stride] 0 1 2 3 4 5 6 7 */ + + psubsw mm5, 56[ebx] /* mm5 -= vv[3] right 0 1 2 3 4 5 6 7 */ + /* v[7] = (((psum + vv[7]) << 1) + (vv[3] - vv[4])) >> 4 */ + /* compute this in mm0 (left) and mm1 (right) */ + movq mm0, mm4 /* mm0 = psum left 0 1 2 3 4 5 6 7 */ + + paddsw mm0, 112[ebx] /* mm0 += vv[7] left 0 1 2 3 4 5 6 7 */ + movq mm1, mm5 /* mm1 = psum right 0 1 2 3 4 5 6 7 */ + + paddsw mm1, 120[ebx] /* mm1 += vv[7] right 0 1 2 3 4 5 6 7 */ + psllw mm0, 1 /* mm0 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm0, 48[ebx] /* mm0 += vv[3] left 0 1 2 3 4 5 6 7 */ + psllw mm1, 1 /* mm1 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm1, 56[ebx] /* mm1 += vv[3] right 0 1 2 3 4 5 6 7 */ + packuswb mm6, mm7 /* pack mm7, mm6 to mm6 0 1 2 3 4 5 6 7 */ + + psubsw mm0, 64[ebx] /* mm0 -= vv[4] left 0 1 2 3 4 5 6 7 */ + + psubsw mm1, 72[ebx] /* mm1 -= vv[4] right 0 1 2 3 4 5 6 7 */ + psrlw mm0, 4 /* mm0 >>= 4 0 1 2 3 4 5 6 7 */ + + movq [ecx], mm6 /* v[6*stride] = mm6 0 1 2 3 4 5 6 7 */ + /* psum += p2 - vv[4] */ + paddsw mm4, 16[eax] /* mm4 += p2 left 0 1 2 3 4 5 6 7 */ + + paddsw mm5, 24[eax] /* mm5 += p2 right 0 1 2 3 4 5 6 7 */ + add ecx, stride /* ecx points at v[7*stride] 0 1 2 3 4 5 6 7 */ + + psubsw mm4, 64[ebx] /* mm4 -= vv[4] left 0 1 2 3 4 5 6 7 */ + psrlw mm1, 4 /* mm1 >>= 4 0 1 2 3 4 5 6 7 */ + + psubsw mm5, 72[ebx] /* mm5 -= vv[4] right 0 1 2 3 4 5 6 7 */ + /* v[8] = (((psum + vv[8]) << 1) + (vv[4] - vv[5])) >> 4 */ + /* compute this in mm6 (left) and mm7 (right) */ + movq mm6, mm4 /* mm6 = psum left 0 1 2 3 4 5 6 7 */ + + paddsw mm6, 128[ebx] /* mm6 += vv[8] left 0 1 2 3 4 5 6 7 */ + movq mm7, mm5 /* mm7 = psum right 0 1 2 3 4 5 6 7 */ + + paddsw mm7, 136[ebx] /* mm7 += vv[8] right 0 1 2 3 4 5 6 7 */ + psllw mm6, 1 /* mm6 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm6, 64[ebx] /* mm6 += vv[4] left 0 1 2 3 4 5 6 7 */ + psllw mm7, 1 /* mm7 <<= 1 0 1 2 3 4 5 6 7 */ + + paddsw mm7, 72[ebx] /* mm7 += vv[4] right 0 1 2 3 4 5 6 7 */ + packuswb mm0, mm1 /* pack mm1, mm0 to mm0 0 1 2 3 4 5 6 7 */ + + psubsw mm6, 80[ebx] /* mm6 -= vv[5] left 0 1 2 3 4 5 6 7 */ + + psubsw mm7, 88[ebx] /* mm7 -= vv[5] right 0 1 2 3 4 5 6 7 */ + psrlw mm6, 4 /* mm6 >>= 4 0 1 2 3 4 5 6 7 */ + + movq [ecx], mm0 /* v[7*stride] = mm0 0 1 2 3 4 5 6 7 */ + psrlw mm7, 4 /* mm7 >>= 4 0 1 2 3 4 5 6 7 */ + + packuswb mm6, mm7 /* pack mm7, mm6 to mm6 0 1 2 3 4 5 6 7 */ + + add ecx, stride /* ecx points at v[8*stride] 0 1 2 3 4 5 6 7 */ + + nop /* 0 1 2 3 4 5 6 7 */ + + movq [ecx], mm6 /* v[8*stride] = mm6 0 1 2 3 4 5 6 7 */ + + + pop ecx + pop ebx + pop eax + + + }; + + #ifdef PP_SELF_CHECK + /* use the self-check version of the filter result in selfcheck[64] to verify the filter output */ + for (k=0; k<8; k++) { /* loop top->bottom */ + for (j=0; j<8; j++) { /* loop left->right */ + vv = &(v[(k+1)*stride + j]); + if (*vv != selfcheck[j+8*k]) { + printf("ERROR: problem with vertical LPF9 filter in row %d\n", k+1); + } + } + } + #endif + + } + + diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert_useDC.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert_useDC.c *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/deblock_vert_useDC.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/deblock_vert_useDC.c Fri Jan 19 15:34:14 2001 *************** *** 0 **** --- 1,250 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* John Funnell, December 2000 */ + + /* decide DC mode or default mode in assembler */ + INLINE int deblock_vert_useDC(uint8_t *v, int stride) { + const uint64_t mask = 0xfefefefefefefefe; + uint32_t mm_data1; + uint64_t *pmm1; + int eq_cnt, useDC; + #ifdef PP_SELF_CHECK + int useDC2, i, j; + #endif + + #ifdef PP_SELF_CHECK + /* C-code version for testing */ + eq_cnt = 0; + for (j=1; j<8; j++) { + for (i=0; i<8; i++) { + if (ABS(v[j*stride+i] - v[(j+1)*stride+i]) <= 1) eq_cnt++; + } + } + useDC2 = (eq_cnt > DEBLOCK_VERT_USEDC_THR); + #endif + + /* starting pointer is at v[stride] == v1 in mpeg4 notation */ + pmm1 = (uint64_t *)(&(v[stride])); + + /* first load some constants into mm4, mm6, mm7 */ + __asm { + push eax + mov eax, pmm1 + + movq mm6, mask /*mm6 = 0xfefefefefefefefe */ + pxor mm7, mm7 /*mm7 = 0x0000000000000000 */ + + movq mm2, [eax] /* mm2 = *p_data */ + pxor mm4, mm4 /*mm4 = 0x0000000000000000 */ + + add eax, stride /* p_data += stride */ + movq mm3, mm2 /* mm3 = *p_data */ + + + + + + + }; + + __asm { + + movq mm2, [eax] /* mm2 = *p_data */ + movq mm0, mm3 /* mm0 = mm3 */ + + movq mm3, mm2 /* mm3 = *p_data */ + movq mm1, mm0 /* mm1 = mm0 */ + + psubusb mm0, mm2 /* mm0 -= mm2 */ + add eax, stride /* p_data += stride */ + + psubusb mm2, mm1 /* mm2 -= mm1 */ + por mm0, mm2 /* mm0 |= mm2 */ + + pand mm0, mm6 /* mm0 &= 0xfefefefefefefefe */ + pcmpeqb mm0, mm4 /* is mm0 == 0 ? */ + + movq mm2, [eax] /* mm2 = *p_data */ + psubb mm7, mm0 /* mm7 has running total of eqcnts */ + + movq mm5, mm3 /* mm5 = mm3 */ + movq mm3, mm2 /* mm3 = *p_data */ + + movq mm1, mm5 /* mm1 = mm5 */ + psubusb mm5, mm2 /* mm5 -= mm2 */ + + psubusb mm2, mm1 /* mm2 -= mm1 */ + por mm5, mm2 /* mm5 |= mm2 */ + + add eax, stride /* p_data += stride */ + pand mm5, mm6 /* mm5 &= 0xfefefefefefefefe */ + + pcmpeqb mm5, mm4 /* is mm0 == 0 ? */ + psubb mm7, mm5 /* mm7 has running total of eqcnts */ + + movq mm2, [eax] /* mm2 = *p_data */ + movq mm0, mm3 /* mm0 = mm3 */ + + movq mm3, mm2 /* mm3 = *p_data */ + movq mm1, mm0 /* mm1 = mm0 */ + + psubusb mm0, mm2 /* mm0 -= mm2 */ + add eax, stride /* p_data += stride */ + + psubusb mm2, mm1 /* mm2 -= mm1 */ + por mm0, mm2 /* mm0 |= mm2 */ + + pand mm0, mm6 /* mm0 &= 0xfefefefefefefefe */ + pcmpeqb mm0, mm4 /* is mm0 == 0 ? */ + + movq mm2, [eax] /* mm2 = *p_data */ + psubb mm7, mm0 /* mm7 has running total of eqcnts */ + + movq mm5, mm3 /* mm5 = mm3 */ + movq mm3, mm2 /* mm3 = *p_data */ + + movq mm1, mm5 /* mm1 = mm5 */ + psubusb mm5, mm2 /* mm5 -= mm2 */ + + psubusb mm2, mm1 /* mm2 -= mm1 */ + por mm5, mm2 /* mm5 |= mm2 */ + + add eax, stride /* p_data += stride */ + pand mm5, mm6 /* mm5 &= 0xfefefefefefefefe */ + + pcmpeqb mm5, mm4 /* is mm0 == 0 ? */ + psubb mm7, mm5 /* mm7 has running total of eqcnts */ + + movq mm2, [eax] /* mm2 = *p_data */ + movq mm0, mm3 /* mm0 = mm3 */ + + movq mm3, mm2 /* mm3 = *p_data */ + movq mm1, mm0 /* mm1 = mm0 */ + + psubusb mm0, mm2 /* mm0 -= mm2 */ + add eax, stride /* p_data += stride */ + + psubusb mm2, mm1 /* mm2 -= mm1 */ + por mm0, mm2 /* mm0 |= mm2 */ + + pand mm0, mm6 /* mm0 &= 0xfefefefefefefefe */ + pcmpeqb mm0, mm4 /* is mm0 == 0 ? */ + + movq mm2, [eax] /* mm2 = *p_data */ + psubb mm7, mm0 /* mm7 has running total of eqcnts */ + + movq mm5, mm3 /* mm5 = mm3 */ + movq mm3, mm2 /* mm3 = *p_data */ + + movq mm1, mm5 /* mm1 = mm5 */ + psubusb mm5, mm2 /* mm5 -= mm2 */ + + psubusb mm2, mm1 /* mm2 -= mm1 */ + por mm5, mm2 /* mm5 |= mm2 */ + + add eax, stride /* p_data += stride */ + pand mm5, mm6 /* mm5 &= 0xfefefefefefefefe */ + + pcmpeqb mm5, mm4 /* is mm0 == 0 ? */ + psubb mm7, mm5 /* mm7 has running total of eqcnts */ + + movq mm2, [eax] /* mm2 = *p_data */ + movq mm0, mm3 /* mm0 = mm3 */ + + movq mm3, mm2 /* mm3 = *p_data */ + movq mm1, mm0 /* mm1 = mm0 */ + + psubusb mm0, mm2 /* mm0 -= mm2 */ + add eax, stride /* p_data += stride */ + + psubusb mm2, mm1 /* mm2 -= mm1 */ + por mm0, mm2 /* mm0 |= mm2 */ + + pand mm0, mm6 /* mm0 &= 0xfefefefefefefefe */ + pcmpeqb mm0, mm4 /* is mm0 == 0 ? */ + + psubb mm7, mm0 /* mm7 has running total of eqcnts */ + + pop eax + + + + + + + }; + + /* now mm7 contains negative eq_cnt for all 8-columns */ + /* copy this to mm_data1 */ + /* sum all 8 bytes in mm7 */ + __asm { + movq mm1, mm7 /* mm1 = mm7 0 1w2 3 4 5 6 7r */ + psrlq mm7, 32 /* mm7 >>= 32 0 1 2 3 4 5 6 7m */ + + paddb mm7, mm1 /* mm7 has running total of eqcnts */ + + movq mm1, mm7 /* mm1 = mm7 0 1w2 3 4 5 6 7r */ + psrlq mm7, 16 /* mm7 >>= 16 0 1 2 3 4 5 6 7m */ + + paddb mm1, mm7 /* mm7 has running total of eqcnts */ + + movq mm7, mm1 /* mm1 = mm7 0 1w2 3 4 5 6 7r */ + psrlq mm7, 8 /* mm7 >>= 8 0 1 2 3 4 5 6 7m */ + + paddb mm7, mm1 /* mm7 has running total of eqcnts */ + + movd mm_data1, mm7 /* mm_data1 = mm7 */ + + }; + + eq_cnt = mm_data1 & 0xff; + + useDC = (eq_cnt > DEBLOCK_VERT_USEDC_THR); + + #ifdef PP_SELF_CHECK + if (useDC != useDC2) printf("ERROR: MMX version of useDC is incorrect\n"); + #endif + + return useDC; + } + diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/fast_copy.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/fast_copy.c *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/fast_copy.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/fast_copy.c Tue Feb 20 05:07:58 2001 *************** *** 0 **** --- 1,115 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + #include "postprocess_mmx.h" + + /* John Funnell, December 2000 */ + + /* I know this could probably be written faster... */ + + + /* Fast copy... needs width and stride to be multiples of 16 */ + void fast_copy(unsigned char *src, int src_stride, + unsigned char *dst, int dst_stride, + int horizontal_size, int vertical_size) { + + uint8_t *pmm1; + uint8_t *pmm2; + int x, y; + + #ifdef PP_SELF_CHECK + int j, k; + #endif + + pmm1 = src; + pmm2 = dst; + + for (y=0; y + * + **/ + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + + #include "postprocess_mmx.h" + + /* John Funnell, 2000,2001 */ + + + + + + + /* entry point for MMX postprocessing */ + void postprocess(unsigned char * src[], int src_stride, + unsigned char * dst[], int dst_stride, + int horizontal_size, int vertical_size, + QP_STORE_T *QP_store, int QP_stride, + int mode) { + + uint8_t *puc_src; + uint8_t *puc_dst; + uint8_t *puc_flt; + QP_STORE_T *QP_ptr; + int y, i; + + + /* this loop is (hopefully) going to improve performance */ + /* loop down the picture, copying and processing in vertical stripes, each four pixels high */ + for (y=0; y>4)*QP_stride]); + deblock_horiz(puc_flt, horizontal_size, dst_stride, QP_ptr, QP_stride, 0); + } + + if (mode & PP_DEBLOCK_Y_V) { + if ( (y%8) && (y-4)>5 ) { + puc_flt = &((dst[0])[(y-4)*dst_stride]); + QP_ptr = &(QP_store[(y>>4)*QP_stride]); + deblock_vert( puc_flt, horizontal_size, dst_stride, QP_ptr, QP_stride, 0); + } + } + + // if (mode & PP_DERING_Y) { + // dering( puc_flt, horizontal_size, dst_stride, QP_ptr, QP_stride, 0); + // } + + } /* for loop */ + + /* now we're going to do U and V assuming 4:2:0 */ + horizontal_size >>= 1; + vertical_size >>= 1; + src_stride >>= 1; + dst_stride >>= 1; + + + /* loop U then V */ + for (i=1; i<=2; i++) { + + for (y=0; y>3)*QP_stride]); + deblock_horiz(puc_flt, horizontal_size, dst_stride, QP_ptr, QP_stride, 1); + } + + if (mode & PP_DEBLOCK_C_V) { + if ( (y%8) && (y-4)>5 ) { + puc_flt = &((dst[i])[(y-4)*dst_stride]); + QP_ptr = &(QP_store[(y>>4)*QP_stride]); + deblock_vert( puc_flt, horizontal_size, dst_stride, QP_ptr, QP_stride, 1); + } + } + + // if (mode & PP_DERING_Y) { + // dering( puc_flt, horizontal_size, dst_stride, QP_ptr, QP_stride, 1); + // } + + } /* stripe loop */ + + } /* U,V loop */ + + do_emms(); + + + } + diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/postprocess.h bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/postprocess.h *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/postprocess.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/postprocess.h Fri Jan 19 15:34:14 2001 *************** *** 0 **** --- 1,116 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + // postprocess.h // + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + /* + + Currently this contains only the deblocking filter. The vertial + deblocking filter operates over eight pixel-wide columns at once. The + horizontal deblocking filter works on four horizontals row at a time. + + Picture height must be multiple of 8, width a multiple of 16 + + */ + + + #ifndef POSTPROCESS_H + #define POSTPROCESS_H + + + + /* we're not using for now, even on Linux */ + #define int8_t char + #define uint8_t unsigned char + #define int16_t short + #define uint16_t unsigned short + #define int32_t int + #define uint32_t unsigned int + #ifdef WIN32 + #define int64_t __int64 + #define uint64_t unsigned __int64 + #else + #define int64_t long long + #define uint64_t unsigned long long + #endif + + + /**** Compile-time options ****/ + + /* the following parameters allow for some tuning of the postprocessor */ + #define DEBLOCK_HORIZ_USEDC_THR (28 - 12) + #define DEBLOCK_VERT_USEDC_THR (56 - 24) + + + + + /* Type to use for QP. This may depend on the decoder's QP store implementation */ + #define QP_STORE_T int + + + + /**** Function prototype - entry point for postprocessing ****/ + void postprocess(unsigned char * src[], int src_stride, + unsigned char * dst[], int dst_stride, + int horizontal_size, int vertical_size, + QP_STORE_T *QP_store, int QP_stride, + int mode); + + + //#define SHOWDECISIONS_V + //#define SHOWDECISIONS_H + + + + + /**** mode flags to control postprocessing actions ****/ + #define PP_DEBLOCK_Y_H 0x00000001 /* Luma horizontal deblocking */ + #define PP_DEBLOCK_Y_V 0x00000002 /* Luma vertical deblocking */ + #define PP_DEBLOCK_C_H 0x00000004 /* Chroma horizontal deblocking */ + #define PP_DEBLOCK_C_V 0x00000008 /* Chroma vertical deblocking */ + #define PP_DERING_Y 0x00000010 /* Luma deringing */ + #define PP_DERING_C 0x00000020 /* Chroma deringing */ + #define PP_DONT_COPY 0x10000000 /* Postprocessor will not copy src -> dst */ + /* instead, it will operate on dst only */ + + + + + + #endif diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/postprocess/postprocess_mmx.h bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/postprocess_mmx.h *** bcast-2000c/quicktime/decore50/intel_mmx/postprocess/postprocess_mmx.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/postprocess/postprocess_mmx.h Sat Feb 17 09:39:44 2001 *************** *** 0 **** --- 1,136 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + * + **/ + // postprocess_mmx.h // + + /*** + + References: + * ISO/IEC 14496-2 + * MoMuSys-FDIS-V1.0-990812 + * Intel Architecture Software Developer's Manual + Volume 2: Instruction Set Reference + + ***/ + + /* Header to be included in all component MMX files */ + + #ifndef _POSTPROCESS_MMX_H_ + #define _POSTPROCESS_MMX_H_ + + + /* include the public API header file */ + #include "postprocess.h" + + + + + /*********************** self checking ***********************/ + + /* PP_SELF_CHECK enables exhaustive self-checking of all MMX routines */ + /* self checking is broken in the "wine cl.exe" environment as printf() crashes */ + //#define PP_SELF_CHECK + + /* we only ever printf() if self-checking is turned on at compile time */ + #ifdef PP_SELF_CHECK + #include + #endif + + + + + + /******************** inlining functions ***********************/ + + /* + If we want the component functions of the filter to be inlined into + the main filter loops, then we need to arrange for their source files + to be #include'd and for them to be identified as static inline + */ + #ifdef PP_COMPONENTS_INLINE + #ifdef WIN32 + #define INLINE __inline + #else + #define INLINE inline + #endif + #else + #define INLINE + #endif + + + + + + /******************* Experimental prefetch *****************/ + /* it would seem my version of Microsoft's tools do not recognise prefetch + instructions so this isn't working! (It worked for gcc) */ + //#define PREFETCH_ENABLE + + /* the optimum values (8 and 8) for these two were discovered by experimentation */ + //#define PREFETCH_AHEAD_H 8 + //#define PREFETCH_AHEAD_V 8 + + + + + + + /******************* general, useful macros ****************/ + #define ABS(a) ( (a)>0 ? (a) : -(a) ) + #define SIGN(a) ( (a)<0 ? -1 : 1 ) + #define MIN(a, b) ( (a)<(b) ? (a) : (b) ) + #define MAX(a, b) ( (a)>(b) ? (a) : (b) ) + + + + + + + /******************** component function prototypes **************/ + int deblock_horiz_useDC(uint8_t *v, int stride); + int deblock_horiz_DC_on(uint8_t *v, int stride, int QP); + void deblock_horiz_lpf9(uint8_t *v, int stride, int QP); + void deblock_horiz_default_filter(uint8_t *v, int stride, int QP); + void deblock_horiz(uint8_t *image, int width, int stride, QP_STORE_T *QP_store, int QP_stride, int chromaFlag); + int deblock_vert_useDC(uint8_t *v, int stride); + int deblock_vert_DC_on(uint8_t *v, int stride, int QP); + void deblock_vert_copy_and_unpack(int stride, uint8_t *source, uint64_t *dest, int n); + void deblock_vert_choose_p1p2(uint8_t *v, int stride, uint64_t *p1p2, int QP); + void deblock_vert_lpf9(uint64_t *v_local, uint64_t *p1p2, uint8_t *v, int stride); + void deblock_vert_default_filter(uint8_t *v, int stride, int QP); + void deblock_vert( uint8_t *image, int width, int stride, QP_STORE_T *QP_store, int QP_stride, int chromaFlag); + void fast_copy(unsigned char *src, int src_stride, + unsigned char *dst, int dst_stride, + int horizontal_size, int vertical_size); + void do_emms(); + + + + + #endif diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/transferIDCT_mmx.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/transferIDCT_mmx.c *** bcast-2000c/quicktime/decore50/intel_mmx/transferIDCT_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/transferIDCT_mmx.c Thu Mar 1 07:32:58 2001 *************** *** 0 **** --- 1,277 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + **/ + // transferIDCT_mmx.c // + + /* routines to transfer iDCT block result into the output picture */ + + /* this routine still needs to be optimised for pipelining */ + /* just haven't got time to finish the optimisations here ;-) */ + + /* inline masm is used here so not compatible with gnu */ + + + + //#define _TEST_TRANSFER + + #ifdef _TEST_TRANSFER + #include + #endif + + + #include "portab.h" + + void transferIDCT_add(int16_t *sourceS16, uint8_t *destU8, int stride) { + #ifdef _TEST_TRANSFER + uint8_t reference_dest[64]; + int x, y, sum16; + + /* populate reference_dest[] with the correct result... */ + for (y=0; y<8; y++) { + for (x=0; x<8; x++) { + sum16 = (destU8[stride*y + x] + sourceS16[8*y + x]); + if (sum16 > 255) reference_dest[8*y + x] = 255; + else if (sum16 < 0) reference_dest[8*y + x] = 0; + else reference_dest[8*y + x] = (uint8_t)sum16; + } + } + #endif + + _asm { + + ; not sure about the state handling here - there must be a better way + push eax + push ebx + push edi + + mov eax, sourceS16 ; parameter 1, *sourceS16 + mov ebx, destU8 ; parameter 2, *destU8 + mov edi, stride ; parameter 3, stride + pxor mm7, mm7 ; set mm7 = 0 + + ; lines 0 to 7 all scheduled in together + movq mm0, qword ptr [ebx] ; eight bytes of destination into mm4 + movq mm1, mm0 ; eight bytes of destination into mm0 + punpcklbw mm0, mm7 ; unpack first 4 bytes from dest into mm4 + punpckhbw mm1, mm7 ; unpack next 4 bytes from dest into mm5 + paddsw mm0, qword ptr [eax] ; add source and destination + paddsw mm1, qword ptr [eax+8]; add source and destination + packuswb mm0, mm1 ; pack mm0 and mm1 into mm0 + movq qword ptr [ebx], mm0 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq mm2, qword ptr [ebx] ; eight bytes of destination into mm4 + movq mm3, mm2 ; eight bytes of destination into mm3 + punpcklbw mm2, mm7 ; unpack first 4 bytes from dest into mm4 + punpckhbw mm3, mm7 ; unpack next 4 bytes from dest into mm5 + paddsw mm2, qword ptr [eax+16] ; add source and destination + paddsw mm3, qword ptr [eax+24]; add source and destination + packuswb mm2, mm3 ; pack mm0 and mm1 into mm0 + movq qword ptr [ebx], mm2 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq mm4, qword ptr [ebx] ; eight bytes of destination into mm4 + movq mm5, mm4 ; eight bytes of destination into mm5 + punpcklbw mm4, mm7 ; unpack first 4 bytes from dest into mm4 + punpckhbw mm5, mm7 ; unpack next 4 bytes from dest into mm5 + paddsw mm4, qword ptr [eax+32] ; add source and destination + paddsw mm5, qword ptr [eax+40]; add source and destination + packuswb mm4, mm5 ; pack mm0 and mm1 into mm0 + movq qword ptr [ebx], mm4 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq mm0, qword ptr [ebx] ; eight bytes of destination into mm4 + movq mm1, qword ptr [ebx] ; eight bytes of destination into mm5 + punpcklbw mm0, mm7 ; unpack first 4 bytes from dest into mm4 + punpckhbw mm1, mm7 ; unpack next 4 bytes from dest into mm5 + paddsw mm0, qword ptr [eax+48] ; add source and destination + paddsw mm1, qword ptr [eax+56]; add source and destination + packuswb mm0, mm1 ; pack mm0 and mm1 into mm0 + add eax, 64 ; add +64 to source ptr + movq qword ptr [ebx], mm0 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq mm2, qword ptr [ebx] ; eight bytes of destination into mm4 + movq mm3, mm2 ; eight bytes of destination into mm3 + punpcklbw mm2, mm7 ; unpack first 4 bytes from dest into mm4 + punpckhbw mm3, mm7 ; unpack next 4 bytes from dest into mm5 + paddsw mm2, qword ptr [eax] ; add source and destination + paddsw mm3, qword ptr [eax+8]; add source and destination + packuswb mm2, mm3 ; pack mm0 and mm1 into mm0 + add eax, 16 ; add +16 to source ptr + movq qword ptr [ebx], mm2 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq mm4, qword ptr [ebx] ; eight bytes of destination into mm4 + movq mm5, mm4 ; eight bytes of destination into mm5 + punpcklbw mm4, mm7 ; unpack first 4 bytes from dest into mm4 + punpckhbw mm5, mm7 ; unpack next 4 bytes from dest into mm5 + paddsw mm4, qword ptr [eax] ; add source and destination + paddsw mm5, qword ptr [eax+8]; add source and destination + packuswb mm4, mm5 ; pack mm0 and mm1 into mm0 + add eax, 16 ; add +16 to source ptr + movq qword ptr [ebx], mm4 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq mm0, qword ptr [ebx] ; eight bytes of destination into mm4 + movq mm1, mm0 ; eight bytes of destination into mm1 + punpcklbw mm0, mm7 ; unpack first 4 bytes from dest into mm4 + punpckhbw mm1, mm7 ; unpack next 4 bytes from dest into mm5 + paddsw mm0, qword ptr [eax] ; add source and destination + paddsw mm1, qword ptr [eax+8]; add source and destination + packuswb mm0, mm1 ; pack mm0 and mm1 into mm0 + add eax, 16 ; add +16 to source ptr + movq qword ptr [ebx], mm0 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq mm2, qword ptr [ebx] ; eight bytes of destination into mm4 + movq mm3, mm2 ; eight bytes of destination into mm3 + punpcklbw mm2, mm7 ; unpack first 4 bytes from dest into mm4 + punpckhbw mm3, mm7 ; unpack next 4 bytes from dest into mm5 + paddsw mm2, qword ptr [eax] ; add source and destination + paddsw mm3, qword ptr [eax+8]; add source and destination + packuswb mm2, mm3 ; pack mm0 and mm1 into mm0 + movq qword ptr [ebx], mm2 ; copy output to destination + + pop edi + pop ebx + pop eax + + emms + + + } + + #ifdef _TEST_TRANSFER + /* check destination against reference_dest[]... */ + for (y=0; y<8; y++) { + for (x=0; x<8; x++) { + if (reference_dest[8*y + x] != destU8[stride*y + x]) printf("transferIDCT_add() is broken\n"); + } + } + #endif + + } + + void transferIDCT_copy(int16_t *sourceS16, uint8_t *destU8, int stride) { + #ifdef _TEST_TRANSFER + int x, y, clipped; + #endif + + _asm { + + ; not sure about the state handling here - there must be a better way + push eax + push ebx + push edi + + mov eax, sourceS16 ; parameter 1, *sourceS16 + mov ebx, destU8 ; parameter 2, *destU8 + mov edi, stride ; parameter 3, stride + + ; lines 0 to 7 schedueled into each other... + movq mm0, qword ptr [eax] ; move first four words into mm0 + + packuswb mm0, qword ptr [eax+8] ; pack mm0 and the next four words into mm0 + + movq mm1, qword ptr [eax+16] ; move first four words into mm1 + + packuswb mm1, qword ptr [eax+24]; pack mm0 and the next four words into mm1 + + movq mm2, qword ptr [eax+32] ; move first four words into mm2 + + packuswb mm2, qword ptr [eax+40]; pack mm0 and the next four words into mm2 + + movq mm3, qword ptr [eax+48] ; move first four words into mm3 + + packuswb mm3, qword ptr [eax+56] ; pack mm3 and the next four words into mm3 + + movq qword ptr [ebx], mm0 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq qword ptr [ebx], mm1 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq qword ptr [ebx], mm2 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq qword ptr [ebx], mm3 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq mm0, qword ptr [eax+64] ; move first four words into mm0 + add eax, 64 ; add 64 to source ptr + + packuswb mm0, qword ptr [eax+8] ; pack mm0 and the next four words into mm0 + + movq mm1, qword ptr [eax+16] ; move first four words into mm1 + + packuswb mm1, qword ptr [eax+24]; pack mm0 and the next four words into mm1 + + movq mm2, qword ptr [eax+32] ; move first four words into mm2 + + packuswb mm2, qword ptr [eax+40]; pack mm0 and the next four words into mm2 + + movq mm3, qword ptr [eax+48] ; move first four words into mm3 + + packuswb mm3, qword ptr [eax+56]; pack mm3 and the next four words into mm3 + + movq qword ptr [ebx], mm0 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq qword ptr [ebx], mm1 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq qword ptr [ebx], mm2 ; copy output to destination + add ebx, edi ; add +stride to dest ptr + + movq qword ptr [ebx], mm3 ; copy output to destination + + pop edi + pop ebx + pop eax + + emms + + } + + #ifdef _TEST_TRANSFER + for (y=0; y<8; y++) { + for (x=0; x<8; x++) { + clipped = sourceS16[8*y + x]; + if (clipped > 255) clipped = 255; + if (clipped < 0) clipped = 0; + if (clipped != destU8[stride*y+x]) printf("transferIDCT_copy() is broken\n"); + } + } + #endif + + } + + + + diff -C2 -r -N bcast-2000c/quicktime/decore50/intel_mmx/yuv2rgb_mmx.c bcast-2000c-mf3/quicktime/decore50/intel_mmx/yuv2rgb_mmx.c *** bcast-2000c/quicktime/decore50/intel_mmx/yuv2rgb_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/intel_mmx/yuv2rgb_mmx.c Tue Apr 24 05:27:14 2001 *************** *** 0 **** --- 1,1020 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * Andrea Graziani + * + * DivX Advanced Research Center + * + **/ + // yuv2rgb_mmx.c // + + /* + MMX version of colourspace conversion + + 13 Feb 2001 - John Funnell, added -height feature to invert output, fixed 24-bit overwrite + + TODO: + 1. Extract common part of from 32, 24 and 16 bit conversions into inline func + to avoid duplication of the core MMX code. + 2. Experiment with using prefetch instructions to improve performance + + + Using matrix of SMPTE 170M + + This is what we're doing: + + Step 1. + Y -= 16 + U -= 128 + V -= 128 + + Step 2. + Y /= 219 + U /= 224 + V /= 224 + + Step 3. + now we want the inverse of this matrix: + / 0.299 0.114 0.587 \ + | -0.169 0.500 -0.331 | + \ 0.500 -0.081 -0.419 / + + which is, approximately: + / 2568 0 3343 \ + | 2568 f36e e5e2 | / 65536 * 8 + \ 2568 40cf 0 / + including the multiplies in Step 2 + + */ + + + #include // for memset() & memcpy() + + + #include "portab.h" + #include "yuv2rgb.h" + + /** + * + **/ + + #define MAXIMUM_Y_WIDTH 800 + + + #define _USE_PREFETCH + + + + /* static constants */ + + /* colourspace conversion matrix values */ + static uint64_t mmw_mult_Y = 0x2568256825682568; + static uint64_t mmw_mult_U_G = 0xf36ef36ef36ef36e; + static uint64_t mmw_mult_U_B = 0x40cf40cf40cf40cf; + static uint64_t mmw_mult_V_R = 0x3343334333433343; + static uint64_t mmw_mult_V_G = 0xe5e2e5e2e5e2e5e2; + + + /* various masks and other constants */ + static uint64_t mmb_0x10 = 0x1010101010101010; + static uint64_t mmw_0x0080 = 0x0080008000800080; + static uint64_t mmw_0x00ff = 0x00ff00ff00ff00ff; + + static uint64_t mmw_cut_red = 0x7c007c007c007c00; + static uint64_t mmw_cut_green = 0x03e003e003e003e0; + static uint64_t mmw_cut_blue = 0x001f001f001f001f; + + + + /**** YUV -> RGB conversion, 32-bit output ****/ + /* if height_y is negative then the output image will be inverted */ + /* + note: _stride_out parameter is ignored in yuv to rgb conversion + it's assumed that stride_out = 4 * width_y for the 32 bit color bitmap + */ + void yuv2rgb_32(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) { + + int y, horiz_count; + int stride_out = width_y * 4; + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + horiz_count = -(width_y >> 3); + + for (y=0; y RGB conversion, 24-bit output ****/ + void yuv2rgb_24(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) { + + int y, horiz_count; + uint8_t *puc_out_remembered; + int stride_out = width_y * 3; + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + horiz_count = -(width_y >> 3); + + for (y=0; y RGB conversion, 16-bit output (two flavours) ****/ + + /* 5 Jan 2001 - Andrea Graziani */ + + static uint64_t mask_5 = 0xf8f8f8f8f8f8f8f8; + static uint64_t mask_6 = 0xfcfcfcfcfcfcfcfc; + + static uint64_t mask_blue = 0x1f1f1f1f1f1f1f1f; + + + /* all stride values are in _bytes_ */ + void yuv2rgb_555(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) { + + + int y, horiz_count; + int stride_out = width_y * 2; + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + horiz_count = -(width_y >> 3); + + for (y=0; y255 ? 255 : (a)<0 ? 0 : (a) + + #define _R(y,u,v) (0x2568*(y) + 0x3343*(u)) /0x2000 + #define _G(y,u,v) (0x2568*(y) - 0x0c92*(v) - 0x1a1e*(u)) /0x2000 + #define _B(y,u,v) (0x2568*(y) + 0x40cf*(v)) /0x2000 + + #define _mR 0x7c00 + #define _mG 0x03e0 + #define _mB 0x001f + + #define _Ps565(r,g,b) ( ((r & 0xF8) >> 3) | (((g & 0xF8) << 3)) | (((b & 0xF8) << 8)) ) + + + void yuv2rgb_565(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) + { + + int y, horiz_count; + unsigned short * pus_out; + int stride_out = width_y * 2; + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + pus_out = (unsigned short *) puc_out; + + horiz_count = -(width_y >> 3); + + for (y=0; y>1] - 128; + v = puc_v[x>>1] - 128; + + _r = _R(y,u,v); + _g = _G(y,u,v); + _b = _B(y,u,v); + + r = _S(_r); + g = _S(_g); + b = _S(_b); + + pus_out[0] = (unsigned short) _Ps565(r,g,b); + + pus_out++; + } + ***/ + + _asm { + push eax + push ebx + push ecx + push edx + push edi + + mov eax, puc_out + mov ebx, puc_y + mov ecx, puc_u + mov edx, puc_v + mov edi, horiz_count + + horiz_loop: + + // load data + movd mm2, [ecx] ; mm2 = ________u3u2u1u0 + movd mm3, [edx] ; mm3 = ________v3v2v1v0 + movq mm0, [ebx] ; mm0 = y7y6y5y4y3y2y1y0 + + pxor mm7, mm7 ; zero mm7 + + // convert chroma part + punpcklbw mm2, mm7 ; mm2 = __u3__u2__u1__u0 + punpcklbw mm3, mm7 ; mm3 = __v3__v2__v1__v0 + psubw mm2, mmw_0x0080 ; mm2 -= 128 + psubw mm3, mmw_0x0080 ; mm3 -= 128 + psllw mm2, 3 ; mm2 *= 8 + psllw mm3, 3 ; mm3 *= 8 + movq mm4, mm2 ; mm4 = mm2 = u + movq mm5, mm3 ; mm5 = mm3 = v + pmulhw mm2, mmw_mult_U_G ; mm2 *= u green coeff + pmulhw mm3, mmw_mult_V_G ; mm3 *= v green coeff + pmulhw mm4, mmw_mult_U_B ; mm4 = blue chroma + pmulhw mm5, mmw_mult_V_R ; mm5 = red chroma + paddsw mm2, mm3 ; mm2 = green chroma + + // convert luma part + psubusb mm0, mmb_0x10 ; mm0 -= 16 + movq mm1, mmw_0x00ff ; mm1 = 00ff00ff00ff00ff + psrlw mm0, 8 ; mm0 = __y7__y5__y3__y1 luma odd + pand mm1, mm0 ; mm1 = __y6__y4__y2__y0 luma even + psllw mm0, 3 ; mm0 *= 8 + psllw mm1, 3 ; mm1 *= 8 + pmulhw mm0, mmw_mult_Y ; mm0 luma odd *= luma coeff + pmulhw mm1, mmw_mult_Y ; mm1 luma even *= luma coeff + + // complete the matrix calc with the addictions + movq mm3, mm4 ; copy blue chroma + movq mm6, mm5 ; copy red chroma + movq mm7, mm2 ; copy green chroma + paddsw mm3, mm0 ; mm3 = luma odd + blue chroma + paddsw mm4, mm1 ; mm4 = luma even + blue chroma + paddsw mm6, mm0 ; mm6 = luma odd + red chroma + paddsw mm5, mm1 ; mm5 = luma even + red chroma + paddsw mm7, mm0 ; mm7 = luma odd + green chroma + paddsw mm2, mm1 ; mm2 = luma even + green chroma + // clipping + packuswb mm3, mm3 + packuswb mm4, mm4 + packuswb mm6, mm6 + packuswb mm5, mm5 + packuswb mm7, mm7 + packuswb mm2, mm2 + // interleave odd and even parts + punpcklbw mm4, mm3 ; mm4 = b7b6b5b4b3b2b1b0 blue + punpcklbw mm5, mm6 ; mm5 = r7r6r5r4r3r2r1r0 red + punpcklbw mm2, mm7 ; mm2 = g7g6g5g4g3g2g1g0 green + + // mask not needed bits (using 555) + pand mm4, mask_5 + pand mm5, mask_5 + pand mm2, mask_5 + + // mix colors and write + + psrlw mm4, 3 ; mm4 = red shifted + pand mm4, mask_blue ; mask the blue again + pxor mm7, mm7 ; zero mm7 + movq mm1, mm5 ; mm1 = copy blue + movq mm3, mm4 ; mm3 = copy red + movq mm6, mm2 ; mm6 = copy green + + punpckhbw mm1, mm7 + punpckhbw mm3, mm7 + punpckhbw mm6, mm7 + psllw mm6, 3 ; shift green + psllw mm1, 8 ; shift blue + por mm6, mm3 + por mm6, mm1 + movq 8[eax], mm6 + + punpcklbw mm2, mm7 ; mm2 = __g3__g2__g1__g0 already masked + punpcklbw mm4, mm7 + punpcklbw mm5, mm7 + psllw mm2, 3 ; shift green + psllw mm5, 8 ; shift blue + por mm2, mm4 + por mm2, mm5 + movq [eax], mm2 + + add ebx, 8 ; puc_y += 8; + add ecx, 4 ; puc_u += 4; + add edx, 4 ; puc_v += 4; + add eax, 16 ; puc_out += 16 // wrote 16 bytes + + inc edi + jne horiz_loop + + pop edi + pop edx + pop ecx + pop ebx + pop eax + + emms + + } + /***/ + + puc_y += stride_y; + if (y%2) { + puc_u += stride_uv; + puc_v += stride_uv; + } + puc_out += stride_out; + } + } + + /***/ + + + + + + + + + /**** YUV -> YUV conversions (more-or-less straight copy) - still in development ****/ + + void yuy2_out(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int stride_out) + { + int y; + uint8_t* puc_out2; + unsigned int stride_diff = 4 * stride_out - 2 * width_y; // expressed in bytes + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + puc_out2 = puc_out + 2 * stride_out; + for (y=height_y/2; y; y--) { + register uint8_t *py, *py2, *pu, *pv; + register int x; + uint32_t tmp; + + py = puc_y; + py2 = puc_y + stride_y; + pu = puc_u; + pv = puc_v; + for (x=width_y/2; x; x--) { + tmp = *(py++); + tmp |= *(pu++) << 8; + tmp |= *(py++) << 16; + tmp |= *(pv++) << 24; + *(uint32_t*)puc_out=tmp; + puc_out += 4; + + tmp &= 0xFF00FF00; + tmp |= *(py2++); + tmp |= *(py2++) << 16; + *(uint32_t*)puc_out2=tmp; + puc_out2 += 4; + } + + puc_y += 2*stride_y; + puc_u += stride_uv; + puc_v += stride_uv; + + puc_out += stride_diff; + puc_out2 += stride_diff; + } + + } + + /*** YUV 4:2:0 -> UYVY ***/ + + void uyvy_out(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int stride_out) + { + int y; + uint8_t* puc_out2; + unsigned int stride_diff = 4 * stride_out - 2 * width_y; // expressed in bytes + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + puc_out2 = puc_out + 2 * stride_out; + for (y=height_y/2; y; y--) { + register uint8_t *py, *py2, *pu, *pv; + register int x; + uint32_t tmp; + + py = puc_y; + py2 = puc_y + stride_y; + pu = puc_u; + pv = puc_v; + for (x=width_y/2; x; x--) { + tmp = *(pu++); + tmp |= *(py++) << 8; + tmp |= *(pv++) << 16; + tmp |= *(py++) << 24; + *(uint32_t*)puc_out=tmp; + puc_out += 4; + + tmp &= 0x00FF00FF; + tmp |= *(py2++) << 8; + tmp |= *(py2++) << 24; + *(uint32_t*)puc_out2=tmp; + puc_out2 += 4; + } + + puc_y += 2*stride_y; + puc_u += stride_uv; + puc_v += stride_uv; + + puc_out += stride_diff; + puc_out2 += stride_diff; + } + + } + + + /*** YUV edged -> YUV conversion (just remove the edges for YV12) ***/ + + void yuv12_out(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int stride_out) + { + int i; + + unsigned char * pauc_out[3]; + + if (height_y < 0) { + // we are flipping our output upside-down + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + pauc_out[0] = puc_out; + pauc_out[1] = puc_out + stride_out * height_y; + pauc_out[2] = puc_out + stride_out * height_y * 5 / 4; + + for (i=0; i + * + **/ + /// mp4_block.c // + + #include + #include + #include + + #include "mp4_vars.h" + + #include "getbits.h" + #include "clearblock.h" + #include "mp4_iquant.h" + #include "mp4_predict.h" + #include "mp4_vld.h" + #include "debug.h" + #include "mp4_block.h" + + /** + * + **/ + + static int getDCdiff(); + static void setDCscaler(int block_num); + + static int getACdir(); + + /***/ + + static int getDCsizeLum() + { + int code; + + // [Ag][note] bad code + + if (showbits(11) == 1) { + flushbits(11); + return 12; + } + if (showbits(10) == 1) { + flushbits(10); + return 11; + } + if (showbits(9) == 1) { + flushbits(9); + return 10; + } + if (showbits(8) == 1) { + flushbits(8); + return 9; + } + if (showbits(7) == 1) { + flushbits(7); + return 8; + } + if (showbits(6) == 1) { + flushbits(6); + return 7; + } + if (showbits(5) == 1) { + flushbits(5); + return 6; + } + if (showbits(4) == 1) { + flushbits(4); + return 5; + } + + code = showbits(3); + + //printf("getDCsizeLum 1 %x %02x\n", code, showbits(16)); + if (code == 1) { + flushbits(3); + return 4; + } else if (code == 2) { + flushbits(3); + return 3; + } else if (code == 3) { + flushbits(3); + //printf("getDCsizeLum 2 %x %02x\n", code, showbits(16)); + return 0; + } + + code = showbits(2); + + if (code == 2) { + flushbits(2); + return 2; + } else if (code == 3) { + flushbits(2); + return 1; + } + //printf("getDCsizeLum 2 %02x\n", showbits(16)); + + return 0; + } + + static int getDCsizeChr() + { + // [Ag][note] bad code + + if (showbits(12) == 1) { + flushbits(12); + return 12; + } + if (showbits(11) == 1) { + flushbits(11); + return 11; + } + if (showbits(10) == 1) { + flushbits(10); + return 10; + } + if (showbits(9) == 1) { + flushbits(9); + return 9; + } + if (showbits(8) == 1) { + flushbits(8); + return 8; + } + if (showbits(7) == 1) { + flushbits(7); + return 7; + } + if (showbits(6) == 1) { + flushbits(6); + return 6; + } + if (showbits(5) == 1) { + flushbits(5); + return 5; + } + if (showbits(4) == 1) { + flushbits(4); + return 4; + } + if (showbits(3) == 1) { + flushbits(3); + return 3; + } + + return (3 - getbits(2)); + } + + // Purpose: texture decoding of block_num + int block(int block_num, int coded) + { + int i; + int dct_dc_size, dct_dc_diff; + int intraFlag = ((mp4_state->hdr.derived_mb_type == INTRA) || + (mp4_state->hdr.derived_mb_type == INTRA_Q)) ? 1 : 0; + event_t event; + + clearblock(ld->block); // clearblock + + if (intraFlag) + { + setDCscaler(block_num); // calculate DC scaler + + if (block_num < 4) { + dct_dc_size = getDCsizeLum(); + if (dct_dc_size != 0) + dct_dc_diff = getDCdiff(dct_dc_size); + else + dct_dc_diff = 0; + if (dct_dc_size > 8) + getbits1(); // marker bit + } + else { + dct_dc_size = getDCsizeChr(); + if (dct_dc_size != 0) + dct_dc_diff = getDCdiff(dct_dc_size); + else + dct_dc_diff = 0; + if (dct_dc_size > 8) + getbits1(); // marker bit + } + + ld->block[0] = (short) dct_dc_diff; + } + if (intraFlag) + { + // dc reconstruction, prediction direction + dc_recon(block_num, &ld->block[0]); + } + + if (coded) + { + unsigned int * zigzag; // zigzag scan dir + + if ((intraFlag) && (mp4_state->hdr.ac_pred_flag == 1)) { + + if (mp4_state->coeff_pred.predict_dir == TOP) + zigzag = mp4_tables->alternate_horizontal_scan; + else + zigzag = mp4_tables->alternate_vertical_scan; + } + else { + zigzag = mp4_tables->zig_zag_scan; + } + + i = intraFlag ? 1 : 0; + + + + do // event vld + { + event = vld_event(intraFlag); + /*** + if (event.run == -1) + { + printf("Error: invalid vld code\n"); + exit(201); + } + ***/ + i+= event.run; + ld->block[zigzag[i]] = (short) event.level; + + // _Print("Vld Event: Run Level Last %d %d %d\n", event.run, event.level, event.last); + + i++; + } while (! event.last); + } + + if (intraFlag) + { + // ac reconstruction + // ac_rescaling(...) + ac_recon(block_num, &ld->block[0]); + } + + #ifdef _DEBUG_B_ACDC + if (intraFlag) + { + int i; + _Print("After AcDcRecon:\n"); + _Print(" x "); + for (i = 1; i < 64; i++) { + if ((i != 0) && ((i % 8) == 0)) + _Print("\n"); + _Print("%4d ", ld->block[i]); + } + _Print("\n"); + } + #endif // _DEBUG_ACDC + + if (mp4_state->hdr.quant_type == 0) + { + // inverse quantization + iquant(ld->block, intraFlag); + } + else + { + _Error("Error: MPEG-2 inverse quantization NOT implemented\n"); + exit(110); + } + + #ifdef _DEBUG_B_QUANT + { + int i; + _Print("After IQuant:\n"); + _Print(" x "); + for (i = 1; i < 64; i++) { + if ((i != 0) && ((i % 8) == 0)) + _Print("\n"); + _Print("%4d ", ld->block[i]); + } + _Print("\n"); + } + #endif // _DEBUG_B_QUANT + + // inverse dct + idct(ld->block); + + return 1; + } + + /***/ + + int blockIntra(int block_num, int coded) + { + int i; + int dct_dc_size, dct_dc_diff; + event_t event; + + //printf("blockIntra 1\n"); + clearblock(ld->block); // clearblock + //printf("blockIntra 1\n"); + + + + + + + + // dc coeff + setDCscaler(block_num); // calculate DC scaler + + + + + + + if (block_num < 4) { + //printf("blockIntra 1 %02x\n", showbits(16)); + dct_dc_size = getDCsizeLum(); + //printf("blockIntra 2 %02x\n", showbits(16)); + if (dct_dc_size != 0) + dct_dc_diff = getDCdiff(dct_dc_size); + else + dct_dc_diff = 0; + if (dct_dc_size > 8) + getbits1(); // marker bit + } + else + { + dct_dc_size = getDCsizeChr(); + if (dct_dc_size != 0) + dct_dc_diff = getDCdiff(dct_dc_size); + else + dct_dc_diff = 0; + if (dct_dc_size > 8) + getbits1(); // marker bit + } + + + + + + + //printf("blockIntra 1\n"); + + ld->block[0] = (short) dct_dc_diff; + //printf("blockIntra 1\n"); + + // dc reconstruction, prediction direction + dc_recon(block_num, &ld->block[0]); + //printf("blockIntra 1\n"); + + if (coded) + { + unsigned int * zigzag; // zigzag scan dir + + if (mp4_state->hdr.ac_pred_flag == 1) { + + if (mp4_state->coeff_pred.predict_dir == TOP) + zigzag = mp4_tables->alternate_horizontal_scan; + else + zigzag = mp4_tables->alternate_vertical_scan; + } + else { + zigzag = mp4_tables->zig_zag_scan; + } + + i = 1; + //printf("blockIntra 1 %02x\n", showbits(12)); + do // event vld + { + event = vld_intra_dct(); + /*** + if (event.run == -1) + { + printf("Error: invalid vld code\n"); + exit(201); + } + ***/ + i+= event.run; + ld->block[zigzag[i]] = (short) event.level; + + // _Print("Vld Event: Run Level Last %d %d %d\n", event.run, event.level, event.last); + + i++; + } while (! event.last); + } + //printf("blockIntra 1\n"); + + // ac reconstruction + mp4_state->hdr.intrablock_rescaled = ac_rescaling(block_num, &ld->block[0]); + + + + + + if (! mp4_state->hdr.intrablock_rescaled) + { + ac_recon(block_num, &ld->block[0]); + } + //printf("blockIntra 1\n"); + ac_store(block_num, &ld->block[0]); + //printf("blockIntra 1\n"); + + if (mp4_state->hdr.quant_type == 0) + { + iquant(ld->block, 1); + } + else + { + iquant_typefirst(ld->block); + } + //printf("blockIntra 1\n"); + + // inverse dct + idct(ld->block); + //printf("blockIntra 2\n"); + + return 1; + } + + /***/ + + int blockInter(int block_num, int coded) + { + event_t event; + unsigned int * zigzag = mp4_tables->zig_zag_scan; // zigzag scan dir + int i; + + clearblock(ld->block); // clearblock + + // inverse quant type + if (mp4_state->hdr.quant_type == 0) + { + int q_scale = mp4_state->hdr.quantizer; + int q_2scale = q_scale << 1; + int q_add = (q_scale & 1) ? q_scale : (q_scale - 1); + + i = 0; + do // event vld + { + event = vld_inter_dct(); + + /*** + if (event.run == -1) + { + printf("Error: invalid vld code\n"); + exit(201); + } + ***/ + i+= event.run; + if (event.level > 0) { + ld->block[zigzag[i]] = (q_2scale * event.level) + q_add; + } + else { + ld->block[zigzag[i]] = (q_2scale * event.level) - q_add; + } + + // _Print("Vld Event: Run Level Last %d %d %d\n", event.run, event.level, event.last); + + i++; + } while (! event.last); + } + else + { + int k, m = 0; + i = 0; + + // event vld + do + { + event = vld_inter_dct(); + + i+= event.run; + + k = (event.level > 0) ? 1 : -1; + + assert(ld->block[zigzag[i]] < 2047); + assert(ld->block[zigzag[i]] > -2048); + + ld->block[zigzag[i]] = ((2 * event.level + k) * mp4_state->hdr.quantizer * + mp4_tables->nonintra_quant_matrix[zigzag[i]]) >> 4; + + assert(ld->block[zigzag[i]] < 2047); + assert(ld->block[zigzag[i]] > -2048); + + m ^= ld->block[zigzag[i]]; + + // _Print("Vld Event: Run Level Last %d %d %d\n", event.run, event.level, event.last); + + i++; + } while (! event.last); + + if (!(m%2)) ld->block[63] ^= 1; + } + + // inverse dct + idct(ld->block); + + return 1; + } + + /***/ + + /***/ + + static int getDCdiff(int dct_dc_size) + { + int code = getbits(dct_dc_size); + int msb = code >> (dct_dc_size - 1); + + if (msb == 0) { + return (-1 * (code^((int) pow(2.0,(double) dct_dc_size) - 1))); + } + else { + return code; + } + } + + /***/ + + static void setDCscaler(int block_num) + { + int type = (block_num < 4) ? 0 : 1; + int quant = mp4_state->hdr.quantizer; + + if (type == 0) { + if (quant > 0 && quant < 5) + mp4_state->hdr.dc_scaler = 8; + else if (quant > 4 && quant < 9) + mp4_state->hdr.dc_scaler = (2 * quant); + else if (quant > 8 && quant < 25) + mp4_state->hdr.dc_scaler = (quant + 8); + else + mp4_state->hdr.dc_scaler = (2 * quant - 16); + } + else { + if (quant > 0 && quant < 5) + mp4_state->hdr.dc_scaler = 8; + else if (quant > 4 && quant < 25) + mp4_state->hdr.dc_scaler = ((quant + 13) / 2); + else + mp4_state->hdr.dc_scaler = (quant - 6); + } + } + + /***/ + diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_block.h bcast-2000c-mf3/quicktime/decore50/mp4_block.h *** bcast-2000c/quicktime/decore50/mp4_block.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_block.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,35 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_block.h // + + #ifndef _MP4_BLOCK_H_ + #define _MP4_BLOCK_H_ + + #endif // _MP4_BLOCK_H_ diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_decoder.c bcast-2000c-mf3/quicktime/decore50/mp4_decoder.c *** bcast-2000c/quicktime/decore50/mp4_decoder.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_decoder.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,198 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * Jonathan White + * + * DivX Advanced Research Center + * + **/ + // mp4_decoder.c // + + #include + #include + #include + #include + #include + #include + #ifdef WIN32 + #include + #endif + + #include "mp4_vars.h" + #include "decore.h" + + /** + * + **/ + + /***/ + + void initdecoder (DEC_BUFFERS buffers) + { + int i, j, cc; + + save_tables(mp4_tables); + + mp4_state->clp = mp4_state->clp_data + 384; + for (i = -384; i < 640; i++) + mp4_state->clp[i] = (unsigned char) ( (i < 0) ? 0 : ((i > 255) ? 255 : i) ); + + /* dc prediction border */ + for (i = 0; i < (2*DEC_MBC+1); i++) + mp4_state->coeff_pred.dc_store_lum[0][i] = 1024; + + for (i = 1; i < (2*DEC_MBR+1); i++) + mp4_state->coeff_pred.dc_store_lum[i][0] = 1024; + + for (i = 0; i < (DEC_MBC+1); i++) { + mp4_state->coeff_pred.dc_store_chr[0][0][i] = 1024; + mp4_state->coeff_pred.dc_store_chr[1][0][i] = 1024; + } + + for (i = 1; i < (DEC_MBR+1); i++) { + mp4_state->coeff_pred.dc_store_chr[0][i][0] = 1024; + mp4_state->coeff_pred.dc_store_chr[1][i][0] = 1024; + } + + /* ac prediction border */ + for (i = 0; i < (2*DEC_MBC+1); i++) + for (j = 0; j < 7; j++) { + mp4_state->coeff_pred.ac_left_lum[0][i][j] = 0; + mp4_state->coeff_pred.ac_top_lum[0][i][j] = 0; + } + + for (i = 1; i < (2*DEC_MBR+1); i++) + for (j = 0; j < 7; j++) { + mp4_state->coeff_pred.ac_left_lum[i][0][j] = 0; + mp4_state->coeff_pred.ac_top_lum[i][0][j] = 0; + } + + /* + [Review] too many computation to access to the + correct array value, better use two different + pointer for Cb and Cr components + */ + for (i = 0; i < (DEC_MBC+1); i++) + for (j = 0; j < 7; j++) { + mp4_state->coeff_pred.ac_left_chr[0][0][i][j] = 0; + mp4_state->coeff_pred.ac_top_chr[0][0][i][j] = 0; + mp4_state->coeff_pred.ac_left_chr[1][0][i][j] = 0; + mp4_state->coeff_pred.ac_top_chr[1][0][i][j] = 0; + } + + for (i = 1; i < (DEC_MBR+1); i++) + for (j = 0; j < 7; j++) { + mp4_state->coeff_pred.ac_left_chr[0][i][0][j] = 0; + mp4_state->coeff_pred.ac_top_chr[0][i][0][j] = 0; + mp4_state->coeff_pred.ac_left_chr[1][i][0][j] = 0; + mp4_state->coeff_pred.ac_top_chr[1][i][0][j] = 0; + } + + /* mode border */ + for (i = 0; i < mp4_state->mb_width + 1; i++) + mp4_state->modemap[0][i] = INTRA; + for (i = 0; i < mp4_state->mb_height + 1; i++) { + mp4_state->modemap[i][0] = INTRA; + mp4_state->modemap[i][mp4_state->mb_width+1] = INTRA; + } + + // edged forward and reference frame + for (cc = 0; cc < 3; cc++) + { + if (cc == 0) + { + edged_ref[cc] = (unsigned char *) buffers.mp4_edged_ref_buffers; + assert(edged_ref[cc]); + + edged_for[cc] = (unsigned char *) buffers.mp4_edged_for_buffers; + assert(edged_for[cc]); + + frame_ref[cc] = edged_ref[cc] + mp4_state->coded_picture_width * 32 + 32; + frame_for[cc] = edged_for[cc] + mp4_state->coded_picture_width * 32 + 32; + } + else + { + unsigned int offset; + + if (cc == 1) + offset = mp4_state->coded_picture_width * mp4_state->coded_picture_height; + else + offset = mp4_state->coded_picture_width * mp4_state->coded_picture_height + + mp4_state->chrom_width * mp4_state->chrom_height; + + edged_ref[cc] = (unsigned char *) buffers.mp4_edged_ref_buffers + offset; + assert(edged_ref[cc]); + + edged_for[cc] = (unsigned char *) buffers.mp4_edged_for_buffers + offset; + assert(edged_for[cc]); + + frame_ref[cc] = edged_ref[cc] + mp4_state->chrom_width * 16 + 16; + frame_for[cc] = edged_for[cc] + mp4_state->chrom_width * 16 + 16; + } + } + + // display frame + for (cc = 0; cc < 3; cc++) + { + unsigned int offset; + + switch (cc) + { + case 0: + offset = 0; + break; + case 1: + offset = mp4_state->horizontal_size * mp4_state->vertical_size; + break; + case 2: + offset = (mp4_state->horizontal_size * mp4_state->vertical_size) + + ((mp4_state->horizontal_size * mp4_state->vertical_size) >> 2); + break; + } + + display_frame[cc] = (unsigned char *) buffers.mp4_display_buffers + offset; + assert(display_frame[cc]); + } + } + + /***/ + + void closedecoder () + { + /*** REVIEW + + int cc; + + clp -= 384; + free(clp); + + for (cc = 0; cc < 3; cc++) { + free(display_frame[cc]); + free(edged_ref[cc]); + free(edged_for[cc]); + } + + ***/ + } diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_decoder.h bcast-2000c-mf3/quicktime/decore50/mp4_decoder.h *** bcast-2000c/quicktime/decore50/mp4_decoder.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_decoder.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,47 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_decoder.h // + + #ifndef _MP4_DECODER_H_ + #define _MP4_DECODER_H_ + + #define MODE_INTER 0 + #define MODE_INTER_Q 1 + #define MODE_INTER4V 2 + #define MODE_INTRA 3 + #define MODE_INTRA_Q 4 + #define MODE_INTER4V_Q 5 + + #endif // _MP4_DECODER_H_ + + /*** *** ***/ + + extern void initdecoder (); + extern void closedecoder (); diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_header.c bcast-2000c-mf3/quicktime/decore50/mp4_header.c *** bcast-2000c/quicktime/decore50/mp4_header.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_header.c Fri Dec 7 15:14:44 2001 *************** *** 0 **** --- 1,385 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_header.c // + + #include + #include + + #include "mp4_vars.h" + + #include "getbits.h" + #include "debug.h" + #include "mp4_header.h" + + /** + * + **/ + + void next_start_code(); + + /***/ + + int getvolhdr() + { + if (showbits(27) == VO_START_CODE) + { + getbits(27); // start_code + getbits(5); // vo_id + + if (getbits(28) != VOL_START_CODE) + { + exit(101); + } + mp4_state->hdr.ident = getbits(4); // vol_id + mp4_state->hdr.random_accessible_vol = getbits(1); + mp4_state->hdr.type_indication = getbits(8); + mp4_state->hdr.is_object_layer_identifier = getbits(1); + + if (mp4_state->hdr.is_object_layer_identifier) { + mp4_state->hdr.visual_object_layer_verid = getbits(4); + mp4_state->hdr.visual_object_layer_priority = getbits(3); + } + else { + mp4_state->hdr.visual_object_layer_verid = 1; + mp4_state->hdr.visual_object_layer_priority = 1; + } + mp4_state->hdr.aspect_ratio_info = getbits(4); + mp4_state->hdr.vol_control_parameters = getbits(1); + if (mp4_state->hdr.vol_control_parameters) { + mp4_state->hdr.chroma_format = getbits(2); + mp4_state->hdr.low_delay = getbits(1); + mp4_state->hdr.vbv_parameters = getbits(1); + if (mp4_state->hdr.vbv_parameters) { + mp4_state->hdr.first_half_bit_rate = getbits(15); + getbits1(); // marker + mp4_state->hdr.latter_half_bit_rate = getbits(15); + getbits1(); // marker + mp4_state->hdr.first_half_vbv_buffer_size = getbits(15); + getbits1(); // marker + mp4_state->hdr.latter_half_vbv_buffer_size = getbits(3); + mp4_state->hdr.first_half_vbv_occupancy = getbits(11); + getbits1(); // marker + mp4_state->hdr.latter_half_vbv_occupancy = getbits(15); + getbits1(); // marker + } + } + mp4_state->hdr.shape = getbits(2); + getbits1(); // marker + mp4_state->hdr.time_increment_resolution = getbits(16); + getbits1(); // marker + mp4_state->hdr.fixed_vop_rate = getbits(1); + + if (mp4_state->hdr.fixed_vop_rate) { + int bits = (int) ceil(log((double)mp4_state->hdr.time_increment_resolution)/log(2.0)); + if (bits < 1) + bits = 1; + mp4_state->hdr.fixed_vop_time_increment = getbits(bits); + } + + if (mp4_state->hdr.shape != BINARY_SHAPE_ONLY) + { + if(mp4_state->hdr.shape == 0) + { + getbits1(); // marker + mp4_state->hdr.width = getbits(13); + getbits1(); // marker + mp4_state->hdr.height = getbits(13); + getbits1(); // marker + } + + mp4_state->hdr.interlaced = getbits(1); + mp4_state->hdr.obmc_disable = getbits(1); + + if (mp4_state->hdr.visual_object_layer_verid == 1) { + mp4_state->hdr.sprite_usage = getbits(1); + } + else { + mp4_state->hdr.sprite_usage = getbits(2); + } + + mp4_state->hdr.not_8_bit = getbits(1); + if (mp4_state->hdr.not_8_bit) + { + mp4_state->hdr.quant_precision = getbits(4); + mp4_state->hdr.bits_per_pixel = getbits(4); + } + else + { + mp4_state->hdr.quant_precision = 5; + mp4_state->hdr.bits_per_pixel = 8; + } + + if (mp4_state->hdr.shape == GRAY_SCALE) { + exit(102); + } + + mp4_state->hdr.quant_type = getbits(1); // quant type + + if (mp4_state->hdr.quant_type) + { + mp4_state->hdr.load_intra_quant_matrix = getbits(1); + if (mp4_state->hdr.load_intra_quant_matrix) { + // load intra quant matrix + unsigned int val; + int i, k = 0; + do { + k++; + val = getbits(8); + mp4_tables->intra_quant_matrix[mp4_tables->zig_zag_scan[k]] = val; + } while ((k < 64) && (val != 0)); + for (i = k; i < 64; i++) { + mp4_tables->intra_quant_matrix[mp4_tables->zig_zag_scan[i]] = + mp4_tables->intra_quant_matrix[mp4_tables->zig_zag_scan[k-1]]; + } + } + mp4_state->hdr.load_nonintra_quant_matrix = getbits(1); + if (mp4_state->hdr.load_nonintra_quant_matrix) { + // load nonintra quant matrix + unsigned int val; + int i, k = 0; + do { + k++; + val = getbits(8); + mp4_tables->nonintra_quant_matrix[mp4_tables->zig_zag_scan[k]] = val; + } while ((k < 64) && (val != 0)); + for (i = k; i < 64; i++) { + mp4_tables->nonintra_quant_matrix[mp4_tables->zig_zag_scan[i]] = + mp4_tables->nonintra_quant_matrix[mp4_tables->zig_zag_scan[k-1]]; + } + } + } + + if (mp4_state->hdr.visual_object_layer_verid/*ident*/ != 1) { + mp4_state->hdr.quarter_pixel = getbits(1); + } else { + mp4_state->hdr.quarter_pixel = 0; + } + + mp4_state->hdr.complexity_estimation_disable = getbits(1); + mp4_state->hdr.error_res_disable = getbits(1); + mp4_state->hdr.data_partitioning = getbits(1); + if (mp4_state->hdr.data_partitioning) { + exit(102); + } + else { + mp4_state->hdr.error_res_disable = 1; + } + + mp4_state->hdr.intra_acdc_pred_disable = 0; + mp4_state->hdr.scalability = getbits(1); + + if (mp4_state->hdr.scalability) { + exit(103); + } + + // next_start_code(); + + if (showbits(32) == USER_DATA_START_CODE) { + exit(104); + } + } + + return 1; + } + + return 0; // no VO start code + } + + /***/ + + int getgophdr() + { + if (nextbits(32) == GOP_START_CODE) // [Ag][Review] possible bug, it's not possible to read 32 bits + { + getbits(32); + + mp4_state->hdr.time_code = getbits(18); + mp4_state->hdr.closed_gov = getbits(1); + mp4_state->hdr.broken_link = getbits(1); + } + + return 1; + } + + /***/ + + int getvophdr() + { + next_start_code(); + if(getbits(32) != (int) VOP_START_CODE) + { + _Print("Vop start_code NOT found\n"); + return 0; + } + + mp4_state->hdr.prediction_type = getbits(2); + + while (getbits(1) == 1) // temporal time base + { + mp4_state->hdr.time_base++; + } + getbits1(); // marker bit + { + int bits = (int) ceil(log(mp4_state->hdr.time_increment_resolution)/log(2.0)); + if (bits < 1) bits = 1; + + mp4_state->hdr.time_inc = getbits(bits); // vop_time_increment (1-16 bits) + } + + getbits1(); // marker bit + mp4_state->hdr.vop_coded = getbits(1); + if (mp4_state->hdr.vop_coded == 0) + { + next_start_code(); + return 1; + } + + if ((mp4_state->hdr.shape != BINARY_SHAPE_ONLY) && + (mp4_state->hdr.prediction_type == P_VOP)) + { + mp4_state->hdr.rounding_type = getbits(1); + } else { + mp4_state->hdr.rounding_type = 0; + } + + if (mp4_state->hdr.shape != RECTANGULAR) + { + if (! (mp4_state->hdr.sprite_usage == STATIC_SPRITE && + mp4_state->hdr.prediction_type==I_VOP) ) + { + mp4_state->hdr.width = getbits(13); + getbits1(); + mp4_state->hdr.height = getbits(13); + getbits1(); + mp4_state->hdr.hor_spat_ref = getbits(13); + getbits1(); + mp4_state->hdr.ver_spat_ref = getbits(13); + getbits1(); // corr + } + + mp4_state->hdr.change_CR_disable = getbits(1); + + mp4_state->hdr.constant_alpha = getbits(1); + if (mp4_state->hdr.constant_alpha) { + mp4_state->hdr.constant_alpha_value = getbits(8); + } + } + + if (! (mp4_state->hdr.complexity_estimation_disable)) { + exit(108); + } + + if (mp4_state->hdr.shape != BINARY_SHAPE_ONLY) + { + mp4_state->hdr.intra_dc_vlc_thr = getbits(3); + if (mp4_state->hdr.interlaced) { + exit(109); + } + } + + if (mp4_state->hdr.shape != BINARY_SHAPE_ONLY) + { + mp4_state->hdr.quantizer = getbits(mp4_state->hdr.quant_precision); // vop quant + + if (mp4_state->hdr.prediction_type != I_VOP) + { + mp4_state->hdr.fcode_for = getbits(3); + } + + if (! mp4_state->hdr.scalability) { + if (mp4_state->hdr.shape && mp4_state->hdr.prediction_type!=I_VOP) + mp4_state->hdr.shape_coding_type = getbits(1); // vop shape coding type + + /* motion_shape_texture() */ + } + } + + return 1; + } + + + + + + + + + + + + + + + /***/ + + void __inline next_start_code() + { + if (mp4_state->juice_flag) + { + // juice_flag = 0; // [Review][Ag] before juice needed this changed only first time + if (! bytealigned(0)) + { + getbits(1); + + // bytealign + while (! bytealigned(0)) { + flushbits(1); + } + } + } + else + { + getbits(1); + + // bytealign + while (! bytealigned(0)) { + flushbits(1); + } + } + } + + + + + + + + + + + + + + + + + + + diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_header.h bcast-2000c-mf3/quicktime/decore50/mp4_header.h *** bcast-2000c/quicktime/decore50/mp4_header.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_header.h Fri Dec 7 15:15:26 2001 *************** *** 0 **** --- 1,158 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_header.h // + + #ifndef _MP4_HEADER_H_ + #define _MP4_HEADER_H_ + + #define VO_START_CODE 0x8 + #define VOL_START_CODE 0x12 + #define GOP_START_CODE 0x1b3 + #define VOP_START_CODE 0x1b6 + + #define I_VOP 0 + #define P_VOP 1 + #define B_VOP 2 + + #define RECTANGULAR 0 + #define BINARY 1 + #define BINARY_SHAPE_ONLY 2 + #define GRAY_SCALE 3 + + #define STATIC_SPRITE 1 + + #define USER_DATA_START_CODE 0x01b2 + + #define NOT_CODED -1 + #define INTER 0 + #define INTER_Q 1 + #define INTER4V 2 + #define INTRA 3 + #define INTRA_Q 4 + #define STUFFING 7 + + /*** *** ***/ + + typedef struct _mp4_header { + + // vol + int ident; + int random_accessible_vol; + int type_indication; + int is_object_layer_identifier; + int visual_object_layer_verid; + int visual_object_layer_priority; + int aspect_ratio_info; + int vol_control_parameters; + int chroma_format; + int low_delay; + int vbv_parameters; + int first_half_bit_rate; + int latter_half_bit_rate; + int first_half_vbv_buffer_size; + int latter_half_vbv_buffer_size; + int first_half_vbv_occupancy; + int latter_half_vbv_occupancy; + int shape; + int time_increment_resolution; + int fixed_vop_rate; + int fixed_vop_time_increment; + int width; + int height; + int interlaced; + int obmc_disable; + int sprite_usage; + int not_8_bit; + int quant_precision; + int bits_per_pixel; + int quant_type; + int load_intra_quant_matrix; + int load_nonintra_quant_matrix; + int quarter_pixel; + int complexity_estimation_disable; + int error_res_disable; + int data_partitioning; + int intra_acdc_pred_disable; + int scalability; + + // gop + int time_code; + int closed_gov; + int broken_link; + + // vop + int prediction_type; + int time_base; + int time_inc; + int vop_coded; + int rounding_type; + int hor_spat_ref; + int ver_spat_ref; + int change_CR_disable; + int constant_alpha; + int constant_alpha_value; + int intra_dc_vlc_thr; + int quantizer; + int fcode_for; + int shape_coding_type; + + // macroblock + int not_coded; + int mcbpc; + int derived_mb_type; + int cbpc; + int ac_pred_flag; + int cbpy; + int dquant; + int cbp; + + // extra/derived + int mba_size; + int mb_xsize; + int mb_ysize; + int picnum; + int mba; + int mb_xpos; + int mb_ypos; + int dc_scaler; + + int intrablock_rescaled; + + } mp4_header; + + /*** *** ***/ + + extern int getvolhdr(); + extern int getgophdr(); + extern int getvophdr(); + + extern void __inline next_start_code(); + + #endif // _MP4_HEADER_H_ diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_iquant.c bcast-2000c-mf3/quicktime/decore50/mp4_iquant.c *** bcast-2000c/quicktime/decore50/mp4_iquant.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_iquant.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,82 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_iquant.c // + + #include "mp4_vars.h" + + #include "mp4_predict.h" + #include "mp4_iquant.h" + + /** + * inverse quantization for intra blocks + **/ + + #define _iquant_h263(coeff, q_2scale, q_add) if ((coeff) != 0) { \ + if ((coeff) > 0) { \ + (coeff) = ((q_2scale) * (coeff)) + (q_add); } \ + else if ((coeff) < 0) { \ + (coeff) *= -1; \ + (coeff) = ((q_2scale) * (coeff)) + (q_add); \ + (coeff) *= -1; } \ + } + + /** + * + **/ + + // iquant type h.263, not optimized + // + __inline void iquant (short * psblock, int intraFlag) + { + int i; + int q_scale = mp4_state->hdr.quantizer; + int q_2scale = q_scale << 1; + int q_add = (q_scale & 1) ? q_scale : (q_scale - 1); + + for (i = intraFlag; i < 64; i++) + { + _iquant_h263(psblock[i], q_2scale, q_add); + } + } + + + void iquant_typefirst (short * psblock) + { + int i; + for (i = 1; i < 64; i++) + { + if (psblock[i] != 0) { + psblock[i] = (psblock[i] * 2 * mp4_state->hdr.quantizer * + mp4_tables->intra_quant_matrix[mp4_tables->zig_zag_scan[i]]) >> 4; + } + } + } + + diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_iquant.h bcast-2000c-mf3/quicktime/decore50/mp4_iquant.h *** bcast-2000c/quicktime/decore50/mp4_iquant.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_iquant.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,38 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_iquant.h // + + #ifndef _MP4_IQUANT_H_ + #define _MP4_IQUANT_H_ + + extern void iquant(short * psblock, int intraFlag); + extern void iquant_typefirst (short * psblock); + + #endif // _MP4_IQUANT_H_ diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_mblock.c bcast-2000c-mf3/quicktime/decore50/mp4_mblock.c *** bcast-2000c/quicktime/decore50/mp4_mblock.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_mblock.c Fri Dec 7 15:29:20 2001 *************** *** 0 **** --- 1,408 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_mblock.c // + + #include + #include + + #include "mp4_vars.h" + + #include "getbits.h" + #include "mp4_block.h" + #include "mp4_mblock.h" + #include "debug.h" + + /** + * + **/ + + static int getMCBPC(); + static int getCBPY(); + static int setMV(int block_num); + static int getMVdata(); + + /***/ + + extern int find_pmv(int block_num, int type); + extern void addblock (int comp, int bx, int by, int addflag); + extern void addblockIntra (int comp, int bx, int by); + extern void addblockInter (int comp, int bx, int by); + + /***/ + + int macroblock() + { + int j; + int intraFlag, interFlag; + + // _Print("-Macroblock %d\n", mp4_state->hdr.mba); + // _Break(93, 426); + //printf("macroblock 1\n"); + + if (mp4_state->hdr.prediction_type != I_VOP) + mp4_state->hdr.not_coded = getbits(1); + //printf("macroblock 2\n"); + + // coded macroblock or I-VOP + if (! mp4_state->hdr.not_coded || mp4_state->hdr.prediction_type == I_VOP) + { + + //printf("macroblock 3\n"); + //printf("macroblock: 1 %02x\n", showbits(16)); + mp4_state->hdr.mcbpc = getMCBPC(); // mcbpc + //printf("macroblock: 2 %02x\n", showbits(16)); + + + + + mp4_state->hdr.derived_mb_type = mp4_state->hdr.mcbpc & 7; + mp4_state->hdr.cbpc = (mp4_state->hdr.mcbpc >> 4) & 3; + //printf("macroblock 4\n"); + + mp4_state->modemap[mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = + mp4_state->hdr.derived_mb_type; // [Review] used only in P-VOPs + intraFlag = ((mp4_state->hdr.derived_mb_type == INTRA) || + (mp4_state->hdr.derived_mb_type == INTRA_Q)) ? 1 : 0; + interFlag = (! intraFlag); + //printf("macroblock 5\n"); + + if (intraFlag) + mp4_state->hdr.ac_pred_flag = getbits(1); + if (mp4_state->hdr.derived_mb_type != STUFFING) { + + mp4_state->hdr.cbpy = getCBPY(); // cbpy + mp4_state->hdr.cbp = (mp4_state->hdr.cbpy << 2) | mp4_state->hdr.cbpc; + } + else + return 1; + //printf("macroblock 6\n"); + + // _Print("Mb type: %d\n", mp4_state->hdr.derived_mb_type); + // _Print("Pattern Chr: %d\n", mp4_state->hdr.cbpc); + // _Print("Pattern Luma: %d\n", mp4_state->hdr.cbpy); + + if (mp4_state->hdr.derived_mb_type == INTER_Q || + mp4_state->hdr.derived_mb_type == INTRA_Q) { + + mp4_state->hdr.dquant = getbits(2); + mp4_state->hdr.quantizer += DQtab[mp4_state->hdr.dquant]; + if (mp4_state->hdr.quantizer > 31) + mp4_state->hdr.quantizer = 31; + else if (mp4_state->hdr.quantizer < 1) + mp4_state->hdr.quantizer = 1; + } + if (mp4_state->hdr.derived_mb_type == INTER || + mp4_state->hdr.derived_mb_type == INTER_Q) { + + setMV(-1); // mv + } + else if (mp4_state->hdr.derived_mb_type == INTER4V) { + + for (j = 0; j < 4; j++) { + + setMV(j); // mv + } + } + else { // intra + if (mp4_state->hdr.prediction_type == P_VOP) { + int i; + for (i = 0; i < 4; i++) { + mp4_state->MV[0][i][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = 0; + mp4_state->MV[1][i][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = 0; + } + } + } + //printf("macroblock 7\n"); + + //printf("macroblock 3 %02x\n", showbits(16)); + // motion compensation + if (interFlag) + { + //printf("macroblock 8\n"); + divx_reconstruct(mp4_state->hdr.mb_xpos, mp4_state->hdr.mb_ypos, mp4_state->hdr.derived_mb_type); + //printf("macroblock 9\n"); + + // texture decoding add + for (j = 0; j < 6; j++) { + int coded = mp4_state->hdr.cbp & (1 << (5 - j)); + + if (coded) { + blockInter(j, (coded != 0)); + addblockInter(j, mp4_state->hdr.mb_xpos, mp4_state->hdr.mb_ypos); + } + } + //printf("macroblock 10\n"); + } + else + { + // texture decoding add + //printf("macroblock 11\n"); + for (j = 0; j < 6; j++) { + int coded = mp4_state->hdr.cbp & (1 << (5 - j)); + + //printf("macroblock 11.1 %02x\n", showbits(16)); + blockIntra(j, (coded != 0)); + //printf("macroblock 11.2 %02x\n", showbits(16)); + addblockIntra(j, mp4_state->hdr.mb_xpos, mp4_state->hdr.mb_ypos); + //printf("macroblock 11.3 %02x\n", showbits(16)); + } + //printf("macroblock 12\n"); + } + //printf("macroblock 8 %02x\n", showbits(16)); + } + + // not coded macroblock + else { + + //printf("macroblock 9\n"); + mp4_state->MV[0][0][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = mp4_state->MV[0][1][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = + mp4_state->MV[0][2][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = mp4_state->MV[0][3][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = 0; + mp4_state->MV[1][0][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = mp4_state->MV[1][1][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = + mp4_state->MV[1][2][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = mp4_state->MV[1][3][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = 0; + + mp4_state->modemap[mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = NOT_CODED; // [Review] used only in P-VOPs + + divx_reconstruct(mp4_state->hdr.mb_xpos, mp4_state->hdr.mb_ypos, mp4_state->hdr.derived_mb_type); + //printf("macroblock 10\n"); + } + + mp4_state->quant_store[mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = mp4_state->hdr.quantizer; + //printf("macroblock 11\n"); + + if (mp4_state->hdr.mb_xpos < (mp4_state->mb_width-1)) { + mp4_state->hdr.mb_xpos++; + } + else { + mp4_state->hdr.mb_ypos++; + mp4_state->hdr.mb_xpos = 0; + } + //printf("macroblock 12\n"); + + return 1; + } + + /***/ + + static int getMCBPC() + { + if (mp4_state->hdr.prediction_type == I_VOP) + { + int code = showbits(9); + + if (code == 1) { + flushbits(9); // stuffing + return 0; + } + else if (code < 8) { + return -1; + } + + code >>= 3; + if (code >= 32) { + flushbits(1); + return 3; + } + + flushbits(mp4_tables->MCBPCtabIntra[code].len); + return mp4_tables->MCBPCtabIntra[code].val; + } + else + { + int code = showbits(9); + + if (code == 1) { + flushbits(9); // stuffing + return 0; + } + else if (code == 0) { + return -1; + } + + if (code >= 256) + { + flushbits(1); + return 0; + } + + flushbits(mp4_tables->MCBPCtabInter[code].len); + return mp4_tables->MCBPCtabInter[code].val; + } + } + + /***/ + + static int getCBPY() + { + int cbpy; + int code = showbits(6); + + if (code < 2) { + return -1; + } + + if (code >= 48) { + flushbits(2); + cbpy = 15; + } else { + flushbits(mp4_tables->CBPYtab[code].len); + cbpy = mp4_tables->CBPYtab[code].val; + } + + if (!((mp4_state->hdr.derived_mb_type == 3) || + (mp4_state->hdr.derived_mb_type == 4))) + cbpy = 15 - cbpy; + + return cbpy; + } + + /***/ + + static int setMV(int block_num) + { + int hor_mv_data, ver_mv_data, hor_mv_res, ver_mv_res; + int scale_fac = 1 << (mp4_state->hdr.fcode_for - 1); + int high = (32 * scale_fac) - 1; + int low = ((-32) * scale_fac); + int range = (64 * scale_fac); + + int mvd_x, mvd_y, pmv_x, pmv_y, mv_x, mv_y; + + /*** + + [hor_mv_data] + if ((vop_fcode_forward != 1) && (hor_mv_data != 0)) + [hor_mv_residual] + + ***/ + + hor_mv_data = getMVdata(); // mv data + + if ((scale_fac == 1) || (hor_mv_data == 0)) + mvd_x = hor_mv_data; + else { + hor_mv_res = getbits(mp4_state->hdr.fcode_for-1); // mv residual + mvd_x = ((abs(hor_mv_data) - 1) * scale_fac) + hor_mv_res + 1; + if (hor_mv_data < 0) + mvd_x = - mvd_x; + } + + ver_mv_data = getMVdata(); + + if ((scale_fac == 1) || (ver_mv_data == 0)) + mvd_y = ver_mv_data; + else { + ver_mv_res = getbits(mp4_state->hdr.fcode_for-1); + mvd_y = ((abs(ver_mv_data) - 1) * scale_fac) + ver_mv_res + 1; + if (ver_mv_data < 0) + mvd_y = - mvd_y; + } + + if (block_num == -1) { + pmv_x = find_pmv(0, 0); + pmv_y = find_pmv(0, 1); + } + else { + pmv_x = find_pmv(block_num, 0); + pmv_y = find_pmv(block_num, 1); + } + + // _Print("Hor MotV Pred: %d\n", pmv_x); + // _Print("Ver MorV Pred: %d\n", pmv_y); + + mv_x = pmv_x + mvd_x; + + if (mv_x < low) + mv_x += range; + if (mv_x > high) + mv_x -= range; + + mv_y = pmv_y + mvd_y; + + if (mv_y < low) + mv_y += range; + if (mv_y > high) + mv_y -= range; + + // put [mv_x, mv_y] in MV struct + if (block_num == -1) { + int i; + for (i = 0; i < 4; i++) { + mp4_state->MV[0][i][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = mv_x; + mp4_state->MV[1][i][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = mv_y; + } + } + else { + mp4_state->MV[0][block_num][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = mv_x; + mp4_state->MV[1][block_num][mp4_state->hdr.mb_ypos+1][mp4_state->hdr.mb_xpos+1] = mv_y; + } + + // _Print("Hor MotV: %d\n", mv_x); + // _Print("Ver MotV: %d\n", mv_y); + + return 1; + } + + /***/ + + static int getMVdata() + { + int code; + + if (getbits(1)) { + return 0; // hor_mv_data == 0 + } + + code = showbits(12); + + if (code >= 512) + { + code = (code >> 8) - 2; + flushbits(mp4_tables->MVtab0[code].len); + return mp4_tables->MVtab0[code].val; + } + + if (code >= 128) + { + code = (code >> 2) - 32; + flushbits(mp4_tables->MVtab1[code].len); + return mp4_tables->MVtab1[code].val; + } + + code -= 4; + + // assert(code >= 0); + if(code <= 0) return 0; + + flushbits(mp4_tables->MVtab2[code].len); + return mp4_tables->MVtab2[code].val; + } + + /***/ + diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_mblock.h bcast-2000c-mf3/quicktime/decore50/mp4_mblock.h *** bcast-2000c/quicktime/decore50/mp4_mblock.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_mblock.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,153 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_mblock.h // + + #ifndef _MP4_MBLOCK_H_ + #define _MP4_MBLOCK_H_ + + /*** *** ***/ + + typedef struct { + int val, len; + } VLCtabMb; + + /*** *** ***/ + + static int DQtab[4] = { + -1, -2, 1, 2 + }; + + /*** + + static VLCtabMb MCBPCtabIntra[] = { + {-1,0}, + {20,6}, {36,6}, {52,6}, {4,4}, {4,4}, {4,4}, + {4,4}, {19,3}, {19,3}, {19,3}, {19,3}, {19,3}, + {19,3}, {19,3}, {19,3}, {35,3}, {35,3}, {35,3}, + {35,3}, {35,3}, {35,3}, {35,3}, {35,3}, {51,3}, + {51,3}, {51,3}, {51,3}, {51,3}, {51,3}, {51,3}, + {51,3}, + }; + + static VLCtabMb MCBPCtabInter[] = { + {-1,0}, + {255,9}, {52,9}, {36,9}, {20,9}, {49,9}, {35,8}, {35,8}, {19,8}, {19,8}, + {50,8}, {50,8}, {51,7}, {51,7}, {51,7}, {51,7}, {34,7}, {34,7}, {34,7}, + {34,7}, {18,7}, {18,7}, {18,7}, {18,7}, {33,7}, {33,7}, {33,7}, {33,7}, + {17,7}, {17,7}, {17,7}, {17,7}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, + {4,6}, {4,6}, {4,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6}, + {48,6}, {48,6}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, + {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, + }; + + + static VLCtabMb CBPYtab[48] = + { + {-1,0}, {-1,0}, {6,6}, {9,6}, {8,5}, {8,5}, {4,5}, {4,5}, + {2,5}, {2,5}, {1,5}, {1,5}, {0,4}, {0,4}, {0,4}, {0,4}, + {12,4}, {12,4}, {12,4}, {12,4}, {10,4}, {10,4}, {10,4}, {10,4}, + {14,4}, {14,4}, {14,4}, {14,4}, {5,4}, {5,4}, {5,4}, {5,4}, + {13,4}, {13,4}, {13,4}, {13,4}, {3,4}, {3,4}, {3,4}, {3,4}, + {11,4}, {11,4}, {11,4}, {11,4}, {7,4}, {7,4}, {7,4}, {7,4}, + }; + + + static VLCtabMb MVtab0[] = + { + {3,4}, {-3,4}, {2,3}, {2,3}, {-2,3}, {-2,3}, {1,2}, {1,2}, {1,2}, {1,2}, + {-1,2}, {-1,2}, {-1,2}, {-1,2} + }; + + static VLCtabMb MVtab1[] = + { + {12,10}, {-12,10}, {11,10}, {-11,10}, {10,9}, {10,9}, {-10,9}, {-10,9}, + {9,9}, {9,9}, {-9,9}, {-9,9}, {8,9}, {8,9}, {-8,9}, {-8,9}, {7,7}, {7,7}, + {7,7}, {7,7}, {7,7}, {7,7}, {7,7}, {7,7}, {-7,7}, {-7,7}, {-7,7}, {-7,7}, + {-7,7}, {-7,7}, {-7,7}, {-7,7}, {6,7}, {6,7}, {6,7}, {6,7}, {6,7}, {6,7}, + {6,7}, {6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, + {-6,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {-5,7}, + {-5,7}, {-5,7}, {-5,7}, {-5,7}, {-5,7}, {-5,7}, {-5,7}, {4,6}, {4,6}, {4,6}, + {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, + {4,6}, {4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, + {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6} + }; + + static VLCtabMb MVtab2[] = + { + {32,12}, {-32,12}, {31,12}, {-31,12}, {30,11}, {30,11}, {-30,11}, {-30,11}, + {29,11}, {29,11}, {-29,11}, {-29,11}, {28,11}, {28,11}, {-28,11}, {-28,11}, + {27,11}, {27,11}, {-27,11}, {-27,11}, {26,11}, {26,11}, {-26,11}, {-26,11}, + {25,11}, {25,11}, {-25,11}, {-25,11}, {24,10}, {24,10}, {24,10}, {24,10}, + {-24,10}, {-24,10}, {-24,10}, {-24,10}, {23,10}, {23,10}, {23,10}, {23,10}, + {-23,10}, {-23,10}, {-23,10}, {-23,10}, {22,10}, {22,10}, {22,10}, {22,10}, + {-22,10}, {-22,10}, {-22,10}, {-22,10}, {21,10}, {21,10}, {21,10}, {21,10}, + {-21,10}, {-21,10}, {-21,10}, {-21,10}, {20,10}, {20,10}, {20,10}, {20,10}, + {-20,10}, {-20,10}, {-20,10}, {-20,10}, {19,10}, {19,10}, {19,10}, {19,10}, + {-19,10}, {-19,10}, {-19,10}, {-19,10}, {18,10}, {18,10}, {18,10}, {18,10}, + {-18,10}, {-18,10}, {-18,10}, {-18,10}, {17,10}, {17,10}, {17,10}, {17,10}, + {-17,10}, {-17,10}, {-17,10}, {-17,10}, {16,10}, {16,10}, {16,10}, {16,10}, + {-16,10}, {-16,10}, {-16,10}, {-16,10}, {15,10}, {15,10}, {15,10}, {15,10}, + {-15,10}, {-15,10}, {-15,10}, {-15,10}, {14,10}, {14,10}, {14,10}, {14,10}, + {-14,10}, {-14,10}, {-14,10}, {-14,10}, {13,10}, {13,10}, {13,10}, {13,10}, + {-13,10}, {-13,10}, {-13,10}, {-13,10} + }; + + ***/ + + #endif // _MP4_MBLOCK_H_ + + /*** *** ***/ + + extern int macroblock(); + extern int block(); + extern int blockIntra(); + extern int blockInter(); diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_picture.c bcast-2000c-mf3/quicktime/decore50/mp4_picture.c *** bcast-2000c/quicktime/decore50/mp4_picture.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_picture.c Thu Dec 13 16:12:22 2001 *************** *** 0 **** --- 1,451 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_picture.c // + + #include + #include + #include + + #include "mp4_decoder.h" + #include "mp4_vars.h" + #include "getbits.h" + + #include "mp4_header.h" + #include "mp4_mblock.h" + + //#include "transferIDCT.h" + #include "postprocess.h" + #include "yuv2rgb.h" + #include "store.h" + + /** + * + **/ + + void addblock (int comp, int bx, int by, int addflag); + int find_pmv (int block, int comp); + + static void make_edge (unsigned char *frame_pic, int width, int height, int edge); + + /***/ + + // Purpose: decode and display a Vop + void get_mp4picture (unsigned char *bmp[], unsigned int stride, int render_flag) + { + mp4_state->hdr.mba = 0; + mp4_state->hdr.mb_xpos = 0; + mp4_state->hdr.mb_ypos = 0; + + //printf("get_mp4picture 1\n"); + do { + //printf("get_mp4picture 1.1\n"); + macroblock(); + //printf("get_mp4picture 1.2\n"); + mp4_state->hdr.mba++; + //printf("get_mp4picture 1 %d %d\n", mp4_state->hdr.mba, mp4_state->hdr.mba_size); + + } while ((nextbits_bytealigned(23) != 0) && + (mp4_state->hdr.mba < mp4_state->hdr.mba_size)); + //printf("get_mp4picture 2\n"); + + // add edge to decoded frame + make_edge (frame_ref[0], mp4_state->coded_picture_width, mp4_state->coded_picture_height, 32); + make_edge (frame_ref[1], mp4_state->chrom_width, mp4_state->chrom_height, 16); + make_edge (frame_ref[2], mp4_state->chrom_width, mp4_state->chrom_height, 16); + //printf("get_mp4picture 3\n"); + + PictureDisplay(bmp, stride, render_flag); + //printf("get_mp4picture 4\n"); + // exchange ref and for frames + { + int i; + unsigned char *tmp; + for (i = 0; i < 3; i++) { + tmp = frame_ref[i]; + frame_ref[i] = frame_for[i]; + frame_for[i] = tmp; + } + } + //printf("get_mp4picture 5\n"); + } + + /***/ + + // Purpose: move/add 8x8 block to curr_frame + void addblock (int comp, int bx, int by, int addflag) + { + int cc, i, iincr; + unsigned char *rfp; + short *bp; + unsigned char *curr[3]; + + curr[0] = frame_ref[0]; + curr[1] = frame_ref[1]; + curr[2] = frame_ref[2]; + + bp = ld->block; + + cc = (comp < 4) ? 0 : (comp & 1) + 1; /* color component index */ + + if (cc == 0) // luminance + { + // pixel coordinates + bx <<= 4; + by <<= 4; + // frame DCT coding + + rfp = curr[0] + mp4_state->coded_picture_width * (by + ((comp & 2) << 2)) + bx + ((comp & 1) << 3); + iincr = mp4_state->coded_picture_width; + } + else // chrominance + { + // pixel coordinates + bx <<= 3; + by <<= 3; + // frame DCT coding + rfp = curr[cc] + mp4_state->chrom_width * by + bx; + iincr = mp4_state->chrom_width; + } + + if (addflag) + { + for (i = 0; i < 8; i++) + { + rfp[0] = mp4_state->clp[bp[0] + rfp[0]]; + rfp[1] = mp4_state->clp[bp[1] + rfp[1]]; + rfp[2] = mp4_state->clp[bp[2] + rfp[2]]; + rfp[3] = mp4_state->clp[bp[3] + rfp[3]]; + rfp[4] = mp4_state->clp[bp[4] + rfp[4]]; + rfp[5] = mp4_state->clp[bp[5] + rfp[5]]; + rfp[6] = mp4_state->clp[bp[6] + rfp[6]]; + rfp[7] = mp4_state->clp[bp[7] + rfp[7]]; + bp += 8; + rfp += iincr; + } + } else + { + for (i = 0; i < 8; i++) + { + rfp[0] = mp4_state->clp[bp[0]]; + rfp[1] = mp4_state->clp[bp[1]]; + rfp[2] = mp4_state->clp[bp[2]]; + rfp[3] = mp4_state->clp[bp[3]]; + rfp[4] = mp4_state->clp[bp[4]]; + rfp[5] = mp4_state->clp[bp[5]]; + rfp[6] = mp4_state->clp[bp[6]]; + rfp[7] = mp4_state->clp[bp[7]]; + bp += 8; + rfp += iincr; + } + } + } + + /***/ + + void addblockIntra (int comp, int bx, int by) + { + int cc, iincr; + unsigned char *rfp; + short *bp; + unsigned char *curr[3]; + + curr[0] = frame_ref[0]; + curr[1] = frame_ref[1]; + curr[2] = frame_ref[2]; + + bp = ld->block; + + cc = (comp < 4) ? 0 : (comp & 1) + 1; /* color component index */ + + if (cc == 0) // luminance + { + // pixel coordinates + bx <<= 4; + by <<= 4; + // frame DCT coding + + rfp = curr[0] + mp4_state->coded_picture_width * (by + ((comp & 2) << 2)) + bx + ((comp & 1) << 3); + iincr = mp4_state->coded_picture_width; + } + else // chrominance + { + // pixel coordinates + bx <<= 3; + by <<= 3; + // frame DCT coding + rfp = curr[cc] + mp4_state->chrom_width * by + bx; + iincr = mp4_state->chrom_width; + } + /*** + for (int i = 0; i < 8; i++) + { + rfp[0] = clp[bp[0]]; + rfp[1] = clp[bp[1]]; + rfp[2] = clp[bp[2]]; + rfp[3] = clp[bp[3]]; + rfp[4] = clp[bp[4]]; + rfp[5] = clp[bp[5]]; + rfp[6] = clp[bp[6]]; + rfp[7] = clp[bp[7]]; + bp += 8; + rfp += iincr; + } + ***/ transferIDCT_copy(bp, rfp, iincr); + } + + /***/ + + void addblockInter (int comp, int bx, int by) + { + int cc, iincr; + unsigned char *rfp; + short *bp; + unsigned char *curr[3]; + + curr[0] = frame_ref[0]; + curr[1] = frame_ref[1]; + curr[2] = frame_ref[2]; + + bp = ld->block; + + cc = (comp < 4) ? 0 : (comp & 1) + 1; /* color component index */ + + if (cc == 0) // luminance + { + // pixel coordinates + bx <<= 4; + by <<= 4; + // frame DCT coding + + rfp = curr[0] + mp4_state->coded_picture_width * (by + ((comp & 2) << 2)) + bx + ((comp & 1) << 3); + iincr = mp4_state->coded_picture_width; + } + else // chrominance + { + // pixel coordinates + bx <<= 3; + by <<= 3; + // frame DCT coding + rfp = curr[cc] + mp4_state->chrom_width * by + bx; + iincr = mp4_state->chrom_width; + } + /*** + for (int i = 0; i < 8; i++) + { + rfp[0] = clp[bp[0] + rfp[0]]; + rfp[1] = clp[bp[1] + rfp[1]]; + rfp[2] = clp[bp[2] + rfp[2]]; + rfp[3] = clp[bp[3] + rfp[3]]; + rfp[4] = clp[bp[4] + rfp[4]]; + rfp[5] = clp[bp[5] + rfp[5]]; + rfp[6] = clp[bp[6] + rfp[6]]; + rfp[7] = clp[bp[7] + rfp[7]]; + bp += 8; + rfp += iincr; + } + ***/ transferIDCT_add(bp, rfp, iincr); + } + + /***/ + + // int x, y: block coord + // int block block num + // int mv comp (0: x, 1: y) + // + // Purpose: compute motion vector prediction + int find_pmv (int block, int comp) + { + int p1, p2, p3; + int xin1, xin2, xin3; + int yin1, yin2, yin3; + int vec1, vec2, vec3; + + int x = mp4_state->hdr.mb_xpos; + int y = mp4_state->hdr.mb_ypos; + + if ((y == 0) && ((block == 0) || (block == 1))) + { + if ((x == 0) && (block == 0)) + return 0; + else if (block == 1) + return mp4_state->MV[comp][0][y+1][x+1]; + else // block == 0 + return mp4_state->MV[comp][1][y+1][x+1-1]; + } + else + { + // considerate border (avoid increment inside each single array index) + x++; + y++; + + switch (block) + { + case 0: + vec1 = 1; yin1 = y; xin1 = x-1; + vec2 = 2; yin2 = y-1; xin2 = x; + vec3 = 2; yin3 = y-1; xin3 = x+1; + break; + case 1: + vec1 = 0; yin1 = y; xin1 = x; + vec2 = 3; yin2 = y-1; xin2 = x; + vec3 = 2; yin3 = y-1; xin3 = x+1; + break; + case 2: + vec1 = 3; yin1 = y; xin1 = x-1; + vec2 = 0; yin2 = y; xin2 = x; + vec3 = 1; yin3 = y; xin3 = x; + break; + default: // case 3 + vec1 = 2; yin1 = y; xin1 = x; + vec2 = 0; yin2 = y; xin2 = x; + vec3 = 1; yin3 = y; xin3 = x; + break; + } + p1 = mp4_state->MV[comp][vec1][yin1][xin1]; + p2 = mp4_state->MV[comp][vec2][yin2][xin2]; + p3 = mp4_state->MV[comp][vec3][yin3][xin3]; + + // return p1 + p2 + p3 - mmax (p1, mmax (p2, p3)) - mmin (p1, mmin (p2, p3)); + return mmin(mmax(p1, p2), mmin(mmax(p2, p3), mmax(p1, p3))); + } + } + + /***/ + + void make_edge (unsigned char *frame_pic, + int edged_width, int edged_height, int edge) + { + int j; + + int width = edged_width - (2*edge); + int height = edged_height - (2*edge); + + unsigned char *p_border; + unsigned char *p_border_top, *p_border_bottom; + unsigned char *p_border_top_ref, *p_border_bottom_ref; + + // left and right edges + p_border = frame_pic; + + for (j = 0; j < height; j++) + { + unsigned char border_left = *(p_border); + unsigned char border_right = *(p_border + (width-1)); + + memset((p_border - edge), border_left, edge); + memset((p_border + width), border_right, edge); + + p_border += edged_width; + } + + // top and bottom edges + p_border_top_ref = frame_pic; + p_border_bottom_ref = frame_pic + (edged_width * (height -1)); + p_border_top = p_border_top_ref - (edge * edged_width); + p_border_bottom = p_border_bottom_ref + edged_width; + + for (j = 0; j < edge; j++) + { + memcpy(p_border_top, p_border_top_ref, width); + memcpy(p_border_bottom, p_border_bottom_ref, width); + + p_border_top += edged_width; + p_border_bottom += edged_width; + } + + // corners + { + unsigned char * p_left_corner_top = frame_pic - edge - (edge * edged_width); + unsigned char * p_right_corner_top = p_left_corner_top + edge + width; + unsigned char * p_left_corner_bottom = frame_pic + (edged_width * height) - edge; + unsigned char * p_right_corner_bottom = p_left_corner_bottom + edge + width; + + char left_corner_top = *(frame_pic); + char right_corner_top = *(frame_pic + (width-1)); + char left_corner_bottom = *(frame_pic + (edged_width * (height-1))); + char right_corner_bottom = *(frame_pic + (edged_width * (height-1)) + (width-1)); + + for (j = 0; j < edge; j++) + { + memset(p_left_corner_top, left_corner_top, edge); + memset(p_right_corner_top, right_corner_top, edge); + memset(p_left_corner_bottom, left_corner_bottom, edge); + memset(p_right_corner_bottom, right_corner_bottom, edge); + + p_left_corner_top += edged_width; + p_right_corner_top += edged_width; + p_left_corner_bottom += edged_width; + p_right_corner_bottom += edged_width; + } + } + } + + /***/ + + // Purpose: manages a one frame buffer for re-ordering frames prior to + // displaying or writing to a file + void PictureDisplay(unsigned char *bmp[], unsigned int stride, int render_flag) + { + #ifdef _DECORE + if (render_flag) + { + if (mp4_state->post_flag) + { + //printf("PictureDisplay 1\n"); + postprocess(frame_ref, mp4_state->coded_picture_width, + display_frame, mp4_state->horizontal_size, + mp4_state->horizontal_size, mp4_state->vertical_size, + &mp4_state->quant_store[1][1], (DEC_MBC+1), mp4_state->pp_options); + mp4_state->convert_yuv(display_frame[0], mp4_state->hdr.width, + display_frame[1], display_frame[2], (mp4_state->hdr.width>>1), + bmp, mp4_state->hdr.width, mp4_state->flag_invert * mp4_state->hdr.height, + stride); + //printf("PictureDisplay 2\n"); + } + else + { + //printf("PictureDisplay 3 %p\n", mp4_state->convert_yuv); + mp4_state->convert_yuv(frame_ref[0], + mp4_state->coded_picture_width, + frame_ref[1], + frame_ref[2], + (mp4_state->coded_picture_width>>1), + bmp, + mp4_state->hdr.width, + mp4_state->flag_invert * mp4_state->hdr.height, + stride); + //printf("PictureDisplay 4\n"); + } + } + #else + // output on a file + storeframe (frame_ref, mp4_state->coded_picture_width, mp4_state->vertical_size); + #endif + } diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_predict.c bcast-2000c-mf3/quicktime/decore50/mp4_predict.c *** bcast-2000c/quicktime/decore50/mp4_predict.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_predict.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,342 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_predict.c // + + #include + + #include "mp4_vars.h" + + #include "mp4_predict.h" + + /** + * + **/ + + static void rescue_predict(); + + /* + + B - C + | | + A - x + + */ + + void dc_recon(int block_num, short * dc_value) + { + if (mp4_state->hdr.prediction_type == P_VOP) { + rescue_predict(); + } + + if (block_num < 4) + { + int b_xpos = (mp4_state->hdr.mb_xpos << 1) + (block_num & 1); + int b_ypos = (mp4_state->hdr.mb_ypos << 1) + ((block_num & 2) >> 1); + int dc_pred; + + // set prediction direction + if (abs(mp4_state->coeff_pred.dc_store_lum[b_ypos+1-1][b_xpos+1-1] - + mp4_state->coeff_pred.dc_store_lum[b_ypos+1][b_xpos+1-1]) < // Fa - Fb + abs(mp4_state->coeff_pred.dc_store_lum[b_ypos+1-1][b_xpos+1-1] - + mp4_state->coeff_pred.dc_store_lum[b_ypos+1-1][b_xpos+1])) // Fb - Fc + { + mp4_state->coeff_pred.predict_dir = TOP; + dc_pred = mp4_state->coeff_pred.dc_store_lum[b_ypos+1-1][b_xpos+1]; + } + else + { + mp4_state->coeff_pred.predict_dir = LEFT; + dc_pred = mp4_state->coeff_pred.dc_store_lum[b_ypos+1][b_xpos+1-1]; + } + + (* dc_value) += _div_div(dc_pred, mp4_state->hdr.dc_scaler); + (* dc_value) *= mp4_state->hdr.dc_scaler; + + // store dc value + mp4_state->coeff_pred.dc_store_lum[b_ypos+1][b_xpos+1] = (* dc_value); + } + else // chrominance blocks + { + int b_xpos = mp4_state->hdr.mb_xpos; + int b_ypos = mp4_state->hdr.mb_ypos; + int chr_num = block_num - 4; + int dc_pred; + + // set prediction direction + if (abs(mp4_state->coeff_pred.dc_store_chr[chr_num][b_ypos+1-1][b_xpos+1-1] - + mp4_state->coeff_pred.dc_store_chr[chr_num][b_ypos+1][b_xpos+1-1]) < // Fa - Fb + abs(mp4_state->coeff_pred.dc_store_chr[chr_num][b_ypos+1-1][b_xpos+1-1] - + mp4_state->coeff_pred.dc_store_chr[chr_num][b_ypos+1-1][b_xpos+1])) // Fb - Fc + { + mp4_state->coeff_pred.predict_dir = TOP; + dc_pred = mp4_state->coeff_pred.dc_store_chr[chr_num][b_ypos+1-1][b_xpos+1]; + } + else + { + mp4_state->coeff_pred.predict_dir = LEFT; + dc_pred = mp4_state->coeff_pred.dc_store_chr[chr_num][b_ypos+1][b_xpos+1-1]; + } + + (* dc_value) += _div_div(dc_pred, mp4_state->hdr.dc_scaler); + (* dc_value) *= mp4_state->hdr.dc_scaler; + + // store dc value + mp4_state->coeff_pred.dc_store_chr[chr_num][b_ypos+1][b_xpos+1] = (* dc_value); + } + } + + /***/ + + static int saiAcLeftIndex[8] = + { + 0, 8,16,24,32,40,48,56 + }; + + void ac_recon(int block_num, short * psBlock) + { + int b_xpos, b_ypos; + int i; + + if (block_num < 4) { + b_xpos = (mp4_state->hdr.mb_xpos << 1) + (block_num & 1); + b_ypos = (mp4_state->hdr.mb_ypos << 1) + ((block_num & 2) >> 1); + } + else { + b_xpos = mp4_state->hdr.mb_xpos; + b_ypos = mp4_state->hdr.mb_ypos; + } + + // predict coefficients + if (mp4_state->hdr.ac_pred_flag) + { + if (block_num < 4) + { + if (mp4_state->coeff_pred.predict_dir == TOP) + { + for (i = 1; i < 8; i++) // [Review] index can become more efficient [0..7] + psBlock[i] += mp4_state->coeff_pred.ac_top_lum[b_ypos+1-1][b_xpos+1][i-1]; + } + else // left prediction + { + for (i = 1; i < 8; i++) + psBlock[mp4_tables->saiAcLeftIndex[i]] += mp4_state->coeff_pred.ac_left_lum[b_ypos+1][b_xpos+1-1][i-1]; + } + } + else + { + int chr_num = block_num - 4; + + if (mp4_state->coeff_pred.predict_dir == TOP) + { + for (i = 1; i < 8; i++) + psBlock[i] += mp4_state->coeff_pred.ac_top_chr[chr_num][b_ypos+1-1][b_xpos+1][i-1]; + } + else // left prediction + { + for (i = 1; i < 8; i++) + psBlock[mp4_tables->saiAcLeftIndex[i]] += mp4_state->coeff_pred.ac_left_chr[chr_num][b_ypos+1][b_xpos+1-1][i-1]; + } + } + } + } + + /***/ + + void ac_store(int block_num, short * psBlock) + { + int b_xpos, b_ypos; + int i; + + //printf("ac_store 1\n"); + // [Review] This lines of code are repeated frequently + if (block_num < 4) { + b_xpos = (mp4_state->hdr.mb_xpos << 1) + (block_num & 1); + b_ypos = (mp4_state->hdr.mb_ypos << 1) + ((block_num & 2) >> 1); + } + else { + b_xpos = mp4_state->hdr.mb_xpos; + b_ypos = mp4_state->hdr.mb_ypos; + } + //printf("ac_store 1 %d %d %d\n", block_num, b_xpos, b_ypos); + + // store coefficients + if (block_num < 4) + { + for (i = 1; i < 8; i++) { + mp4_state->coeff_pred.ac_top_lum[b_ypos+1][b_xpos+1][i-1] = psBlock[i]; + mp4_state->coeff_pred.ac_left_lum[b_ypos+1][b_xpos+1][i-1] = psBlock[mp4_tables->saiAcLeftIndex[i]]; + } + } + else + { + int chr_num = block_num - 4; + + + for (i = 1; i < 8; i++) { + //printf("ac_store 1 %d %d %d\n", chr_num, b_ypos+1, b_xpos+1); + mp4_state->coeff_pred.ac_top_chr[chr_num][b_ypos+1][b_xpos+1][i-1] = + psBlock[i]; + mp4_state->coeff_pred.ac_left_chr[chr_num][b_ypos+1][b_xpos+1][i-1] = + psBlock[mp4_tables->saiAcLeftIndex[i]]; + } + } + //printf("ac_store 2\n"); + } + + + /***/ + + #define _rescale(predict_quant, current_quant, coeff) (coeff != 0) ? \ + _div_div((coeff) * (predict_quant), (current_quant)) : 0 + + int ac_rescaling(int block_num, short * psBlock) + { + int mb_xpos = mp4_state->hdr.mb_xpos; + int mb_ypos = mp4_state->hdr.mb_ypos; + int current_quant = mp4_state->hdr.quantizer; + int predict_quant = (mp4_state->coeff_pred.predict_dir == TOP) ? + mp4_state->quant_store[mb_ypos][mb_xpos+1] : mp4_state->quant_store[mb_ypos+1][mb_xpos]; + int b_xpos, b_ypos; // index for stored coeff matrix + int i; + + if ((! mp4_state->hdr.ac_pred_flag) || (current_quant == predict_quant) || (block_num == 3)) + return 0; + + if ((mb_ypos == 0) && (mp4_state->coeff_pred.predict_dir == TOP)) + return 0; + if ((mb_xpos == 0) && (mp4_state->coeff_pred.predict_dir == LEFT)) + return 0; + if ((mb_xpos == 0) && (mb_ypos == 0)) + return 0; + + // [Review] This lines of code are repeated frequently + if (block_num < 4) { + b_xpos = (mp4_state->hdr.mb_xpos << 1) + (block_num & 1); + b_ypos = (mp4_state->hdr.mb_ypos << 1) + ((block_num & 2) >> 1); + } + else { + b_xpos = mp4_state->hdr.mb_xpos; + b_ypos = mp4_state->hdr.mb_ypos; + } + + if (mp4_state->coeff_pred.predict_dir == TOP) // rescale only if really needed + { + switch (block_num) + { + case 0: case 1: + for (i = 1; i < 8; i++) + psBlock[i] += _rescale(predict_quant, current_quant, mp4_state->coeff_pred.ac_top_lum[b_ypos][b_xpos+1][i-1]); + return 1; + break; + case 4: + for (i = 1; i < 8; i++) + psBlock[i] += _rescale(predict_quant, current_quant, mp4_state->coeff_pred.ac_top_chr[0][b_ypos][b_xpos+1][i-1]); + return 1; + break; + case 5: + for (i = 1; i < 8; i++) + psBlock[i] += _rescale(predict_quant, current_quant, mp4_state->coeff_pred.ac_top_chr[1][b_ypos][b_xpos+1][i-1]); + return 1; + break; + } + } + else + { + switch (block_num) + { + case 0: case 2: + for (i = 1; i < 8; i++) + psBlock[mp4_tables->saiAcLeftIndex[i]] += _rescale(predict_quant, current_quant, mp4_state->coeff_pred.ac_left_lum[b_ypos+1][b_xpos][i-1]); + return 1; + break; + case 4: + for (i = 1; i < 8; i++) + psBlock[mp4_tables->saiAcLeftIndex[i]] += _rescale(predict_quant, current_quant, mp4_state->coeff_pred.ac_left_chr[0][b_ypos+1][b_xpos][i-1]); + return 1; + break; + case 5: + for (i = 1; i < 8; i++) + psBlock[mp4_tables->saiAcLeftIndex[i]] += _rescale(predict_quant, current_quant, mp4_state->coeff_pred.ac_left_chr[1][b_ypos+1][b_xpos][i-1]); + return 1; + break; + } + } + + return 0; + } + + /***/ + + #define _IsIntra(mb_y, mb_x) ((mp4_state->modemap[(mb_y)+1][(mb_x)+1] == INTRA) || \ + (mp4_state->modemap[(mb_y)+1][(mb_x)+1] == INTRA_Q)) + + static void rescue_predict() + { + int mb_xpos = mp4_state->hdr.mb_xpos; + int mb_ypos = mp4_state->hdr.mb_ypos; + int i; + + if (! _IsIntra(mb_ypos-1, mb_xpos-1)) { + // rescue -A- DC value + mp4_state->coeff_pred.dc_store_lum[2*mb_ypos+1-1][2*mb_xpos+1-1] = 1024; + mp4_state->coeff_pred.dc_store_chr[0][mb_ypos+1-1][mb_xpos+1-1] = 1024; + mp4_state->coeff_pred.dc_store_chr[1][mb_ypos+1-1][mb_xpos+1-1] = 1024; + } + // left + if (! _IsIntra(mb_ypos, mb_xpos-1)) { + // rescue -B- DC values + mp4_state->coeff_pred.dc_store_lum[2*mb_ypos+1][2*mb_xpos+1-1] = 1024; + mp4_state->coeff_pred.dc_store_lum[2*mb_ypos+1+1][2*mb_xpos+1-1] = 1024; + mp4_state->coeff_pred.dc_store_chr[0][mb_ypos+1][mb_xpos+1-1] = 1024; + mp4_state->coeff_pred.dc_store_chr[1][mb_ypos+1][mb_xpos+1-1] = 1024; + // rescue -B- AC values + for(i = 0; i < 7; i++) { + mp4_state->coeff_pred.ac_left_lum[2*mb_ypos+1][2*mb_xpos+1-1][i] = 0; + mp4_state->coeff_pred.ac_left_lum[2*mb_ypos+1+1][2*mb_xpos+1-1][i] = 0; + mp4_state->coeff_pred.ac_left_chr[0][mb_ypos+1][mb_xpos+1-1][i] = 0; + mp4_state->coeff_pred.ac_left_chr[1][mb_ypos+1][mb_xpos+1-1][i] = 0; + } + } + // top + if (! _IsIntra(mb_ypos-1, mb_xpos)) { + // rescue -C- DC values + mp4_state->coeff_pred.dc_store_lum[2*mb_ypos+1-1][2*mb_xpos+1] = 1024; + mp4_state->coeff_pred.dc_store_lum[2*mb_ypos+1-1][2*mb_xpos+1+1] = 1024; + mp4_state->coeff_pred.dc_store_chr[0][mb_ypos+1-1][mb_xpos+1] = 1024; + mp4_state->coeff_pred.dc_store_chr[1][mb_ypos+1-1][mb_xpos+1] = 1024; + // rescue -C- AC values + for(i = 0; i < 7; i++) { + mp4_state->coeff_pred.ac_top_lum[2*mb_ypos+1-1][2*mb_xpos+1][i] = 0; + mp4_state->coeff_pred.ac_top_lum[2*mb_ypos+1-1][2*mb_xpos+1+1][i] = 0; + mp4_state->coeff_pred.ac_top_chr[0][mb_ypos+1-1][mb_xpos+1][i] = 0; + mp4_state->coeff_pred.ac_top_chr[1][mb_ypos+1-1][mb_xpos+1][i] = 0; + } + } + } diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_predict.h bcast-2000c-mf3/quicktime/decore50/mp4_predict.h *** bcast-2000c/quicktime/decore50/mp4_predict.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_predict.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,48 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_predict.h // + + #ifndef _MP4_PREDICT_H_ + #define _MP4_PREDICT_H_ + + #define TOP 1 + #define LEFT 0 + + #endif // _MP4_PREDICT_H_ + + /*** aritmetic operators ***/ + #define _div_div(a, b) (a>0) ? (a+(b>>1))/b : (a-(b>>1))/b + + /*** *** ***/ + + extern void dc_recon(int block_num, short * dc_value); + extern void ac_recon(int block_num, short * psBlock); + extern int ac_rescaling(int block_num, short * psBlock); + extern void ac_store(int block_num, short * psBlock); diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_recon.c bcast-2000c-mf3/quicktime/decore50/mp4_recon.c *** bcast-2000c/quicktime/decore50/mp4_recon.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_recon.c Fri Dec 7 15:33:09 2001 *************** *** 0 **** --- 1,214 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_recon.c // + + + #include "mp4_vars.h" + + #include "basic_prediction.h" + #include "timer.h" + /** + * + **/ + + void recon_comp (unsigned char *src, unsigned char *dst, + int lx, int w, int h, int x, + int y, int dx, int dy, int chroma) + { + int xint, xh, yint, yh; + unsigned char *s, *d; + + xint = dx >> 1; + xh = dx & 1; + yint = dy >> 1; + yh = dy & 1; + + /* origins */ + s = src + lx * (y + yint) + x + xint; + d = dst + lx * y + x; + + { + int mc_driver = ((w!=8)<<3) | (mp4_state->hdr.rounding_type<<2) | (yh<<1) | (xh); + + + + + + //printf("recon_comp 1 %x\n", mc_driver); + switch (mc_driver) + { + // block + // no round + case 0: case 4: + CopyBlock(s, d, lx); + break; + case 1: + CopyBlockHor(s, d, lx); + break; + case 2: + CopyBlockVer(s, d, lx); + break; + case 3: + CopyBlockHorVer(s, d, lx); + break; + // round + case 5: + CopyBlockHorRound(s, d, lx); + break; + case 6: + CopyBlockVerRound(s, d, lx); + break; + case 7: + CopyBlockHorVerRound(s, d, lx); + break; + // macroblock + // no round + case 8: case 12: + CopyMBlock(s, d, lx); + break; + case 9: + CopyMBlockHor(s, d, lx); + break; + case 10: + CopyMBlockVer(s, d, lx); + break; + case 11: + CopyMBlockHorVer(s, d, lx); + break; + // round + case 13: + CopyMBlockHorRound(s, d, lx); + break; + case 14: + CopyMBlockVerRound(s, d, lx); + break; + case 15: + CopyMBlockHorVerRound(s, d, lx); + break; + } + //printf("recon_comp 2\n"); + } + } + + + /***/ + + void divx_reconstruct (int bx, int by, int mode) + { + int w, h, lx, dx, dy, xp, yp, comp, sum; + int x, y, px, py; + unsigned char * src[3]; + start_timer(); + + x = bx + 1; + y = by + 1; + + + //printf("divx_reconstruct 1\n"); + lx = mp4_state->coded_picture_width; + + src[0] = frame_for[0]; + src[1] = frame_for[1]; + src[2] = frame_for[2]; + + //printf("divx_reconstruct 1\n"); + w = 8; + h = 8; + + //printf("divx_reconstruct 1\n"); + // Luma + px = bx << 4; + py = by << 4; + if (mode == INTER4V) + { + for (comp = 0; comp < 4; comp++) + { + dx = mp4_state->MV[0][comp][y][x]; + dy = mp4_state->MV[1][comp][y][x]; + + xp = px + ((comp & 1) << 3); + yp = py + ((comp & 2) << 2); + //printf("divx_reconstruct 1.1\n"); + + recon_comp (src[0], frame_ref[0], lx, w, h, xp, yp, dx, dy, 0); + //printf("divx_reconstruct 1.2\n"); + } + } else + { + dx = mp4_state->MV[0][0][y][x]; + dy = mp4_state->MV[1][0][y][x]; + + //printf("divx_reconstruct 1.3\n"); + recon_comp (src[0], frame_ref[0], lx, w << 1, h << 1, px, py, dx, dy, 0); + //printf("divx_reconstruct 1.4\n"); + } + + //printf("divx_reconstruct 1\n"); + // Chr + px = bx << 3; + py = by << 3; + if (mode == INTER4V) + { + sum = mp4_state->MV[0][0][y][x] + mp4_state->MV[0][1][y][x] + + mp4_state->MV[0][2][y][x] + mp4_state->MV[0][3][y][x]; + if (sum == 0) + dx = 0; + else + dx = sign (sum) * (mp4_tables->roundtab[abs (sum) % 16] + (abs (sum) / 16) * 2); + + sum = mp4_state->MV[1][0][y][x] + mp4_state->MV[1][1][y][x] + + mp4_state->MV[1][2][y][x] + mp4_state->MV[1][3][y][x]; + if (sum == 0) + dy = 0; + else + dy = sign (sum) * (mp4_tables->roundtab[abs (sum) % 16] + (abs (sum) / 16) * 2); + + } else + { + dx = mp4_state->MV[0][0][y][x]; + dy = mp4_state->MV[1][0][y][x]; + + /* chroma rounding */ + dx = (dx % 4 == 0 ? dx >> 1 : (dx >> 1) | 1); + dy = (dy % 4 == 0 ? dy >> 1 : (dy >> 1) | 1); + } + lx >>= 1; + + //printf("divx_reconstruct 1\n"); + recon_comp (src[1], frame_ref[1], lx, w, h, px, py, dx, dy, 1); + recon_comp (src[2], frame_ref[2], lx, w, h, px, py, dx, dy, 2); + + //printf("divx_reconstruct 1\n"); + stop_recon_timer(); + //printf("divx_reconstruct 2\n"); + } + + /***/ + diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_tables.c bcast-2000c-mf3/quicktime/decore50/mp4_tables.c *** bcast-2000c/quicktime/decore50/mp4_tables.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_tables.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,370 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * Jonathan White + * + * DivX Advanced Research Center + * + **/ + + #include + #include + #include + + #include "portab.h" + #include "mp4_vars.h" + + + extern unsigned int zig_zag_scan[64]; + extern unsigned int alternate_horizontal_scan[64]; + extern unsigned int alternate_vertical_scan[64]; + extern unsigned int intra_quant_matrix[64]; + extern unsigned int nonintra_quant_matrix[64]; + + + extern unsigned int msk[33]; + extern int roundtab[16]; + extern int saiAcLeftIndex[8]; + extern int DQtab[4]; + extern tab_type MCBPCtabIntra[32]; + extern tab_type MCBPCtabInter[256]; + extern tab_type CBPYtab[48]; + extern tab_type MVtab0[14]; + extern tab_type MVtab1[96]; + extern tab_type MVtab2[124]; + extern tab_type tableB16_1[112]; + extern tab_type tableB16_2[96]; + extern tab_type tableB16_3[120]; + extern tab_type tableB17_1[112]; + extern tab_type tableB17_2[96]; + extern tab_type tableB17_3[120]; + + + void save_tables(MP4_TABLES * tables) + { + // FILE * ftables; + + memcpy(tables->zig_zag_scan, zig_zag_scan, sizeof(zig_zag_scan)); + memcpy(tables->alternate_vertical_scan, alternate_vertical_scan, sizeof(alternate_vertical_scan)); + memcpy(tables->alternate_horizontal_scan, alternate_horizontal_scan, sizeof(alternate_horizontal_scan)); + memcpy(tables->intra_quant_matrix, intra_quant_matrix, sizeof(intra_quant_matrix)); + memcpy(tables->nonintra_quant_matrix, nonintra_quant_matrix, sizeof(nonintra_quant_matrix)); + memcpy(tables->msk, msk, sizeof(msk)); + memcpy(tables->roundtab, roundtab, sizeof(roundtab)); + memcpy(tables->saiAcLeftIndex, saiAcLeftIndex, sizeof( saiAcLeftIndex)); + memcpy(tables->DQtab, DQtab, sizeof( DQtab)); + memcpy(tables->MCBPCtabIntra, MCBPCtabIntra, sizeof( MCBPCtabIntra)); + memcpy(tables->MCBPCtabInter, MCBPCtabInter, sizeof( MCBPCtabInter)); + memcpy(tables->CBPYtab, CBPYtab, sizeof( CBPYtab)); + memcpy(tables->MVtab0, MVtab0, sizeof( MVtab0)); + memcpy(tables->MVtab1, MVtab1, sizeof( MVtab1)); + memcpy(tables->MVtab2, MVtab2, sizeof( MVtab2)); + memcpy(tables->tableB16_1, tableB16_1, sizeof( tableB16_1)); + memcpy(tables->tableB16_2, tableB16_2, sizeof( tableB16_2)); + memcpy(tables->tableB16_3, tableB16_3, sizeof( tableB16_3)); + memcpy(tables->tableB17_1, tableB17_1, sizeof( tableB17_1)); + memcpy(tables->tableB17_2, tableB17_2, sizeof( tableB17_2)); + memcpy(tables->tableB17_3, tableB17_3, sizeof( tableB17_3)); + + // ftables = fopen("mp4_tables.bin", "wb"); + // fwrite(tables, sizeof(char), sizeof(MP4_TABLES), ftables); + // fclose(ftables); + } + + // zig-zag scan + unsigned int zig_zag_scan[64] = + { + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 + }; + + // other scan orders + unsigned int alternate_horizontal_scan[64] = + { + 0, 1, 2, 3, 8, 9, 16, 17, + 10, 11, 4, 5, 6, 7, 15, 14, + 13, 12, 19, 18, 24, 25, 32, 33, + 26, 27, 20, 21, 22, 23, 28, 29, + 30, 31, 34, 35, 40, 41, 48, 49, + 42, 43, 36, 37, 38, 39, 44, 45, + 46, 47, 50, 51, 56, 57, 58, 59, + 52, 53, 54, 55, 60, 61, 62, 63 + }; + + unsigned int alternate_vertical_scan[64] = + { + 0, 8, 16, 24, 1, 9, 2, 10, + 17, 25, 32, 40, 48, 56, 57, 49, + 41, 33, 26, 18, 3, 11, 4, 12, + 19, 27, 34, 42, 50, 58, 35, 43, + 51, 59, 20, 28, 5, 13, 6, 14, + 21, 29, 36, 44, 52, 60, 37, 45, + 53, 61, 22, 30, 7, 15, 23, 31, + 38, 46, 54, 62, 39, 47, 55, 63 + }; + + unsigned int intra_quant_matrix[64] = + { + 8,17,18,19,21,23,25,27, + 17,18,19,21,23,25,27,28, + 20,21,22,23,24,26,28,30, + 21,22,23,24,26,28,30,32, + 22,23,24,26,28,30,32,35, + 23,24,26,28,30,32,35,38, + 25,26,28,30,32,35,38,41, + 27,28,30,32,35,38,41,45 + }; + + unsigned int nonintra_quant_matrix[64] = + { + 16,17,18,19,20,21,22,23, + 17,18,19,20,21,22,23,24, + 18,19,20,21,22,23,24,25, + 19,20,21,22,23,24,26,27, + 20,21,22,23,25,26,27,28, + 21,22,23,24,26,27,28,30, + 22,23,24,26,27,28,30,31, + 23,24,25,27,28,30,31,33 + }; + + // to mask the n least significant bits of an integer + unsigned int msk[33] = + { + 0x00000000, 0x00000001, 0x00000003, 0x00000007, + 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, + 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, + 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, + 0x0000ffff, 0x0001ffff, 0x0003ffff, 0x0007ffff, + 0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff, + 0x00ffffff, 0x01ffffff, 0x03ffffff, 0x07ffffff, + 0x0fffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, + 0xffffffff + }; + + int roundtab[16] = {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2}; + + int saiAcLeftIndex[8] = + { + 0, 8,16,24,32,40,48,56 + }; + + int DQtab[4] = { + -1, -2, 1, 2 + }; + + tab_type MCBPCtabIntra[32] = { + {-1,0}, + {20,6}, {36,6}, {52,6}, {4,4}, {4,4}, {4,4}, + {4,4}, {19,3}, {19,3}, {19,3}, {19,3}, {19,3}, + {19,3}, {19,3}, {19,3}, {35,3}, {35,3}, {35,3}, + {35,3}, {35,3}, {35,3}, {35,3}, {35,3}, {51,3}, + {51,3}, {51,3}, {51,3}, {51,3}, {51,3}, {51,3}, + {51,3}, + }; + + tab_type MCBPCtabInter[256] = { + {-1,0}, + {255,9}, {52,9}, {36,9}, {20,9}, {49,9}, {35,8}, {35,8}, {19,8}, {19,8}, + {50,8}, {50,8}, {51,7}, {51,7}, {51,7}, {51,7}, {34,7}, {34,7}, {34,7}, + {34,7}, {18,7}, {18,7}, {18,7}, {18,7}, {33,7}, {33,7}, {33,7}, {33,7}, + {17,7}, {17,7}, {17,7}, {17,7}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, + {4,6}, {4,6}, {4,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6}, + {48,6}, {48,6}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, + {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, + {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, + {16,4}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, + {2,3}, {2,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, + {1,3}, {1,3}, {1,3}, + }; + + tab_type CBPYtab[48] = + { + {-1,0}, {-1,0}, {6,6}, {9,6}, {8,5}, {8,5}, {4,5}, {4,5}, + {2,5}, {2,5}, {1,5}, {1,5}, {0,4}, {0,4}, {0,4}, {0,4}, + {12,4}, {12,4}, {12,4}, {12,4}, {10,4}, {10,4}, {10,4}, {10,4}, + {14,4}, {14,4}, {14,4}, {14,4}, {5,4}, {5,4}, {5,4}, {5,4}, + {13,4}, {13,4}, {13,4}, {13,4}, {3,4}, {3,4}, {3,4}, {3,4}, + {11,4}, {11,4}, {11,4}, {11,4}, {7,4}, {7,4}, {7,4}, {7,4}, + }; + + tab_type MVtab0[14] = + { + {3,4}, {-3,4}, {2,3}, {2,3}, {-2,3}, {-2,3}, {1,2}, {1,2}, {1,2}, {1,2}, + {-1,2}, {-1,2}, {-1,2}, {-1,2} + }; + + tab_type MVtab1[96] = + { + {12,10}, {-12,10}, {11,10}, {-11,10}, {10,9}, {10,9}, {-10,9}, {-10,9}, + {9,9}, {9,9}, {-9,9}, {-9,9}, {8,9}, {8,9}, {-8,9}, {-8,9}, {7,7}, {7,7}, + {7,7}, {7,7}, {7,7}, {7,7}, {7,7}, {7,7}, {-7,7}, {-7,7}, {-7,7}, {-7,7}, + {-7,7}, {-7,7}, {-7,7}, {-7,7}, {6,7}, {6,7}, {6,7}, {6,7}, {6,7}, {6,7}, + {6,7}, {6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, {-6,7}, + {-6,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {-5,7}, + {-5,7}, {-5,7}, {-5,7}, {-5,7}, {-5,7}, {-5,7}, {-5,7}, {4,6}, {4,6}, {4,6}, + {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, + {4,6}, {4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, + {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6}, {-4,6} + }; + + tab_type MVtab2[124] = + { + {32,12}, {-32,12}, {31,12}, {-31,12}, {30,11}, {30,11}, {-30,11}, {-30,11}, + {29,11}, {29,11}, {-29,11}, {-29,11}, {28,11}, {28,11}, {-28,11}, {-28,11}, + {27,11}, {27,11}, {-27,11}, {-27,11}, {26,11}, {26,11}, {-26,11}, {-26,11}, + {25,11}, {25,11}, {-25,11}, {-25,11}, {24,10}, {24,10}, {24,10}, {24,10}, + {-24,10}, {-24,10}, {-24,10}, {-24,10}, {23,10}, {23,10}, {23,10}, {23,10}, + {-23,10}, {-23,10}, {-23,10}, {-23,10}, {22,10}, {22,10}, {22,10}, {22,10}, + {-22,10}, {-22,10}, {-22,10}, {-22,10}, {21,10}, {21,10}, {21,10}, {21,10}, + {-21,10}, {-21,10}, {-21,10}, {-21,10}, {20,10}, {20,10}, {20,10}, {20,10}, + {-20,10}, {-20,10}, {-20,10}, {-20,10}, {19,10}, {19,10}, {19,10}, {19,10}, + {-19,10}, {-19,10}, {-19,10}, {-19,10}, {18,10}, {18,10}, {18,10}, {18,10}, + {-18,10}, {-18,10}, {-18,10}, {-18,10}, {17,10}, {17,10}, {17,10}, {17,10}, + {-17,10}, {-17,10}, {-17,10}, {-17,10}, {16,10}, {16,10}, {16,10}, {16,10}, + {-16,10}, {-16,10}, {-16,10}, {-16,10}, {15,10}, {15,10}, {15,10}, {15,10}, + {-15,10}, {-15,10}, {-15,10}, {-15,10}, {14,10}, {14,10}, {14,10}, {14,10}, + {-14,10}, {-14,10}, {-14,10}, {-14,10}, {13,10}, {13,10}, {13,10}, {13,10}, + {-13,10}, {-13,10}, {-13,10}, {-13,10} + }; + + /*** REVIEW * This tables have been automatically generated! + + // tables to decode Table B16 VLC - 112 values + + tab_type tableB16_1[112] = + { + {4353, 7}, {4289, 7}, {385, 7}, {4417, 7}, {449, 7}, {130, 7}, {67, 7}, {9, 7}, {4098, 6}, {4098, 6}, + {321, 6}, {321, 6}, {4225, 6}, {4225, 6}, {4161, 6}, {4161, 6}, {257, 6}, {257, 6}, {193, 6}, {193, 6}, + {8, 6}, {8, 6}, {7, 6}, {7, 6}, {66, 6}, {66, 6}, {6, 6}, {6, 6}, {129, 5}, {129, 5}, + {129, 5}, {129, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, {4, 5}, {4, 5}, {4, 5}, {4, 5}, + {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, + {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {65, 4}, {65, 4}, {65, 4}, {65, 4}, + {65, 4}, {65, 4}, {65, 4}, {65, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4}, + {3, 4}, {3, 4} + }; + + tab_type tableB16_2[96] = + { + {18, 10}, {17, 10}, {4993, 9}, {4993, 9}, {4929, 9}, {4929, 9}, {4865, 9}, {4865, 9}, {4801, 9}, {4801, 9}, + {4737, 9}, {4737, 9}, {4162, 9}, {4162, 9}, {4100, 9}, {4100, 9}, {769, 9}, {769, 9}, {705, 9}, {705, 9}, + {450, 9}, {450, 9}, {386, 9}, {386, 9}, {322, 9}, {322, 9}, {195, 9}, {195, 9}, {131, 9}, {131, 9}, + {70, 9}, {70, 9}, {69, 9}, {69, 9}, {16, 9}, {16, 9}, {258, 9}, {258, 9}, {15, 9}, {15, 9}, + {14, 9}, {14, 9}, {13, 9}, {13, 9}, {4609, 8}, {4609, 8}, {4609, 8}, {4609, 8}, {4545, 8}, {4545, 8}, + {4545, 8}, {4545, 8}, {4481, 8}, {4481, 8}, {4481, 8}, {4481, 8}, {4099, 8}, {4099, 8}, {4099, 8}, {4099, 8}, + {641, 8}, {641, 8}, {641, 8}, {641, 8}, {577, 8}, {577, 8}, {577, 8}, {577, 8}, {513, 8}, {513, 8}, + {513, 8}, {513, 8}, {4673, 8}, {4673, 8}, {4673, 8}, {4673, 8}, {194, 8}, {194, 8}, {194, 8}, {194, 8}, + {68, 8}, {68, 8}, {68, 8}, {68, 8}, {12, 8}, {12, 8}, {12, 8}, {12, 8}, {11, 8}, {11, 8}, + {11, 8}, {11, 8}, {10, 8}, {10, 8}, {10, 8}, {10, 8} + }; + + tab_type tableB16_3[120] = + { + {4103, 11}, {4103, 11}, {4102, 11}, {4102, 11}, {22, 11}, {22, 11}, {21, 11}, {21, 11}, {4226, 10}, {4226, 10}, + {4226, 10}, {4226, 10}, {4163, 10}, {4163, 10}, {4163, 10}, {4163, 10}, {4101, 10}, {4101, 10}, {4101, 10}, {4101, 10}, + {833, 10}, {833, 10}, {833, 10}, {833, 10}, {323, 10}, {323, 10}, {323, 10}, {323, 10}, {514, 10}, {514, 10}, + {514, 10}, {514, 10}, {259, 10}, {259, 10}, {259, 10}, {259, 10}, {196, 10}, {196, 10}, {196, 10}, {196, 10}, + {132, 10}, {132, 10}, {132, 10}, {132, 10}, {71, 10}, {71, 10}, {71, 10}, {71, 10}, {20, 10}, {20, 10}, + {20, 10}, {20, 10}, {19, 10}, {19, 10}, {19, 10}, {19, 10}, {23, 11}, {23, 11}, {24, 11}, {24, 11}, + {72, 11}, {72, 11}, {578, 11}, {578, 11}, {4290, 11}, {4290, 11}, {4354, 11}, {4354, 11}, {5057, 11}, {5057, 11}, + {5121, 11}, {5121, 11}, {25, 12}, {26, 12}, {27, 12}, {73, 12}, {387, 12}, {74, 12}, {133, 12}, {451, 12}, + {897, 12}, {4104, 12}, {4418, 12}, {4482, 12}, {5185, 12}, {5249, 12}, {5313, 12}, {5377, 12}, {7167, 7}, {7167, 7}, + {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, + {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, + {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7} + }; + + // tables to decode Table B17 VLC + + tab_type tableB17_1[112] = + { + {4225,7}, {4209,7}, {4193,7}, {4177,7}, {193,7}, {177,7}, {161,7}, {4,7}, {4161,6}, {4161,6}, + {4145,6}, {4145,6}, {4129,6}, {4129,6}, {4113,6}, {4113,6}, {145,6}, {145,6}, {129,6}, {129,6}, + {113,6}, {113,6}, {97,6}, {97,6}, {18,6}, {18,6}, {3,6}, {3,6}, {81,5}, {81,5}, + {81,5}, {81,5}, {65,5}, {65,5}, {65,5}, {65,5}, {49,5}, {49,5}, {49,5}, {49,5}, + {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {1,2}, {1,2}, + {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, + {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, + {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, + {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, + {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {33,4}, {33,4}, {33,4}, {33,4}, + {33,4}, {33,4}, {33,4}, {33,4}, {2,4}, {2,4}, {2,4}, {2,4}, {2,4}, {2,4}, + {2,4}, {2,4} + }; + + tab_type tableB17_2[96] = + { + {9,10}, {8,10}, {4481,9}, {4481,9}, {4465,9}, {4465,9}, {4449,9}, {4449,9}, {4433,9}, {4433,9}, + {4417,9}, {4417,9}, {4401,9}, {4401,9}, {4385,9}, {4385,9}, {4369,9}, {4369,9}, {4098,9}, {4098,9}, + {353,9}, {353,9}, {337,9}, {337,9}, {321,9}, {321,9}, {305,9}, {305,9}, {289,9}, {289,9}, + {273,9}, {273,9}, {257,9}, {257,9}, {241,9}, {241,9}, {66,9}, {66,9}, {50,9}, {50,9}, + {7,9}, {7,9}, {6,9}, {6,9}, {4353,8}, {4353,8}, {4353,8}, {4353,8}, {4337,8}, {4337,8}, + {4337,8}, {4337,8}, {4321,8}, {4321,8}, {4321,8}, {4321,8}, {4305,8}, {4305,8}, {4305,8}, {4305,8}, + {4289,8}, {4289,8}, {4289,8}, {4289,8}, {4273,8}, {4273,8}, {4273,8}, {4273,8}, {4257,8}, {4257,8}, + {4257,8}, {4257,8}, {4241,8}, {4241,8}, {4241,8}, {4241,8}, {225,8}, {225,8}, {225,8}, {225,8}, + {209,8}, {209,8}, {209,8}, {209,8}, {34,8}, {34,8}, {34,8}, {34,8}, {19,8}, {19,8}, + {19,8}, {19,8}, {5,8}, {5,8}, {5,8}, {5,8} + }; + + tab_type tableB17_3[120] = + { + {4114,11}, {4114,11}, {4099,11}, {4099,11}, {11,11}, {11,11}, {10,11}, {10,11}, {4545,10}, {4545,10}, + {4545,10}, {4545,10}, {4529,10}, {4529,10}, {4529,10}, {4529,10}, {4513,10}, {4513,10}, {4513,10}, {4513,10}, + {4497,10}, {4497,10}, {4497,10}, {4497,10}, {146,10}, {146,10}, {146,10}, {146,10}, {130,10}, {130,10}, + {130,10}, {130,10}, {114,10}, {114,10}, {114,10}, {114,10}, {98,10}, {98,10}, {98,10}, {98,10}, + {82,10}, {82,10}, {82,10}, {82,10}, {51,10}, {51,10}, {51,10}, {51,10}, {35,10}, {35,10}, + {35,10}, {35,10}, {20,10}, {20,10}, {20,10}, {20,10}, {12,11}, {12,11}, {21,11}, {21,11}, + {369,11}, {369,11}, {385,11}, {385,11}, {4561,11}, {4561,11}, {4577,11}, {4577,11}, {4593,11}, {4593,11}, + {4609,11}, {4609,11}, {22,12}, {36,12}, {67,12}, {83,12}, {99,12}, {162,12}, {401,12}, {417,12}, + {4625,12}, {4641,12}, {4657,12}, {4673,12}, {4689,12}, {4705,12}, {4721,12}, {4737,12}, {7167,7}, {7167,7}, + {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, + {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, + {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7} + }; + + ***/ diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_vars.c bcast-2000c-mf3/quicktime/decore50/mp4_vars.c *** bcast-2000c/quicktime/decore50/mp4_vars.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_vars.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,47 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * Jonathan White + * + * DivX Advanced Research Center + * + **/ + + #include "portab.h" + #include "mp4_vars.h" + + /** + * globals + **/ + + unsigned char *edged_ref[3]; + unsigned char *edged_for[3]; + unsigned char *frame_ref[3]; + unsigned char *frame_for[3]; + unsigned char *display_frame[3]; + MP4_STATE *mp4_state; + MP4_TABLES *mp4_tables; + MP4_STREAM *ld; + diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_vars.h bcast-2000c-mf3/quicktime/decore50/mp4_vars.h *** bcast-2000c/quicktime/decore50/mp4_vars.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_vars.h Thu Dec 13 16:16:54 2001 *************** *** 0 **** --- 1,205 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * + * DivX Advanced Research Center + * + **/ + // mp4_vars.h // + + #include "portab.h" + #include "decore.h" + + #include "mp4_header.h" + #include "mp4_vld.h" + #include "postprocess.h" + + /** + * macros + **/ + + #define mmax(a, b) ((a) > (b) ? (a) : (b)) + #define mmin(a, b) ((a) < (b) ? (a) : (b)) + #define mnint(a) ((a) < 0 ? (int)(a - 0.5) : (int)(a + 0.5)) + #define sign(a) ((a) < 0 ? -1 : 1) + #define abs(a) ((a)>0 ? (a) : -(a)) + #define sign(a) ((a) < 0 ? -1 : 1) + #define mnint(a) ((a) < 0 ? (int)(a - 0.5) : (int)(a + 0.5)) + #define _div_div(a, b) (a>0) ? (a+(b>>1))/b : (a-(b>>1))/b + + /** + * decoder struct + **/ + + typedef struct + { + // bit input + int infile; + unsigned char rdbfr[2051]; + unsigned char *rdptr; + unsigned char inbfr[16]; + int incnt; + int bitcnt; + int length; + // block data + short block[64]; + + + + + + + + + // New bitstream parser + uint64_t buf; + uint32_t pos; + unsigned char *head; + } MP4_STREAM; + + typedef struct _ac_dc + { + int dc_store_lum[2*DEC_MBR+1][2*DEC_MBC+1]; + int ac_left_lum[2*DEC_MBR+1][2*DEC_MBC+1][7]; + int ac_top_lum[2*DEC_MBR+1][2*DEC_MBC+1][7]; + + int dc_store_chr[2][DEC_MBR+1][DEC_MBC+1]; + int ac_left_chr[2][DEC_MBR+1][DEC_MBC+1][7]; + int ac_top_chr[2][DEC_MBR+1][DEC_MBC+1][7]; + + int predict_dir; + + } ac_dc; + + typedef void (* pfun_convert_yuv)(unsigned char *puc_y, int stride_y, + unsigned char *puc_u, unsigned char *puc_v, int stride_uv, + unsigned char *bmp, int width_y, int height_y, + unsigned int stride_out); + + /***/ + + typedef struct _MP4_STATE_ + { + mp4_header hdr; + + int modemap[DEC_MBR+1][DEC_MBC+2]; + int quant_store[DEC_MBR+1][DEC_MBC+1]; // [Review] + int MV[2][6][DEC_MBR+1][DEC_MBC+2]; + + ac_dc coeff_pred; + + short iclp_data[1024]; + short *iclp; + unsigned char clp_data[1024]; + unsigned char *clp; + + pfun_convert_yuv convert_yuv; + int flag_invert; + + int horizontal_size; + int vertical_size; + int mb_width; + int mb_height; + int juice_hor; + int juice_ver; + int coded_picture_width; + int coded_picture_height; + int chrom_width; + int chrom_height; + + int juice_flag; + int post_flag; + int pp_options; + + #ifndef _DECORE + char *infilename; + char * outputname; + int output_flag; + #endif + } + MP4_STATE; + + typedef struct _MP4_TABLES_ + { + unsigned int zig_zag_scan[64]; + unsigned int alternate_vertical_scan[64]; + unsigned int alternate_horizontal_scan[64]; + unsigned int intra_quant_matrix[64]; + unsigned int nonintra_quant_matrix[64]; + + unsigned int msk[33]; + + int roundtab[16]; + int saiAcLeftIndex[8]; + int DQtab[4]; + + tab_type MCBPCtabIntra[32]; + tab_type MCBPCtabInter[256]; + tab_type CBPYtab[48]; + + tab_type MVtab0[14]; + tab_type MVtab1[96]; + tab_type MVtab2[124]; + + tab_type tableB16_1[112]; + tab_type tableB16_2[96]; + tab_type tableB16_3[120]; + tab_type tableB17_1[112]; + tab_type tableB17_2[96]; + tab_type tableB17_3[120]; + } + MP4_TABLES; + + /** + * globals + **/ + + extern unsigned char *edged_ref[3], + *edged_for[3], + *frame_ref[3], + *frame_for[3], + *display_frame[3]; + + extern MP4_STATE *mp4_state; + extern MP4_TABLES *mp4_tables; + extern MP4_STREAM *ld; + + + /** + * prototypes of global functions + **/ + + int decore_init (int hor_size, int ver_size, int output_format, int time_incr, DEC_BUFFERS buffers); + int decore_frame (unsigned char *stream, int length, unsigned char *bmp[], unsigned int stride, int render_flag); + int decore_release (); + int decore_setoutput (int output_format); + void closedecoder (); + void initdecoder (DEC_BUFFERS buffers); + void save_tables (MP4_TABLES * tables); + + void idct (short *block); + void divx_reconstruct (int bx, int by, int mode); + void get_mp4picture (unsigned char *bmp[], unsigned int stride, int render_flag); + void PictureDisplay (unsigned char *bmp[], unsigned int stride, int render_flag); diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_vld.c bcast-2000c-mf3/quicktime/decore50/mp4_vld.c *** bcast-2000c/quicktime/decore50/mp4_vld.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_vld.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,381 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * Andrea Graziani + * + * DivX Advanced Research Center + * + **/ + // mp4_vld.c // + + #include + + #include "mp4_vars.h" + #include "getbits.h" + #include "mp4_vld.h" + + /** + * + **/ + + /***/ + + event_t vld_intra_dct() + { + event_t event; + tab_type *tab = (tab_type *) NULL; + int lmax, rmax; + + //printf("vld_intra_dct 1 %02x\n", showbits(12)); + tab = vldTableB16(showbits(12)); + if (!tab) { /* bad code */ + event.run = + event.level = + event.last = -1; + return event; + } + + if (tab->val != ESCAPE) { + event.run = (tab->val >> 6) & 63; + event.level = tab->val & 63; + event.last = (tab->val >> 12) & 1; + event.level = getbits(1) ? -event.level : event.level; + } else { + /* this value is escaped - see para 7.4.1.3 */ + /* assuming short_video_header == 0 */ + switch (showbits(2)) { + case 0x0 : /* Type 1 */ + case 0x1 : /* Type 1 */ + flushbits(1); + tab = vldTableB16(showbits(12)); /* use table B-16 */ + if (!tab) { /* bad code */ + event.run = + event.level = + event.last = -1; + return event; + } + event.run = (tab->val >> 6) & 63; + event.level = tab->val & 63; + event.last = (tab->val >> 12) & 1; + lmax = vldTableB19(event.last, event.run); /* use table B-19 */ + event.level += lmax; + event.level = getbits(1) ? -event.level : event.level; + break; + case 0x2 : /* Type 2 */ + flushbits(2); + tab = vldTableB16(showbits(12)); /* use table B-16 */ + if (!tab) { /* bad code */ + event.run = + event.level = + event.last = -1; + break; + } + event.run = (tab->val >> 6) & 63; + event.level = tab->val & 63; + event.last = (tab->val >> 12) & 1; + rmax = vldTableB21(event.last, event.level); /* use table B-21 */ + event.run = event.run + rmax + 1; + event.level = getbits(1) ? -event.level : event.level; + break; + case 0x3 : /* Type 3 - fixed length codes */ + flushbits(2); + event.last = getbits(1); + event.run = getbits(6); /* table B-18 */ + getbits(1); /* marker bit */ + event.level = getbits(12); /* table B-18 */ + /* sign extend level... */ + event.level = (event.level & 0x800) ? (event.level | (-1 ^ 0xfff)) : event.level; + getbits(1); /* marker bit */ + break; + } + } + + return event; + } + + /***/ + + event_t vld_inter_dct() + { + event_t event; + tab_type *tab = (tab_type *) NULL; + int lmax, rmax; + + tab = vldTableB17(showbits(12)); + if (!tab) { /* bad code */ + event.run = + event.level = + event.last = -1; + return event; + } + if (tab->val != ESCAPE) { + event.run = (tab->val >> 4) & 255; + event.level = tab->val & 15; + event.last = (tab->val >> 12) & 1; + event.level = getbits(1) ? -event.level : event.level; + } else { + /* this value is escaped - see para 7.4.1.3 */ + /* assuming short_video_header == 0 */ + int mode = showbits(2); + switch (mode) { + case 0x0 : /* Type 1 */ + case 0x1 : /* Type 1 */ + flushbits(1); + tab = vldTableB17(showbits(12)); /* use table B-17 */ + if (!tab) { /* bad code */ + event.run = + event.level = + event.last = -1; + return event; + } + event.run = (tab->val >> 4) & 255; + event.level = tab->val & 15; + event.last = (tab->val >> 12) & 1; + lmax = vldTableB20(event.last, event.run); /* use table B-20 */ + event.level += lmax; + event.level = getbits(1) ? -event.level : event.level; + break; + case 0x2 : /* Type 2 */ + flushbits(2); + tab = vldTableB17(showbits(12)); /* use table B-16 */ + if (!tab) { /* bad code */ + event.run = + event.level = + event.last = -1; + break; + } + event.run = (tab->val >> 4) & 255; + event.level = tab->val & 15; + event.last = (tab->val >> 12) & 1; + rmax = vldTableB22(event.last, event.level); /* use table B-22 */ + event.run = event.run + rmax + 1; + event.level = getbits(1) ? -event.level : event.level; + break; + case 0x3 : /* Type 3 - fixed length codes */ + flushbits(2); + event.last = getbits(1); + event.run = getbits(6); /* table B-18 */ + getbits(1); /* marker bit */ + event.level = getbits(12); /* table B-18 */ + /* sign extend level... */ + event.level = (event.level & 0x800) ? (event.level | (-1 ^ 0xfff)) : event.level; + getbits(1); /* marker bit */ + break; + } + } + + return event; + } + + /***/ + + event_t vld_event(int intraFlag) + { + if (intraFlag) { + return vld_intra_dct(); + } else { + return vld_inter_dct(); + } + } + + /***/ + + /* Table B-19 -- ESCL(a), LMAX values of intra macroblocks */ + int vldTableB19(int last, int run) { + if (!last){ /* LAST == 0 */ + if (run == 0) { + return 27; + } else if (run == 1) { + return 10; + } else if (run == 2) { + return 5; + } else if (run == 3) { + return 4; + } else if (run <= 7) { + return 3; + } else if (run <= 9) { + return 2; + } else if (run <= 14) { + return 1; + } else { /* illegal? */ + return 0; + } + } else { /* LAST == 1 */ + if (run == 0) { + return 8; + } else if (run == 1) { + return 3; + } else if (run <= 6) { + return 2; + } else if (run <= 20) { + return 1; + } else { /* illegal? */ + return 0; + } + } + } + + /***/ + + /* Table B-20 -- ESCL(b), LMAX values of inter macroblocks */ + int vldTableB20(int last, int run) { + if (!last){ /* LAST == 0 */ + if (run == 0) { + return 12; + } else if (run == 1) { + return 6; + } else if (run == 2) { + return 4; + } else if (run <= 6) { + return 3; + } else if (run <= 10) { + return 2; + } else if (run <= 26) { + return 1; + } else { /* illegal? */ + return 0; + } + } else { /* LAST == 1 */ + if (run == 0) { + return 3; + } else if (run == 1) { + return 2; + } else if (run <= 40) { + return 1; + } else { /* illegal? */ + return 0; + } + } + } + + /***/ + + /* Table B-21 -- ESCR(a), RMAX values of intra macroblocks */ + int vldTableB21(int last, int level) { + if (!last){ /* LAST == 0 */ + if (level == 1) { + return 14; + } else if (level == 2) { + return 9; + } else if (level == 3) { + return 7; + } else if (level == 4) { + return 3; + } else if (level == 5) { + return 2; + } else if (level <= 10) { + return 1; + } else if (level <= 27) { + return 0; + } else { /* illegal? */ + return 0; + } + } else { /* LAST == 1 */ + if (level == 1) { + return 20; + } else if (level == 2) { + return 6; + } else if (level == 3) { + return 1; + } else if (level <= 8) { + return 0; + } else { /* illegal? */ + return 0; + } + } + } + + /***/ + + /* Table B-22 -- ESCR(b), RMAX values of inter macroblocks */ + int vldTableB22(int last, int level) { + if (!last){ /* LAST == 0 */ + if (level == 1) { + return 26; + } else if (level == 2) { + return 10; + } else if (level == 3) { + return 6; + } else if (level == 4) { + return 2; + } else if (level <= 6) { + return 1; + } else if (level <= 12) { + return 0; + } else { /* illegal? */ + return 0; + } + } else { /* LAST == 1 */ + if (level == 1) { + return 40; + } else if (level == 2) { + return 1; + } else if (level == 3) { + return 0; + } else { /* illegal? */ + return 0; + } + } + } + + /***/ + + tab_type *vldTableB16(int code) { + tab_type *tab; + + if (code >= 512) { + tab = &(mp4_tables->tableB16_1[(code >> 5) - 16]); + } else if (code >= 128) { + tab = &(mp4_tables->tableB16_2[(code >> 2) - 32]); + } else if (code >= 8) { + tab = &(mp4_tables->tableB16_3[(code >> 0) - 8]); + } else { + /* invalid Huffman code */ + return (tab_type *) NULL; + } + flushbits(tab->len); + return tab; + } + + /***/ + + tab_type *vldTableB17(int code) { + tab_type *tab; + + if (code >= 512) { + tab = &(mp4_tables->tableB17_1[(code >> 5) - 16]); + } else if (code >= 128) { + tab = &(mp4_tables->tableB17_2[(code >> 2) - 32]); + } else if (code >= 8) { + tab = &(mp4_tables->tableB17_3[(code >> 0) - 8]); + } else { + /* invalid Huffman code */ + return (tab_type *) NULL; + } + flushbits(tab->len); + return tab; + } + + /***/ diff -C2 -r -N bcast-2000c/quicktime/decore50/mp4_vld.h bcast-2000c-mf3/quicktime/decore50/mp4_vld.h *** bcast-2000c/quicktime/decore50/mp4_vld.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/mp4_vld.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,106 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * Andrea Graziani + * + * DivX Advanced Research Center + * + **/ + // mp4_vld.h // + + #ifndef _MP4_VLD_H_ + #define _MP4_VLD_H_ + + #define ESCAPE 7167 + + /*** *** ***/ + + typedef struct { + int val, len; + } tab_type; + + /***/ + + typedef struct { + int last; + int run; + int level; + } event_t; + + /*** *** ***/ + + static tab_type tableB16_1[] = // tables to decode Table B16 VLC - 112 values + { + {4353, 7}, {4289, 7}, {385, 7}, {4417, 7}, {449, 7}, {130, 7}, {67, 7}, {9, 7}, {4098, 6}, {4098, 6}, + {321, 6}, {321, 6}, {4225, 6}, {4225, 6}, {4161, 6}, {4161, 6}, {257, 6}, {257, 6}, {193, 6}, {193, 6}, + {8, 6}, {8, 6}, {7, 6}, {7, 6}, {66, 6}, {66, 6}, {6, 6}, {6, 6}, {129, 5}, {129, 5}, + {129, 5}, {129, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, {4, 5}, {4, 5}, {4, 5}, {4, 5}, + {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, + {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {65, 4}, {65, 4}, {65, 4}, {65, 4}, + {65, 4}, {65, 4}, {65, 4}, {65, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4}, + {3, 4}, {3, 4} + }; + static tab_type tableB16_2[] = { {18, 10}, {17, 10}, {4993, 9}, {4993, 9}, {4929, 9}, {4929, 9}, {4865, 9}, {4865, 9}, {4801, 9}, {4801, 9}, {4737, 9}, {4737, 9}, {4162, 9}, {4162, 9}, {4100, 9}, {4100, 9}, {769, 9}, {769, 9}, {705, 9}, {705, 9}, {450, 9}, {450, 9}, {386, 9}, {386, 9}, {322, 9}, {322, 9}, {195, 9}, {195, 9}, {131, 9}, {131, 9}, {70, 9}, {70, 9}, {69, 9}, {69, 9}, {16, 9}, {16, 9}, {258, 9}, {258, 9}, {15, 9}, {15, 9}, {14, 9}, {14, 9}, {13, 9}, {13, 9}, {4609, 8}, {4609, 8}, {4609, 8}, {4609, 8}, {4545, 8}, {4545, 8}, {4545, 8}, {4545, 8}, {4481, 8}, {4481, 8}, {4481, 8}, {4481, 8}, {4099, 8}, {4099, 8}, {4099, 8}, {4099, 8}, {641, 8}, {641, 8}, {641, 8}, {641, 8}, {577, 8}, {577, 8}, {577, 8}, {577, 8}, {513, 8}, {513, 8}, {513, 8}, {513, 8}, {4673, 8}, {4673, 8}, {4673, 8}, {4673, 8}, {194, 8}, {194, 8}, {194, 8}, {194, 8}, {68, 8}, {68, 8}, {68, 8}, {68, 8}, {12, 8}, {12, 8}, {12, 8}, {12, 8}, {11, 8}, {11, 8}, {11, 8}, {11, 8}, {10, 8}, {10, 8}, {10, 8}, {10, 8} }; + static tab_type tableB16_3[] = { {4103, 11}, {4103, 11}, {4102, 11}, {4102, 11}, {22, 11}, {22, 11}, {21, 11}, {21, 11}, {4226, 10}, {4226, 10}, {4226, 10}, {4226, 10}, {4163, 10}, {4163, 10}, {4163, 10}, {4163, 10}, {4101, 10}, {4101, 10}, {4101, 10}, {4101, 10}, {833, 10}, {833, 10}, {833, 10}, {833, 10}, {323, 10}, {323, 10}, {323, 10}, {323, 10}, {514, 10}, {514, 10}, {514, 10}, {514, 10}, {259, 10}, {259, 10}, {259, 10}, {259, 10}, {196, 10}, {196, 10}, {196, 10}, {196, 10}, {132, 10}, {132, 10}, {132, 10}, {132, 10}, {71, 10}, {71, 10}, {71, 10}, {71, 10}, {20, 10}, {20, 10}, {20, 10}, {20, 10}, {19, 10}, {19, 10}, {19, 10}, {19, 10}, {23, 11}, {23, 11}, {24, 11}, {24, 11}, {72, 11}, {72, 11}, {578, 11}, {578, 11}, {4290, 11}, {4290, 11}, {4354, 11}, {4354, 11}, {5057, 11}, {5057, 11}, {5121, 11}, {5121, 11}, {25, 12}, {26, 12}, {27, 12}, {73, 12}, {387, 12}, {74, 12}, {133, 12}, {451, 12}, {897, 12}, {4104, 12}, {4418, 12}, {4482, 12}, {5185, 12}, {5249, 12}, {5313, 12}, {5377, 12}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7} }; + + /* tables to decode Table B17 VLC */ + static tab_type tableB17_1[] = { {4225,7}, {4209,7}, {4193,7}, {4177,7}, {193,7}, {177,7}, {161,7}, {4,7}, {4161,6}, {4161,6}, {4145,6}, {4145,6}, {4129,6}, {4129,6}, {4113,6}, {4113,6}, {145,6}, {145,6}, {129,6}, {129,6}, {113,6}, {113,6}, {97,6}, {97,6}, {18,6}, {18,6}, {3,6}, {3,6}, {81,5}, {81,5}, {81,5}, {81,5}, {65,5}, {65,5}, {65,5}, {65,5}, {49,5}, {49,5}, {49,5}, {49,5}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {33,4}, {33,4}, {33,4}, {33,4}, {33,4}, {33,4}, {33,4}, {33,4}, {2,4}, {2,4},{2,4},{2,4}, {2,4}, {2,4},{2,4},{2,4} }; + static tab_type tableB17_2[] = { {9,10}, {8,10}, {4481,9}, {4481,9}, {4465,9}, {4465,9}, {4449,9}, {4449,9}, {4433,9}, {4433,9}, {4417,9}, {4417,9}, {4401,9}, {4401,9}, {4385,9}, {4385,9}, {4369,9}, {4369,9}, {4098,9}, {4098,9}, {353,9}, {353,9}, {337,9}, {337,9}, {321,9}, {321,9}, {305,9}, {305,9}, {289,9}, {289,9}, {273,9}, {273,9}, {257,9}, {257,9}, {241,9}, {241,9}, {66,9}, {66,9}, {50,9}, {50,9}, {7,9}, {7,9}, {6,9}, {6,9}, {4353,8}, {4353,8}, {4353,8}, {4353,8}, {4337,8}, {4337,8}, {4337,8}, {4337,8}, {4321,8}, {4321,8}, {4321,8}, {4321,8}, {4305,8}, {4305,8}, {4305,8}, {4305,8}, {4289,8}, {4289,8}, {4289,8}, {4289,8}, {4273,8}, {4273,8}, {4273,8}, {4273,8}, {4257,8}, {4257,8}, {4257,8}, {4257,8}, {4241,8}, {4241,8}, {4241,8}, {4241,8}, {225,8}, {225,8}, {225,8}, {225,8}, {209,8}, {209,8}, {209,8}, {209,8}, {34,8}, {34,8}, {34,8}, {34,8}, {19,8}, {19,8}, {19,8}, {19,8}, {5,8}, {5,8}, {5,8}, {5,8}, }; + static tab_type tableB17_3[] = { {4114,11}, {4114,11}, {4099,11}, {4099,11}, {11,11}, {11,11}, {10,11}, {10,11}, {4545,10}, {4545,10}, {4545,10}, {4545,10}, {4529,10}, {4529,10}, {4529,10}, {4529,10}, {4513,10}, {4513,10}, {4513,10}, {4513,10}, {4497,10}, {4497,10}, {4497,10}, {4497,10}, {146,10}, {146,10}, {146,10}, {146,10}, {130,10}, {130,10}, {130,10}, {130,10}, {114,10}, {114,10}, {114,10}, {114,10}, {98,10}, {98,10}, {98,10}, {98,10}, {82,10}, {82,10}, {82,10}, {82,10}, {51,10}, {51,10}, {51,10}, {51,10}, {35,10}, {35,10}, {35,10}, {35,10}, {20,10}, {20,10}, {20,10}, {20,10}, {12,11}, {12,11}, {21,11}, {21,11}, {369,11}, {369,11}, {385,11}, {385,11}, {4561,11}, {4561,11}, {4577,11}, {4577,11}, {4593,11}, {4593,11}, {4609,11}, {4609,11}, {22,12}, {36,12}, {67,12}, {83,12}, {99,12}, {162,12}, {401,12}, {417,12}, {4625,12}, {4641,12}, {4657,12}, {4673,12}, {4689,12}, {4705,12}, {4721,12}, {4737,12}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, }; + + /***/ + + #endif // _MP4_VLD_H_ + + /***/ + + extern tab_type tableB16_1[]; + extern tab_type tableB16_2[]; + extern tab_type tableB16_3[]; + + extern tab_type tableB17_1[]; + extern tab_type tableB17_2[]; + extern tab_type tableB17_3[]; + + /***/ + + int vldTableB19(int last, int run); + int vldTableB20(int last, int run); + int vldTableB21(int last, int level); + int vldTableB22(int last, int level); + tab_type *vldTableB16(int code); + tab_type *vldTableB17(int code); + + /***/ + + extern event_t vld_event(int intraFlag); + extern event_t vld_intra_dct(); + extern event_t vld_inter_dct(); + + /***/ diff -C2 -r -N bcast-2000c/quicktime/decore50/portab.h bcast-2000c-mf3/quicktime/decore50/portab.h *** bcast-2000c/quicktime/decore50/portab.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/portab.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,62 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani (Ag) + * Jonathan White + * + * DivX Advanced Research Center + **/ + // portab.h // + + #ifndef _PORTAB_H_ + #define _PORTAB_H_ + + #ifdef WIN32 + + /* basic types + */ + #ifndef NULL + #ifdef __cplusplus + #define NULL 0 + #else + #define NULL ((void *)0) + #endif + #endif + + #define int8_t char + #define uint8_t unsigned char + #define int16_t short + #define uint16_t unsigned short + #define int32_t int + #define uint32_t unsigned int + #define int64_t __int64 + #define uint64_t unsigned __int64 + + #else // WIN32 + + #include + + #endif + + #endif // _PORTAB_H_ diff -C2 -r -N bcast-2000c/quicktime/decore50/postprocess.c bcast-2000c-mf3/quicktime/decore50/postprocess.c *** bcast-2000c/quicktime/decore50/postprocess.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/postprocess.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,814 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + **/ + // postprocess.c // + + /* Currently this contains only the deblocking filter. The vertical */ + /* deblocking filter operates over eight pixel-wide columns at once. The */ + /* horizontal deblocking filter works on four horizontals row at a time. */ + + + #include "postprocess.h" + + #ifdef PP_SELF_CHECK + #include + #endif + + + #define ABS(a) ( (a)>0 ? (a) : -(a) ) + #define SIGN(a) ( (a)<0 ? -1 : 1 ) + #define MIN(a, b) ( (a)<(b) ? (a) : (b) ) + #define MAX(a, b) ( (a)>(b) ? (a) : (b) ) + + + + + /***** H O R I Z O N T A L D E B L O C K I N G F I L T E R *****/ + + + + /* decide DC mode or default mode for the horizontal filter */ + static int deblock_horiz_useDC(uint8_t *v, int stride) { + int eq_cnt, useDC; + int x, y; + #ifdef PP_SELF_CHECK + int eq_cnt2, j, k; + #endif + + eq_cnt = 0; + for (y=0; y<4; y++) { + for (x=1; x<=7; x++) { + if (ABS(v[x+y*stride]-v[1+x+y*stride]) <= 1) eq_cnt--; + } + } + + #ifdef PP_SELF_CHECK + eq_cnt2 = 0; + for (k=0; k<4; k++) { + for (j=1; j<=7; j++) { + if (ABS(v[j+k*stride]-v[1+j+k*stride]) <= 1) eq_cnt2--; + } + } + if (eq_cnt2 != eq_cnt) printf("ERROR: C version of useDC is incorrect\n"); + #endif + + useDC = eq_cnt <= -DEBLOCK_HORIZ_USEDC_THR; + + return useDC; + } + + + /* decide whether the DC filter should be turned on accoding to QP */ + static int deblock_horiz_DC_on(uint8_t *v, int stride, int QP) { + /* 99% of the time, this test turns out the same as the |max-min| strategy in the standard */ + return (ABS(v[1]-v[8]) < 2*QP); + } + + + + + + /* The 9-tap low pass filter used in "DC" regions */ + static void deblock_horiz_lpf9(uint8_t *v, int stride, int QP) { + int x, y, p1, p2, psum; + uint8_t *vv, vnew[9]; + #ifdef PP_SELF_CHECK + uint8_t selfcheck[9]; + int psum2; + uint8_t *vv2; + #endif + + for (y=0; y<4; y++) { + p1 = (ABS(v[0+y*stride]-v[1+y*stride]) < QP ) ? v[0+y*stride] : v[1+y*stride]; + p2 = (ABS(v[8+y*stride]-v[9+y*stride]) < QP ) ? v[9+y*stride] : v[8+y*stride]; + + + #ifdef PP_SELF_CHECK + /* generate a self-check version of the filter result in selfcheck[9] */ + /* low pass filtering (LPF9: 1 1 2 2 4 2 2 1 1) */ + vv2 = &(v[y*stride]); + psum2 = p1 + p1 + p1 + vv2[1] + vv2[2] + vv2[3] + vv2[4] + 4; + selfcheck[1] = (((psum2 + vv2[1]) << 1) - (vv2[4] - vv2[5])) >> 4; + psum2 += vv2[5] - p1; + selfcheck[2] = (((psum2 + vv2[2]) << 1) - (vv2[5] - vv2[6])) >> 4; + psum2 += vv2[6] - p1; + selfcheck[3] = (((psum2 + vv2[3]) << 1) - (vv2[6] - vv2[7])) >> 4; + psum2 += vv2[7] - p1; + selfcheck[4] = (((psum2 + vv2[4]) << 1) + p1 - vv2[1] - (vv2[7] - vv2[8])) >> 4; + psum2 += vv2[8] - vv2[1]; + selfcheck[5] = (((psum2 + vv2[5]) << 1) + (vv2[1] - vv2[2]) - vv2[8] + p2) >> 4; + psum2 += p2 - vv2[2]; + selfcheck[6] = (((psum2 + vv2[6]) << 1) + (vv2[2] - vv2[3])) >> 4; + psum2 += p2 - vv2[3]; + selfcheck[7] = (((psum2 + vv2[7]) << 1) + (vv2[3] - vv2[4])) >> 4; + psum2 += p2 - vv2[4]; + selfcheck[8] = (((psum2 + vv2[8]) << 1) + (vv2[4] - vv2[5])) >> 4; + #endif + + /* C implementation of horizontal LPF */ + vv = &(v[y*stride]); + psum = p1 + p1 + p1 + vv[1] + vv[2] + vv[3] + vv[4] + 4; + vnew[1] = (((psum + vv[1]) << 1) - (vv[4] - vv[5])) >> 4; + psum += vv[5] - p1; + vnew[2] = (((psum + vv[2]) << 1) - (vv[5] - vv[6])) >> 4; + psum += vv[6] - p1; + vnew[3] = (((psum + vv[3]) << 1) - (vv[6] - vv[7])) >> 4; + psum += vv[7] - p1; + vnew[4] = (((psum + vv[4]) << 1) + p1 - vv[1] - (vv[7] - vv[8])) >> 4; + psum += vv[8] - vv[1]; + vnew[5] = (((psum + vv[5]) << 1) + (vv[1] - vv[2]) - vv[8] + p2) >> 4; + psum += p2 - vv[2]; + vnew[6] = (((psum + vv[6]) << 1) + (vv[2] - vv[3])) >> 4; + psum += p2 - vv[3]; + vnew[7] = (((psum + vv[7]) << 1) + (vv[3] - vv[4])) >> 4; + psum += p2 - vv[4]; + vnew[8] = (((psum + vv[8]) << 1) + (vv[4] - vv[5])) >> 4; + for (x=1; x<=8; x++) { + vv[x] = vnew[x]; + } + + #ifdef PP_SELF_CHECK + for (x=1; x<=8; x++) { + if (selfcheck[x] != v[x+y*stride]) printf("ERROR: C version of horiz lpf9 is incorrect\n"); + } + #endif + + } + + } + + + + + + /* horizontal deblocking filter used in default (non-DC) mode */ + static void deblock_horiz_default_filter(uint8_t *v, int stride, int QP) { + int a3_0, a3_1, a3_2, d; + int q1, q; + int y; + + for (y=0; y<4; y++) { + + q1 = v[4] - v[5]; + q = q1 / 2; + if (q) { + + a3_0 = 2*(v[3]-v[6]) - 5*q1; + + /* apply the 'delta' function first and check there is a difference to avoid wasting time */ + if (ABS(a3_0) < 8*QP) { + + a3_1 = 2*(v[1]-v[4]) + 5*(v[3]-v[2]); + a3_2 = 2*(v[5]-v[8]) + 5*(v[7]-v[8]); + d = ABS(a3_0) - MIN(ABS(a3_1), ABS(a3_2)); + + if (d > 0) { /* energy across boundary is greater than in one or both of the blocks */ + d += d<<2; + d = (d + 32) >> 6; + + if (d > 0) { + + d *= SIGN(-a3_0); + + /* clip d in the range 0 ... q */ + if (q > 0) { + d = d<0 ? 0 : d; + d = d>q ? q : d; + } else { + d = d>0 ? 0 : d; + d = d DEBLOCK_VERT_USEDC_THR); + #endif + + /* C-code imlementation of vertial useDC */ + eq_cnt = 0; + for (y=1; y<8; y++) { + for (x=0; x<8; x++) { + if (ABS(v[y*stride+x] - v[(y+1)*stride+x]) <= 1) eq_cnt++; + } + } + useDC = (eq_cnt > DEBLOCK_VERT_USEDC_THR); + + #ifdef PP_SELF_CHECK + if (useDC != useDC2) printf("ERROR: C version of useDC is incorrect\n"); + #endif + + return useDC; + } + + + + + + /* decide whether the DC filter should be turned on accoding to QP */ + static int deblock_vert_DC_on(uint8_t *v, int stride, int QP) { + int DC_on, x; + #ifdef PP_SELF_CHECK + int i, DC_on2; + #endif + + #ifdef PP_SELF_CHECK + DC_on2 = 1; + for (i=0; i<8; i++) { + if (ABS(v[i+1*stride]-v[i+8*stride]) > 2 *QP) DC_on2 = 0; + } + #endif + + /* C implementation of vertical DC_on */ + DC_on = 1; + for (x=0; x<8; x++) { + if (ABS(v[x+1*stride]-v[x+8*stride]) > 2 *QP) DC_on = 0; + } + + #ifdef PP_SELF_CHECK + if (DC_on != DC_on2) printf("ERROR: C version of DC_on is incorrect\n"); + #endif + + return DC_on; + } + + + + + + + + /* Vertical 9-tap low-pass filter for use in "DC" regions of the picture */ + void deblock_vert_lpf9(uint64_t *v_local, uint64_t *p1p2, uint8_t *v, int stride, int QP) { + int x, y; + int p1, p2, psum; + uint8_t *vv, vnew[9]; + /* define semi-constants to enable us to move up and down the picture easily... */ + int l1 = 1 * stride; + int l2 = 2 * stride; + int l3 = 3 * stride; + int l4 = 4 * stride; + int l5 = 5 * stride; + int l6 = 6 * stride; + int l7 = 7 * stride; + int l8 = 8 * stride; + #ifdef PP_SELF_CHECK + int j, k; + uint8_t selfcheck[64]; + #endif + + + #ifdef PP_SELF_CHECK + /* generate a self-check version of the filter result in selfcheck[64] */ + for (j=0; j<8; j++) { /* loop left->right */ + vv = &(v[j]); + p1 = (ABS(vv[0*stride]-vv[1*stride]) < QP ) ? vv[0*stride] : vv[1*stride]; + p2 = (ABS(vv[8*stride]-vv[9*stride]) < QP ) ? vv[9*stride] : vv[8*stride]; + /* the above may well be endian-fussy */ + psum = p1 + p1 + p1 + vv[l1] + vv[l2] + vv[l3] + vv[l4] + 4; + selfcheck[j+8*0] = (((psum + vv[l1]) << 1) - (vv[l4] - vv[l5])) >> 4; + psum += vv[l5] - p1; + selfcheck[j+8*1] = (((psum + vv[l2]) << 1) - (vv[l5] - vv[l6])) >> 4; + psum += vv[l6] - p1; + selfcheck[j+8*2] = (((psum + vv[l3]) << 1) - (vv[l6] - vv[l7])) >> 4; + psum += vv[l7] - p1; + selfcheck[j+8*3] = (((psum + vv[l4]) << 1) + p1 - vv[l1] - (vv[l7] - vv[l8])) >> 4; + psum += vv[l8] - vv[l1]; + selfcheck[j+8*4] = (((psum + vv[l5]) << 1) + (vv[l1] - vv[l2]) - vv[l8] + p2) >> 4; + psum += p2 - vv[l2]; + selfcheck[j+8*5] = (((psum + vv[l6]) << 1) + (vv[l2] - vv[l3])) >> 4; + psum += p2 - vv[l3]; + selfcheck[j+8*6] = (((psum + vv[l7]) << 1) + (vv[l3] - vv[l4])) >> 4; + psum += p2 - vv[l4]; + selfcheck[j+8*7] = (((psum + vv[l8]) << 1) + (vv[l4] - vv[l5])) >> 4; + } + #endif + + /* simple C implementation of vertical default filter */ + for (x=0; x<8; x++) { /* loop left->right */ + vv = &(v[x]); + p1 = (ABS(vv[0*stride]-vv[1*stride]) < QP ) ? vv[0*stride] : vv[1*stride]; + p2 = (ABS(vv[8*stride]-vv[9*stride]) < QP ) ? vv[9*stride] : vv[8*stride]; + /* the above may well be endian-fussy */ + psum = p1 + p1 + p1 + vv[l1] + vv[l2] + vv[l3] + vv[l4] + 4; + vnew[1] = (((psum + vv[l1]) << 1) - (vv[l4] - vv[l5])) >> 4; + psum += vv[l5] - p1; + vnew[2] = (((psum + vv[l2]) << 1) - (vv[l5] - vv[l6])) >> 4; + psum += vv[l6] - p1; + vnew[3] = (((psum + vv[l3]) << 1) - (vv[l6] - vv[l7])) >> 4; + psum += vv[l7] - p1; + vnew[4] = (((psum + vv[l4]) << 1) + p1 - vv[l1] - (vv[l7] - vv[l8])) >> 4; + psum += vv[l8] - vv[l1]; + vnew[5] = (((psum + vv[l5]) << 1) + (vv[l1] - vv[l2]) - vv[l8] + p2) >> 4; + psum += p2 - vv[l2]; + vnew[6] = (((psum + vv[l6]) << 1) + (vv[l2] - vv[l3])) >> 4; + psum += p2 - vv[l3]; + vnew[7] = (((psum + vv[l7]) << 1) + (vv[l3] - vv[l4])) >> 4; + psum += p2 - vv[l4]; + vnew[8] = (((psum + vv[l8]) << 1) + (vv[l4] - vv[l5])) >> 4; + for (y=1; y<=8; y++) { + vv[y*stride] = vnew[y]; + } + } + + #ifdef PP_SELF_CHECK + /* use the self-check version of the filter result in selfcheck[64] to verify the filter output */ + for (k=0; k<8; k++) { /* loop top->bottom */ + for (j=0; j<8; j++) { /* loop left->right */ + if (v[(k+1)*stride + j] != selfcheck[j+8*k]) printf("ERROR: problem with C filter in row %d\n", k+1); + } + } + #endif + + } + + + + + /* Vertical deblocking filter for use in non-flat picture regions */ + static void deblock_vert_default_filter(uint8_t *v, int stride, int QP) { + int x, a3_0, a3_1, a3_2, d, q; + /* define semi-constants to enable us to move up and down the picture easily... */ + int l1 = 1 * stride; + int l2 = 2 * stride; + int l3 = 3 * stride; + int l4 = 4 * stride; + int l5 = 5 * stride; + int l6 = 6 * stride; + int l7 = 7 * stride; + int l8 = 8 * stride; + + #ifdef PP_SELF_CHECK + int j, k, a3_0_SC, a3_1_SC, a3_2_SC, d_SC, q_SC; + uint8_t selfcheck[8][2]; + #endif + + #ifdef PP_SELF_CHECK + /* compute selfcheck matrix for later comparison */ + for (j=0; j<8; j++) { + a3_0_SC = 2*v[l3+j] - 5*v[l4+j] + 5*v[l5+j] - 2*v[l6+j]; + a3_1_SC = 2*v[l1+j] - 5*v[l2+j] + 5*v[l3+j] - 2*v[l4+j]; + a3_2_SC = 2*v[l5+j] - 5*v[l6+j] + 5*v[l7+j] - 2*v[l8+j]; + q_SC = (v[l4+j] - v[l5+j]) / 2; + + if (ABS(a3_0_SC) < 8*QP) { + + d_SC = ABS(a3_0_SC) - MIN(ABS(a3_1_SC), ABS(a3_2_SC)); + if (d_SC < 0) d_SC=0; + + d_SC = (5*d_SC + 32) >> 6; + d_SC *= SIGN(-a3_0_SC); + + //printf("d_SC[%d] preclip=%d\n", j, d_SC); + /* clip d in the range 0 ... q */ + if (q_SC > 0) { + d_SC = d_SC<0 ? 0 : d_SC; + d_SC = d_SC>q_SC ? q_SC : d_SC; + } else { + d_SC = d_SC>0 ? 0 : d_SC; + d_SC = d_SC> 6; + d *= SIGN(-a3_0); + + //printf("d[%d] preclip=%d\n", x, d); + /* clip d in the range 0 ... q */ + if (q > 0) { + d = d<0 ? 0 : d; + d = d>q ? q : d; + } else { + d = d>0 ? 0 : d; + d = d max ? b8x8[stride*v + h] : max; + } + } + /* Threshold detirmination - compute threshold and dynamic range */ + thr = (max + min + 1) / 2; + range = max - min; + + /* Threshold rearrangement not implemented yet */ + + /* Index aquisition */ + for (j=0; j<10; j++) { + indicesP[j] = 0; + for (i=0; i<10; i++) { + if (b10x10[j*stride+i] >= thr) indicesP[j] |= (2 << i); + } + indicesN[j] = ~indicesP[j]; + } + + /* Adaptive filtering */ + /* need to identify 3x3 blocks of '1's in indicesP and indicesN */ + for (j=0; j<10; j++) { + indicesP[j] = (indicesP[j]<<1) & indicesP[j] & (indicesP[j]>>1); + indicesN[j] = (indicesN[j]<<1) & indicesN[j] & (indicesN[j]>>1); + } + for (j=1; j<9; j++) { + indices3x3[j-1] = indicesP[j-1] & indicesP[j] & indicesP[j+1]; + indices3x3[j-1] |= indicesN[j-1] & indicesN[j] & indicesN[j+1]; + } + + for (v=0; v<8; v++) { + sr = 4; + for (h=0; h<8; h++) { + if (indices3x3[v] & sr) { + b8x8filtered[8*v + h] = ( 8 + + 1 * b10x10[stride*(v+0) + (h+0)] + 2 * b10x10[stride*(v+0) + (h+1)] + 1 * b10x10[stride*(v+0) + (h+2)] + + 2 * b10x10[stride*(v+1) + (h+0)] + 4 * b10x10[stride*(v+1) + (h+1)] + 2 * b10x10[stride*(v+1) + (h+2)] + + 1 * b10x10[stride*(v+2) + (h+0)] + 2 * b10x10[stride*(v+2) + (h+1)] + 1 * b10x10[stride*(v+2) + (h+2)] + ) / 16; + } + sr <<= 1; + } + } + + /* Clipping */ + max_diff = QP/2; + for (v=0; v<8; v++) { + sr = 4; + for (h=0; h<8; h++) { + if (indices3x3[v] & sr) { + if (b8x8filtered[8*v + h] - b8x8[stride*v + h] > max_diff) { + b8x8[stride*v + h] = b8x8[stride*v + h] + max_diff; + } else if (b8x8filtered[8*v + h] - b8x8[stride*v + h] < -max_diff) { + b8x8[stride*v + h] = b8x8[stride*v + h] - max_diff; + } else { + b8x8[stride*v + h] = b8x8filtered[8*v + h]; + } + } + sr <<= 1; + } + } + + } + } + + + } + + + + + + /* This function is more or less what Andrea wanted: */ + void postprocess(unsigned char * src[], int src_stride, + unsigned char * dst[], int dst_stride, + int horizontal_size, int vertical_size, + QP_STORE_T *QP_store, int QP_stride, + int mode) { + + uint8_t *Y, *U, *V; + int x, y; + + if (!(mode & PP_DONT_COPY)) { + /* First copy source to destination... */ + /* luma */ + for (y=0; y + **/ + // postprocess.h // + + /* Currently this contains only the deblocking filter. The vertial */ + /* deblocking filter operates over eight pixel-wide columns at once. The */ + /* horizontal deblocking filter works on four horizontals row at a time. */ + + /* Picture height must be multiple of 8, width a multiple of 16 */ + + + + #ifndef POSTPROCESS_H + #define POSTPROCESS_H + + + + #include "portab.h" + + + /**** Compile-time options ****/ + + /* the following parameters allow for some tuning of the postprocessor */ + #define DEBLOCK_HORIZ_USEDC_THR (28 - 8) + #define DEBLOCK_VERT_USEDC_THR (56 - 16) + + /* SHOWDECISIONS(_H/_V) enables you to see where the deblocking filter has used DC filtering (black) and default filtering (white) */ + //#define SHOWDECISIONS_H + //#define SHOWDECISIONS_V + + /* When defined, PP_SELF_CHECK causes the postfilter to double check every */ + /* computation it makes. For development use. */ + //#define PP_SELF_CHECK + + /* Type to use for QP. This may depend on the decoder's QP store implementation */ + //#define TSINGHUA + + #define QP_STORE_T int + + #ifdef TSINGHUA + #define QP_STORE_T int16_t + #endif + + /*** decore parameter mask ***/ + #define PP_DEBLOCK_Y_H_MASK 0x00ff0000 + #define PP_DEBLOCK_Y_V_MASK 0x0000ff00 + #define PP_DERING_Y_MASK 0x000000ff + + /**** Function prototype - entry point for postprocessing ****/ + void postprocess(unsigned char * src[], int src_stride, + unsigned char * dst[], int dst_stride, + int horizontal_size, int vertical_size, + QP_STORE_T *QP_store, int QP_stride, + int mode); + + /**** mode flags to control postprocessing actions ****/ + #define PP_DEBLOCK_Y_H 0x00000001 /* Luma horizontal deblocking */ + #define PP_DEBLOCK_Y_V 0x00000002 /* Luma vertical deblocking */ + #define PP_DEBLOCK_C_H 0x00000004 /* Chroma horizontal deblocking */ + #define PP_DEBLOCK_C_V 0x00000008 /* Chroma vertical deblocking */ + #define PP_DERING_Y 0x00000010 /* Luma deringing */ + #define PP_DERING_C 0x00000020 /* Chroma deringing */ + #define PP_DONT_COPY 0x10000000 /* Postprocessor will not copy src -> dst */ + /* instead, it will operate on dst only */ + + + + + + #endif diff -C2 -r -N bcast-2000c/quicktime/decore50/store.c bcast-2000c-mf3/quicktime/decore50/store.c *** bcast-2000c/quicktime/decore50/store.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/store.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,100 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani + * + * DivX Advanced Research Center + * + **/ + // store.c // + + #include + #include + #include + + #include "mp4_vars.h" + + #include "debug.h" + #include "store.h" + + /** + * + **/ + + static void store_yuv (char *name, unsigned char *src, int offset, int incr, int width, int height); + static void putbyte (int c); + + /**/ + + FILE * outfile; + int create_flag = 1; + const char mode_create[] = "wb"; + const char mode_open[] = "ab"; + + /***/ + + // Purpose: store a frame in yuv format + void storeframe (unsigned char *src[], int width, int height) + { + int offset = 0; + int hor_size = mp4_state->horizontal_size; + + store_yuv (mp4_state->outputname, src[0], offset, width, hor_size, height); + + offset >>= 1; + width >>= 1; + height >>= 1; + hor_size >>= 1; + + store_yuv (mp4_state->outputname, src[1], offset, width, hor_size, height); + store_yuv (mp4_state->outputname, src[2], offset, width, hor_size, height); + } + + /***/ + + static void store_yuv (char *name, unsigned char *src, int offset, + int incr, int width, int height) + { + int i; + unsigned char *p; + const char * mode = create_flag ? mode_create : mode_open; + + + if (create_flag) + create_flag = 0; + + if ((outfile = fopen (name, mode)) == NULL) + { + _Print ("Error: Couldn't append to %s\n", name); + exit(0); + } + + for (i = 0; i < height; i++) + { + p = src + offset + incr * i; + fwrite(p, width, 1, outfile); + } + + fclose (outfile); + } diff -C2 -r -N bcast-2000c/quicktime/decore50/store.h bcast-2000c-mf3/quicktime/decore50/store.h *** bcast-2000c/quicktime/decore50/store.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/store.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,39 ---- + /************************************************************************** + * * + * This code has been developed by Andrea Graziani. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Andrea Graziani + * + * DivX Advanced Research Center + * + **/ + // store.h // + + #ifndef _STORE_H_ + #define _STORE_H_ + + #endif // _STORE_H_ + + /*** *** ***/ + + extern void storeframe (unsigned char *src[], int xsize, int ysize); diff -C2 -r -N bcast-2000c/quicktime/decore50/timer.h bcast-2000c-mf3/quicktime/decore50/timer.h *** bcast-2000c/quicktime/decore50/timer.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/timer.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,80 ---- + /************************************************************************** + * * + * This code has been developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advanced Research Center + * + **/ + #ifndef _DECORE_TIMER_H + #define _DECORE_TIMER_H + + #if (defined(LINUX) && defined(PROFILING)) + + #include "portab.h" + struct timer + { + int64_t dct_times; + int64_t vld_times; + int64_t iquant_times; + int64_t edge_times; + int64_t display_times; + int64_t recon_times; + int64_t transfer_times; + int64_t block_times; + int64_t current; + }; + extern struct timer tim; + #ifdef __cplusplus + extern "C" { + #endif + extern void start_timer(); + extern void stop_dct_timer(); + extern void stop_vld_timer(); + extern void stop_iquant_timer(); + extern void stop_edge_timer(); + extern void stop_display_timer(); + extern void stop_recon_timer(); + extern void stop_transfer_timer(); + extern void stop_block_timer(); + extern void clear_timer(); + extern void write_timer(); + #ifdef __cplusplus + }; + #endif + + #else + static __inline void start_timer(){} + static __inline void stop_dct_timer(){} + static __inline void stop_vld_timer(){} + static __inline void stop_iquant_timer(){} + static __inline void stop_edge_timer(){} + static __inline void stop_display_timer(){} + static __inline void stop_recon_timer(){} + static __inline void stop_block_timer(){} + static __inline void clear_timer(){} + static __inline void write_timer(){} + #endif /* LINUX */ + + #endif /* _DECORE_TIMER_H */ diff -C2 -r -N bcast-2000c/quicktime/decore50/transferidct.c bcast-2000c-mf3/quicktime/decore50/transferidct.c *** bcast-2000c/quicktime/decore50/transferidct.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/transferidct.c Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,71 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + **/ + // transferIDCT.c // + + /* C version to be optimised */ + + /* Functions to add or copy the result of the iDCT into the output */ + /* frame buffer. The "clear block" function could be absorbed into this */ + /* loop (set *ouputPtr = 0 after the copy/add). */ + + + #include "portab.h" + + void transferIDCT_add(int16_t *sourceS16, uint8_t *destU8, int stride) { + int x, y; + + stride -= 8; + for (y=0; y<8; y++) { + for (x=0; x<8; x++) { + #define SUM16 (*(destU8) + *(sourceS16)) + if (SUM16 > 255) *(destU8) = 255; + else if (SUM16 < 0) *(destU8) = 0; + else *(destU8) = SUM16; + sourceS16++; + destU8++; + } + destU8 += stride; + } + } + + void transferIDCT_copy(int16_t *sourceS16, uint8_t *destU8, int stride) { + int x, y; + + stride -= 8; + for (y=0; y<8; y++) { + for (x=0; x<8; x++) { + if (*(sourceS16) > 255) *(destU8) = 255; + else if (*(sourceS16) < 0) *(destU8) = 0; + else *(destU8) = (unsigned char) *(sourceS16); + sourceS16++; + destU8++; + } + destU8 += stride; + } + } diff -C2 -r -N bcast-2000c/quicktime/decore50/transferidct.h bcast-2000c-mf3/quicktime/decore50/transferidct.h *** bcast-2000c/quicktime/decore50/transferidct.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/transferidct.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,38 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * + * DivX Advanced Research Center + **/ + // transferIDCT.h // + + /* Functions to add or copy the result of the iDCT into the output */ + /* frame buffer. The "clear block" function could be absorbed into this */ + /* loop (set *ouputPtr = 0 after the copy/add). */ + + #include "portab.h" + + void transferIDCT_add(int16_t *sourceS16, uint8_t *destU8, int stride); + void transferIDCT_copy(int16_t *sourceS16, uint8_t *destU8, int stride); diff -C2 -r -N bcast-2000c/quicktime/decore50/yuv2rgb.c bcast-2000c-mf3/quicktime/decore50/yuv2rgb.c *** bcast-2000c/quicktime/decore50/yuv2rgb.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/decore50/yuv2rgb.c Thu Dec 13 16:14:07 2001 *************** *** 0 **** --- 1,553 ---- + /************************************************************************** + * * + * This code has been developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php * + * * + **************************************************************************/ + /** + * Copyright (C) 2001 - Project Mayo + * + * John Funnell + * Andrea Graziani + * + * DivX Advanced Research Center + * + **/ + // yuv2rgb.c // + + #include + + #include "portab.h" + #include "yuv2rgb.h" + + /** + * + **/ + + + void (*convert_yuv)(unsigned char *puc_y, int stride_y, + unsigned char *puc_u, unsigned char *puc_v, int stride_uv, + unsigned char *bmp[], int width_y, int height_y, + unsigned int stride_out); + + /** + * + **/ + + /*** + + / 2568 0 3343 \ + | 2568 -0c92 -1a1e | / 65536 * 8 + \ 2568 40cf 0 / + + Y -= 16; + U -= 128; + V -= 128; + + R = (0x2568*Y + 0x0000*V + 0x3343*U) / 0x2000; + G = (0x2568*Y - 0x0c92*V - 0x1a1e*U) / 0x2000; + B = (0x2568*Y + 0x40cf*V + 0x0000*U) / 0x2000; + + R = R>255 ? 255 : R; + R = R<0 ? 0 : R; + + G = G>255 ? 255 : G; + G = G<0 ? 0 : G; + + B = B>255 ? 255 : B; + B = B<0 ? 0 : B; + + ***/ + + #define _S(a) (a)>255 ? 255 : (a)<0 ? 0 : (a) + + #define _R(y,u,v) (0x2568*(y) + 0x3343*(u)) /0x2000 + #define _G(y,u,v) (0x2568*(y) - 0x0c92*(v) - 0x1a1e*(u)) /0x2000 + #define _B(y,u,v) (0x2568*(y) + 0x40cf*(v)) /0x2000 + + struct lookuptable + { + int32_t m_plY[256]; + int32_t m_plRV[256]; + int32_t m_plGV[256]; + int32_t m_plGU[256]; + int32_t m_plBU[256]; + }; + static struct lookuptable lut; + void init_yuv2rgb() + { + int i; + for(i=0; i<256; i++) + { + if(i>=16) + if(i>240) + lut.m_plY[i]=lut.m_plY[240]; + else + lut.m_plY[i]=298*(i-16); + else + lut.m_plY[i]=0; + if((i>=16) && (i<=240)) + { + lut.m_plRV[i]=408*(i-128); + lut.m_plGV[i]=-208*(i-128); + lut.m_plGU[i]=-100*(i-128); + lut.m_plBU[i]=517*(i-128); + } + else if(i<16) + { + lut.m_plRV[i]=408*(16-128); + lut.m_plGV[i]=-208*(16-128); + lut.m_plGU[i]=-100*(16-128); + lut.m_plBU[i]=517*(16-128); + } + else + { + lut.m_plRV[i]=lut.m_plRV[240]; + lut.m_plGV[i]=lut.m_plGV[240]; + lut.m_plGU[i]=lut.m_plGU[240]; + lut.m_plBU[i]=lut.m_plBU[240]; + } + } + } + + /* all stride values are in _pixels_ */ + + void yuv2rgb_32(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) + { + + int x, y; + int stride_diff = 4 * (_stride_out - width_y); + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + for (y=0; y>1] - 128; + v = puc_v[x>>1] - 128; + + _r = _R(y,u,v); + _g = _G(y,u,v); + _b = _B(y,u,v); + + r = _S(_r); + g = _S(_g); + b = _S(_b); + + puc_out[0] = r; + puc_out[1] = g; + puc_out[2] = b; + puc_out[3] = 0; + + puc_out+=4; + } + + puc_y += stride_y; + if (y%2) { + puc_u += stride_uv; + puc_v += stride_uv; + } + puc_out += stride_diff; + } + } + + /***/ + + // This be done more efficiently + // ( we spend almost as much time only in here + // as DivX 3.11 spends on all decoding ) + void yuv2rgb_24(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) + { + + int x, y; + int stride_diff = 6*_stride_out - 3*width_y; + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + for (y=0; y>8; \ + else \ + p[i]=(tmp >> 24) ^ 0xff; + Y=lut.m_plY[*pY]; + pY++; + PUT_COMPONENT(puc_out, R+Y, 0); + PUT_COMPONENT(puc_out, G+Y, 1); + PUT_COMPONENT(puc_out, B+Y, 2); + Y=lut.m_plY[*pY]; + pY++; + PUT_COMPONENT(puc_out, R+Y, 3); + PUT_COMPONENT(puc_out, G+Y, 4); + PUT_COMPONENT(puc_out, B+Y, 5); + Y=lut.m_plY[*pY1]; + pY1++; + PUT_COMPONENT(pOut2, R+Y, 0); + PUT_COMPONENT(pOut2, G+Y, 1); + PUT_COMPONENT(pOut2, B+Y, 2); + Y=lut.m_plY[*pY1]; + pY1++; + PUT_COMPONENT(pOut2, R+Y, 3); + PUT_COMPONENT(pOut2, G+Y, 4); + PUT_COMPONENT(pOut2, B+Y, 5); + puc_out+=6; + pOut2+=6; + } + + puc_y += 2*stride_y; + puc_u += stride_uv; + puc_v += stride_uv; + puc_out += stride_diff; + } + } + + /***/ + + #define _S(a) (a)>255 ? 255 : (a)<0 ? 0 : (a) + + #define _R(y,u,v) (0x2568*(y) + 0x3343*(u)) /0x2000 + #define _G(y,u,v) (0x2568*(y) - 0x0c92*(v) - 0x1a1e*(u)) /0x2000 + #define _B(y,u,v) (0x2568*(y) + 0x40cf*(v)) /0x2000 + + #define _mR 0x7c00 + #define _mG 0x03e0 + #define _mB 0x001f + + #define _Ps555(r,g,b) (((r) << 7) & _mR) | (((g) << 2) & _mG) | (((b) >> 3) & _mB) + + #define _Ps565(r,g,b) ( ((r & 0xF8) >> 3) | (((g & 0xF8) << 3)) | (((b & 0xF8) << 8)) ) + + void yuv2rgb_555(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) + { + + int x, y; + unsigned short *pus_out; + int stride_diff = _stride_out - width_y; // expressed in short + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + pus_out = (unsigned short *) puc_out; + + for (y=0; y>1] - 128; + v = puc_v[x>>1] - 128; + + _r = _R(y,u,v); + _g = _G(y,u,v); + _b = _B(y,u,v); + + r = _S(_r); + g = _S(_g); + b = _S(_b); + + pus_out[0] = _Ps555(b,g,r); + + pus_out++; + } + + puc_y += stride_y; + if (y%2) { + puc_u += stride_uv; + puc_v += stride_uv; + } + pus_out += stride_diff; + } + } + + /***/ + + void yuv2rgb_565(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int _stride_out) + { + + int x, y; + unsigned short *pus_out; + int stride_diff = _stride_out - width_y; // expressed in short + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + pus_out = (unsigned short *) puc_out; + + for (y=0; y>1] - 128; + v = puc_v[x>>1] - 128; + + _r = _R(y,u,v); + _g = _G(y,u,v); + _b = _B(y,u,v); + + r = _S(_r); + g = _S(_g); + b = _S(_b); + + pus_out[0] = (unsigned short) _Ps565(r,g,b); + + pus_out++; + } + + puc_y += stride_y; + if (y%2) { + puc_u += stride_uv; + puc_v += stride_uv; + } + pus_out += stride_diff; + } + } + + /***/ + + // conversion from 4:2:0 to yuv2, 16 bit yuv output + // + void yuy2_out(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int stride_out) + { + int y; + uint8_t* puc_out2; + unsigned int stride_diff = 4 * stride_out - 2 * width_y; // expressed in bytes + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + puc_out2 = puc_out + 2 * stride_out; + for (y=height_y/2; y; y--) { + register uint8_t *py, *py2, *pu, *pv; + register int x; + uint32_t tmp; + + py = puc_y; + py2 = puc_y + stride_y; + pu = puc_u; + pv = puc_v; + for (x=width_y/2; x; x--) { + tmp = *(py++); + tmp |= *(pu++) << 8; + tmp |= *(py++) << 16; + tmp |= *(pv++) << 24; + *(uint32_t*)puc_out=tmp; + puc_out += 4; + + tmp &= 0xFF00FF00; + tmp |= *(py2++); + tmp |= *(py2++) << 16; + *(uint32_t*)puc_out2=tmp; + puc_out2 += 4; + } + + puc_y += 2*stride_y; + puc_u += stride_uv; + puc_v += stride_uv; + + puc_out += stride_diff; + puc_out2 += stride_diff; + } + + } + + /*** YUV 4:2:0 -> UYVY ***/ + + void uyvy_out(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int stride_out) + { + int y; + uint8_t* puc_out2; + unsigned int stride_diff = 4 * stride_out - 2 * width_y; // expressed in bytes + + if (height_y < 0) { + /* we are flipping our output upside-down */ + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + puc_out2 = puc_out + 2 * stride_out; + for (y=height_y/2; y; y--) { + register uint8_t *py, *py2, *pu, *pv; + register int x; + uint32_t tmp; + + py = puc_y; + py2 = puc_y + stride_y; + pu = puc_u; + pv = puc_v; + for (x=width_y/2; x; x--) { + tmp = *(pu++); + tmp |= *(py++) << 8; + tmp |= *(pv++) << 16; + tmp |= *(py++) << 24; + *(uint32_t*)puc_out=tmp; + puc_out += 4; + + tmp &= 0x00FF00FF; + tmp |= *(py2++) << 8; + tmp |= *(py2++) << 24; + *(uint32_t*)puc_out2=tmp; + puc_out2 += 4; + } + + puc_y += 2*stride_y; + puc_u += stride_uv; + puc_v += stride_uv; + + puc_out += stride_diff; + puc_out2 += stride_diff; + } + + } + + + // conversion from 4:2:0 to yv2, 12 bit (just remove the edges) + // + void yuv12_out(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out[], int width_y, int height_y, + unsigned int stride_out) + { + int i; + + unsigned char * pauc_out[3]; + + if (height_y < 0) { + // we are flipping our output upside-down + height_y = -height_y; + puc_y += (height_y - 1) * stride_y ; + puc_u += (height_y/2 - 1) * stride_uv; + puc_v += (height_y/2 - 1) * stride_uv; + stride_y = -stride_y; + stride_uv = -stride_uv; + } + + pauc_out[0] = puc_out[0]; + pauc_out[2] = puc_out[1]; + pauc_out[1] = puc_out[2]; + + //printf("yuv12_out 1 %d %d\n", stride_out, height_y); + for (i=0; i + **/ + // yuvrgb.h // + + // 13.Feb.01 John Funnell: a negative height value now signifies that the output should be flipped + + + #include "portab.h" + + #ifndef _YUVRGB_H_ + #define _YUVRGB_H_ + + void yuv2rgb_24( + uint8_t *puc_y, int stride_y, + uint8_t *puc_u, + uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, + int width_y, int height_y, + unsigned int stride_out); + void yuv2rgb_32( + uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, + int width_y, int height_y, + unsigned int stride_out); + void yuv2rgb_555( + uint8_t *puc_y, int stride_y, + uint8_t *puc_u, + uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, + int width_y, int height_y, + unsigned int stride_out); + void yuv2rgb_565( + uint8_t *puc_y, int stride_y, + uint8_t *puc_u, + uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, + int width_y, int height_y, + unsigned int stride_out); + + void yuv12_out(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out[], int width_y, int height_y, + unsigned int stride_out); + void yuy2_out(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int stride_out); + void uyvy_out(uint8_t *puc_y, int stride_y, + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + uint8_t *puc_out, int width_y, int height_y, + unsigned int stride_out); + + #endif // _YUVRGB_H_ diff -C2 -r -N bcast-2000c/quicktime/divx.c bcast-2000c-mf3/quicktime/divx.c *** bcast-2000c/quicktime/divx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/divx.c Mon Dec 17 19:20:21 2001 *************** *** 0 **** --- 1,959 ---- + // Divx for encore50 + + + #include "colormodels.h" + #include "funcprotos.h" + #include "quicktime.h" + #include "workarounds.h" + #include ENCORE_INCLUDE + #include DECORE_INCLUDE + + #include + #include + #include + + + typedef struct + { + unsigned char *work_buffer; + char *temp_frame; + long buffer_size; + int decode_initialized; + int encode_initialized; + int bitrate; + long rc_period; // the intended rate control averaging period + long rc_reaction_period; // the reation period for rate control + long rc_reaction_ratio; // the ratio for down/up rate control + long max_key_interval; // the maximum interval between key frames + int max_quantizer; // the upper limit of the quantizer + int min_quantizer; // the lower limit of the quantizer + int quantizer; // For vbr + int quality; // the forward search range for motion estimation + int fix_bitrate; + // Last frame decoded + long last_frame; + int encode_handle; + + DEC_PARAM dec_param; + ENC_PARAM enc_param; + + int decode_handle; + // Must count pframes in VBR + int p_count; + } quicktime_divx_codec_t; + + static pthread_mutex_t encode_mutex; + static pthread_mutex_t decode_mutex; + static int mutex_initialized = 0; + static int decode_handle = 1; + static int encode_handle = 0; + + static int delete_codec(quicktime_video_map_t *vtrack) + { + quicktime_divx_codec_t *codec; + + codec = ((quicktime_codec_t*)vtrack->codec)->priv; + if(codec->encode_initialized) + { + pthread_mutex_lock(&encode_mutex); + encore(codec->encode_handle, + ENC_OPT_RELEASE, + 0, + 0); + pthread_mutex_unlock(&encode_mutex); + } + if(codec->decode_initialized) + { + pthread_mutex_lock(&decode_mutex); + + + + + + /* + * decore(codec->handle, + * DEC_OPT_DESTROY, + * 0, + * 0); + */ + + + + decore(codec->decode_handle, + DEC_OPT_RELEASE, + 0, + 0); + + + + pthread_mutex_unlock(&decode_mutex); + } + if(codec->temp_frame) free(codec->temp_frame); + if(codec->work_buffer) free(codec->work_buffer); + free(codec); + return 0; + } + + static int reads_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_YUV420P); + } + + static int writes_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_RGB888 || + colormodel == BC_RGBA8888 || + colormodel == BC_RGB161616 || + colormodel == BC_RGBA16161616 || + colormodel == BC_YUV888 || + colormodel == BC_YUVA8888 || + colormodel == BC_YUV161616 || + colormodel == BC_YUVA16161616 || + colormodel == BC_YUV420P || + colormodel == BC_YUV422 || + colormodel == BC_COMPRESSED); + } + + + + + + + + + static void init_mutex() + { + if(!mutex_initialized) + { + pthread_mutexattr_t attr; + mutex_initialized = 1; + pthread_mutexattr_init(&attr); + pthread_mutex_init(&decode_mutex, &attr); + pthread_mutex_init(&encode_mutex, &attr); + } + } + + + + + // Determine of the compressed frame is a keyframe for direct copy + int quicktime_divx_is_key(unsigned char *data, long size) + { + int result = 0; + int i; + + for(i = 0; i < size - 5; i++) + { + if( data[i] == 0x00 && + data[i + 1] == 0x00 && + data[i + 2] == 0x01 && + data[i + 3] == 0xb6) + { + if((data[i + 4] & 0xc0) == 0x0) + return 1; + else + return 0; + } + } + + return result; + } + + + // Test for VOL header in frame + int quicktime_divx_has_vol(unsigned char *data) + { + if( data[0] == 0x00 && + data[1] == 0x00 && + data[2] == 0x01 && + data[3] == 0x00 && + data[4] == 0x00 && + data[5] == 0x00 && + data[6] == 0x01 && + data[7] == 0x20) + return 1; + else + return 0; + } + + + + + static void putbits(unsigned char **data, + int *bit_pos, + uint64_t *bit_store, + int *total, + int count, + uint64_t value) + { + value &= 0xffffffffffffffff >> (64 - count); + + while(64 - *bit_pos < count) + { + *(*data)++ = (*bit_store) >> 56; + (*bit_store) <<= 8; + (*bit_pos) -= 8; + } + + (*bit_store) |= value << (64 - count - *bit_pos); + (*bit_pos) += count; + (*total) += count; + } + + + static void flushbits(unsigned char **data, + int *bit_pos, + uint64_t *bit_store) + { + //printf("flushbits %llx\n", (*bit_store)); + while((*bit_pos) > 0) + { + *(*data)++ = (*bit_store) >> 56; + (*bit_store) <<= 8; + (*bit_pos) -= 8; + } + } + + + + + #define VO_START_CODE 0x8 + #define VO_START_CODE_LENGTH 27 + #define VOL_START_CODE 0x12 /* 25-MAR-97 JDL : according to WD2 */ + #define VOL_START_CODE_LENGTH 28 + + + + int quicktime_divx_write_vol(unsigned char *data_start, + int vol_width, + int vol_height, + int time_increment_resolution, + float frame_rate) + { + int written = 0; + int bits, fixed_vop_time_increment; + unsigned char *data = data_start; + int bit_pos; + uint64_t bit_store; + int i, j; + + bit_store = 0; + bit_pos = 0; + vol_width = (int)((float)vol_width / 16 + 0.5) * 16; + vol_height = (int)((float)vol_height / 16 + 0.5) * 16; + + + putbits(&data, + &bit_pos, + &bit_store, + &written, + VO_START_CODE_LENGTH, VO_START_CODE); + putbits(&data, + &bit_pos, + &bit_store, + &written, + 5, 0); /* vo_id = 0 */ + + putbits(&data, + &bit_pos, + &bit_store, + &written, + VOL_START_CODE_LENGTH, VOL_START_CODE); + + + + + putbits(&data, + &bit_pos, + &bit_store, + &written, + 4, 0); /* vol_id = 0 */ + + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 0); /* random_accessible_vol = 0 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 8, 1); /* video_object_type_indication = 1 video */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* is_object_layer_identifier = 1 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 4, 2); /* visual_object_layer_ver_id = 2 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 3, 1); /* visual_object_layer_priority = 1 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 4, 1); /* aspect_ratio_info = 1 */ + + + + + + + + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 0); /* vol_control_parameter = 0 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 2, 0); /* vol_shape = 0 rectangular */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* marker */ + + + + + + + + putbits(&data, + &bit_pos, + &bit_store, + &written, + 16, time_increment_resolution); + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* marker */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* fixed_vop_rate = 1 */ + + + bits = 1; + while((1 << bits) < time_increment_resolution) bits++; + + // Log calculation fails for some reason + // bits = (int)ceil(log((double)time_increment_resolution) / log(2.0)); + // if (bits < 1) bits=1; + + fixed_vop_time_increment = + (int)(time_increment_resolution / frame_rate + 0.1); + + putbits(&data, + &bit_pos, + &bit_store, + &written, + bits, fixed_vop_time_increment); + + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* marker */ + + putbits(&data, + &bit_pos, + &bit_store, + &written, + 13, vol_width); + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* marker */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 13, vol_height); + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* marker */ + + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 0); /* interlaced = 0 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* OBMC_disabled = 1 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 2, 0); /* vol_sprite_usage = 0 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 0); /* not_8_bit = 0 */ + + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 0); /* vol_quant_type = 0 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 0); /* vol_quarter_pixel = 0 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* complexity_estimation_disabled = 1 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 1); /* resync_marker_disabled = 1 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 0); /* data_partitioning_enabled = 0 */ + putbits(&data, + &bit_pos, + &bit_store, + &written, + 1, 0); /* scalability = 0 */ + + flushbits(&data, + &bit_pos, + &bit_store); + + + + /* + * for(i = 0; i < data - data_start; i++) + * for(j = 0x80; j >= 1; j /= 2) + * printf("%d", (data_start[i] & j) ? 1 : 0); + * printf("\n"); + */ + + + + return data - data_start; + } + + + + + + #define READ_RAW(framenum) \ + { \ + quicktime_set_video_position(file, framenum, track); \ + bytes = quicktime_frame_size(file, framenum, track); \ + if(!codec->work_buffer || codec->buffer_size < bytes) \ + { \ + if(codec->work_buffer) free(codec->work_buffer); \ + codec->buffer_size = bytes; \ + codec->work_buffer = calloc(1, codec->buffer_size + 100); \ + } \ + result = !quicktime_read_data(file, codec->work_buffer, bytes); \ + } + + + + + + static int decode(quicktime_t *file, unsigned char **row_pointers, int track) + { + int i; + longest bytes; + int result = 0; + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_trak_t *trak = vtrack->track; + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 16 + 0.5) * 16; + int height_i = (int)((float)height / 16 + 0.5) * 16; + DEC_FRAME dec_frame; + int use_temp = 0; + int input_cmodel; + char *bmp_pointers[3]; + long temp_position; + + + + + //printf("decode 1 %d\n", file->color_model); + + init_mutex(); + pthread_mutex_lock(&decode_mutex); + + + + + + + + + + + + + if(!codec->decode_initialized) + { + DEC_MEM_REQS dec_mem_reqs; + + // decore requires handle to be > 1 + codec->decode_handle = decode_handle++; + codec->last_frame = -1; + codec->dec_param.x_dim = width_i; + codec->dec_param.y_dim = height_i; + codec->dec_param.output_format = DEC_420; + codec->dec_param.time_incr = 0; + + decore(codec->decode_handle, DEC_OPT_MEMORY_REQS, &codec->dec_param, &dec_mem_reqs); + codec->dec_param.buffers.mp4_edged_ref_buffers = calloc(1, dec_mem_reqs.mp4_edged_ref_buffers_size); + codec->dec_param.buffers.mp4_edged_for_buffers = calloc(1, dec_mem_reqs.mp4_edged_for_buffers_size); + codec->dec_param.buffers.mp4_display_buffers = calloc(1, dec_mem_reqs.mp4_display_buffers_size); + codec->dec_param.buffers.mp4_state = calloc(1, dec_mem_reqs.mp4_state_size); + codec->dec_param.buffers.mp4_tables = calloc(1, dec_mem_reqs.mp4_tables_size); + codec->dec_param.buffers.mp4_stream = calloc(1, dec_mem_reqs.mp4_stream_size); + decore(codec->decode_handle, DEC_OPT_INIT, &codec->dec_param, NULL); + + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + + + /* + * codec->dec_param.width = width_i; + * codec->dec_param.height = height_i; + * decore(0, DEC_OPT_CREATE, &codec->dec_param, NULL); + */ + + + + + // Must decode frame with VOL header first but only the first frame in the + // sequence has a VOL header. + temp_position = vtrack->current_position; + READ_RAW(0); + vtrack->current_position = temp_position; + dec_frame.bitstream = codec->work_buffer; + dec_frame.length = bytes; + dec_frame.stride = width_i; + dec_frame.render_flag = 0; + dec_frame.bmp[0] = codec->temp_frame; + dec_frame.bmp[1] = codec->temp_frame + width_i * height_i; + dec_frame.bmp[2] = codec->temp_frame + width_i * height_i * 5 / 4; + decore(codec->decode_handle, 0, &dec_frame, NULL); + + + + codec->decode_initialized = 1; + } + + //printf("decode 1\n"); + + + + + input_cmodel = BC_YUV420P; + if(file->color_model == input_cmodel && + file->out_w == width_i && + file->out_h == height_i && + file->in_x == 0 && + file->in_y == 0 && + file->in_w == width_i && + file->in_h == height_i) + { + // dec_frame.dst = row_pointers[0]; + dec_frame.bmp[0] = row_pointers[0]; + dec_frame.bmp[1] = row_pointers[1]; + dec_frame.bmp[2] = row_pointers[2]; + use_temp = 0; + } + else + { + // dec_frame.dst = codec->temp_frame; + dec_frame.bmp[0] = codec->temp_frame; + dec_frame.bmp[1] = codec->temp_frame + width_i * height_i; + dec_frame.bmp[2] = codec->temp_frame + width_i * height_i * 5 / 4; + use_temp = 1; + } + + + + + + + + + dec_frame.stride = width_i; + + // dec_frame.render = 1; + // dec_frame.colorspace = DEC_CSP_YV12; + + + + + + + + + + + + + //printf("decode 1 %d %d\n", codec->last_frame, vtrack->current_position); + + if(quicktime_has_keyframes(file, track) && + vtrack->current_position != codec->last_frame + 1) + { + int frame1, frame2 = vtrack->current_position; + + frame1 = quicktime_get_keyframe_before(file, vtrack->current_position, track); + + if(frame1 < codec->last_frame && + frame2 > codec->last_frame) frame1 = codec->last_frame + 1; + + + while(frame1 < frame2) + { + quicktime_set_video_position(file, frame1, track); + bytes = quicktime_frame_size(file, frame1, track); + + + if(!codec->work_buffer || codec->buffer_size < bytes) + { + if(codec->work_buffer) free(codec->work_buffer); + codec->buffer_size = bytes; + codec->work_buffer = calloc(1, codec->buffer_size + 100); + } + + quicktime_read_data(file, codec->work_buffer, bytes); + + //printf("decode 2 %d %d\n", frame1, frame2); + dec_frame.bitstream = codec->work_buffer; + dec_frame.length = bytes; + dec_frame.render_flag = 0; + decore(codec->decode_handle, 0, &dec_frame, NULL); + frame1++; + } + + + vtrack->current_position = frame2; + } + + + + + + + + + + + + + + + codec->last_frame = vtrack->current_position; + //printf("decode 1\n"); + + + READ_RAW(vtrack->current_position); + + + + //printf("decode 1\n"); + + //printf("decode 1\n"); + + + dec_frame.bitstream = codec->work_buffer; + dec_frame.length = bytes; + dec_frame.render_flag = 1; + + //printf("decode 1\n"); + // decore(codec->dec_param.handle, DEC_OPT_DECODE, &dec_frame, NULL); + decore(codec->decode_handle, 0, &dec_frame, NULL); + //printf("decode 2\n"); + + + pthread_mutex_unlock(&decode_mutex); + //printf("decode 1 %d %d\n", use_temp, file->color_model); + + if(use_temp) + { + unsigned char **input_rows = malloc(sizeof(unsigned char*) * height_i); + for(i = 0; i < height_i; i++) + input_rows[i] = codec->temp_frame + width_i * 3; + + + cmodel_transfer(row_pointers, /* Leave NULL if non existent */ + input_rows, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + file->in_x, /* Dimensions to capture from input frame */ + file->in_y, + file->in_w, + file->in_h, + 0, /* Dimensions to project on output frame */ + 0, + file->out_w, + file->out_h, + input_cmodel, + file->color_model, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width_i, /* For planar use the luma rowspan */ + width); + + free(input_rows); + } + + + + + //printf("decode 2\n"); + + return result; + } + + + + static int encode(quicktime_t *file, unsigned char **row_pointers, int track) + { + //printf("encode 1\n"); + longest offset = quicktime_position(file); + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + quicktime_trak_t *trak = vtrack->track; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 16 + 0.5) * 16; + int height_i = (int)((float)height / 16 + 0.5) * 16; + int result = 0; + int i; + ENC_FRAME encore_input; + ENC_RESULT encore_result; + //printf("encode 1 %d %d\n", width_i, height_i); + + init_mutex(); + pthread_mutex_lock(&encode_mutex); + + if(!codec->encode_initialized) + { + codec->encode_initialized = 1; + codec->encode_handle = encode_handle++; + codec->enc_param.x_dim = width_i; + codec->enc_param.y_dim = height_i; + codec->enc_param.framerate = quicktime_frame_rate(file, track); + codec->enc_param.bitrate = codec->bitrate; + codec->enc_param.rc_period = codec->rc_period; + codec->enc_param.rc_reaction_period = codec->rc_reaction_period; + codec->enc_param.rc_reaction_ratio = codec->rc_reaction_ratio; + codec->enc_param.max_quantizer = codec->max_quantizer; + codec->enc_param.min_quantizer = codec->min_quantizer; + codec->enc_param.max_key_interval = codec->max_key_interval; + + codec->enc_param.search_range = codec->quality * 3; + if(codec->enc_param.search_range > 15) codec->enc_param.search_range = 15; + + encore(codec->encode_handle, ENC_OPT_INIT, &codec->enc_param, NULL); + } + + //printf("encode 1\n"); + + // Assume planes are contiguous + if(file->color_model == BC_YUV420P && + width == width_i && + height == height_i) + { + //printf("encode 1.1\n"); + encore_input.image = row_pointers[0]; + } + // Convert to YUV420P + else + { + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + } + //printf("encode 2 %d %d %d %d %d %d\n", file->color_model, width, height, width_i, height_i); + + //printf("encode 1.5\n"); + cmodel_transfer(0, /* Leave NULL if non existent */ + row_pointers, + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + 0, /* Dimensions to capture from input frame */ + 0, + width, + height, + 0, /* Dimensions to project on output frame */ + 0, + width, + height, + file->color_model, + BC_YUV420P, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width, /* For planar use the luma rowspan */ + width_i); + + //printf("encode 2\n"); + + encore_input.image = codec->temp_frame; + } + //printf("encode 3\n"); + + if(!codec->work_buffer) + { + codec->buffer_size = width * height; + // codec->buffer_size = 0x1000000; + codec->work_buffer = malloc(codec->buffer_size); + } + + //printf("encode 4\n"); + + bzero(codec->work_buffer, codec->buffer_size); + encore_input.bitstream = codec->work_buffer; + encore_input.length = 0; + encore_input.quant = !codec->fix_bitrate ? codec->quantizer : 0; + + if(codec->p_count == 0) + { + codec->p_count++; + } + else + { + codec->p_count++; + if(codec->p_count >= codec->max_key_interval) + codec->p_count = 0; + } + + //printf("encode 5 %d\n", encore_input.quant); + encore(codec->encode_handle, + 0, + &encore_input, + &encore_result); + pthread_mutex_unlock(&encode_mutex); + //printf("encode 6\n"); + + result = !quicktime_write_data(file, codec->work_buffer, encore_input.length); + quicktime_update_tables(file, + file->vtracks[track].track, + offset, + file->vtracks[track].current_chunk, + file->vtracks[track].current_position, + 1, + encore_input.length); + + file->vtracks[track].current_chunk++; + + if(encore_result.isKeyFrame) + quicktime_insert_keyframe(file, file->vtracks[track].current_position, track); + + //printf("encode 7\n"); + + //printf("encode 8\n"); + + return result; + } + + static int set_parameter(quicktime_t *file, + int track, + char *key, + void *value) + { + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + + if(!strcasecmp(key, "divx_bitrate")) + codec->bitrate = *(int*)value; + else + if(!strcasecmp(key, "divx_rc_period")) + codec->rc_period = *(int*)value; + else + if(!strcasecmp(key, "divx_rc_reaction_ratio")) + codec->rc_reaction_ratio = *(int*)value; + else + if(!strcasecmp(key, "divx_rc_reaction_period")) + codec->rc_reaction_period = *(int*)value; + else + if(!strcasecmp(key, "divx_max_key_interval")) + codec->max_key_interval = *(int*)value; + else + if(!strcasecmp(key, "divx_max_quantizer")) + codec->max_quantizer = *(int*)value; + else + if(!strcasecmp(key, "divx_min_quantizer")) + codec->min_quantizer = *(int*)value; + else + if(!strcasecmp(key, "divx_quantizer")) + codec->quantizer = *(int*)value; + else + if(!strcasecmp(key, "divx_quality")) + codec->quality = *(int*)value; + else + if(!strcasecmp(key, "divx_fix_bitrate")) + codec->fix_bitrate = *(int*)value; + return 0; + } + + + void quicktime_init_codec_divx(quicktime_video_map_t *vtrack) + { + int i; + quicktime_divx_codec_t *codec; + + /* Init public items */ + ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_divx_codec_t)); + ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = delete_codec; + ((quicktime_codec_t*)vtrack->codec)->decode_video = decode; + ((quicktime_codec_t*)vtrack->codec)->encode_video = encode; + ((quicktime_codec_t*)vtrack->codec)->reads_colormodel = reads_colormodel; + ((quicktime_codec_t*)vtrack->codec)->writes_colormodel = writes_colormodel; + ((quicktime_codec_t*)vtrack->codec)->set_parameter = set_parameter; + + codec = ((quicktime_codec_t*)vtrack->codec)->priv; + + codec->bitrate = 1000000; + codec->rc_period = 50; + codec->rc_reaction_ratio = 45; + codec->rc_reaction_period = 10; + codec->max_key_interval = 45; + codec->max_quantizer = 31; + codec->min_quantizer = 1; + codec->quantizer = 10; + codec->quality = 5; + codec->fix_bitrate = 1; + } + diff -C2 -r -N bcast-2000c/quicktime/divx.c.2 bcast-2000c-mf3/quicktime/divx.c.2 *** bcast-2000c/quicktime/divx.c.2 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/divx.c.2 Fri Nov 30 02:09:09 2001 *************** *** 0 **** --- 1,415 ---- + #include "colormodels.h" + #include "funcprotos.h" + #include "quicktime.h" + #include "workarounds.h" + #include "divx.h" + + + #include + #include + + + static pthread_mutex_t encode_mutex; + static pthread_mutex_t decode_mutex; + static int mutex_initialized = 0; + + static int delete_codec(quicktime_video_map_t *vtrack) + { + quicktime_divx_codec_t *codec; + + codec = ((quicktime_codec_t*)vtrack->codec)->priv; + if(codec->encode_initialized) + { + pthread_mutex_lock(&encode_mutex); + encore(codec->enc_param.handle, + ENC_OPT_RELEASE, + 0, + 0); + pthread_mutex_unlock(&encode_mutex); + } + if(codec->decode_initialized) + { + pthread_mutex_lock(&decode_mutex); + decore(codec->dec_param.handle, + DEC_OPT_DESTROY, + 0, + 0); + pthread_mutex_unlock(&decode_mutex); + } + if(codec->temp_frame) free(codec->temp_frame); + if(codec->work_buffer) free(codec->work_buffer); + free(codec); + return 0; + } + + static int reads_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_RGB888 || + colormodel == BC_RGBA8888 || + colormodel == BC_RGB161616 || + colormodel == BC_RGBA16161616 || + colormodel == BC_YUV888 || + colormodel == BC_YUVA8888 || + colormodel == BC_YUV161616 || + colormodel == BC_YUVA16161616 || + colormodel == BC_RGB8 || + colormodel == BC_RGB565 || + colormodel == BC_BGR888 || + colormodel == BC_BGR8888 || + colormodel == BC_YUV420P || + colormodel == BC_YUV422); + } + + static int writes_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_RGB888 || + colormodel == BC_RGBA8888 || + colormodel == BC_RGB161616 || + colormodel == BC_RGBA16161616 || + colormodel == BC_YUV888 || + colormodel == BC_YUVA8888 || + colormodel == BC_YUV161616 || + colormodel == BC_YUVA16161616 || + colormodel == BC_YUV420P || + colormodel == BC_YUV422); + } + + + + + + + + + static void init_mutex() + { + if(!mutex_initialized) + { + pthread_mutexattr_t attr; + mutex_initialized = 1; + pthread_mutexattr_init(&attr); + pthread_mutex_init(&decode_mutex, &attr); + pthread_mutex_init(&encode_mutex, &attr); + } + } + + + + + + static int decode(quicktime_t *file, unsigned char **row_pointers, int track) + { + int i; + longest bytes; + int result = 0; + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_trak_t *trak = vtrack->track; + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 2 + 0.5) * 2; + int height_i = (int)((float)height / 2 + 0.5) * 2; + DEC_FRAME dec_frame; + int use_temp = 0; + int input_cmodel; + char *bmp_pointers[3]; + + //printf("decode 1\n"); + + init_mutex(); + pthread_mutex_lock(&decode_mutex); + + quicktime_set_video_position(file, vtrack->current_position, track); + bytes = quicktime_frame_size(file, vtrack->current_position, track); + //printf("decode 1\n"); + + if(!codec->work_buffer || codec->buffer_size < bytes) + { + if(codec->work_buffer) free(codec->work_buffer); + codec->buffer_size = bytes; + codec->work_buffer = calloc(1, codec->buffer_size + 100); + } + //printf("decode 1\n"); + + result = !quicktime_read_data(file, codec->work_buffer, bytes); + //printf("decode 1\n"); + + if(!codec->decode_initialized) + { + codec->decode_initialized = 1; + codec->dec_param.width = width_i; + codec->dec_param.height = height_i; + decore(0, DEC_OPT_CREATE, &codec->dec_param, NULL); + + + } + + //printf("decode 1\n"); + + + + dec_frame.bitstream = codec->work_buffer; + dec_frame.length = bytes; + dec_frame.stride = width_i; + dec_frame.render = 1; + dec_frame.colorspace = DEC_CSP_YV12; + + input_cmodel = BC_YUV420P; + if(file->color_model == input_cmodel && + file->out_w == width_i && + file->out_h == height_i && + file->in_x == 0 && + file->in_y == 0 && + file->in_w == width_i && + file->in_h == height_i) + { + dec_frame.dst = row_pointers[0]; + use_temp = 0; + } + else + { + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + } + dec_frame.dst = codec->temp_frame; + use_temp = 1; + } + + + //printf("decode 1\n"); + decore(codec->dec_param.handle, DEC_OPT_DECODE, &dec_frame, NULL); + //printf("decode 2\n"); + + + pthread_mutex_unlock(&decode_mutex); + //printf("decode 1 %d %d\n", use_temp, file->color_model); + + if(use_temp) + { + unsigned char **input_rows = malloc(sizeof(unsigned char*) * height_i); + for(i = 0; i < height_i; i++) + input_rows[i] = (char*)codec->temp_frame + width_i * 3; + //printf("decode 3\n"); + + + cmodel_transfer(row_pointers, /* Leave NULL if non existent */ + input_rows, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + file->in_x, /* Dimensions to capture from input frame */ + file->in_y, + file->in_w, + file->in_h, + 0, /* Dimensions to project on output frame */ + 0, + file->out_w, + file->out_h, + input_cmodel, + file->color_model, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width_i, /* For planar use the luma rowspan */ + width); + + //printf("decode 4\n"); + free(input_rows); + } + + + + + //printf("decode 2\n"); + + return result; + } + + + + + + + + static int encode(quicktime_t *file, unsigned char **row_pointers, int track) + { + //printf("encode 1\n"); + longest offset = quicktime_position(file); + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + quicktime_trak_t *trak = vtrack->track; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 2 + 0.5) * 2; + int height_i = (int)((float)height / 2 + 0.5) * 2; + int result = 0; + int i; + ENC_FRAME encore_input; + ENC_RESULT encore_result; + //printf("encode 1\n"); + + init_mutex(); + pthread_mutex_lock(&encode_mutex); + + if(!codec->encode_initialized) + { + codec->encode_initialized = 1; + codec->enc_param.x_dim = width_i; + codec->enc_param.y_dim = height_i; + codec->enc_param.framerate = quicktime_frame_rate(file, track); + codec->enc_param.bitrate = codec->bitrate; + codec->enc_param.rc_period = codec->rc_period; + codec->enc_param.rc_reaction_period = codec->rc_reaction_period; + codec->enc_param.rc_reaction_ratio = codec->rc_reaction_ratio; + codec->enc_param.max_quantizer = codec->max_quantizer; + codec->enc_param.min_quantizer = codec->min_quantizer; + codec->enc_param.max_key_interval = codec->max_key_interval; + codec->enc_param.use_bidirect = 0; + codec->enc_param.deinterlace = 0; + codec->enc_param.quality = 5; + codec->enc_param.obmc = 0; + + + + encore(0, ENC_OPT_INIT, &codec->enc_param, NULL); + } + + //printf("encode 1\n"); + + // Assume planes are contiguous + if(file->color_model == BC_YUV420P && + width == width_i && + height == height_i) + { + encore_input.image = row_pointers[0]; + //printf("encode 1\n"); + } + // Convert to YUV420P + else + { + //printf("encode 2\n"); + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + } + //printf("encode 2 %d %d %d %d %d %d\n", file->color_model, width, height, width_i, height_i); + + cmodel_transfer(0, /* Leave NULL if non existent */ + row_pointers, + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + 0, /* Dimensions to capture from input frame */ + 0, + width, + height, + 0, /* Dimensions to project on output frame */ + 0, + width_i, + height_i, + file->color_model, + BC_YUV420P, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width, /* For planar use the luma rowspan */ + width_i); + + //printf("encode 2\n"); + + encore_input.image = codec->temp_frame; + } + //printf("encode 1\n"); + + if(!codec->work_buffer) + { + codec->buffer_size = width * height; + codec->work_buffer = malloc(codec->buffer_size); + } + //printf("encode 1\n"); + + encore_input.bitstream = codec->work_buffer; + encore_input.length = codec->buffer_size; + encore_input.colorspace = ENC_CSP_YV12; + encore_input.quant = codec->enc_param.min_quantizer; + + //printf("encode 1\n"); + encore(codec->enc_param.handle, + ENC_OPT_ENCODE, + &encore_input, + &encore_result); + pthread_mutex_unlock(&encode_mutex); + //printf("encode 1\n"); + + result = !quicktime_write_data(file, codec->work_buffer, encore_input.length); + quicktime_update_tables(file, + file->vtracks[track].track, + offset, + file->vtracks[track].current_chunk, + file->vtracks[track].current_position, + 1, + encore_input.length); + //printf("encode 1\n"); + + file->vtracks[track].current_chunk++; + //printf("encode 2\n"); + + return result; + } + + static int set_parameter(quicktime_t *file, + int track, + char *key, + void *value) + { + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + + if(!strcasecmp(key, "v_bitrate")) + codec->bitrate = *(int*)value; + else + if(!strcasecmp(key, "v_rc_period")) + codec->rc_period = *(int*)value; + else + if(!strcasecmp(key, "v_rc_reaction_ratio")) + codec->rc_reaction_ratio = *(int*)value; + else + if(!strcasecmp(key, "v_rc_reaction_period")) + codec->rc_reaction_period = *(int*)value; + else + if(!strcasecmp(key, "v_max_key_interval")) + codec->max_key_interval = *(int*)value; + else + if(!strcasecmp(key, "v_max_quantizer")) + codec->max_quantizer = *(int*)value; + else + if(!strcasecmp(key, "v_min_quantizer")) + codec->min_quantizer = *(int*)value; + else + if(!strcasecmp(key, "v_search_range")) + codec->search_range = *(int*)value; + } + + + void quicktime_init_codec_divx(quicktime_video_map_t *vtrack) + { + int i; + quicktime_divx_codec_t *codec; + + /* Init public items */ + ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_divx_codec_t)); + ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = delete_codec; + ((quicktime_codec_t*)vtrack->codec)->decode_video = decode; + ((quicktime_codec_t*)vtrack->codec)->encode_video = encode; + ((quicktime_codec_t*)vtrack->codec)->reads_colormodel = reads_colormodel; + ((quicktime_codec_t*)vtrack->codec)->writes_colormodel = writes_colormodel; + ((quicktime_codec_t*)vtrack->codec)->set_parameter = set_parameter; + } + diff -C2 -r -N bcast-2000c/quicktime/divx.c.50 bcast-2000c-mf3/quicktime/divx.c.50 *** bcast-2000c/quicktime/divx.c.50 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/divx.c.50 Fri Nov 30 02:09:09 2001 *************** *** 0 **** --- 1,429 ---- + + #include "colormodels.h" + #include ENCORE_DIR + #include "funcprotos.h" + #include "quicktime.h" + #include "workarounds.h" + #include "divx.h" + + + #include + #include + + + static pthread_mutex_t encode_mutex; + static pthread_mutex_t decode_mutex; + static int mutex_initialized = 0; + static int decode_handle = 1; + static int encode_handle = 0; + + static int delete_codec(quicktime_video_map_t *vtrack) + { + quicktime_divx_codec_t *codec; + + codec = ((quicktime_codec_t*)vtrack->codec)->priv; + if(codec->encode_initialized) + { + pthread_mutex_lock(&encode_mutex); + encore(codec->handle, + ENC_OPT_RELEASE, + 0, + 0); + pthread_mutex_unlock(&encode_mutex); + } + if(codec->decode_initialized) + { + pthread_mutex_lock(&decode_mutex); + decore(codec->handle, + DEC_OPT_RELEASE, + 0, + 0); + pthread_mutex_unlock(&decode_mutex); + } + if(codec->temp_frame) free(codec->temp_frame); + if(codec->work_buffer) free(codec->work_buffer); + free(codec); + return 0; + } + + static int reads_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_RGB888 || + colormodel == BC_RGBA8888 || + colormodel == BC_RGB161616 || + colormodel == BC_RGBA16161616 || + colormodel == BC_YUV888 || + colormodel == BC_YUVA8888 || + colormodel == BC_YUV161616 || + colormodel == BC_YUVA16161616 || + colormodel == BC_RGB8 || + colormodel == BC_RGB565 || + colormodel == BC_BGR888 || + colormodel == BC_BGR8888 || + colormodel == BC_YUV420P || + colormodel == BC_YUV422); + } + + static int writes_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_RGB888 || + colormodel == BC_RGBA8888 || + colormodel == BC_RGB161616 || + colormodel == BC_RGBA16161616 || + colormodel == BC_YUV888 || + colormodel == BC_YUVA8888 || + colormodel == BC_YUV161616 || + colormodel == BC_YUVA16161616 || + colormodel == BC_YUV420P || + colormodel == BC_YUV422); + } + + + + + + + + + static void init_mutex() + { + if(!mutex_initialized) + { + pthread_mutexattr_t attr; + mutex_initialized = 1; + pthread_mutexattr_init(&attr); + pthread_mutex_init(&decode_mutex, &attr); + pthread_mutex_init(&encode_mutex, &attr); + } + } + + + + + + static int decode(quicktime_t *file, unsigned char **row_pointers, int track) + { + int i; + longest bytes; + int result = 0; + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_trak_t *trak = vtrack->track; + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 2 + 0.5) * 2; + int height_i = (int)((float)height / 2 + 0.5) * 2; + DEC_FRAME dec_frame; + int use_temp = 0; + int input_cmodel; + char *bmp_pointers[3]; + + //printf("decode 1\n"); + + init_mutex(); + pthread_mutex_lock(&decode_mutex); + + quicktime_set_video_position(file, vtrack->current_position, track); + bytes = quicktime_frame_size(file, vtrack->current_position, track); + //printf("decode 1\n"); + + if(!codec->work_buffer || codec->buffer_size < bytes) + { + if(codec->work_buffer) free(codec->work_buffer); + codec->buffer_size = bytes; + codec->work_buffer = calloc(1, codec->buffer_size + 100); + } + //printf("decode 1\n"); + + result = !quicktime_read_data(file, codec->work_buffer, bytes); + //printf("decode 1\n"); + + if(!codec->decode_initialized) + { + DEC_MEM_REQS dec_mem_reqs; + + codec->decode_initialized = 1; + // decore requires handle to be > 1 + codec->handle = decode_handle++; + codec->dec_param.x_dim = width_i; + codec->dec_param.y_dim = height_i; + codec->dec_param.output_format = DEC_420; + codec->dec_param.time_incr = 0; + + decore(codec->handle, DEC_OPT_MEMORY_REQS, &codec->dec_param, &dec_mem_reqs); + codec->dec_param.buffers.mp4_edged_ref_buffers = calloc(1, dec_mem_reqs.mp4_edged_ref_buffers_size); + codec->dec_param.buffers.mp4_edged_for_buffers = calloc(1, dec_mem_reqs.mp4_edged_for_buffers_size); + codec->dec_param.buffers.mp4_display_buffers = calloc(1, dec_mem_reqs.mp4_display_buffers_size); + codec->dec_param.buffers.mp4_state = calloc(1, dec_mem_reqs.mp4_state_size); + codec->dec_param.buffers.mp4_tables = calloc(1, dec_mem_reqs.mp4_tables_size); + codec->dec_param.buffers.mp4_stream = calloc(1, dec_mem_reqs.mp4_stream_size); + decore(codec->handle, DEC_OPT_INIT, &codec->dec_param, NULL); + + + + + } + + //printf("decode 1\n"); + + + + dec_frame.bitstream = codec->work_buffer; + dec_frame.length = bytes; + dec_frame.render_flag = 1; + + dec_frame.stride = width_i; + + input_cmodel = BC_YUV420P; + if(file->color_model == input_cmodel && + file->out_w == width_i && + file->out_h == height_i && + file->in_x == 0 && + file->in_y == 0 && + file->in_w == width_i && + file->in_h == height_i) + { + dec_frame.bmp = row_pointers[0]; + use_temp = 0; + } + else + { + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + } + dec_frame.bmp = codec->temp_frame; + use_temp = 1; + } + + + //printf("decode 1\n"); + decore(codec->handle, 0, &dec_frame, NULL); + //printf("decode 2\n"); + + + pthread_mutex_unlock(&decode_mutex); + //printf("decode 1 %d %d\n", use_temp, file->color_model); + + if(use_temp) + { + unsigned char **input_rows = malloc(sizeof(unsigned char*) * height_i); + for(i = 0; i < height_i; i++) + input_rows[i] = codec->temp_frame + width_i * 3; + + + cmodel_transfer(row_pointers, /* Leave NULL if non existent */ + input_rows, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + file->in_x, /* Dimensions to capture from input frame */ + file->in_y, + file->in_w, + file->in_h, + 0, /* Dimensions to project on output frame */ + 0, + file->out_w, + file->out_h, + input_cmodel, + file->color_model, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width_i, /* For planar use the luma rowspan */ + width); + + free(input_rows); + } + + + + + //printf("decode 2\n"); + + return result; + } + + + + + + + + static int encode(quicktime_t *file, unsigned char **row_pointers, int track) + { + //printf("encode 1\n"); + longest offset = quicktime_position(file); + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + quicktime_trak_t *trak = vtrack->track; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 2 + 0.5) * 2; + int height_i = (int)((float)height / 2 + 0.5) * 2; + int result = 0; + int i; + ENC_FRAME encore_input; + ENC_RESULT encore_result; + //printf("encode 1\n"); + + init_mutex(); + pthread_mutex_lock(&encode_mutex); + + if(!codec->encode_initialized) + { + ENC_PARAM enc_param; + + codec->encode_initialized = 1; + codec->handle = encode_handle++; + enc_param.framerate = quicktime_frame_rate(file, track); + enc_param.bitrate = codec->bitrate; + enc_param.rc_period = codec->rc_period; + enc_param.rc_reaction_period = codec->rc_reaction_period; + enc_param.rc_reaction_ratio = codec->rc_reaction_ratio; + enc_param.x_dim = width_i; + enc_param.y_dim = height_i; + enc_param.max_key_interval = codec->max_key_interval; + enc_param.search_range = codec->search_range; + enc_param.max_quantizer = codec->max_quantizer; + enc_param.min_quantizer = codec->min_quantizer; + + encore(track, ENC_OPT_INIT, &enc_param, NULL); + } + + //printf("encode 1\n"); + + // Assume planes are contiguous + if(file->color_model == BC_YUV420P && + width == width_i && + height == height_i) + { + encore_input.image = row_pointers[0]; + //printf("encode 1\n"); + } + // Convert to YUV420P + else + { + //printf("encode 2\n"); + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + } + //printf("encode 2 %d %d %d %d %d %d\n", file->color_model, width, height, width_i, height_i); + + cmodel_transfer(0, /* Leave NULL if non existent */ + row_pointers, + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + 0, /* Dimensions to capture from input frame */ + 0, + width, + height, + 0, /* Dimensions to project on output frame */ + 0, + width_i, + height_i, + file->color_model, + BC_YUV420P, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width, /* For planar use the luma rowspan */ + width_i); + + //printf("encode 2\n"); + + encore_input.image = codec->temp_frame; + } + //printf("encode 1\n"); + + if(!codec->work_buffer) + { + codec->buffer_size = width * height; + codec->work_buffer = malloc(codec->buffer_size); + } + //printf("encode 1\n"); + + encore_input.bitstream = codec->work_buffer; + encore_input.length = codec->buffer_size; + + //printf("encode 1\n"); + encore(codec->handle, + 0, + &encore_input, + &encore_result); + pthread_mutex_unlock(&encode_mutex); + //printf("encode 1\n"); + + result = !quicktime_write_data(file, codec->work_buffer, encore_input.length); + quicktime_update_tables(file, + file->vtracks[track].track, + offset, + file->vtracks[track].current_chunk, + file->vtracks[track].current_position, + 1, + encore_input.length); + //printf("encode 1\n"); + + file->vtracks[track].current_chunk++; + //printf("encode 2\n"); + + return result; + } + + static int set_parameter(quicktime_t *file, + int track, + char *key, + void *value) + { + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + + if(!strcasecmp(key, "v_bitrate")) + codec->bitrate = *(int*)value; + else + if(!strcasecmp(key, "v_rc_period")) + codec->rc_period = *(int*)value; + else + if(!strcasecmp(key, "v_rc_reaction_ratio")) + codec->rc_reaction_ratio = *(int*)value; + else + if(!strcasecmp(key, "v_rc_reaction_period")) + codec->rc_reaction_period = *(int*)value; + else + if(!strcasecmp(key, "v_max_key_interval")) + codec->max_key_interval = *(int*)value; + else + if(!strcasecmp(key, "v_max_quantizer")) + codec->max_quantizer = *(int*)value; + else + if(!strcasecmp(key, "v_min_quantizer")) + codec->min_quantizer = *(int*)value; + else + if(!strcasecmp(key, "v_search_range")) + codec->search_range = *(int*)value; + } + + + void quicktime_init_codec_divx(quicktime_video_map_t *vtrack) + { + int i; + quicktime_divx_codec_t *codec; + + /* Init public items */ + ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_divx_codec_t)); + ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = delete_codec; + ((quicktime_codec_t*)vtrack->codec)->decode_video = decode; + ((quicktime_codec_t*)vtrack->codec)->encode_video = encode; + ((quicktime_codec_t*)vtrack->codec)->reads_colormodel = reads_colormodel; + ((quicktime_codec_t*)vtrack->codec)->writes_colormodel = writes_colormodel; + ((quicktime_codec_t*)vtrack->codec)->set_parameter = set_parameter; + } + diff -C2 -r -N bcast-2000c/quicktime/divx.c.encore2 bcast-2000c-mf3/quicktime/divx.c.encore2 *** bcast-2000c/quicktime/divx.c.encore2 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/divx.c.encore2 Mon Dec 10 14:46:07 2001 *************** *** 0 **** --- 1,595 ---- + // Divx for encore2 + + + + + #include "colormodels.h" + #include "funcprotos.h" + #include "quicktime.h" + #include "workarounds.h" + #include ENCORE_INCLUDE + #include DECORE_INCLUDE + + #include + #include + #include + + + typedef struct + { + unsigned char *work_buffer; + char *temp_frame; + long buffer_size; + int decode_initialized; + int encode_initialized; + int bitrate; + long rc_period; // the intended rate control averaging period + long rc_reaction_period; // the reation period for rate control + long rc_reaction_ratio; // the ratio for down/up rate control + long max_key_interval; // the maximum interval between key frames + int max_quantizer; // the upper limit of the quantizer + int min_quantizer; // the lower limit of the quantizer + int quantizer; // For vbr + int quality; // the forward search range for motion estimation + int fix_bitrate; + // Last frame decoded + long last_frame; + + DEC_PARAM dec_param; + ENC_PARAM enc_param; + + int handle; + // Must count pframes in VBR + int p_count; + } quicktime_divx_codec_t; + + static pthread_mutex_t encode_mutex; + static pthread_mutex_t decode_mutex; + static int mutex_initialized = 0; + static int decode_handle = 1; + static int encode_handle = 0; + + static int delete_codec(quicktime_video_map_t *vtrack) + { + quicktime_divx_codec_t *codec; + + codec = ((quicktime_codec_t*)vtrack->codec)->priv; + if(codec->encode_initialized) + { + pthread_mutex_lock(&encode_mutex); + encore(codec->enc_param.handle, + ENC_OPT_RELEASE, + 0, + 0); + pthread_mutex_unlock(&encode_mutex); + } + if(codec->decode_initialized) + { + pthread_mutex_lock(&decode_mutex); + + + + + + /* + * decore(codec->dec_param.handle, + * DEC_OPT_DESTROY, + * 0, + * 0); + */ + + + + decore(codec->handle, + DEC_OPT_RELEASE, + 0, + 0); + + + + pthread_mutex_unlock(&decode_mutex); + } + if(codec->temp_frame) free(codec->temp_frame); + if(codec->work_buffer) free(codec->work_buffer); + free(codec); + return 0; + } + + static int reads_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_RGB888 || + colormodel == BC_RGBA8888 || + colormodel == BC_RGB161616 || + colormodel == BC_RGBA16161616 || + colormodel == BC_YUV888 || + colormodel == BC_YUVA8888 || + colormodel == BC_YUV161616 || + colormodel == BC_YUVA16161616 || + colormodel == BC_RGB8 || + colormodel == BC_RGB565 || + colormodel == BC_BGR888 || + colormodel == BC_BGR8888 || + colormodel == BC_YUV420P || + colormodel == BC_YUV422); + } + + static int writes_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_RGB888 || + colormodel == BC_RGBA8888 || + colormodel == BC_RGB161616 || + colormodel == BC_RGBA16161616 || + colormodel == BC_YUV888 || + colormodel == BC_YUVA8888 || + colormodel == BC_YUV161616 || + colormodel == BC_YUVA16161616 || + colormodel == BC_YUV420P || + colormodel == BC_YUV422); + } + + + + + + + + + static void init_mutex() + { + if(!mutex_initialized) + { + pthread_mutexattr_t attr; + mutex_initialized = 1; + pthread_mutexattr_init(&attr); + pthread_mutex_init(&decode_mutex, &attr); + pthread_mutex_init(&encode_mutex, &attr); + } + } + + + + + + static int decode(quicktime_t *file, unsigned char **row_pointers, int track) + { + int i; + longest bytes; + int result = 0; + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_trak_t *trak = vtrack->track; + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 16 + 0.5) * 16; + int height_i = (int)((float)height / 16 + 0.5) * 16; + DEC_FRAME dec_frame; + int use_temp = 0; + int input_cmodel; + char *bmp_pointers[3]; + + //printf("decode 1\n"); + + init_mutex(); + pthread_mutex_lock(&decode_mutex); + + if(!codec->decode_initialized) + { + DEC_MEM_REQS dec_mem_reqs; + + // decore requires handle to be > 1 + codec->handle = decode_handle++; + codec->last_frame = -1; + codec->dec_param.x_dim = width_i; + codec->dec_param.y_dim = height_i; + codec->dec_param.output_format = DEC_420; + codec->dec_param.time_incr = 0; + + decore(codec->handle, DEC_OPT_MEMORY_REQS, &codec->dec_param, &dec_mem_reqs); + codec->dec_param.buffers.mp4_edged_ref_buffers = calloc(1, dec_mem_reqs.mp4_edged_ref_buffers_size); + codec->dec_param.buffers.mp4_edged_for_buffers = calloc(1, dec_mem_reqs.mp4_edged_for_buffers_size); + codec->dec_param.buffers.mp4_display_buffers = calloc(1, dec_mem_reqs.mp4_display_buffers_size); + codec->dec_param.buffers.mp4_state = calloc(1, dec_mem_reqs.mp4_state_size); + codec->dec_param.buffers.mp4_tables = calloc(1, dec_mem_reqs.mp4_tables_size); + codec->dec_param.buffers.mp4_stream = calloc(1, dec_mem_reqs.mp4_stream_size); + decore(codec->handle, DEC_OPT_INIT, &codec->dec_param, NULL); + + + /* + * codec->dec_param.width = width_i; + * codec->dec_param.height = height_i; + * decore(0, DEC_OPT_CREATE, &codec->dec_param, NULL); + */ + + codec->decode_initialized = 1; + } + + //printf("decode 1\n"); + + + + + input_cmodel = BC_YUV420P; + if(file->color_model == input_cmodel && + file->out_w == width_i && + file->out_h == height_i && + file->in_x == 0 && + file->in_y == 0 && + file->in_w == width_i && + file->in_h == height_i) + { + // dec_frame.dst = row_pointers[0]; + dec_frame.bmp = row_pointers[0]; + use_temp = 0; + } + else + { + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + } + // dec_frame.dst = codec->temp_frame; + dec_frame.bmp = codec->temp_frame; + use_temp = 1; + } + + + + dec_frame.stride = width_i; + dec_frame.render_flag = 1; + + // dec_frame.render = 1; + // dec_frame.colorspace = DEC_CSP_YV12; + + + + + + + + + + + + + //printf("decode 1 %d %d\n", codec->last_frame, vtrack->current_position); + + if(quicktime_has_keyframes(file, track) && + codec->last_frame >= 0 && + vtrack->current_position != codec->last_frame + 1) + { + int frame1, frame2 = vtrack->current_position; + + frame1 = quicktime_get_keyframe_before(file, vtrack->current_position, track); + + if(frame1 < codec->last_frame && + frame2 > codec->last_frame) frame1 = codec->last_frame + 1; + + + while(frame1 < frame2) + { + quicktime_set_video_position(file, frame1, track); + bytes = quicktime_frame_size(file, frame1, track); + + + if(!codec->work_buffer || codec->buffer_size < bytes) + { + if(codec->work_buffer) free(codec->work_buffer); + codec->buffer_size = bytes; + codec->work_buffer = calloc(1, codec->buffer_size + 100); + } + + quicktime_read_data(file, codec->work_buffer, bytes); + + //printf("decode 2 %d %d\n", frame1, frame2); + dec_frame.bitstream = codec->work_buffer; + dec_frame.length = bytes; + decore(codec->handle, 0, &dec_frame, NULL); + frame1++; + } + + + vtrack->current_position = frame2; + } + + + + + + + + + + + + + + + quicktime_set_video_position(file, vtrack->current_position, track); + bytes = quicktime_frame_size(file, vtrack->current_position, track); + codec->last_frame = vtrack->current_position; + //printf("decode 1\n"); + + if(!codec->work_buffer || codec->buffer_size < bytes) + { + if(codec->work_buffer) free(codec->work_buffer); + codec->buffer_size = bytes; + codec->work_buffer = calloc(1, codec->buffer_size + 100); + } + //printf("decode 1\n"); + + result = !quicktime_read_data(file, codec->work_buffer, bytes); + //printf("decode 1\n"); + + + dec_frame.bitstream = codec->work_buffer; + dec_frame.length = bytes; + + //printf("decode 1\n"); + // decore(codec->dec_param.handle, DEC_OPT_DECODE, &dec_frame, NULL); + decore(codec->handle, 0, &dec_frame, NULL); + //printf("decode 2\n"); + + + pthread_mutex_unlock(&decode_mutex); + //printf("decode 1 %d %d\n", use_temp, file->color_model); + + if(use_temp) + { + unsigned char **input_rows = malloc(sizeof(unsigned char*) * height_i); + for(i = 0; i < height_i; i++) + input_rows[i] = codec->temp_frame + width_i * 3; + + + cmodel_transfer(row_pointers, /* Leave NULL if non existent */ + input_rows, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + file->in_x, /* Dimensions to capture from input frame */ + file->in_y, + file->in_w, + file->in_h, + 0, /* Dimensions to project on output frame */ + 0, + file->out_w, + file->out_h, + input_cmodel, + file->color_model, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width_i, /* For planar use the luma rowspan */ + width); + + free(input_rows); + } + + + + + //printf("decode 2\n"); + + return result; + } + + + + + + + + static int encode(quicktime_t *file, unsigned char **row_pointers, int track) + { + //printf("encode 1\n"); + longest offset = quicktime_position(file); + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + quicktime_trak_t *trak = vtrack->track; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 16 + 0.5) * 16; + int height_i = (int)((float)height / 16 + 0.5) * 16; + int result = 0; + int i; + ENC_FRAME encore_input; + ENC_RESULT encore_result; + //printf("encode 1 %d %d\n", width_i, height_i); + + init_mutex(); + pthread_mutex_lock(&encode_mutex); + + if(!codec->encode_initialized) + { + codec->encode_initialized = 1; + codec->enc_param.x_dim = width_i; + codec->enc_param.y_dim = height_i; + codec->enc_param.framerate = quicktime_frame_rate(file, track); + codec->enc_param.bitrate = codec->bitrate; + codec->enc_param.rc_period = codec->rc_period; + codec->enc_param.rc_reaction_period = codec->rc_reaction_period; + codec->enc_param.rc_reaction_ratio = codec->rc_reaction_ratio; + codec->enc_param.max_quantizer = codec->max_quantizer; + codec->enc_param.min_quantizer = codec->min_quantizer; + codec->enc_param.max_key_interval = codec->max_key_interval; + codec->enc_param.use_bidirect = 0; + codec->enc_param.deinterlace = 0; + codec->enc_param.quality = codec->quality; + codec->enc_param.obmc = 0; + codec->p_count = 0; + + + encore(0, ENC_OPT_INIT, &codec->enc_param, NULL); + } + + //printf("encode 1\n"); + + // Assume planes are contiguous + if(file->color_model == BC_YUV420P && + width == width_i && + height == height_i) + { + encore_input.image = row_pointers[0]; + //printf("encode 1.1\n"); + } + // Convert to YUV420P + else + { + //printf("encode 2\n"); + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + } + //printf("encode 2 %d %d %d %d %d %d\n", file->color_model, width, height, width_i, height_i); + + cmodel_transfer(0, /* Leave NULL if non existent */ + row_pointers, + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + 0, /* Dimensions to capture from input frame */ + 0, + width, + height, + 0, /* Dimensions to project on output frame */ + 0, + width, + height, + file->color_model, + BC_YUV420P, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width, /* For planar use the luma rowspan */ + width_i); + + //printf("encode 2\n"); + + encore_input.image = codec->temp_frame; + } + //printf("encode 3\n"); + + if(!codec->work_buffer) + { + codec->buffer_size = width * height; + // codec->buffer_size = 0x1000000; + codec->work_buffer = malloc(codec->buffer_size); + } + + //printf("encode 4\n"); + + bzero(codec->work_buffer, codec->buffer_size); + encore_input.bitstream = codec->work_buffer; + encore_input.length = codec->buffer_size; + encore_input.colorspace = ENC_CSP_YV12; + encore_input.quant = codec->quantizer; + + if(codec->p_count == 0) + { + encore_input.intra = 1; + codec->p_count++; + } + else + { + encore_input.intra = 0; + codec->p_count++; + if(codec->p_count >= codec->max_key_interval) + codec->p_count = 0; + } + + //printf("encode 5 %d %d \n", encore_input.quant, encore_input.intra); + if(codec->fix_bitrate) + encore(codec->enc_param.handle, + ENC_OPT_ENCODE, + &encore_input, + &encore_result); + else + encore(codec->enc_param.handle, + ENC_OPT_ENCODE_VBR, + &encore_input, + &encore_result); + pthread_mutex_unlock(&encode_mutex); + //printf("encode 6\n"); + + result = !quicktime_write_data(file, codec->work_buffer, encore_input.length); + quicktime_update_tables(file, + file->vtracks[track].track, + offset, + file->vtracks[track].current_chunk, + file->vtracks[track].current_position, + 1, + encore_input.length); + + file->vtracks[track].current_chunk++; + + if(encore_result.is_key_frame) + quicktime_insert_keyframe(file, file->vtracks[track].current_position, track); + + //printf("encode 7\n"); + + //printf("encode 8\n"); + + return result; + } + + static int set_parameter(quicktime_t *file, + int track, + char *key, + void *value) + { + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + + if(!strcasecmp(key, "divx_bitrate")) + codec->bitrate = *(int*)value; + else + if(!strcasecmp(key, "divx_rc_period")) + codec->rc_period = *(int*)value; + else + if(!strcasecmp(key, "divx_rc_reaction_ratio")) + codec->rc_reaction_ratio = *(int*)value; + else + if(!strcasecmp(key, "divx_rc_reaction_period")) + codec->rc_reaction_period = *(int*)value; + else + if(!strcasecmp(key, "divx_max_key_interval")) + codec->max_key_interval = *(int*)value; + else + if(!strcasecmp(key, "divx_max_quantizer")) + codec->max_quantizer = *(int*)value; + else + if(!strcasecmp(key, "divx_min_quantizer")) + codec->min_quantizer = *(int*)value; + else + if(!strcasecmp(key, "divx_quantizer")) + codec->quantizer = *(int*)value; + else + if(!strcasecmp(key, "divx_quality")) + codec->quality = *(int*)value; + else + if(!strcasecmp(key, "divx_fix_bitrate")) + codec->fix_bitrate = *(int*)value; + return 0; + } + + + void quicktime_init_codec_divx(quicktime_video_map_t *vtrack) + { + int i; + quicktime_divx_codec_t *codec; + + /* Init public items */ + ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_divx_codec_t)); + ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = delete_codec; + ((quicktime_codec_t*)vtrack->codec)->decode_video = decode; + ((quicktime_codec_t*)vtrack->codec)->encode_video = encode; + ((quicktime_codec_t*)vtrack->codec)->reads_colormodel = reads_colormodel; + ((quicktime_codec_t*)vtrack->codec)->writes_colormodel = writes_colormodel; + ((quicktime_codec_t*)vtrack->codec)->set_parameter = set_parameter; + } + diff -C2 -r -N bcast-2000c/quicktime/divx.c.encore50 bcast-2000c-mf3/quicktime/divx.c.encore50 *** bcast-2000c/quicktime/divx.c.encore50 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/divx.c.encore50 Sat Dec 8 08:58:34 2001 *************** *** 0 **** --- 1,582 ---- + // Divx for encore50 + + + #include "colormodels.h" + #include "funcprotos.h" + #include "quicktime.h" + #include "workarounds.h" + #include ENCORE_INCLUDE + #include DECORE_INCLUDE + + #include + #include + #include + + + typedef struct + { + unsigned char *work_buffer; + char *temp_frame; + long buffer_size; + int decode_initialized; + int encode_initialized; + int bitrate; + long rc_period; // the intended rate control averaging period + long rc_reaction_period; // the reation period for rate control + long rc_reaction_ratio; // the ratio for down/up rate control + long max_key_interval; // the maximum interval between key frames + int max_quantizer; // the upper limit of the quantizer + int min_quantizer; // the lower limit of the quantizer + int quantizer; // For vbr + int quality; // the forward search range for motion estimation + int fix_bitrate; + // Last frame decoded + long last_frame; + int encode_handle; + + DEC_PARAM dec_param; + ENC_PARAM enc_param; + + int decode_handle; + // Must count pframes in VBR + int p_count; + } quicktime_divx_codec_t; + + static pthread_mutex_t encode_mutex; + static pthread_mutex_t decode_mutex; + static int mutex_initialized = 0; + static int decode_handle = 1; + static int encode_handle = 0; + + static int delete_codec(quicktime_video_map_t *vtrack) + { + quicktime_divx_codec_t *codec; + + codec = ((quicktime_codec_t*)vtrack->codec)->priv; + if(codec->encode_initialized) + { + pthread_mutex_lock(&encode_mutex); + encore(codec->encode_handle, + ENC_OPT_RELEASE, + 0, + 0); + pthread_mutex_unlock(&encode_mutex); + } + if(codec->decode_initialized) + { + pthread_mutex_lock(&decode_mutex); + + + + + + /* + * decore(codec->handle, + * DEC_OPT_DESTROY, + * 0, + * 0); + */ + + + + decore(codec->decode_handle, + DEC_OPT_RELEASE, + 0, + 0); + + + + pthread_mutex_unlock(&decode_mutex); + } + if(codec->temp_frame) free(codec->temp_frame); + if(codec->work_buffer) free(codec->work_buffer); + free(codec); + return 0; + } + + static int reads_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_RGB888 || + colormodel == BC_RGBA8888 || + colormodel == BC_RGB161616 || + colormodel == BC_RGBA16161616 || + colormodel == BC_YUV888 || + colormodel == BC_YUVA8888 || + colormodel == BC_YUV161616 || + colormodel == BC_YUVA16161616 || + colormodel == BC_RGB8 || + colormodel == BC_RGB565 || + colormodel == BC_BGR888 || + colormodel == BC_BGR8888 || + colormodel == BC_YUV420P || + colormodel == BC_YUV422); + } + + static int writes_colormodel(quicktime_t *file, + int colormodel, + int track) + { + return (colormodel == BC_RGB888 || + colormodel == BC_RGBA8888 || + colormodel == BC_RGB161616 || + colormodel == BC_RGBA16161616 || + colormodel == BC_YUV888 || + colormodel == BC_YUVA8888 || + colormodel == BC_YUV161616 || + colormodel == BC_YUVA16161616 || + colormodel == BC_YUV420P || + colormodel == BC_YUV422); + } + + + + + + + + + static void init_mutex() + { + if(!mutex_initialized) + { + pthread_mutexattr_t attr; + mutex_initialized = 1; + pthread_mutexattr_init(&attr); + pthread_mutex_init(&decode_mutex, &attr); + pthread_mutex_init(&encode_mutex, &attr); + } + } + + + + + + static int decode(quicktime_t *file, unsigned char **row_pointers, int track) + { + int i; + longest bytes; + int result = 0; + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_trak_t *trak = vtrack->track; + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 16 + 0.5) * 16; + int height_i = (int)((float)height / 16 + 0.5) * 16; + DEC_FRAME dec_frame; + int use_temp = 0; + int input_cmodel; + char *bmp_pointers[3]; + + //printf("decode 1\n"); + + init_mutex(); + pthread_mutex_lock(&decode_mutex); + + if(!codec->decode_initialized) + { + DEC_MEM_REQS dec_mem_reqs; + + // decore requires handle to be > 1 + codec->decode_handle = decode_handle++; + codec->last_frame = -1; + codec->dec_param.x_dim = width_i; + codec->dec_param.y_dim = height_i; + codec->dec_param.output_format = DEC_420; + codec->dec_param.time_incr = 0; + + decore(codec->decode_handle, DEC_OPT_MEMORY_REQS, &codec->dec_param, &dec_mem_reqs); + codec->dec_param.buffers.mp4_edged_ref_buffers = calloc(1, dec_mem_reqs.mp4_edged_ref_buffers_size); + codec->dec_param.buffers.mp4_edged_for_buffers = calloc(1, dec_mem_reqs.mp4_edged_for_buffers_size); + codec->dec_param.buffers.mp4_display_buffers = calloc(1, dec_mem_reqs.mp4_display_buffers_size); + codec->dec_param.buffers.mp4_state = calloc(1, dec_mem_reqs.mp4_state_size); + codec->dec_param.buffers.mp4_tables = calloc(1, dec_mem_reqs.mp4_tables_size); + codec->dec_param.buffers.mp4_stream = calloc(1, dec_mem_reqs.mp4_stream_size); + decore(codec->decode_handle, DEC_OPT_INIT, &codec->dec_param, NULL); + + + /* + * codec->dec_param.width = width_i; + * codec->dec_param.height = height_i; + * decore(0, DEC_OPT_CREATE, &codec->dec_param, NULL); + */ + + codec->decode_initialized = 1; + } + + //printf("decode 1\n"); + + + + + input_cmodel = BC_YUV420P; + if(file->color_model == input_cmodel && + file->out_w == width_i && + file->out_h == height_i && + file->in_x == 0 && + file->in_y == 0 && + file->in_w == width_i && + file->in_h == height_i) + { + // dec_frame.dst = row_pointers[0]; + dec_frame.bmp = row_pointers[0]; + use_temp = 0; + } + else + { + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + } + // dec_frame.dst = codec->temp_frame; + dec_frame.bmp = codec->temp_frame; + use_temp = 1; + } + + + + dec_frame.stride = width_i; + dec_frame.render_flag = 1; + + // dec_frame.render = 1; + // dec_frame.colorspace = DEC_CSP_YV12; + + + + + + + + + + + + + //printf("decode 1 %d %d\n", codec->last_frame, vtrack->current_position); + + if(quicktime_has_keyframes(file, track) && + codec->last_frame >= 0 && + vtrack->current_position != codec->last_frame + 1) + { + int frame1, frame2 = vtrack->current_position; + + frame1 = quicktime_get_keyframe_before(file, vtrack->current_position, track); + + if(frame1 < codec->last_frame && + frame2 > codec->last_frame) frame1 = codec->last_frame + 1; + + + while(frame1 < frame2) + { + quicktime_set_video_position(file, frame1, track); + bytes = quicktime_frame_size(file, frame1, track); + + + if(!codec->work_buffer || codec->buffer_size < bytes) + { + if(codec->work_buffer) free(codec->work_buffer); + codec->buffer_size = bytes; + codec->work_buffer = calloc(1, codec->buffer_size + 100); + } + + quicktime_read_data(file, codec->work_buffer, bytes); + + //printf("decode 2 %d %d\n", frame1, frame2); + dec_frame.bitstream = codec->work_buffer; + dec_frame.length = bytes; + decore(codec->decode_handle, 0, &dec_frame, NULL); + frame1++; + } + + + vtrack->current_position = frame2; + } + + + + + + + + + + + + + + + quicktime_set_video_position(file, vtrack->current_position, track); + bytes = quicktime_frame_size(file, vtrack->current_position, track); + codec->last_frame = vtrack->current_position; + //printf("decode 1\n"); + + if(!codec->work_buffer || codec->buffer_size < bytes) + { + if(codec->work_buffer) free(codec->work_buffer); + codec->buffer_size = bytes; + codec->work_buffer = calloc(1, codec->buffer_size + 100); + } + //printf("decode 1\n"); + + result = !quicktime_read_data(file, codec->work_buffer, bytes); + //printf("decode 1\n"); + + + dec_frame.bitstream = codec->work_buffer; + dec_frame.length = bytes; + + //printf("decode 1\n"); + // decore(codec->dec_param.handle, DEC_OPT_DECODE, &dec_frame, NULL); + decore(codec->decode_handle, 0, &dec_frame, NULL); + //printf("decode 2\n"); + + + pthread_mutex_unlock(&decode_mutex); + //printf("decode 1 %d %d\n", use_temp, file->color_model); + + if(use_temp) + { + unsigned char **input_rows = malloc(sizeof(unsigned char*) * height_i); + for(i = 0; i < height_i; i++) + input_rows[i] = codec->temp_frame + width_i * 3; + + + cmodel_transfer(row_pointers, /* Leave NULL if non existent */ + input_rows, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + file->in_x, /* Dimensions to capture from input frame */ + file->in_y, + file->in_w, + file->in_h, + 0, /* Dimensions to project on output frame */ + 0, + file->out_w, + file->out_h, + input_cmodel, + file->color_model, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width_i, /* For planar use the luma rowspan */ + width); + + free(input_rows); + } + + + + + //printf("decode 2\n"); + + return result; + } + + + + + + + + static int encode(quicktime_t *file, unsigned char **row_pointers, int track) + { + //printf("encode 1\n"); + longest offset = quicktime_position(file); + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + quicktime_trak_t *trak = vtrack->track; + int width = trak->tkhd.track_width; + int height = trak->tkhd.track_height; + int width_i = (int)((float)width / 16 + 0.5) * 16; + int height_i = (int)((float)height / 16 + 0.5) * 16; + int result = 0; + int i; + ENC_FRAME encore_input; + ENC_RESULT encore_result; + //printf("encode 1 %d %d\n", width_i, height_i); + + init_mutex(); + pthread_mutex_lock(&encode_mutex); + + if(!codec->encode_initialized) + { + codec->encode_initialized = 1; + codec->encode_handle = encode_handle++; + codec->enc_param.x_dim = width_i; + codec->enc_param.y_dim = height_i; + codec->enc_param.framerate = quicktime_frame_rate(file, track); + codec->enc_param.bitrate = codec->bitrate; + codec->enc_param.rc_period = codec->rc_period; + codec->enc_param.rc_reaction_period = codec->rc_reaction_period; + codec->enc_param.rc_reaction_ratio = codec->rc_reaction_ratio; + codec->enc_param.max_quantizer = codec->max_quantizer; + codec->enc_param.min_quantizer = codec->min_quantizer; + codec->enc_param.max_key_interval = codec->max_key_interval; + codec->enc_param.search_range = codec->quality * 3; + + + encore(codec->encode_handle, ENC_OPT_INIT, &codec->enc_param, NULL); + } + + //printf("encode 1\n"); + + // Assume planes are contiguous + if(file->color_model == BC_YUV420P && + width == width_i && + height == height_i) + { + //printf("encode 1.1\n"); + encore_input.image = row_pointers[0]; + } + // Convert to YUV420P + else + { + if(!codec->temp_frame) + { + codec->temp_frame = malloc(width_i * height_i * 3 / 2); + } + //printf("encode 2 %d %d %d %d %d %d\n", file->color_model, width, height, width_i, height_i); + + //printf("encode 1.5\n"); + cmodel_transfer(0, /* Leave NULL if non existent */ + row_pointers, + codec->temp_frame, /* Leave NULL if non existent */ + codec->temp_frame + width_i * height_i, + codec->temp_frame + width_i * height_i + width_i * height_i / 4, + row_pointers[0], /* Leave NULL if non existent */ + row_pointers[1], + row_pointers[2], + 0, /* Dimensions to capture from input frame */ + 0, + width, + height, + 0, /* Dimensions to project on output frame */ + 0, + width, + height, + file->color_model, + BC_YUV420P, + 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + width, /* For planar use the luma rowspan */ + width_i); + + //printf("encode 2\n"); + + encore_input.image = codec->temp_frame; + } + //printf("encode 3\n"); + + if(!codec->work_buffer) + { + codec->buffer_size = width * height; + // codec->buffer_size = 0x1000000; + codec->work_buffer = malloc(codec->buffer_size); + } + + //printf("encode 4\n"); + + bzero(codec->work_buffer, codec->buffer_size); + encore_input.bitstream = codec->work_buffer; + encore_input.length = codec->buffer_size; + encore_input.quant = !codec->fix_bitrate ? codec->quantizer : 0; + + if(codec->p_count == 0) + { + codec->p_count++; + } + else + { + codec->p_count++; + if(codec->p_count >= codec->max_key_interval) + codec->p_count = 0; + } + + //printf("encode 5 %d\n", encore_input.quant); + encore(codec->encode_handle, + 0, + &encore_input, + &encore_result); + pthread_mutex_unlock(&encode_mutex); + //printf("encode 6\n"); + + result = !quicktime_write_data(file, codec->work_buffer, encore_input.length); + quicktime_update_tables(file, + file->vtracks[track].track, + offset, + file->vtracks[track].current_chunk, + file->vtracks[track].current_position, + 1, + encore_input.length); + + file->vtracks[track].current_chunk++; + + if(encore_result.isKeyFrame) + quicktime_insert_keyframe(file, file->vtracks[track].current_position, track); + + //printf("encode 7\n"); + + //printf("encode 8\n"); + + return result; + } + + static int set_parameter(quicktime_t *file, + int track, + char *key, + void *value) + { + quicktime_video_map_t *vtrack = &(file->vtracks[track]); + quicktime_divx_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + + if(!strcasecmp(key, "divx_bitrate")) + codec->bitrate = *(int*)value; + else + if(!strcasecmp(key, "divx_rc_period")) + codec->rc_period = *(int*)value; + else + if(!strcasecmp(key, "divx_rc_reaction_ratio")) + codec->rc_reaction_ratio = *(int*)value; + else + if(!strcasecmp(key, "divx_rc_reaction_period")) + codec->rc_reaction_period = *(int*)value; + else + if(!strcasecmp(key, "divx_max_key_interval")) + codec->max_key_interval = *(int*)value; + else + if(!strcasecmp(key, "divx_max_quantizer")) + codec->max_quantizer = *(int*)value; + else + if(!strcasecmp(key, "divx_min_quantizer")) + codec->min_quantizer = *(int*)value; + else + if(!strcasecmp(key, "divx_quantizer")) + codec->quantizer = *(int*)value; + else + if(!strcasecmp(key, "divx_quality")) + codec->quality = *(int*)value; + else + if(!strcasecmp(key, "divx_fix_bitrate")) + codec->fix_bitrate = *(int*)value; + return 0; + } + + + void quicktime_init_codec_divx(quicktime_video_map_t *vtrack) + { + int i; + quicktime_divx_codec_t *codec; + + /* Init public items */ + ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_divx_codec_t)); + ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = delete_codec; + ((quicktime_codec_t*)vtrack->codec)->decode_video = decode; + ((quicktime_codec_t*)vtrack->codec)->encode_video = encode; + ((quicktime_codec_t*)vtrack->codec)->reads_colormodel = reads_colormodel; + ((quicktime_codec_t*)vtrack->codec)->writes_colormodel = writes_colormodel; + ((quicktime_codec_t*)vtrack->codec)->set_parameter = set_parameter; + } + diff -C2 -r -N bcast-2000c/quicktime/divx.h bcast-2000c-mf3/quicktime/divx.h *** bcast-2000c/quicktime/divx.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/divx.h Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1,6 ---- + #ifndef QUICKTIME_DIVX_H + #define QUICKTIME_DIVX_H + + extern void quicktime_init_codec_divx(quicktime_video_map_t *); + + #endif diff -C2 -r -N bcast-2000c/quicktime/divx.h.2 bcast-2000c-mf3/quicktime/divx.h.2 *** bcast-2000c/quicktime/divx.h.2 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/divx.h.2 Thu Nov 29 11:12:33 2001 *************** *** 0 **** --- 1,30 ---- + #ifndef QUICKTIME_DIVX_H + #define QUICKTIME_DIVX_H + + // OpenDIVX + + #include DECORE_DIR + #include ENCORE_DIR + #include + + typedef struct + { + unsigned char *work_buffer; + unsigned char *temp_frame; + long buffer_size; + int decode_initialized; + int encode_initialized; + DEC_PARAM dec_param; + ENC_PARAM enc_param; + int bitrate; + long rc_period; // the intended rate control averaging period + long rc_reaction_period; // the reation period for rate control + long rc_reaction_ratio; // the ratio for down/up rate control + long max_key_interval; // the maximum interval between key frames + int max_quantizer; // the upper limit of the quantizer + int min_quantizer; // the lower limit of the quantizer + int search_range; // the forward search range for motion estimation + + } quicktime_divx_codec_t; + + #endif diff -C2 -r -N bcast-2000c/quicktime/divx.h.50 bcast-2000c-mf3/quicktime/divx.h.50 *** bcast-2000c/quicktime/divx.h.50 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/divx.h.50 Fri Nov 30 02:09:09 2001 *************** *** 0 **** --- 1,29 ---- + #ifndef QUICKTIME_DIVX_H + #define QUICKTIME_DIVX_H + + // OpenDIVX + + #include DECORE_DIR + #include + + typedef struct + { + unsigned char *work_buffer; + unsigned char *temp_frame; + long buffer_size; + int decode_initialized; + int encode_initialized; + int handle; + int bitrate; + long rc_period; // the intended rate control averaging period + long rc_reaction_period; // the reation period for rate control + long rc_reaction_ratio; // the ratio for down/up rate control + long max_key_interval; // the maximum interval between key frames + int max_quantizer; // the upper limit of the quantizer + int min_quantizer; // the lower limit of the quantizer + int search_range; // the forward search range for motion estimation + DEC_PARAM dec_param; + + } quicktime_divx_codec_t; + + #endif diff -C2 -r -N bcast-2000c/quicktime/docs/CVS/Entries bcast-2000c-mf3/quicktime/docs/CVS/Entries *** bcast-2000c/quicktime/docs/CVS/Entries Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/docs/CVS/Entries Mon Dec 17 14:28:27 2001 *************** *** 1,12 **** ! /Makefile.am/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /Makefile.in/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /building.html/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /codecs.html/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /firewire.html/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /index.html/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /opening.html/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /positioning.html/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /reading.html/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /util.html/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /writing.html/1.1.1.1/Thu Nov 2 04:28:45 2000// D --- 1,13 ---- ! /Makefile.am/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /Makefile.in/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /firewire.html/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /license.html/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /util.html/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /building.html/1.2/Mon Dec 17 13:28:26 2001// ! /codecs.html/1.2/Mon Dec 17 13:28:26 2001// ! /index.html/1.2/Mon Dec 17 13:28:27 2001// ! /opening.html/1.2/Mon Dec 17 13:28:27 2001// ! /positioning.html/1.2/Mon Dec 17 13:28:27 2001// ! /reading.html/1.2/Mon Dec 17 13:28:27 2001// ! /writing.html/1.2/Mon Dec 17 13:28:27 2001// D diff -C2 -r -N bcast-2000c/quicktime/docs/CVS/Root bcast-2000c-mf3/quicktime/docs/CVS/Root *** bcast-2000c/quicktime/docs/CVS/Root Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/docs/CVS/Root Tue Nov 6 14:47:04 2001 *************** *** 1 **** ! heroines@cvs.heroines.sourceforge.net:/cvsroot/heroines --- 1 ---- ! :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/docs/building.html bcast-2000c-mf3/quicktime/docs/building.html *** bcast-2000c/quicktime/docs/building.html Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/docs/building.html Mon Dec 17 14:28:26 2001 *************** *** 4,12 ****

Step 1: Build the library

! Run the configure script. It takes several options which can be ! viewed by invoking configure --help.

! Then run make. Now you have a self contained libary: ! libquicktime.a.

--- 4,17 ----

Step 1: Build the library

! The entire source code tree should be positioned in a location where ! every application that needs it can access it. There is no provision ! for standard include files and normally it's much to difficult for ! users to match versions to use it as a shared library. Those of you ! who were around in 1997 may remember QT doing this.

! Run make. Make automatically configures itself. The output is put in ! i686/libquicktime.a. You should manually set the CFLAGS environment ! variable with the optimum optimization parameters for your i686 ! derivative.

diff -C2 -r -N bcast-2000c/quicktime/docs/codecs.html bcast-2000c-mf3/quicktime/docs/codecs.html *** bcast-2000c/quicktime/docs/codecs.html Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/docs/codecs.html Mon Dec 17 14:28:26 2001 *************** *** 6,35 ****

DV

! DV is only supported for decoding only. Secondly, only NTSC 25 ! Mbit/sec 4:1:1 DV data has ever been tested. There are two derivatives ! of DV: DVC and DVCP. The dvcp format is used by ! professional equipment and can't be supported because of cost ! restrictions.

IMA4

The IMA4 compressor reduces 16 bit audio data to 1/4 size, with very ! good quality. This is the preferred codec for low bandwidth audio.

JPEG

! and JPEG is preferred for low bandwidth video. This format writes a ! seperate JPEG photo for every frame.

! Using the JPEG format requires calling the following function after quicktime_set_video.

! int quicktime_set_jpeg(quicktime_t *file, int quality, int use_float);

! This takes a quality factor from 1 - 100 and a booleen flag to determine whether floating point operations should be used to slow it down.

--- 6,59 ---- +

DIVX

+ + This encodes video in MPEG-4 using the OpenDivx codec. This is the + preferred compressed format although it probably won't be supported by + Microsoft or Apple any time soon. It takes the following + parameters:

+ + + + divx_bitrate (int)
+ divx_rc_period (int)
+ divx_rc_reaction_ratio (int)
+ divx_rc_reaction_period (int)
+ divx_max_key_interval (int)
+ divx_max_quantizer (int)
+ divx_min_quantizer (int)
+ divx_quantizer (int)
+ divx_quality (int)
+ divx_fix_bitrate (int)
+

+ +

DV

! DV is supported for full decoding but only for black and white encoding ! on IA-32 platforms/architectures. Secondly, only NTSC 25 Mbit/sec ! 4:1:1 DV data has ever been tested. There are two derivatives of DV: ! DVC and DVCP. Only DVC is currently supported.

IMA4

The IMA4 compressor reduces 16 bit audio data to 1/4 size, with very ! good quality. For many years IMA4 was the best compressed audio format ! in Quicktime. The first Starwars trailer in 1998 was encoded using ! IMA4 audio.

JPEG

! JPEG is preferred for compressed video. This format writes a seperate ! JPEG photo for every frame in YUV 4:2:0.

! JPEG supports the following parameters, which can be set after quicktime_set_video.

! jpeg_quality (int)
! jpeg_usefloat (int)

! These takes a quality factor from 1 - 100 and a booleen flag to determine whether floating point operations should be used to slow it down.

*************** *** 37,45 ****

MJPA

! MJPA stores each frame as two JPEGs interlaced. Quicktime for Linux ! lets you synthesize MJPA images suitable for playback on hardware or ! decompress MJPA frames captured on hardware. The real advantage is ! that it can split compression and decompression across 2 processors, ! doubling the frame rate. To enable dualized MJPA processing call:

--- 61,68 ----

MJPA

! MJPA stores each frame as two JPEGs interlaced and in YUV 4:2:2. The ! real advantage is that it can split compression and decompression ! across 2 processors and it supports higher color sampling than JPEG ! Photo. To enable dualized MJPA processing call:

*************** *** 58,75 **** codec supports 32 bit depths.

-

YUV2

- - The human eye percieves brightness much more accurately than colors. - YUV2 downsamples the color components by 50% for a total compression of - 33% with virtually no image degredation. This is preferred for - intermediate storage. YUV2 is called "Component video" in Losedows and - Mac OS land.

- -

YUV4

- - YUV4 is planar YUV, identical to MPEG. It downsamples the color - components by 75% for a total 50% compression. This is the preferred - intermediate format for working with MPEG.

-

RAW

--- 81,84 ---- *************** *** 86,96 ****

! specifying a depth of 32. In this case the input format for ! encode_video functions is RGBA packed as well.

TWOS

! Twos is the preferred encoding for audio. It stores 8, 16, and 24 bit ! audio, interleaved for multiple channels. The 8 bit mode is signed. ! The 16 and 24 bit modes are big endian signed. There is no codec for ! these formats because they're simple enough to access raw. --- 95,117 ----

! specifying a depth of 32.

TWOS

! Twos is the preferred encoding for uncompressed audio. It stores 8, ! 16, and 24 bit audio, interleaved for multiple channels. The 8 bit ! mode is signed. The 16 and 24 bit modes are big endian signed. ! !

Vorbis

! ! This is the preferred encoding for compressed audio although it ! probably won't be supported by Microsoft or Apple any time soon. It ! takes the following parameters:

! ! ! vorbis_bitrate (int)
! vorbis_max_bitrate (int)
! vorbis_min_bitrate (int)
!

! ! Units are bits per second. diff -C2 -r -N bcast-2000c/quicktime/docs/index.html bcast-2000c-mf3/quicktime/docs/index.html *** bcast-2000c/quicktime/docs/index.html Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/docs/index.html Mon Dec 17 14:28:27 2001 *************** *** 8,13 **** ! Author: Adam Williams broadcast@earthling.net
! Homepage: heroinewarrior.com/quicktime.html
Requires: libpthread libpng
--- 8,13 ---- ! Author: Heroine Virtual broadcast@earthling.net
! Homepage: heroinewarrior.com/quicktime.php3
Requires: libpthread libpng
*************** *** 18,46 **** ! Quicktime movies are first and foremost a very complicated, tedious, ! wrapper for 3rd party compression schemes.

! ! Quicktime for Linux hides the nightmare of accessing a Quicktime movie ! and gives the programmer a set of audio and video streams with some ! compression ability. The audio tracks are sequential streams of PCM ! audio data and video tracks are a sequential streams of frames.

Before you drop your classes and write up your dream program on this be aware of some limitations. This library doesn't give you the official ! Quicktime API even remotely. It uses it's own threadable, scalable ! ANSI C API. This library doesn't include any commercial codecs nor ! does it include support for keyframes, which most of the expensive ! codecs require but the free codecs don't. Also you may encounter ! Quicktime files containing compressed headers. This library only reads ! uncompressed headers.

! ! What you can do is create and read any Quicktime movie that uses JPEG, ! MJPA, RGB, PNG, or YUV2 compression and many sound formats. MJPA, ! JPEG, RGB, PNG, YUV 4:2:2, and YUV 4:2:0 encoding and decoding is ! currently built into the library. For audio, IMA4, ulaw, 16, 8, and 24 ! bit linear encoding and decoding is in the library. You can still get ! raw data if you want to write your own compression routines.

Contents

Step 1: Building the library

--- 18,51 ---- ! Quicktime movies are first and foremost a very sophisticated wrapper ! for 3rd party compression schemes. While not belonging to the umbrella ! of official Microsoft software, it is well documented and it supports ! files longer than 4 GB.

! ! Quicktime for Linux hides the structure of a Quicktime movie and gives ! the programmer a set of audio and video streams with some compression ! ability. The audio tracks are sequential streams of PCM audio data and ! video tracks are a sequential streams of frames.

Before you drop your classes and write up your dream program on this be aware of some limitations. This library doesn't give you the official ! Quicktime API. It uses an ANSI C API. This library doesn't include ! any commercial codecs or compressed header support. This library only ! reads uncompressed headers.

! ! What you can do is create and read any Quicktime movie using certain ! compression formats. You can still access raw data if you want to ! write your own compression routines.

! ! Quicktime for Linux doesn't officially use plugins to achieve ! functionality although there is some unfinished code for handling ! plugins. The philosophy behind this is that users can easily access ! the complete library and source code over the internet and the library ! is always updated more frequently than the codecs. Plugins are more ! convenient when the library is only available on hard media or requires ! upgrade licenses for every download, which it doesn't.

Contents

+ License

Step 1: Building the library

*************** *** 49,68 **** Reading a file

Decoding Video
- Changing the colormodel
Reading raw video
Reading raw audio

! Positioning yourself in a file

Writing a file

Encoding Video
- Changing the colormodel
Encoding Audio
Writing raw video
Writing raw audio
--- 54,74 ---- Reading a file +
Decoding Video
Reading raw video
+ Reading keyframes
Reading raw audio

! Positioning in a file

Writing a file

Encoding Video
Encoding Audio
Writing raw video
+ Writing keyframes
Writing raw audio
diff -C2 -r -N bcast-2000c/quicktime/docs/license.html bcast-2000c-mf3/quicktime/docs/license.html *** bcast-2000c/quicktime/docs/license.html Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/docs/license.html Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,52 ---- + Quicktime for Linux + + + + + +

GNU Lesser General Public License

+

+ + + The terms of the GNU Lesser General Public License apply to everything + except libdv and libraw. You can statically link the + rest in a program and charge money for the program. The only condition + is that if you use it in a program, you must put the author's name and + email somewhere. If you improve the library itself or add a free codec + to it, you should release your improvements. If you redistribute the + code, you must also redistribute the author information and + documentation. You are free to include this library in a derived work + and license the derived work under GPL.

+ + + + In addition to the LGPL's warranty stipulation, quicktime4linux is + distributed WITHOUT GUARANTEED SUPPORT; without even the guarantee of + ADDITIONAL LABOR. Support that is not guaranteed includes technical + support, compiler troubleshooting, debugging, version matching, + updating, among other additional labor which may or may not be required + to meet a user's requirements.

+ + + + + + +

+ 
+ 
+ This library 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 of the License, or
+ (at your option) any later version.
+ 
+ This library 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 this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 
+ USA
+ 
diff -C2 -r -N bcast-2000c/quicktime/docs/opening.html bcast-2000c-mf3/quicktime/docs/opening.html
*** bcast-2000c/quicktime/docs/opening.html	Mon Jan 22 21:55:48 2001
--- bcast-2000c-mf3/quicktime/docs/opening.html	Mon Dec 17 14:28:27 2001
***************
*** 18,23 ****
  
  
! and open the file in read only, read/write, or write mode.  The
! following code opens a file in read only:

--- 18,23 ---- ! and open the file in read or write mode. The following code opens ! a file in read only:

*************** *** 26,33 **** Argument 1 is the path to a file. Argument 2 is a flag for read ! access. Argument 3 is a flag for write access. You can specify read, ! read/write or write access by setting these flags. Only specify ! read/write for creating new files. Opening an existing file in ! read/write mode destroys the file.

quicktime_open returns a NULL if the file couldn't be opened or the --- 26,32 ---- Argument 1 is the path to a file. Argument 2 is a flag for read ! access. Argument 3 is a flag for write access. You can specify read ! or write access by setting these flags. Never specify read and ! write.

quicktime_open returns a NULL if the file couldn't be opened or the *************** *** 37,41 **** ! When you're done doing whatever you do, call

--- 36,40 ---- ! When you're done using the file, call

diff -C2 -r -N bcast-2000c/quicktime/docs/positioning.html bcast-2000c-mf3/quicktime/docs/positioning.html *** bcast-2000c/quicktime/docs/positioning.html Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/docs/positioning.html Mon Dec 17 14:28:27 2001 *************** *** 12,18 **** position every time you want to read a different audio channel.

! When you write audio, you write all channels simultaneously, so there's ! no need to manually set the file position unless you want to overwrite ! data.

The positioning routines are as follows:

--- 12,16 ---- position every time you want to read a different audio channel.

! There is no positioning support while writing because this is write-only.

The positioning routines are as follows:

diff -C2 -r -N bcast-2000c/quicktime/docs/reading.html bcast-2000c-mf3/quicktime/docs/reading.html *** bcast-2000c/quicktime/docs/reading.html Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/docs/reading.html Mon Dec 17 14:28:27 2001 *************** *** 64,73 **** compression of the track. These identifiers are 4 alphanumeric characters which go along with one of the #defines in quicktime.h. The ! bits parameter returns the number of bits in a sample.

The most interesting contents of a Quicktime file are of course the video tracks. Quicktime stores multiple video tracks.

! The available video information for each video track is:

--- 64,74 ---- compression of the track. These identifiers are 4 alphanumeric characters which go along with one of the #defines in quicktime.h. The ! bits function returns the number of bits in a sample, usually ! meaningless.

The most interesting contents of a Quicktime file are of course the video tracks. Quicktime stores multiple video tracks.

! The available queries for each video track are:

*************** *** 79,82 **** --- 80,86 ---- long quicktime_frame_size(quicktime_t *file, long frame, int track);
int quicktime_video_depth(quicktime_t *file, int track);
+ quicktime_reads_cmodel(quicktime_t *file, + int colormodel, + int track);

*************** *** 87,100 **** length is in frames. The width and height are in pixels. The frame rate is in frames per second. Depth returns the total number of bits ! per pixel. These are not the number of bits per pixel on disk but the ! number of bits per pixel in the decompressed data returned by one of ! the video decoding routines. The only two values Quicktime for Linux ! returns are 24 and 32 and the 32 bit depth is only supported in PNG and ! RGB format. There's no reason to use 16 or 8. A depth of 24 means a ! video row from a decoding routine is in RGBRGBRGB packed bytes. A ! depth of 32 means video data is in RGBARGBARGBA packed bytes with alpha ! channels.

! To get a four byte compressor type for the track issue:

--- 91,106 ---- length is in frames. The width and height are in pixels. The frame rate is in frames per second. Depth returns the total number of bits ! per pixel. The only two values Quicktime for Linux returns are 24 and ! 32 and the 32 bit depth is only returned when the format has an alpha ! channel. There's no reason to use 16 or 8.

! ! quicktime_reads_cmodel allows you to determine the optimum color ! model for decompression output. It requires a colormodel #define from ! colormodels.h. If the codec can generate the desired colormodel ! without downsampling it returns 1. If downsampling is required it ! returns 0. You can assume all colormodels in colormodels.h are ! supported, whether they require downsampling or not.

! To get the four byte compressor type for the track issue:

*************** *** 104,116 **** Unless you get a really nihilistic file for reading, you can safely ! assume the encoding scheme for track 0 of any file is the same for all ! tracks of that media type.

Decoding video

! The library decodes compressed video frames into rows of unsigned RGB ! bytes or RGBA bytes, depending on the depth. Then it gives you an ! array of row pointers. First issue

--- 110,121 ---- Unless you get a really nihilistic file for reading, you can safely ! assume the encoding scheme for track 0 of audio or video is the same ! for all tracks.

Decoding video

! The library decodes compressed video frames into a buffer in whatever ! colormodel you desire but before then you should issue

*************** *** 125,165 **** ! int quicktime_decode_video(quicktime_t *file, unsigned char **row_pointers, int track);
!
!

! ! to decompress a frame at the current position of the track into ! **row_pointers and advance the current position. The array of rows ! must have enough space allocated for the entire frame. For each row ! that's width * depth / 8 bytes. For more about positioning go to positioning

! ! There are other routines for reading compressed data and chunks, but ! unless you want to write a codec, you'd better focus on more important ! things.

! ! !

Changing the colormodel

! ! The quicktime_decode_video command can produce rows other ! than RGB but only if the sampling is equal or higher than the codec. ! Before calling quicktime_decode_video call

! ! ! quicktime_reads_cmodel(quicktime_t *file, ! int colormodel, ! int track); ! !

! ! colormodels.h contains a set of colormodel #defines which supply ! the colormodel argument. The function returns True or False depending ! on if the colormodel argument is supported. BC_RGB888 is always ! supported.

! ! Once you find a supported colormodel call

! !

! quicktime_decode_scaled(quicktime_t *file, 
  	int in_x,                    /* Location of input frame to take picture */
  	int in_y,
--- 130,135 ----
  
  
! 
! long quicktime_decode_scaled(quicktime_t *file, 
  	int in_x,                    /* Location of input frame to take picture */
  	int in_y,
***************
*** 170,188 ****
  	int color_model,             /* One of the color models defined above */
  	unsigned char **row_pointers, 
! 	int track);
! 
- instead of quicktime_decode_video. The usage is identical - to quicktime_decode_video except for the input and output - dimensions.

- - The row pointers must point to rows allocated with enough memory to - store the colormodel. Planar colormodels use only the first 3 row - pointers, each pointing to one of the planes.

The decoder "sees" a region of the movie screen defined by in_x, in_y, in_w, in_h and transfers it to the frame buffer defined by **row_pointers. The size of the frame buffer is defined by ! out_w, out_h. --- 140,167 ---- int color_model, /* One of the color models defined above */ unsigned char **row_pointers, ! int track);
!

! !

! ! to decompress a frame at the current position of the track into ! **row_pointers and advance the current position. The array of rows ! must have enough space allocated for the entire frame, depending on the ! colormodel. Planar colormodels use only the first 3 row pointers, each ! pointing to one of the planes.

The decoder "sees" a region of the movie screen defined by in_x, in_y, in_w, in_h and transfers it to the frame buffer defined by **row_pointers. The size of the frame buffer is defined by ! out_w, out_h.

! ! ! For more about the track's current position go to positioning

! ! There are other routines for reading compressed data and chunks, but ! unless you want to write a codec, you'd better focus on more important ! things.

*************** *** 200,204 **** ! int quicktime_decode_audio(quicktime_t *file, QUICKTIME_INT16 *output_i, float *output_f, long samples, int channel);

--- 179,183 ---- ! int quicktime_decode_audio(quicktime_t *file, int16_t *output_i, float *output_f, long samples, int channel);

*************** *** 212,216 **** channels in the track.

! Notice the QUICKTIME_INT16* and float* parameters. This call can either return a buffer of int16 samples or float samples. The argument for the data format you want should be passed a preallocated buffer big --- 191,195 ---- channels in the track.

! Notice the int16_t* and float* parameters. This call can either return a buffer of int16 samples or float samples. The argument for the data format you want should be passed a preallocated buffer big *************** *** 235,245 **** - When you're done reading, call - - - quicktime_close(quicktime_t *file);
-
-

-

Reading raw video

--- 214,217 ---- *************** *** 264,299 **** 0.

! Now some of you are going to want to read frames directly from a file ! descriptor using another library like libjpeg or something. To read a ! frame directly start by calling

! ! int quicktime_read_frame_init(quicktime_t *file, int track); !

! ! to initialize the input. ! Then read your raw, compressed data from a file descriptor given by !

! FILE* quicktime_get_fd(quicktime_t *file);

! End the frame read operation by calling

! int quicktime_read_frame_end(quicktime_t *file, int track);

! You can get the file descriptor any time the file is opened, not just ! when reading or writing, but you must call the init and end routines to ! read a frame.

Reading raw audio

These commands are good for reading raw sample data. They should only be used for codecs not supported in the library and only work for --- 236,273 ---- 0.

! !

Accessing Keyframes

! Quicktime offers very simple support for keyframes: a table of all the ! keyframe numbers in a track. Many students think there's a massive ! keyframe programming language in Quicktime. Really all there is is a ! table.

! There are two things you can do with the keyframe table: insert ! keyframe numbers and retrieve keyframe numbers.

! long quicktime_get_keyframe_before(quicktime_t *file, long frame, int track)

! Gets the keyframe number before the frame argument. The frame ! argument starts on 0.

! void quicktime_insert_keyframe(quicktime_t *file, long frame, int track)

! Inserts a keyframe into the table. The frame argument starts on 0.

!

Reading raw audio

+ This functionality is obsolete and there's no reason to use it. A + future interface may provide raw audio support but for now you're + better off writing a codec into the library.

+ These commands are good for reading raw sample data. They should only be used for codecs not supported in the library and only work for diff -C2 -r -N bcast-2000c/quicktime/docs/writing.html bcast-2000c-mf3/quicktime/docs/writing.html *** bcast-2000c/quicktime/docs/writing.html Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/docs/writing.html Mon Dec 17 15:01:48 2001 *************** *** 15,73 **** Don't call the audio command if you don't intend to store any audio ! data. Some programs rely on an audio track for video timing. ! Likewise, don't call the video command if you're just going to save ! audio.

Notice the channels argument for audio channels but there is no ! argument for total audio tracks. For sanity reasons, the library only ! supports writing one audio track of any number of channels.

If you intend to use the library's built-in compression routines specify a compressor #define from quicktime.h as the compressor argument. If you want to write your own compression routine, specify ! any 4 byte identifier you want. The compressor applies to all tracks ! of the same media type, for sanity reasons.

! Choose an audio compressor for the audio command and a video compressor ! for the video command. The library doesn't check for conflicting media ! types or whether a compressor you make up is legitimate.

! ! Now you'll want to seek to any point in the file. Seeking works ! exactly as in reading, using the same commands, except if you seek to ! the middle of a file and write out data, you're going to cause a glitch ! in the playback data. It's virtually impossible to line up new frame ! boundaries with old frames since some codecs aren't linear and hardly ! anyone uses this library anyway.

! !

Encoding video

! The library generates compressed video frames from rows of unsigned RGB ! bytes. This depends on whether the compressor you passed to ! quicktime_set_video is supported in the library. First use

! int quicktime_supported_video(quicktime_t *file, int track);

! to find out if the codec for the track is in the library. This returns ! 1 if it is and 0 if it isn't supported. Then use ! !

! int quicktime_encode_video(quicktime_t *file, unsigned char **row_pointers, int track); !

! to compress the frame pointed to by **row_pointers, write it at the ! current position of the track and advance the current position. The ! return value is always 1 for failure and 0 for success.

! !

Changing the colormodel

! The quicktime_encode_video command can encode rows other ! than RGB. Before calling quicktime_encode_video call

--- 15,70 ---- Don't call the audio command if you don't intend to store any audio ! data. Likewise, don't call the video command if you're just going to ! save audio.

Notice the channels argument for audio channels but there is no ! argument for total audio tracks. Currently the library only supports ! writing one audio track of any number of channels.

If you intend to use the library's built-in compression routines specify a compressor #define from quicktime.h as the compressor argument. If you want to write your own compression routine, specify ! any 4 byte identifier you want but don't expect the library to handle ! compression. The compressor applies to all tracks of the same media ! type, for sanity reasons.

+ Once these routines are called you can optionally call

! ! void quicktime_set_parameter(quicktime_t *file, char *key, void *value);

!

! to set compression parameters for the codecs. Each parameter for a ! codec consists of a unique string and a pointer to a value. The string ! is unique to the codec and the parameter. The value is in a specific ! data type recognized by the parameter.

! To set a jpeg compression quality of 80, for example, do the following:

! int quality = 80;
! quicktime_set_parameter(file, "jpeg_quality", &quality);

! The data type of the value depends on the parameter. Currently the ! best way to determine what parameters and value data types a particular ! codec supports is to look at the codec's source code. A better way may ! become available in the future.

+ If you don't call quicktime_set_parameter the codecs will use default + parameters.

! !

Encoding video

+ The library generates compressed video frames from a frame buffer of + any colormodel in colormodels.h. First use

! ! int quicktime_supported_video(quicktime_t *file, int track); !

! to find out if the codec for the track is in the library. This returns ! 1 if it is and 0 if it isn't supported. Then use

*************** *** 77,94 ****

! colormodels.h contains a set of colormodel #defines which supply ! the colormodel argument. The function returns True or False depending ! on if the colormodel argument is supported. BC_RGB888 is always ! supported.

! ! Once you find a supported colormodel call

quicktime_set_cmodel(quicktime_t *file, int colormodel);

! and then

- quicktime_encode_video ! The row pointers must point to rows stored in the colormodel. Planar colormodels use only the first 3 row pointers, each pointing to one of the planes.

--- 74,97 ----

! To query the library for a colormodel which doesn't require ! downsampling to drive the codec. colormodels.h contains a set ! of colormodel #defines which supply the colormodel argument. The ! function returns True or False depending on whether the colormodel ! argument is optimum. When a colormodel doesn't require downsampling it ! returns 1. Then call

quicktime_set_cmodel(quicktime_t *file, int colormodel);

! to set the colormodel your frame buffer is in. Finally call ! !

! int quicktime_encode_video(quicktime_t *file, unsigned char **row_pointers, int track); !

! to compress the frame pointed to by **row_pointers, write it at the ! current position of the track and advance the current position. The ! return value is always 1 for failure and 0 for success. The row ! pointers must point to rows stored in the colormodel. Planar colormodels use only the first 3 row pointers, each pointing to one of the planes.

*************** *** 98,102 **** -

Encoding audio

--- 101,104 ---- *************** *** 114,126 ****

! int quicktime_encode_audio(quicktime_t *file, QUICKTIME_INT16 **input_i, float **input_f, long samples);

to encode the sample buffer. Pass an array of buffers to either the ! QUICKTIME_INT16** or the float** argument, depending on what format ! your data is in. Pass a NULL to the undesired format. The array of ! buffers is one buffer of samples for each channel, all pointed to by an ! array. This means all the channels have to be written simultaneously. ! The return value is 0 on success.

--- 116,127 ----

! int quicktime_encode_audio(quicktime_t *file, int16_t **input_i, float **input_f, long samples);

to encode the sample buffer. Pass an array of buffers to either the ! int16_t** or the float** argument, depending on what format your data ! is in. Pass a NULL to the undesired format. The array of buffers is ! one buffer of samples for each channel. This means all the channels ! have to be written simultaneously. The return value is 0 on success.

*************** *** 140,143 **** --- 141,145 ---- + Now some of you are going to want to write frames directly to a file descriptor using another library like libjpeg or something. For every *************** *** 164,173 **** Repeat starting at quicktime_write_frame_init for every frame.

Writing raw audio data

Writing audio involves writing the raw audio data exactly the way the ! read operations are going to see it, with channels interleaved and ! whatever else.

--- 166,197 ---- Repeat starting at quicktime_write_frame_init for every frame. + +

Writing Keyframes

+ + Quicktime offers very simple support for keyframes: a table of all the + keyframe numbers in a track. Many students think there's a massive + keyframe programming language in Quicktime. Really all there is is a + table.

+ + There are two things you can with the keyframe table: insert keyframe + numbers and retrieve keyframe numbers.

+ + + void quicktime_insert_keyframe(quicktime_t *file, long frame, int track) + +

+ + Inserts a keyframe number corresponding to the frame argument in + the table.

+

Writing raw audio data

+ This functionality is obsolete due to the idiosyncracies in compressed + audio handling. If you want to write an audio codec you should put it + into the library.

+ Writing audio involves writing the raw audio data exactly the way the ! read operations are going to see it.

diff -C2 -r -N bcast-2000c/quicktime/dv.c bcast-2000c-mf3/quicktime/dv.c *** bcast-2000c/quicktime/dv.c Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/dv.c Fri Dec 28 21:41:22 2001 *************** *** 1,13 **** #include "colormodels.h" - #include "dv.h" #include "funcprotos.h" #include "quicktime.h" ! static int quicktime_delete_codec_dv(quicktime_video_map_t *vtrack) { quicktime_dv_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; if(codec->dv) dv_delete(codec->dv); ! free(codec->temp_frame); free(codec->data); free(codec); --- 1,22 ---- #include "colormodels.h" #include "funcprotos.h" + #include "libdv.h" #include "quicktime.h" ! ! typedef struct ! { ! dv_t *dv; ! unsigned char *data; ! unsigned char *temp_frame, **temp_rows; ! } quicktime_dv_codec_t; ! ! static int delete_codec(quicktime_video_map_t *vtrack) { quicktime_dv_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; if(codec->dv) dv_delete(codec->dv); ! if(codec->temp_frame) free(codec->temp_frame); ! if(codec->temp_rows) free(codec->temp_rows); free(codec->data); free(codec); *************** *** 15,19 **** } ! static int quicktime_decode_dv(quicktime_t *file, unsigned char **row_pointers, int track) { long bytes; --- 24,28 ---- } ! static int decode(quicktime_t *file, unsigned char **row_pointers, int track) { long bytes; *************** *** 23,49 **** int height = vtrack->track->tkhd.track_height; int result = 0; quicktime_set_video_position(file, vtrack->current_position, track); bytes = quicktime_frame_size(file, vtrack->current_position, track); ! result = !quicktime_read_data(file, codec->data, bytes); if(codec->dv) { ! if(width == 720 && height == 480) { ! dv_read_video(codec->dv, row_pointers, codec->data, bytes, file->color_model); } else { - register int x, y; - dv_read_video(codec->dv, codec->temp_rows, codec->data, bytes, file->color_model); ! for(y = 0; y < height; y++) { ! for(x = 0; x < width * 3; x++) ! { ! row_pointers[y][x] = codec->temp_rows[y][x]; ! } } } } --- 32,100 ---- int height = vtrack->track->tkhd.track_height; int result = 0; + int i; quicktime_set_video_position(file, vtrack->current_position, track); bytes = quicktime_frame_size(file, vtrack->current_position, track); ! result = !quicktime_read_data(file, (char*)codec->data, bytes); if(codec->dv) { ! if(file->color_model == BC_YUV422 && ! file->in_x == 0 && ! file->in_y == 0 && ! file->in_w == width && ! file->in_h == height && ! file->out_w == width && ! file->out_h == height) { ! dv_read_video(codec->dv, ! row_pointers, ! codec->data, ! bytes, ! BC_YUV422); } else { ! if(!codec->temp_frame) { ! codec->temp_frame = malloc(720 * 576 * 2); ! codec->temp_rows = malloc(sizeof(unsigned char*) * 576); ! for(i = 0; i < 576; i++) ! codec->temp_rows[i] = codec->temp_frame + 720 * 2 * i; } + + + + //printf("decode 1 %d %d\n", width, height); + dv_read_video(codec->dv, + codec->temp_rows, + codec->data, + bytes, + BC_YUV422); + //printf("decode 2\n"); + + cmodel_transfer(row_pointers, + codec->temp_rows, + row_pointers[0], + row_pointers[1], + row_pointers[2], + codec->temp_rows[0], + codec->temp_rows[1], + codec->temp_rows[2], + file->in_x, + file->in_y, + file->in_w, + file->in_h, + 0, + 0, + file->out_w, + file->out_h, + BC_YUV422, + file->color_model, + 0, + width, + file->out_w); + //printf("decode 3\n"); } } *************** *** 52,59 **** } ! static int quicktime_encode_dv(quicktime_t *file, unsigned char **row_pointers, int track) { ! fprintf(stderr, "quicktime_encode_dv: DV encoder not available\n"); ! return 1; } --- 103,192 ---- } ! static int encode(quicktime_t *file, unsigned char **row_pointers, int track) { ! longest offset = quicktime_position(file); ! quicktime_video_map_t *vtrack = &(file->vtracks[track]); ! quicktime_dv_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; ! quicktime_trak_t *trak = vtrack->track; ! int width = trak->tkhd.track_width; ! int height = trak->tkhd.track_height; ! int width_i = 720; ! int height_i = (height <= 480) ? 480 : 576; ! int i; ! unsigned char **input_rows; ! int norm = (height_i == 480) ? DV_NTSC : DV_PAL; ! int data_length = (norm == DV_NTSC) ? DV_NTSC_SIZE : DV_PAL_SIZE; ! int result = 0; ! ! if(file->color_model == BC_YUV422 && ! width == width_i && ! height == height_i) ! { ! input_rows = row_pointers; ! } ! else ! { ! if(!codec->temp_frame) ! { ! codec->temp_frame = malloc(720 * 576 * 2); ! codec->temp_rows = malloc(sizeof(unsigned char*) * 576); ! for(i = 0; i < 576; i++) ! codec->temp_rows[i] = codec->temp_frame + 720 * 2 * i; ! } ! ! ! ! ! cmodel_transfer(codec->temp_rows, /* Leave NULL if non existent */ ! row_pointers, ! codec->temp_rows[0], /* Leave NULL if non existent */ ! codec->temp_rows[1], ! codec->temp_rows[2], ! row_pointers[0], /* Leave NULL if non existent */ ! row_pointers[1], ! row_pointers[2], ! 0, /* Dimensions to capture from input frame */ ! 0, ! MIN(width, width_i), ! MIN(height, height_i), ! 0, /* Dimensions to project on output frame */ ! 0, ! MIN(width, width_i), ! MIN(height, height_i), ! file->color_model, ! BC_YUV422, ! 0, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ ! width, /* For planar use the luma rowspan */ ! width_i); ! ! ! input_rows = codec->temp_rows; ! } ! ! bzero(codec->data, DV_PAL_SIZE); ! ! ! ! ! //printf("encode 1 %d %d\n", width_i, height_i); ! dv_write_video(codec->dv, ! codec->data, ! input_rows, ! BC_YUV422, ! norm); ! //printf("encode 2 %d %d\n", width_i, height_i); ! ! result = !quicktime_write_data(file, codec->data, data_length); ! quicktime_update_tables(file, ! file->vtracks[track].track, ! offset, ! file->vtracks[track].current_chunk, ! file->vtracks[track].current_position, ! 1, ! data_length); ! file->vtracks[track].current_chunk++; ! //printf("encode 3\n", width_i, height_i); ! ! return result; } *************** *** 64,69 **** int track) { ! return (colormodel == BC_RGB888 || ! colormodel == BC_YUV888); } --- 197,202 ---- int track) { ! return (colormodel == BC_YUV888 || ! colormodel == BC_YUV422); } *************** *** 75,81 **** /* Init public items */ ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_dv_codec_t)); ! ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = quicktime_delete_codec_dv; ! ((quicktime_codec_t*)vtrack->codec)->decode_video = quicktime_decode_dv; ! ((quicktime_codec_t*)vtrack->codec)->encode_video = quicktime_encode_dv; ((quicktime_codec_t*)vtrack->codec)->decode_audio = 0; ((quicktime_codec_t*)vtrack->codec)->encode_audio = 0; --- 208,214 ---- /* Init public items */ ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_dv_codec_t)); ! ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = delete_codec; ! ((quicktime_codec_t*)vtrack->codec)->decode_video = decode; ! ((quicktime_codec_t*)vtrack->codec)->encode_video = encode; ((quicktime_codec_t*)vtrack->codec)->decode_audio = 0; ((quicktime_codec_t*)vtrack->codec)->encode_audio = 0; *************** *** 85,90 **** codec = ((quicktime_codec_t*)vtrack->codec)->priv; codec->dv = dv_new(); - codec->temp_frame = calloc(1, 720 * 576 * 3); codec->data = calloc(1, 140000); - for(i = 0; i < 576; i++) codec->temp_rows[i] = codec->temp_frame + 720 * 3 * i; } --- 218,221 ---- diff -C2 -r -N bcast-2000c/quicktime/dv.h bcast-2000c-mf3/quicktime/dv.h *** bcast-2000c/quicktime/dv.h Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/dv.h Mon Dec 3 14:48:32 2001 *************** *** 2,13 **** #define QUICKTIME_DV_H ! #include "libdv.h" ! ! typedef struct ! { ! dv_t *dv; ! unsigned char *data; ! unsigned char *temp_frame, *temp_rows[576]; ! } quicktime_dv_codec_t; #endif --- 2,6 ---- #define QUICKTIME_DV_H ! extern void quicktime_init_codec_dv(quicktime_video_map_t *); #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/CVS/Entries bcast-2000c-mf3/quicktime/encore2/CVS/Entries *** bcast-2000c/quicktime/encore2/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/CVS/Entries Fri Dec 7 14:28:28 2001 *************** *** 0 **** --- 1,3 ---- + /divxlicense.txt/1.1/Fri Nov 30 01:09:03 2001// + D/src//// + D/build//// diff -C2 -r -N bcast-2000c/quicktime/encore2/CVS/Repository bcast-2000c-mf3/quicktime/encore2/CVS/Repository *** bcast-2000c/quicktime/encore2/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/CVS/Repository Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2 diff -C2 -r -N bcast-2000c/quicktime/encore2/CVS/Root bcast-2000c-mf3/quicktime/encore2/CVS/Root *** bcast-2000c/quicktime/encore2/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/CVS/Root Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/build/CVS/Entries bcast-2000c-mf3/quicktime/encore2/build/CVS/Entries *** bcast-2000c/quicktime/encore2/build/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/build/CVS/Entries Fri Dec 7 14:28:24 2001 *************** *** 0 **** --- 1 ---- + D diff -C2 -r -N bcast-2000c/quicktime/encore2/build/CVS/Repository bcast-2000c-mf3/quicktime/encore2/build/CVS/Repository *** bcast-2000c/quicktime/encore2/build/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/build/CVS/Repository Fri Dec 7 14:28:24 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/build diff -C2 -r -N bcast-2000c/quicktime/encore2/build/CVS/Root bcast-2000c-mf3/quicktime/encore2/build/CVS/Root *** bcast-2000c/quicktime/encore2/build/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/build/CVS/Root Fri Dec 7 14:28:24 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/divxlicense.txt bcast-2000c-mf3/quicktime/encore2/divxlicense.txt *** bcast-2000c/quicktime/encore2/divxlicense.txt Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/divxlicense.txt Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,119 ---- + DivX Open License ================= Version 2.1 + + This version of the DivX Open License supercedes any prior versions. + + Copyright (C) 2001 Project Mayo. Everyone is permitted to copy and + distribute verbatim copies of this license document, but changing it is + not allowed. + + Provided below is our open source license agreement ("License") under + which we provide the Codec (defined below) to you free of charge. + Please read it carefully. + + BY USING, COPYING, MODIFYING, OR DISTRIBUTING THE CODEC OR A LARGER + WORK (DEFINED BELOW), YOU INDICATE YOUR ACCEPTANCE OF THIS LICENSE TO + DO SO, AND ALL ITS TERMS AND CONDITIONS. + + For purposes of this Agreement, the "Codec" shall mean the OpenDivX + compression/decompression software provided to you by Project Mayo + ("Project Mayo") and any derivative work thereof, that is to say, a + work containing the Codec or a portion of it, either verbatim or with + modifications and/or translated into another language. A "Larger Work" + shall mean any work including or integrating the Codec as an object + file or linked library. "Encoded Content" shall mean any multimedia + content encoded as output of the Codec, even if that Codec is + integrated into a Larger Work. + + Permission is granted to you to use the Codec for any purpose, and to + copy it, alter it and redistribute it, subject to the following: + + 1. You may modify your copy or copies of the Codec or any portion of + it, provided that you cause the modified files to carry prominent + notices stating that you changed the files and the date of any such + change. + + 2. You may copy, distribute, display and transmit the Codec's source + code, in any medium, subject to the following: + + a. You must conspicuously and appropriately publish on each copy an + appropriate copyright notice and disclaimer of warranty; keep intact + all the notices that refer to this License and to the absence of any + warranty; and give any other recipients of the Codec a copy of this + License along with the Codec. + + b. You must cause any Codec that you distribute or publish to be + licensed as a whole at no charge to all third parties under the terms + of this License. However, you may charge a fee for the physical act of + transferring a copy of the Codec, and you may at your option offer + warranty protection in exchange for a fee. + + c. In each instance in which you attribute ownership or authorship of + the Codec you will include an acknowledgement in a location viewable to + users of the Codec as follows: "This product includes software + developed by or derived from software developed by Project Mayo." In + any event, the origin of the Codec must not be misrepresented; you must + not claim sole authorship in the Codec. + + d. Each time you redistribute the Codec, the recipient automatically + receives a license from Project Mayo to copy, distribute or modify the + Codec subject to these terms and conditions. You may not impose any + further restrictions on the recipients' exercise of the rights granted + herein. + + 3. You may copy and distribute the Codec in object code or executable + form under the terms of Section 2, provided that you also accompany it + with the complete machine-readable source code, or make such + source-code freely and publicly available. + + 4. You may incorporate the Codec into a Larger Work and distribute that + Larger Work under terms of your choice, provided that: + + a. The terms permit modification of the work for the customer's own use + and reverse engineering for debugging such modifications. + + b. You include an acknowledgement in a location viewable to users of a + distribution of a Larger Work as follows: "This product includes + software developed by or derived from software developed by Project + Mayo." + + 5. Any Codec or Larger Works created by you must conform to the MPEG-4 + Video Standard, however modules of the Codec that do not derive from + MoMuSys can be used and incorporated into a non-MPEG-4 conforming work + that otherwise complies with this license. + + 6. Except as provided in section 7 below, you must receive prior + express written permission from Project Mayo before you use the names + "DivX;-)" or "DivX" (or any names incorporating those names) or the + file extensions ".divx" or ".div" to promote or endorse any products + derived from the Codec, including, but not limited to Larger Works. + + 7. You must use the ".divx" file extension in any Encoded Content, when + tools for this purpose are readily available. For Encoded Content used + for a commercial purpose, you must prominently display the "Encoded in + DivX" logo on the package of any Encoded Content in a manner + immediately visible to viewers and you must include the "Encoded in + DivX" video logo at the beginning of any Encoded Content when the means + for such display are reasonably available. + + 8. The Codec contains copyrighted materials that are proprietary to + Project Mayo, and no rights are granted to you except as expressly + provided herein. You may not copy, modify, sublicense, display, + distribute or transmit the Codec except as expressly provided under + this License. Any act or attempt to copy, modify, sublicense, display, + distribute or transmit the Codec other than as permitted herein will + automatically terminate your rights under this License. However, + parties who have received copies from you under this License will not + have their licenses terminated so long as such parties remain in full + compliance. + + THIS CODEC IS PROVIDED BY PROJECT MAYO AND ITS CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE + IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL PROJECT MAYO OR + ITS CONTRIBUTORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, + DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -C2 -r -N bcast-2000c/quicktime/encore2/src/.#encoder.c.1.6 bcast-2000c-mf3/quicktime/encore2/src/.#encoder.c.1.6 *** bcast-2000c/quicktime/encore2/src/.#encoder.c.1.6 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/.#encoder.c.1.6 Mon Dec 3 18:32:56 2001 *************** *** 0 **** --- 1,961 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + + /************************************************************************** + * + * encoder.c, video encoder kernel + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + + /************************************************************************** + * + * Modifications: + * + * 24.11.2001 mmx rgb24/32 support + * 23.11.2001 'dirty keyframes' bugfix + * 18.11.2001 introduced new encoding mode quality=0 (keyframes only) + * 17.11.2001 aquant bug fix + * 16.11.2001 support for new bitstream headers; relocated dquant malloc + * 10.11.2001 removed init_dct_codes(); now done in mbtransquant.c + * removed old idct/fdct init, added new idct init + * 03.11.2001 case ENC_CSP_IYUV break was missing, thanks anon + * 28.10.2001 added new colorspace switch, reset minQ/maxQ limited to 1/31 + * 01.10.2001 added experimental luminance masking support + * 26.08.2001 reactivated INTER4V encoding mode for EXT_MODE + * 26.08.2001 dquants are filled with absolute quant value after MB coding + * 24.08.2001 fixed bug in EncodeFrameP which lead to ugly keyframes + * 23.08.2001 fixed bug when EXT_MODE is called without options + * 22.08.2001 support for EXT_MODE encoding + * support for setting quantizer on a per macro block level + * 10.08.2001 fixed some compiling errors, get rid of compiler warnings + * + * Michael Militzer + * + **************************************************************************/ + + #include "encoder.h" + #include "enc_mbfunctions.h" + #include "enc_bitstream.h" + #include "colorspace/enc_colorspace.h" + #include + #include + #include + #include + #include "mbtransquant/enc_dct.h" + #include "enc_timer.h" + #include "ratecontrol.h" + + static int FrameCodeI(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, int enc_mode); + static int FrameCodeP(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, bool force_inter, int enc_mode); + + #define MAX(a,b) (((a) > (b)) ? (a) : (b)) + + // gruel's normalize code + // should be moved to a seperate file + // *********** + // *********** + int MBXDIM; + int MBYDIM; + + int normalize_quantizer_field(float *in, int *out, int num, int min_quant, int max_quant); + int adaptive_quantization(unsigned char* buf, int stride, int* intquant, + int framequant, int min_quant, int max_quant); // no qstride because normalization + + #define RDIFF(a,b) ((int)(a+0.5)-(int)(b+0.5)) + int normalize_quantizer_field(float *in, int *out, int num, int min_quant, int max_quant) + { + int i; + int finished; + + do + { + finished = 1; + for(i = 1; i < num; i++) + { + if(RDIFF(in[i], in[i-1]) > 2) + { + in[i] -= (float) 0.5; + finished = 0; + } + else if(RDIFF(in[i], in[i-1]) < -2) + { + in[i-1] -= (float) 0.5; + finished = 0; + } + + if(in[i] > max_quant) + { + in[i] = (float) max_quant; + finished = 0; + } + if(in[i] < min_quant) + { + in[i] = (float) min_quant; + finished = 0; + } + if(in[i-1] > max_quant) + { + in[i-1] = (float) max_quant; + finished = 0; + } + if(in[i-1] < min_quant) + { + in[i-1] = (float) min_quant; + finished = 0; + } + } + } while(!finished); + + out[0] = 0; + for (i = 1; i < num; i++) + out[i] = RDIFF(in[i], in[i-1]); + + return (int) (in[0] + 0.5); + } + + int adaptive_quantization(unsigned char* buf, int stride, int* intquant, + int framequant, int min_quant, int max_quant) // no qstride because normalization + { + int i,j,k,l; + + static float *quant; + unsigned char *ptr; + float val; + + const float DarkAmpl = 14 / 2; + const float BrightAmpl = 10 / 2; + const float DarkThres = 70; + const float BrightThres = 200; + + if(!quant) + if(!(quant = (float *) malloc(MBXDIM*MBYDIM * sizeof(float)))) + return -1; + + + for(k = 0; k < MBYDIM; k++) + { + for(l = 0;l < MBXDIM; l++) // do this for all macroblocks individually + { + quant[k*MBXDIM+l] = (float) framequant; + + // calculate luminance-masking + ptr = &buf[16*k*stride+16*l]; // address of MB + + val = 0.; + + for(i = 0; i < 16; i++) + for(j = 0; j < 16; j++) + val += ptr[i*stride+j]; + val /= 256.; + + if(val < DarkThres) + quant[k*MBXDIM+l] += DarkAmpl*(DarkThres-val)/DarkThres; + else if (val>BrightThres) + quant[k*MBXDIM+l] += BrightAmpl*(val-BrightThres)/(255-BrightThres); + } + } + + return normalize_quantizer_field(quant, intquant, MBXDIM*MBYDIM, min_quant, max_quant); + } + // *********** + // *********** + + static __inline uint8_t get_fcode(uint16_t sr) + { + if (sr <= 16) + return 1; + + else if (sr <= 32) + return 2; + + else if (sr <= 64) + return 3; + + else if (sr <= 128) + return 4; + + else if (sr <= 256) + return 5; + + else if (sr <= 512) + return 6; + + else if (sr <= 1024) + return 7; + + else + return 0; + } + + #define ENC_CHECK(X) if(!(X)) return ENC_BAD_FORMAT + + int CreateEncoder(ENC_PARAM * pParam) + { + Encoder *pEnc; + + pParam->handle = NULL; + + ENC_CHECK(pParam); + + + /* Validate input parameters */ + + ENC_CHECK(pParam->x_dim > 0); + ENC_CHECK(pParam->y_dim > 0); + ENC_CHECK(!(pParam->x_dim % 2)); + ENC_CHECK(!(pParam->y_dim % 2)); + + /* + these two limits are introduced by limitations of decore */ + + // ENC_CHECK(pParam->x_dim <= 720); + // ENC_CHECK(pParam->y_dim <= 576); + + + /* Set default values for all other parameters if they are outside + acceptable range */ + + if (pParam->framerate <= 0) + pParam->framerate = 25.; + + if (pParam->bitrate <= 0) + pParam->bitrate = 910000; + + if (pParam->rc_period <= 0) + pParam->rc_period = 50; + + if (pParam->rc_reaction_period <= 0) + pParam->rc_reaction_period = 10; + + if (pParam->rc_reaction_ratio <= 0) + pParam->rc_reaction_ratio = 10; + + if ((pParam->min_quantizer <= 0) || (pParam->min_quantizer > 31)) + pParam->min_quantizer = 1; + + if ((pParam->max_quantizer <= 0) || (pParam->max_quantizer > 31)) + pParam->max_quantizer = 31; + + if (pParam->max_key_interval == 0) + pParam->max_key_interval = 250; /* 1 keyframe each 10 seconds */ + + if (pParam->max_quantizer < pParam->min_quantizer) + pParam->max_quantizer = pParam->min_quantizer; + + if ((pParam->quality < 0) || (pParam->quality > 5)) + pParam->quality = 5; + + pEnc = (Encoder *) malloc(sizeof(Encoder)); + + if (pEnc == 0) + return ENC_MEMORY; + + /* Fill members of Encoder structure */ + + pEnc->mbParam.width = pParam->x_dim; + pEnc->mbParam.height = pParam->y_dim; + pEnc->mbParam.quality = pParam->quality; + pEnc->sStat.fMvPrevSigma = -1; + + /* Fill rate control parameters */ + + pEnc->rateCtlParam.max_quant = pParam->max_quantizer; + pEnc->rateCtlParam.min_quant = pParam->min_quantizer; + + pEnc->mbParam.quant = 4; + + if (pEnc->rateCtlParam.max_quant < pEnc->mbParam.quant) + pEnc->mbParam.quant = pEnc->rateCtlParam.max_quant; + + if (pEnc->rateCtlParam.min_quant > pEnc->mbParam.quant) + pEnc->mbParam.quant = pEnc->rateCtlParam.min_quant; + + pEnc->iFrameNum = 0; + pEnc->iMaxKeyInterval = pParam->max_key_interval; + + if (CreateImage(&(pEnc->sCurrent), pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&(pEnc->sBackup), pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&(pEnc->sReference), pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&pEnc->vInterH, pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + FreeImage(&(pEnc->sReference)); + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&pEnc->vInterV, pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + FreeImage(&(pEnc->sReference)); + FreeImage(&(pEnc->vInterH)); + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&pEnc->vInterHV, pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + FreeImage(&(pEnc->sReference)); + FreeImage(&(pEnc->vInterH)); + FreeImage(&(pEnc->vInterV)); + free(pEnc); + return ENC_MEMORY; + } + + pParam->handle = (void *) pEnc; + + RateCtlInit(&(pEnc->rateCtlParam), pEnc->mbParam.quant, + pParam->bitrate / pParam->framerate, + pParam->rc_period, + pParam->rc_reaction_period, pParam->rc_reaction_ratio); + + #if !(defined(WIN32) && defined(_MMX_)) + enc_idct_int32_init(); + #endif + + init_timer(); + + return ENC_OK; + } + + + int FreeEncoder(Encoder * pEnc) + { + ENC_CHECK(pEnc); + ENC_CHECK(pEnc->sCurrent.pY); + ENC_CHECK(pEnc->sReference.pY); + + + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + FreeImage(&(pEnc->sReference)); + FreeImage(&(pEnc->vInterH)); + FreeImage(&(pEnc->vInterV)); + FreeImage(&(pEnc->vInterHV)); + free(pEnc); + + return ENC_OK; + } + + + #if defined(_MMX_) && 0 + + + + + + + #define RGB24_TO_YUV rgb24_to_yuv_mmx + #define RGB32_TO_YUV rgb32_to_yuv_mmx + + + + + #if defined(_XMM_) + + #define YUV_TO_YUV yuv_to_yuv_xmm + + + + + #else + + #define YUV_TO_YUV yuv_to_yuv_mmx + + + + #endif + #else + + + + + #define RGB24_TO_YUV rgb24_to_yuv + #define RGB32_TO_YUV rgb32_to_yuv + #define YUV_TO_YUV yuv_to_yuv + + + + + + #endif + + int EncodeFrame(Encoder * pEnc, + ENC_FRAME * pFrame, + ENC_RESULT * pResult, + int enc_mode) + { + int result; + uint16_t x, y; + Bitstream bs; + uint32_t bits; + ENC_FRAME_EXT *pFrame_ext; + Image *pCurrent = &(pEnc->sCurrent); + int *temp_dquants; + + printf("EncodeFrame 1\n"); + start_global_timer(); + + temp_dquants = NULL; + + ENC_CHECK(pEnc); + ENC_CHECK(pFrame); + ENC_CHECK(pFrame->bitstream); + ENC_CHECK(pFrame->image); + + + /* convert input colorspace into yuv planar + * + * testing results + * rgb24 yes + * rgb32 yes + * iyuv + * yv12 + * yuy2 yes + * yvyu + * uyvy yes + */ + printf("EncodeFrame 1\n"); + + start_timer(); + printf("EncodeFrame 1\n"); + + switch(pFrame->colorspace) { + + case ENC_CSP_RGB24 : + RGB24_TO_YUV(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + case ENC_CSP_RGB32 : + RGB32_TO_YUV(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + case ENC_CSP_IYUV : /* ENC_CSP_I420 : */ + YUV_TO_YUV(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + case ENC_CSP_YV12 : /* u/v simply swapped */ + printf("EncodeFrame 1.1 %p\n", pEnc); + YUV_TO_YUV(pEnc->sCurrent.pY, + pEnc->sCurrent.pV, + pEnc->sCurrent.pU, + pFrame->image, + pEnc->mbParam.width, + pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + printf("EncodeFrame 1.2\n"); + break; + + case ENC_CSP_YUY2 : + yuyv_to_yuv(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + case ENC_CSP_YVYU : /* u/v simply swapped */ + yuyv_to_yuv(pEnc->sCurrent.pY, pEnc->sCurrent.pV, pEnc->sCurrent.pU, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + + case ENC_CSP_UYVY : + uyvy_to_yuv(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + default : + return ENC_BAD_FORMAT; + } + printf("EncodeFrame 1\n"); + + stop_conv_timer(); + printf("EncodeFrame 1\n"); + + BitstreamInit(&bs, pFrame->bitstream); + printf("EncodeFrame 1\n"); + + switch (enc_mode) + { + case RC_MODE: + pEnc->mbParam.quant = RateCtlGetQ(&(pEnc->rateCtlParam), 0); + break; + + case VBR_MODE: + pEnc->mbParam.quant = pFrame->quant; + break; + + case EXT_MODE: + + temp_dquants = (int *) malloc(pCurrent->iMbHcount * pCurrent->iMbWcount * sizeof(int)); + + MBXDIM = pCurrent->iMbWcount; + MBYDIM = pCurrent->iMbHcount; + + pFrame_ext = (ENC_FRAME_EXT *) pFrame->mvs; + + if((pFrame_ext->ext_opt & EXT_OPT_LUMINANCE_MASKING) > 0) { + pEnc->mbParam.quant = adaptive_quantization(pEnc->sCurrent.pY, pEnc->mbParam.width, + temp_dquants, pFrame->quant, pFrame->quant, + MAX(pEnc->rateCtlParam.max_quant, pFrame->quant)); + + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + pMB->dquant = iDQtab[(temp_dquants[y * pCurrent->iMbWcount + x] + 2)]; + } + break; + } + + if((pFrame_ext->ext_opt & EXT_OPT_QUANT_ARRAY) > 0) { + pEnc->mbParam.quant = normalize_quantizer_field((float *) pFrame_ext->quant_array, + temp_dquants, pCurrent->iMbHcount * pCurrent->iMbWcount, 1, 31); + + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + pMB->dquant = iDQtab[(temp_dquants[y * pCurrent->iMbWcount + x] + 2)]; + } + break; + } + + if(pFrame_ext->ext_opt == 0) { + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + pMB->dquant = NO_CHANGE; + } + pEnc->mbParam.quant = pFrame->quant; + } + + break; + + default: + return ENC_FAIL; // should never happen + } + printf("EncodeFrame 1\n"); + + if ((enc_mode == RC_MODE) || (pFrame->intra < 0) + + + + ) + { + if ((pEnc->iFrameNum == 0) || ((pEnc->iMaxKeyInterval > 0) + && (pEnc->iFrameNum >= pEnc->iMaxKeyInterval)) + || (pEnc->mbParam.quality==0) ) + + result = FrameCodeI(pEnc, &bs, &bits, enc_mode); + else + result = FrameCodeP(pEnc, &bs, &bits, 0, enc_mode); + } + else + { + if (pFrame->intra == 1) + result = FrameCodeI(pEnc, &bs, &bits, enc_mode); + else + result = FrameCodeP(pEnc, &bs, &bits, 1, enc_mode); + } + + printf("EncodeFrame 1 %d\n", pFrame->intra); + if (pResult) + { + pResult->is_key_frame = result; + pResult->texture_bits = pEnc->sStat.iTextBits; + pResult->motion_bits = pEnc->sStat.iMvBits; + pResult->total_bits = bits; + pResult->quantizer = pEnc->mbParam.quant; + } + printf("EncodeFrame 2\n"); + + + BitstreamPutBits(&bs, 0x0000, 16); + BitstreamPutBits(&bs, 0x0000, 16); + + BitstreamPad(&bs); + pFrame->length = BitstreamLength(&bs); + pEnc->iFrameNum++; + + if (enc_mode == RC_MODE) + RateCtlUpdate(&(pEnc->rateCtlParam), bits); + + SwapImages(&(pEnc->sCurrent), &(pEnc->sReference)); + + if (temp_dquants) + { + free(temp_dquants); + } + + stop_global_timer(); + write_timer(); + + return ENC_OK; + } + + + static int FrameCodeI(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, int enc_mode) + { + int16_t dct_codes[6][64]; + int16_t qcoeff[6][64]; + uint16_t x, y; + Image *pCurrent = &(pEnc->sCurrent); + + pEnc->iFrameNum = 0; + pEnc->mbParam.rounding_type = 1; + pEnc->mbParam.coding_type = I_VOP; + + //printf("FrameCodeI 1\n"); + + BitstreamVolHeader(bs, pEnc->mbParam.width, pEnc->mbParam.height); + BitstreamVopHeader(bs, I_VOP, pEnc->mbParam.rounding_type, + pEnc->mbParam.quant, + pEnc->mbParam.fixed_code); + + //printf("FrameCodeI 2\n"); + *pBits = BsPos(bs); + + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + + printf("FrameCodeI 1 %d %d %p %p\n", x, y, bs->tail, bs->start); + if(enc_mode == EXT_MODE) { + //printf("FrameCodeI 3.1\n"); + if(pMB->dquant == NO_CHANGE) + pMB->mode = MODE_INTRA; + else { + pMB->mode = MODE_INTRA_Q; + //printf("FrameCodeI 3.2\n"); + pEnc->mbParam.quant += DQtab[pMB->dquant]; + //printf("FrameCodeI 3.3\n"); + if(pEnc->mbParam.quant > 31) pEnc->mbParam.quant = 31; + //printf("FrameCodeI 3.4\n"); + if(pEnc->mbParam.quant < 1) pEnc->mbParam.quant = 1; + //printf("FrameCodeI 3.5\n"); + } + } + else + pMB->mode = MODE_INTRA; + + + pMB->aquant = pEnc->mbParam.quant; + + //printf("FrameCodeI 3.6\n"); + MBTransQuantIntra(&pEnc->mbParam, x, y, dct_codes, qcoeff, pCurrent); + //printf("FrameCodeI 3.7\n"); + + start_timer(); + //printf("FrameCodeI 3\n"); + + MBPrediction(&pEnc->mbParam, x, y, pCurrent->iMbWcount, qcoeff, pCurrent->pMBs); + //printf("FrameCodeI 3\n"); + + stop_prediction_timer(); + //printf("FrameCodeI 3\n"); + + start_timer(); + //printf("FrameCodeI 3\n"); + + printf("FrameCodeI 3\n"); + MBCoding(&pEnc->mbParam, + pCurrent->pMBs + x + y * pCurrent->iMbWcount, + qcoeff, + bs, &pEnc->sStat); + + printf("FrameCodeI 4\n"); + stop_coding_timer(); + //printf("FrameCodeI 5\n"); + } + + EMMS; + + *pBits = BsPos(bs) - *pBits; + pEnc->sStat.fMvPrevSigma = -1; + pEnc->sStat.iTextBits = *pBits; + pEnc->sStat.iMvBits = 0; + pEnc->sStat.iMvSum = 0; + pEnc->sStat.iMvCount = 0; + pEnc->mbParam.fixed_code = 2; + printf("FrameCodeI 5\n"); + + return 1; // intra + } + + + #define INTRA_THRESHOLD 0.5 + + static int FrameCodeP(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, + bool force_inter, int enc_mode) + { + float fSigma; + int16_t dct_codes[6][64]; + int16_t qcoeff[6][64]; + int x, y; + int iIntra, iLimit; + int iSearchRange; + int backup_quant; + + Image *pCurrent = &(pEnc->sCurrent); + Image *pRef = &(pEnc->sReference); + + //printf("FrameCodeP 1\n"); + SetEdges(pRef); + //printf("FrameCodeP 1\n"); + + // DumpImage(pRef, "ref.bmp"); + + pEnc->mbParam.rounding_type = 1 - pEnc->mbParam.rounding_type; + + //printf("FrameCodeP 1\n"); + backup_quant = pEnc->mbParam.quant; + CopyImages(&(pEnc->sBackup), &(pEnc->sCurrent)); + //printf("FrameCodeP 1\n"); + + iIntra = 0; + + if (!force_inter) + iLimit = (int)(pCurrent->iMbWcount * pCurrent->iMbHcount * INTRA_THRESHOLD); + else + iLimit = pCurrent->iMbWcount * pCurrent->iMbHcount + 1; + + start_timer(); + + Interpolate(pRef, &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV, + pEnc->mbParam.rounding_type, + (pEnc->mbParam.quality < 4)); + //printf("FrameCodeP 1\n"); + + stop_inter_timer(); + + pEnc->mbParam.coding_type = P_VOP; + //printf("FrameCodeP 1\n"); + + BitstreamVopHeader(bs, P_VOP, pEnc->mbParam.rounding_type, + pEnc->mbParam.quant, + pEnc->mbParam.fixed_code); + //printf("FrameCodeP 1\n"); + + *pBits = BsPos(bs); + pEnc->sStat.iTextBits = 0; + pEnc->sStat.iMvBits = 0; + pEnc->sStat.iMvSum = 0; + pEnc->sStat.iMvCount = 0; + + //printf("FrameCodeP 1\n"); + + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + + // + + // No floating calculations inside this loop please! + + // + + //printf("FrameCodeP 1\n"); + bool bIntra; + + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + //printf("FrameCodeP 1\n"); + + start_timer(); + //printf("FrameCodeP 1\n"); + + bIntra = MBMotionEstComp(&pEnc->mbParam, + x, + y, + &pEnc->sReference, + &pEnc->vInterH, + &pEnc->vInterV, + &pEnc->vInterHV, + &pEnc->sCurrent, + dct_codes, + (pMB->dquant == NO_CHANGE || + enc_mode != EXT_MODE)); + //printf("FrameCodeP 1\n"); + + stop_motion_timer(); + //printf("FrameCodeP 1\n"); + + if (bIntra) + { + iIntra++; + if (iIntra >= iLimit) + { + BitstreamReset(bs); + pEnc->mbParam.quant = backup_quant; + CopyImages(&(pEnc->sCurrent), &(pEnc->sBackup)); + return FrameCodeI(pEnc, bs, pBits, enc_mode); + } + } + + bIntra = (pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q); + + if (bIntra) + { + if(enc_mode == EXT_MODE) { + if(pMB->dquant != NO_CHANGE) { + pMB->mode = MODE_INTRA_Q; + pEnc->mbParam.quant += DQtab[pMB->dquant]; + if(pEnc->mbParam.quant > 31) pEnc->mbParam.quant = 31; + if(pEnc->mbParam.quant < 1) pEnc->mbParam.quant = 1; + } + } + pMB->aquant = pEnc->mbParam.quant; + + MBTransQuantIntra(&pEnc->mbParam, x, y, + dct_codes, qcoeff, pCurrent); + } + + else { + if(enc_mode == EXT_MODE) { + if(pMB->dquant != NO_CHANGE) { + pMB->mode = MODE_INTER_Q; + pEnc->mbParam.quant += DQtab[pMB->dquant]; + if(pEnc->mbParam.quant > 31) pEnc->mbParam.quant = 31; + if(pEnc->mbParam.quant < 1) pEnc->mbParam.quant = 1; + } + } + pMB->aquant = pEnc->mbParam.quant; + + pEnc->sCurrent.pMBs[x + y * pCurrent->iMbWcount].cbp + = MBTransQuantInter(&pEnc->mbParam, x, y, + dct_codes, qcoeff, pCurrent); + } + + //printf("FrameCodeP 1\n"); + start_timer(); + + MBPrediction(&pEnc->mbParam, x, y, pCurrent->iMbWcount, qcoeff, pCurrent->pMBs); + //printf("FrameCodeP 1\n"); + + stop_prediction_timer(); + + //printf("FrameCodeP 1\n"); + start_timer(); + + //printf("FrameCodeP 1\n"); + MBCoding(&pEnc->mbParam, + pCurrent->pMBs + x + y * pCurrent->iMbWcount, qcoeff, bs, + &pEnc->sStat); + //printf("FrameCodeP 1\n"); + + stop_coding_timer(); + //printf("FrameCodeP 2\n"); + } + //printf("FrameCodeP 1\n"); + + EMMS; + + // DumpImage(pCurrent, "cur.bmp"); + + if (pEnc->sStat.iMvCount == 0) + + pEnc->sStat.iMvCount = 1; + + fSigma = (float)sqrt((float) pEnc->sStat.iMvSum / pEnc->sStat.iMvCount); + //printf("FrameCodeP 1\n"); + + //printf("Texture: %d bits, motion: %d bits, mv sigma: %f\n", + // pEnc->sStat.iTextBits, pEnc->sStat.iMvBits, fSigma); + + iSearchRange = 1 << (3 + pEnc->mbParam.fixed_code); + + //printf("FrameCodeP 1\n"); + if ((fSigma > iSearchRange / 3) && (pEnc->mbParam.fixed_code <= 3)) // maximum search + + // range 128 + + { + pEnc->mbParam.fixed_code++; + iSearchRange *= 2; + // printf("New search range: %d\n", iSearchRange); + } + + else + if ((fSigma < iSearchRange / 6) + && (pEnc->sStat.fMvPrevSigma >= 0) + && (pEnc->sStat.fMvPrevSigma < iSearchRange / 6) + && (pEnc->mbParam.fixed_code >= 2)) // minimum search range 16 + { + + pEnc->mbParam.fixed_code--; + iSearchRange /= 2; + // printf("New search range: %d\n", iSearchRange); + } + + //printf("FrameCodeP 1\n"); + + pEnc->sStat.fMvPrevSigma = fSigma; + *pBits = BsPos(bs) - *pBits; + + //printf("FrameCodeP 2\n"); + return 0; // inter + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/CVS/Entries *** bcast-2000c/quicktime/encore2/src/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/CVS/Entries Thu Dec 13 18:20:40 2001 *************** *** 0 **** --- 1,28 ---- + /bitstream.c/1.1/Fri Nov 30 01:09:03 2001// + /copyblock.c/1.2/Sat Dec 1 01:45:44 2001// + /enc_copyblock.h/1.1/Fri Nov 30 01:09:03 2001// + /enc_image.h/1.1/Fri Nov 30 01:09:03 2001// + /enc_mbfunctions.h/1.1/Fri Nov 30 01:09:03 2001// + /enc_mv_hint.h/1.1/Fri Nov 30 01:09:03 2001// + /enc_portab.h/1.2/Fri Nov 30 01:18:48 2001// + /enc_timer.h/1.1/Fri Nov 30 01:09:03 2001// + /encoder.h/1.1/Fri Nov 30 01:09:03 2001// + /encore.c/1.2/Fri Nov 30 09:49:41 2001// + /encore2.h/1.1/Fri Nov 30 01:09:03 2001// + /encore_ext.h/1.1/Fri Nov 30 01:09:03 2001// + /image.c/1.2/Fri Nov 30 09:49:41 2001// + /ratecontrol.c/1.1/Fri Nov 30 01:09:03 2001// + /ratecontrol.h/1.2/Sat Dec 1 01:45:44 2001// + /rgb2yuv.c/1.1/Fri Nov 30 01:09:03 2001// + /rgb2yuv.h/1.2/Sat Dec 1 01:45:44 2001// + /timer.c/1.1/Fri Nov 30 01:09:03 2001// + D/att_mmx//// + D/colorspace//// + D/intel_mmx//// + D/mbcoding//// + D/mbmotionestcomp//// + D/mbprediction//// + D/mbtransquant//// + /enctypes.h/1.1/Wed Dec 5 14:06:07 2001// + /encoder.c/1.10/Thu Dec 6 14:28:44 2001// + /enc_bitstream.h/1.3/Fri Dec 7 13:28:24 2001// diff -C2 -r -N bcast-2000c/quicktime/encore2/src/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/CVS/Repository *** bcast-2000c/quicktime/encore2/src/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/CVS/Repository Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src diff -C2 -r -N bcast-2000c/quicktime/encore2/src/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/CVS/Root *** bcast-2000c/quicktime/encore2/src/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/CVS/Root Mon Dec 3 14:48:32 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/att_mmx/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/att_mmx/CVS/Entries *** bcast-2000c/quicktime/encore2/src/att_mmx/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/att_mmx/CVS/Entries Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,4 ---- + /halfpel_mmx.c/1.1/Fri Nov 30 01:09:35 2001// + /mad_mmx.c/1.1/Fri Nov 30 01:09:35 2001// + /transferidct_mmx.c/1.1/Fri Nov 30 01:09:35 2001// + D diff -C2 -r -N bcast-2000c/quicktime/encore2/src/att_mmx/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/att_mmx/CVS/Repository *** bcast-2000c/quicktime/encore2/src/att_mmx/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/att_mmx/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/att_mmx diff -C2 -r -N bcast-2000c/quicktime/encore2/src/att_mmx/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/att_mmx/CVS/Root *** bcast-2000c/quicktime/encore2/src/att_mmx/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/att_mmx/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/att_mmx/halfpel_mmx.c bcast-2000c-mf3/quicktime/encore2/src/att_mmx/halfpel_mmx.c *** bcast-2000c/quicktime/encore2/src/att_mmx/halfpel_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/att_mmx/halfpel_mmx.c Fri Nov 30 02:09:35 2001 *************** *** 0 **** --- 1,381 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * halfpel_mmx_linux.c, half-pixel interpolation routines, MMX version, + * AT&T syntax + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * John Funnell + * + * DivX Advance Research Center + * + **************************************************************************/ + + #include "mbmotionestcomp/halfpel.h" + + //#define PENTIUMIII + /* Having PENTIUMIII defined makes no noticeable difference in performance */ + + #ifdef PENTIUMIII + #define MOVNTQ "movntq" + #else + #define MOVNTQ "movq" + #endif + + const uint64_t mm_7f7f7f7f7f7f7f7f = 0x7f7f7f7f7f7f7f7fLL; + const uint64_t mm_0002000200020002 = 0x0002000200020002LL; + const uint64_t mm_0001000100010001 = 0x0001000100010001LL; + const uint64_t mm_0202020202020202 = 0x0202020202020202LL; + const uint64_t mm_3f3f3f3f3f3f3f3f = 0x3f3f3f3f3f3f3f3fLL; + const uint64_t mm_0101010101010101 = 0x0101010101010101LL; + const uint64_t mm_f0f0f0f0f0f0f0f0 = 0xf0f0f0f0f0f0f0f0LL; + const uint64_t mm_0f0f0f0f0f0f0f0f = 0x0f0f0f0f0f0f0f0fLL; + const uint64_t mm_FE = 0xfefefefefefefefeLL; + static __inline void interpolate_halfpel_h_noround( + uint8_t *src, + uint8_t *dstH, + int width, /* width % 16 == 0 */ + int height) + { + __asm__ __volatile__ + ( + "movl %3, %%edi\n" + "pushl %%ebx\n" + "movl %%ecx, %%ebx\n" + "movq mm_7f7f7f7f7f7f7f7f, %%mm7\n" + "horiz_round0_loop_y:\n" + "movl %%edx, %%esi\n" + "horiz_round0_loop_x:\n" + "movq (%%eax), %%mm0\n" + "movq 8(%%eax), %%mm4\n" + "movq 1(%%eax), %%mm1\n" + "movq 9(%%eax), %%mm5\n" + + "movq %%mm0, %%mm2\n" + "pxor %%mm1, %%mm0\n" // mm0 = src[0] ^ src[1] + "por %%mm2, %%mm1\n" // mm1 = src[0] | src[1] + "psrlq $1, %%mm0\n" + "addl $16, %%eax\n" + "pand %%mm7, %%mm0\n" + "psubb %%mm0, %%mm1\n" + MOVNTQ " %%mm1, (%%ebx)\n" + + "movq %%mm4, %%mm6\n" + "pxor %%mm5, %%mm4\n" + "por %%mm6, %%mm5\n" + "psrlq $1, %%mm4\n" + "pand %%mm7, %%mm4\n" + "psubb %%mm4, %%mm5\n" + MOVNTQ " %%mm5, 8(%%ebx)\n" + + "addl $16, %%ebx\n" + "decl %%esi\n" + "jne horiz_round0_loop_x\n" + "decl %%edi\n" + "jne horiz_round0_loop_y\n" + + "emms\n" + "popl %%ebx\n" + : + : "a" (src), "c" (dstH), "d" (width >> 4), "g" (height) + : "esi", "edi" + ); + } + static __inline void interpolate_halfpel_h_round( + uint8_t *src, + uint8_t *dstH, + int width, /* width % 16 == 0 */ + int height) + { + __asm__ __volatile__ + ( + "movl %3, %%edi\n" + "pushl %%ebx\n" + "movl %%ecx, %%ebx\n" + // "movq mm_7f7f7f7f7f7f7f7f, %%mm7\n" + "movq mm_FE, %%mm3\n" + "horiz_round1_loop_y:\n" + "movl %%edx, %%esi\n" + "horiz_round1_loop_x:\n" + "movq (%%eax), %%mm0\n" + "movq 1(%%eax), %%mm1\n" + + //(a+b)/2=((a&b) + ((a^b)>>1)) + "movq %%mm0, %%mm2\n" + "pxor %%mm1, %%mm2\n" + "pand %%mm3, %%mm2\n" + "pand %%mm1, %%mm0\n" + "psrlq $1, %%mm2\n" + "paddb %%mm2, %%mm0\n" + MOVNTQ " %%mm0, (%%ebx)\n" + + // "movq 8(%%eax), %%mm4\n" + // "movq 9(%%eax), %%mm5\n" + // "movq %%mm4, %%mm2\n" + // "pxor %%mm5, %%mm2\n" + // "pand %%mm3, %%mm2\n" + // "pand %%mm5, %%mm4\n" + // "psrlq $1, %%mm2\n" + // "paddb %%mm2, %%mm4\n" + // MOVNTQ " %%mm4, 8(%%ebx)\n" + + "addl $8, %%ebx\n" + "addl $8, %%eax\n" + "decl %%esi\n" + "jne horiz_round1_loop_x\n" + "decl %%edi\n" + "jne horiz_round1_loop_y\n" + + "emms\n" + "popl %%ebx\n" + : + : "a" (src), "c" (dstH), "d" (width >> 3), "g" (height) + : "esi", "edi" + ); + } + + static __inline void interpolate_halfpel_v_noround( + uint8_t *src, + uint8_t *dstV, + int width, + int height) + { + __asm__ __volatile__ + ( + "movl %3, %%edi\n" + "pushl %%ebx\n" + "movl %%ecx, %%ebx\n" + "movq mm_7f7f7f7f7f7f7f7f, %%mm7\n" + "vert_round0_loop_y:\n" + "movl %%edx, %%esi\n" + "shrl $4, %%esi\n" + "vert_round0_loop_x:\n" + "movq (%%eax), %%mm0\n" + "movq 8(%%eax), %%mm4\n" + "movq (%%eax,%%edx), %%mm1\n" + "movq 8(%%eax,%%edx), %%mm5\n" + + "movq %%mm0, %%mm2\n" + "pxor %%mm1, %%mm0\n" + "por %%mm2, %%mm1\n" + "psrlq $1, %%mm0\n" + "addl $16, %%eax\n" + "pand %%mm7, %%mm0\n" + "psubb %%mm0, %%mm1\n" + MOVNTQ " %%mm1, (%%ebx)\n" + + "movq %%mm4, %%mm6\n" + "pxor %%mm5, %%mm4\n" + "por %%mm6, %%mm5\n" + "psrlq $1, %%mm4\n" + "pand %%mm7, %%mm4\n" + "psubb %%mm4, %%mm5\n" + MOVNTQ " %%mm5, 8(%%ebx)\n" + + "addl $16, %%ebx\n" + "decl %%esi\n" + "jne vert_round0_loop_x\n" + "decl %%edi\n" + "jne vert_round0_loop_y\n" + + "emms\n" + "popl %%ebx\n" + : + : "a" (src), "c" (dstV), "d" (width), "g" (height) + : "esi", "edi" + ); + } + + static __inline void interpolate_halfpel_v_round( + uint8_t *src, + uint8_t *dstV, + int width, + int height) + { + __asm__ __volatile__ + ( + "movl %3, %%edi\n" + "pushl %%ebx\n" + "movl %%ecx, %%ebx\n" + "movq mm_FE, %%mm3\n" + "vert_round1_loop_y:\n" + "movl %%edx, %%esi\n" + "shrl $3, %%esi\n" + "vert_round1_loop_x:\n" + "movq (%%eax), %%mm0\n" + "movq (%%eax,%%edx), %%mm1\n" + + //(a+b)/2=((a&b) + ((a^b)>>1)) + "movq %%mm0, %%mm2\n" + "pxor %%mm1, %%mm2\n" + "pand %%mm3, %%mm2\n" + "pand %%mm1, %%mm0\n" + "psrlq $1, %%mm2\n" + "paddb %%mm2, %%mm0\n" + MOVNTQ " %%mm0, (%%ebx)\n" + + "addl $8, %%ebx\n" + "addl $8, %%eax\n" + "decl %%esi\n" + "jne vert_round1_loop_x\n" + "decl %%edi\n" + "jne vert_round1_loop_y\n" + + "emms\n" + "popl %%ebx\n" + : + : "a" (src), "c" (dstV), "d" (width), "g" (height) + : "esi", "edi" + ); + } + + void interpolate_halfpel_h( + uint8_t *src, + uint8_t *dstH, + int width, /* width % 16 == 0 */ + int height, + int rounding) + { + if(!rounding) + interpolate_halfpel_h_noround(src, dstH, width, height); + else + interpolate_halfpel_h_round(src, dstH, width, height); + } + + void interpolate_halfpel_v( + uint8_t *src, + uint8_t *dstV, + int width, /* width % 16 == 0 */ + int height, + int rounding) + { + if(!rounding) + interpolate_halfpel_v_noround(src, dstV, width, height); + else + interpolate_halfpel_v_round(src, dstV, width, height); + } + + void interpolate_halfpel_hv( + uint8_t *src, + uint8_t *dstHV, + int width, + int height, + int rounding) + { + __asm__ __volatile__ + ( + "movl %5, %%eax\n" + "testl %%eax, %%eax\n" + "jnz 1f\n" + "movq mm_0002000200020002, %%mm6\n" + "jmp 2f\n" + "1:\n" + "movq mm_0001000100010001, %%mm6\n" + "2:\n" + "movl %0, %%eax\n" + "movl %3, %%edi\n" + "movl %1, %%esi\n" + "pushl %%ebx\n" + "movl %%esi, %%ebx\n" + "pxor %%mm7, %%mm7\n" + "horizvert_round0_loop_y:\n" + "movl %%edx, %%esi\n" + "horizvert_round0_loop_x:\n" + "movq (%%eax), %%mm0\n" + "movq %%mm0, %%mm1\n" + "punpcklbw %%mm7, %%mm0\n" + "movq 1(%%eax), %%mm2\n" + "punpckhbw %%mm7, %%mm1\n" + "movq %%mm2, %%mm3\n" + "punpcklbw %%mm7, %%mm2\n" + "paddw %%mm6, %%mm0\n" + "punpckhbw %%mm7, %%mm3\n" + "paddw %%mm6, %%mm1\n" + "movq (%%ecx), %%mm4\n" + "paddw %%mm2, %%mm0\n" + "movq %%mm4, %%mm5\n" + "punpcklbw %%mm7, %%mm4\n" + "paddw %%mm3, %%mm1\n" + "punpckhbw %%mm7, %%mm5\n" + "paddw %%mm4, %%mm0\n" + "paddw %%mm5, %%mm1\n" + "movq 1(%%ecx), %%mm4\n" + "movq %%mm4, %%mm5\n" + "punpcklbw %%mm7, %%mm4\n" + #ifdef PENTIUMIII + "prefetchnta 32(%%ecx)\n" + #endif + "punpckhbw %%mm7, %%mm5\n" + "paddw %%mm0, %%mm4\n" + "paddw %%mm1, %%mm5\n" + "psrlw $2, %%mm4\n" + "movq 8(%%eax), %%mm0\n" + "psrlw $2, %%mm5\n" + "movq %%mm0, %%mm1\n" + "punpcklbw %%mm7, %%mm0\n" + "movq 9(%%eax), %%mm2\n" + "punpckhbw %%mm7, %%mm1\n" + "movq %%mm2, %%mm3\n" + "packuswb %%mm5, %%mm4\n" + "paddw %%mm6, %%mm0\n" + "punpcklbw %%mm7, %%mm2\n" + "addl $16, %%eax\n" + "punpckhbw %%mm7, %%mm3\n" + MOVNTQ " %%mm4, (%%ebx)\n" + "paddw %%mm6, %%mm1\n" + "movq 8(%%ecx), %%mm4\n" + "paddw %%mm2, %%mm0\n" + "movq %%mm4, %%mm5\n" + "punpcklbw %%mm7, %%mm4\n" + "paddw %%mm3, %%mm1\n" + "punpckhbw %%mm7, %%mm5\n" + "paddw %%mm4, %%mm0\n" + "paddw %%mm5, %%mm1\n" + "movq 9(%%ecx), %%mm4\n" + "movq %%mm4, %%mm5\n" + "punpcklbw %%mm7, %%mm4\n" + "addl $16, %%ecx\n" + "punpckhbw %%mm7, %%mm5\n" + "paddw %%mm0, %%mm4\n" + "paddw %%mm1, %%mm5\n" + "psrlw $2, %%mm4\n" + "psrlw $2, %%mm5\n" + "packuswb %%mm5, %%mm4\n" + MOVNTQ " %%mm4, 8(%%ebx)\n" + "addl $16, %%ebx\n" + "decl %%esi\n" + "jne horizvert_round0_loop_x\n" + "decl %%edi\n" + "jne horizvert_round0_loop_y\n" + + "popl %%ebx\n" + "emms\n" + : + : "g"(src), "g" (dstHV), "c"(src+width), + "g"(height), "d"(width >> 4), "g"(rounding) + : "eax", "esi", "edi" + ); + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/att_mmx/mad_mmx.c bcast-2000c-mf3/quicktime/encore2/src/att_mmx/mad_mmx.c *** bcast-2000c/quicktime/encore2/src/att_mmx/mad_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/att_mmx/mad_mmx.c Fri Nov 30 02:09:35 2001 *************** *** 0 **** --- 1,279 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mad.c, utility functions that calculate MADs and SADs. + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + #include "mbmotionestcomp/mad.h" + #define ABS(X) (((X)>0)?(X):-(X)) + float MAD_Image(const Image* pIm, const Image* pImage) + { + int x, y; + int32_t sum=0; + int iStride=pImage->iEdgedWidth; + for(y=0; yiHeight; y++) + for(x=0; xiWidth; x++) + sum+=ABS((int32_t)pImage->pY[x+y*iStride]-(int32_t)pIm->pY[x+y*iStride]); + iStride/=2; + for(y=0; yiHeight/2; y++) + for(x=0; xiWidth/2; x++) + sum+=ABS((int32_t)pImage->pU[x+y*iStride]-(int32_t)pIm->pU[x+y*iStride]); + for(y=0; yiHeight/2; y++) + for(x=0; xiWidth/2; x++) + sum+=ABS((int32_t)pImage->pV[x+y*iStride]-(int32_t)pIm->pV[x+y*iStride]); + return ((float)sum)/(pImage->iWidth*pImage->iHeight*3/2); + } + + // x & y in blocks ( 8 pixel units ) + // dx & dy in pixels + static const int64_t mm_FFFFFFFFFFFFFFFF=0xFFFFFFFFFFFFFFFFLL; + + #define SAD_INIT \ + "movl %1, %%ecx\n" \ + "movl %2, %%edx\n" \ + "movq mm_FFFFFFFFFFFFFFFF, %%mm7\n" \ + "pxor %%mm0, %%mm0\n" \ + "pxor %%mm1, %%mm1\n" + + #define SAD_ONE_STEP(X) \ + "movq " #X "(%%ecx), %%mm2\n" \ + "movq " #X "(%%edx), %%mm3\n" \ + \ + "movq %%mm2, %%mm4\n" \ + "movq %%mm3, %%mm5\n" \ + "punpcklbw %%mm0, %%mm2\n" \ + "punpckhbw %%mm0, %%mm4\n" \ + "punpcklbw %%mm0, %%mm3\n" \ + "punpckhbw %%mm0, %%mm5\n" \ + \ + "psubw %%mm2, %%mm3\n" \ + "psubw %%mm4, %%mm5\n" \ + \ + "movq %%mm3, %%mm2\n" \ + "movq %%mm5, %%mm4\n" \ + "pcmpgtw %%mm0, %%mm2\n"\ + "pcmpgtw %%mm0, %%mm4\n"\ + "pxor %%mm7, %%mm2\n" \ + "pxor %%mm7, %%mm4\n" \ + "pxor %%mm2, %%mm3\n" \ + "pxor %%mm4, %%mm5\n" \ + "psubw %%mm2, %%mm3\n" \ + "psubw %%mm4, %%mm5\n" \ + "paddusw %%mm3, %%mm1\n"\ + "paddusw %%mm5, %%mm1\n" + + #define SAD_PACK \ + "movq %%mm1, %%mm2\n" \ + "psrlq $32, %%mm1\n" \ + "paddusw %%mm2, %%mm1\n"\ + "movq %%mm1, %%mm2\n" \ + "psrlq $16, %%mm1\n" \ + "paddusw %%mm2, %%mm1\n"\ + "movd %%mm1, %%ecx\n" \ + "andl $0xFFFF, %%ecx\n" + + int32_t SAD_Block(const Image* pIm, const Image* pImage, + int x, int y, + int dx, int dy, + int sad_opt, + int component) + { + int32_t sum=0; + const uint8_t *pRef; + const uint8_t *pCur; + int iEdgedWidth=pImage->iEdgedWidth; + switch(component) + { + case 0: + pRef=pIm->pY+x*8+y*8*pImage->iEdgedWidth; + pCur=pImage->pY+(x*8+dx)+(y*8+dy)*pImage->iEdgedWidth; + break; + case 1: + pRef=pIm->pU+x*8+y*8*pImage->iEdgedWidth/2; + pCur=pImage->pU+(x*8+dx)+(y*8+dy)*pImage->iEdgedWidth/2; + break; + case 2: + default: + pRef=pIm->pV+x*8+y*8*pImage->iEdgedWidth/2; + pCur=pImage->pV+(x*8+dx)+(y*8+dy)*pImage->iEdgedWidth/2; + break; + } + if(component) + iEdgedWidth/=2; + + __asm__ __volatile__ + ( + + SAD_INIT + "movl $8, %%edi\n" + + "1:\n" + SAD_ONE_STEP(0) + "addl %3, %%ecx\n" + "addl %3, %%edx\n" + "decl %%edi\n" + "jnz 1b\n" + + SAD_PACK + + : "=c" (sum) + : "m" (pRef), "m" (pCur), "m"(iEdgedWidth) + : "eax", "edx", "edi" + ); + return sum; + } + + int32_t SAD_Macroblock(const Image* pIm, + const Image* pImageN, const Image* pImageH, const Image* pImageV, const Image* pImageHV, + int x, int y, int dx, int dy, int sad_opt, int iQuality) + { + const Image* pImage; + int32_t sum=0; + const uint8_t *pRef; + const uint8_t *pCur; + int iEdgedWidth=pImageN->iEdgedWidth; + switch(((dx%2)?2:0)+((dy%2)?1:0)) + { + case 0: + pImage=pImageN; + break; + case 1: + pImage=pImageV; + dy--; + break; + case 2: + pImage=pImageH; + dx--; + break; + case 3: + default: + pImage=pImageHV; + dx--; + dy--; + break; + } + dx/=2; + dy/=2; + + pRef=pIm->pY+x*16+y*16*iEdgedWidth; + pCur=pImage->pY+(x*16+dx)+(y*16+dy)*iEdgedWidth; + + switch(iQuality) + { + case 1: + __asm__ __volatile__ + ( + SAD_INIT + "movl $4, %%edi\n" + + "1:\n" + SAD_ONE_STEP(0) + SAD_ONE_STEP(8) + "addl %3, %%ecx\n" + "addl %3, %%edx\n" + "decl %%edi\n" + "jnz 1b\n" + + SAD_PACK + + : "=c" (sum) + : "g" (pRef), "g" (pCur), "m"(4*iEdgedWidth) + : "eax", "edx", "edi" + ); + return sum*4; + case 2: + __asm__ __volatile__ + ( + SAD_INIT + "movl $8, %%edi\n" + + "1:\n" + SAD_ONE_STEP(0) + SAD_ONE_STEP(8) + "addl %3, %%ecx\n" + "addl %3, %%edx\n" + "decl %%edi\n" + "jnz 1b\n" + + SAD_PACK + + : "=c" (sum) + : "g" (pRef), "g" (pCur), "m"(2*iEdgedWidth) + : "eax", "edx", "edi" + ); + return sum*2; + default: + __asm__ __volatile__ + ( + SAD_INIT + "movl $16, %%edi\n" + + "1:\n" + SAD_ONE_STEP(0) + SAD_ONE_STEP(8) + "addl %3, %%ecx\n" + "addl %3, %%edx\n" + "decl %%edi\n" + "jnz 1b\n" + + SAD_PACK + + : "=c" (sum) + : "m" (pRef), "m" (pCur), "m"(iEdgedWidth) + : "eax", "edx", "edi" + ); + return sum; + } + } + + int32_t SAD_Deviation_MB(const Image* pIm, int x, int y) + { + int32_t sum=0, avg=0; + const uint8_t *pRef; + int i, j; + + pRef=pIm->pY+x*16+y*16*pIm->iEdgedWidth; + for(i=0; i<16; i++) + { + for(j=0; j<16; j++) + sum+=(int32_t)pRef[j]; + pRef+=pIm->iEdgedWidth; + } + sum/=256; + pRef=pIm->pY+x*16+y*16*pIm->iEdgedWidth; + for(i=0; i<16; i++) + { + for(j=0; j<16; j++) + avg+=ABS((int32_t)pRef[j]-sum); + pRef+=pIm->iEdgedWidth; + } + return avg; + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/att_mmx/transferidct_mmx.c bcast-2000c-mf3/quicktime/encore2/src/att_mmx/transferidct_mmx.c *** bcast-2000c/quicktime/encore2/src/att_mmx/transferidct_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/att_mmx/transferidct_mmx.c Fri Nov 30 02:09:35 2001 *************** *** 0 **** --- 1,414 ---- + #include "mbtransquant/transferidct.h" + + + + void EncTransferIDCT_add(uint8_t* pDest, int16_t* pSrc, int stride) + + { + + //not scheduled + + __asm__ __volatile__ + + ( + + "movl $8, %%edi\n" + + "pxor %%mm2, %%mm2\n" + + "1:\n" + + "movq (%%edx), %%mm0\n" + + "movq 8(%%edx), %%mm1\n" + + "movq (%%ecx), %%mm3\n" + + "movq %%mm3, %%mm4\n" + + "punpcklbw %%mm2, %%mm3\n" + + "punpckhbw %%mm2, %%mm4\n" + + "paddsw %%mm3, %%mm0\n" + + "paddsw %%mm4, %%mm1\n" + + "packuswb %%mm1, %%mm0\n" + + "movq %%mm0, (%%ecx)\n" + + "addl $16, %%edx\n" + + "addl %%eax, %%ecx\n" + + "decl %%edi\n" + + "jnz 1b\n" + + "emms\n" + + : + + : "c" (pDest), "d"(pSrc), "a"(stride) + + : "edi" + + ); + + } + + + + void EncTransferIDCT_copy(uint8_t* pDest, int16_t* pSrc, int stride) + + { + + int x, y; + + __asm__ __volatile__ + + ( + + "movq (%%edx), %%mm0\n" + + "packuswb 8(%%edx), %%mm0\n" + + "movq 16(%%edx), %%mm1\n" + + "packuswb 24(%%edx), %%mm1\n" + + "movq 32(%%edx), %%mm2\n" + + "packuswb 40(%%edx), %%mm2\n" + + "movq 48(%%edx), %%mm3\n" + + "packuswb 56(%%edx), %%mm3\n" + + + + "movq %%mm0, (%%ecx)\n" + + "addl %%eax, %%ecx\n" + + "movq %%mm1, (%%ecx)\n" + + "addl %%eax, %%ecx\n" + + "movq %%mm2, (%%ecx)\n" + + "addl %%eax, %%ecx\n" + + "movq %%mm3, (%%ecx)\n" + + "addl %%eax, %%ecx\n" + + + + "movq 64(%%edx), %%mm0\n" + + "addl $64, %%edx\n" + + "packuswb 8(%%edx), %%mm0\n" + + "movq 16(%%edx), %%mm1\n" + + "packuswb 24(%%edx), %%mm1\n" + + "movq 32(%%edx), %%mm2\n" + + "packuswb 40(%%edx), %%mm2\n" + + "movq 48(%%edx), %%mm3\n" + + "packuswb 56(%%edx), %%mm3\n" + + + + "movq %%mm0, (%%ecx)\n" + + "addl %%eax, %%ecx\n" + + "movq %%mm1, (%%ecx)\n" + + "addl %%eax, %%ecx\n" + + "movq %%mm2, (%%ecx)\n" + + "addl %%eax, %%ecx\n" + + "movq %%mm3, (%%ecx)\n" + + + + "emms\n" + + : + + : "c" (pDest), "d"(pSrc), "a"(stride) + + // : "edi" + + ); + + + /* + + for(y=0; y<8; y++) + + for(x=0; x<8; x++) + + { + + int16_t tmp=pSrc[x+y*8]; + + if(tmp<0) tmp=0; + + if(tmp>255) tmp=255; + + pDest[x+y*stride]=(uint8_t)tmp; + + } + + + */ + + } + + /* + + void EncTransferFDCT_sub(uint8_t* pSrc1, uint8_t* pSrc2, + + int16_t* pDest, int stride1, int stride2) + + { + + __asm__ __volatile__ + + ( + + "movl %4, %%edi\n" + + "movl %2, %%esi\n" + + "pushl %%ebx\n" + + "movl %%edi, %%ebx\n" + + "movl $8, %%edi\n" + + "pxor %%mm1, %%mm1\n" + + "1:\n" + + "movq (%%edx), %%mm0\n" + + "movq %%mm0, %%mm2\n" + + "punpcklbw %%mm1, %%mm2\n" + + "punpckhbw %%mm1, %%mm0\n" + + + + "movq (%%esi), %%mm3\n" + + "movq %%mm3, %%mm4\n" + + "punpcklbw %%mm1, %%mm4\n" + + "punpckhbw %%mm1, %%mm3\n" + + + + "psubsw %%mm3, %%mm0\n" + + "psubsw %%mm4, %%mm2\n" + + + + "movq %%mm2, (%%ecx)\n" + + "movq %%mm0, 8(%%ecx)\n" + + "addl $16, %%ecx\n" + + "addl %%eax, %%edx\n" + + "addl %%ebx, %%esi\n" + + "decl %%edi\n" + + "jnz 1b\n" + + "popl %%ebx\n" + + "emms\n" + + : + + : "c" (pDest), "d"(pSrc1), "g" (pSrc2), "a"(stride1), "g" (stride2) + + : "esi", "edi" + + ); + + } + + */ + + void EncTransferFDCT_sub(const uint8_t* pSrc, uint8_t* pSrc2, + + int16_t* pDest, int stride) + + { + + int i, j; + + __asm__ __volatile__ + + ( + + "movl %3, %%esi\n" + + "movl $8, %%edi\n" + + "pxor %%mm1, %%mm1\n" + + "1:\n" + + "movq (%%edx), %%mm0\n" + + "movq %%mm0, %%mm2\n" + + "punpcklbw %%mm1, %%mm2\n" + + "punpckhbw %%mm1, %%mm0\n" + + + + "movq (%%esi), %%mm3\n" + + "movq %%mm3, %%mm4\n" + + "movq %%mm3, %%mm5\n" + + "punpcklbw %%mm1, %%mm4\n" + + "punpckhbw %%mm1, %%mm3\n" + + + + "psubsw %%mm3, %%mm0\n" + + "psubsw %%mm4, %%mm2\n" + + + + "movq %%mm2, (%%ecx)\n" + + "movq %%mm0, 8(%%ecx)\n" + + "movq %%mm5, (%%edx)\n" + + "addl $16, %%ecx\n" + + "addl %%eax, %%edx\n" + + "addl %%eax, %%esi\n" + + "decl %%edi\n" + + "jnz 1b\n" + + "emms\n" + + : + + : "d"(pSrc2), "c" (pDest), "a"(stride), "g" (pSrc) + + : "esi", "edi" + + ); + + return; + + + + for(i=0; i<8; i++) + + { + + for(j=0; j<8; j++) + + { + + uint8_t tmp2=pSrc[j]; + + uint8_t tmp=pSrc2[j]; + + pSrc2[j]=tmp2; + + pDest[j]=(int16_t)tmp-(int16_t)tmp2; + + } + + pSrc2+=stride; + + pSrc+=stride; + + pDest+=8; + + } + + } + + + + void EncTransferFDCT_copy(uint8_t* pSrc, int16_t* pDest, int stride) + + { + + __asm__ __volatile__ + + ( + + "movl $8, %%edi\n" + + "pxor %%mm1, %%mm1\n" + + "1:\n" + + "movq (%%edx), %%mm0\n" + + "movq %%mm0, %%mm2\n" + + "punpcklbw %%mm1, %%mm2\n" + + "movq %%mm2, (%%ecx)\n" + + "punpckhbw %%mm1, %%mm0\n" + + "movq %%mm0, 8(%%ecx)\n" + + "addl $16, %%ecx\n" + + "addl %%eax, %%edx\n" + + "decl %%edi\n" + + "jnz 1b\n" + + "emms\n" + + : + + : "c" (pDest), "d"(pSrc), "a"(stride) + + : "edi" + + ); + + } + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/bitstream.c bcast-2000c-mf3/quicktime/encore2/src/bitstream.c *** bcast-2000c/quicktime/encore2/src/bitstream.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/bitstream.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,153 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * vol/vop headers + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 16.11.2001 rewrite; (c)2001 peter ross + * + *************************************************************************/ + + + #include "enc_bitstream.h" + + + #define VO_START_CODE 0x8 + #define VOL_START_CODE 0x12 + #define VOP_START_CODE 0x1b6 + + + #define MARKER() BitstreamPutBit(bs, 1) + + + /* + write vol header + */ + void BitstreamVolHeader(Bitstream * const bs, + const int width, + const int height) + { + // video object_start_code & vo_id + BitstreamPad(bs); + BitstreamPutBits(bs, VO_START_CODE, 27); + BitstreamPutBits(bs, 0, 5); + + // video_object_layer_start_code & vol_id + BitstreamPutBits(bs, VOL_START_CODE, 28); + BitstreamPutBits(bs, 0, 4); + + BitstreamPutBit(bs, 0); // random_accessible_vol + BitstreamPutBits(bs, 0, 8); // video_object_type_indication + BitstreamPutBit(bs, 0); // is_object_layer_identified (0=not given) + BitstreamPutBits(bs, 1, 4); // aspect_ratio_info (1=1:1) + BitstreamPutBit(bs, 0); // vol_control_parameters (0=not given) + BitstreamPutBits(bs, 0, 2); // video_object_layer_shape (0=rectangular) + + MARKER(); + + /* time_increment_resolution; ignored by current decore versions + eg. 2fps res=2 inc=1 + 25fps res=25 inc=1 + 29.97fps res=30000 inc=1001 + */ + BitstreamPutBits(bs, 1, 16); + + MARKER(); + + // fixed_vop_rate + BitstreamPutBit(bs, 0); + + // fixed_time_increment: value=nth_of_sec, nbits = log2(resolution) + // BitstreamPutBits(bs, 0, 15); + + MARKER(); + BitstreamPutBits(bs, width, 13); // width + MARKER(); + BitstreamPutBits(bs, height, 13); // height + MARKER(); + + BitstreamPutBit(bs, 0); // interlace + BitstreamPutBit(bs, 1); // obmc_disable (overlapped block motion compensation) + BitstreamPutBit(bs, 0); // sprite_enable + BitstreamPutBit(bs, 0); // not_in_bit + + // quant_type 0=h.263 1=mpeg4(quantizer tables) + BitstreamPutBit(bs, 0); + + BitstreamPutBit(bs, 1); // complexity_estimation_disable + BitstreamPutBit(bs, 1); // resync_marker_disable + BitstreamPutBit(bs, 0); // data_partitioned + BitstreamPutBit(bs, 0); // scalability + } + + + + /* + write vop header + + NOTE: doesnt handle bother with time_base & time_inc + time_base = n seconds since last resync (eg. last iframe) + time_inc = nth of a second since last resync + (decoder uses these values to determine precise time since last resync) + */ + void BitstreamVopHeader(Bitstream * const bs, + VOP_TYPE prediction_type, + const int rounding_type, + const uint8_t quant, + const uint8_t fcode) + { + BitstreamPad(bs); + BitstreamPutBits(bs, VOP_START_CODE, 32); + + BitstreamPutBits(bs, prediction_type, 2); + + // time_base = 0 write n x PutBit(1), PutBit(0) + BitstreamPutBits(bs, 0, 1); + + MARKER(); + + // time_increment: value=nth_of_sec, nbits = log2(resolution) + BitstreamPutBits(bs, 1, 1); + + MARKER(); + + BitstreamPutBits(bs, 1, 1); // vop_coded + + if (prediction_type != I_VOP) + BitstreamPutBits(bs, rounding_type, 1); + + BitstreamPutBits(bs, 0, 3); // intra_dc_vlc_threshold + + BitstreamPutBits(bs, quant, 5); // quantizer + + if (prediction_type != I_VOP) + BitstreamPutBits(bs, fcode, 3); // fixed_code = [1,4] + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/colorspace/CVS/Entries *** bcast-2000c/quicktime/encore2/src/colorspace/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/CVS/Entries Thu Dec 13 18:20:40 2001 *************** *** 0 **** --- 1,3 ---- + /enc_colorspace.h/1.1/Fri Nov 30 01:09:03 2001// + D/intel_mmx//// + /colorspace.c/1.1/Mon Dec 3 14:17:28 2001// diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/colorspace/CVS/Repository *** bcast-2000c/quicktime/encore2/src/colorspace/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/colorspace diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/colorspace/CVS/Root *** bcast-2000c/quicktime/encore2/src/colorspace/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/colorspace.c bcast-2000c-mf3/quicktime/encore2/src/colorspace/colorspace.c *** bcast-2000c/quicktime/encore2/src/colorspace/colorspace.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/colorspace.c Mon Dec 3 15:17:28 2001 *************** *** 0 **** --- 1,347 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * colorspace conversions + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 24.11.2001 accuracy improvement to yuyv/vyuy conversion + * 28.10.2001 total rewrite + * + **************************************************************************/ + + + /*#ifdef WIN32 + #include + #endif + #include + */ + + + #include "enc_colorspace.h" + + + + /* rgb -> yuv def's + + this following constants are "official spec" + Video Demystified" (ISBN 1-878707-09-4) + + rgb<->yuv _is_ lossy, sicne most programs do the conversion differently + + SCALEBITS/FIX taken from ffmpeg + */ + + #define Y_R 0.257 + #define Y_G 0.504 + #define Y_B 0.098 + #define Y_ADD 16 + + #define U_R 0.148 + #define U_G 0.291 + #define U_B 0.439 + #define U_ADD 128 + + #define V_R 0.439 + #define V_G 0.368 + #define V_B 0.071 + #define V_ADD 128 + + + #define SCALEBITS 8 + #define FIX(x) ((int) ((x) * (1L< yuv 4:2:0 planar + + NOTE: always flips. + */ + + void rgb24_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride) + { + uint32_t width3 = (width << 1) + width; /* width * 3 */ + uint32_t src_dif = (width << 3) + width; /* width3 * 3 */ + uint32_t y_dif = (stride << 1) - width; + uint32_t uv_dif = (stride - width) >> 1; + uint32_t x, y; + + src += (height - 2) * width3; + + + for(y = height >> 1; y; y--) { + for(x = width >> 1; x; x--) { + uint32_t r, g, b, r4, g4, b4; + + b4 = b = src[0]; + g4 = g = src[1]; + r4 = r = src[2]; + y_out[stride + 0] =(uint8_t)(( + FIX(Y_R) * r + + FIX(Y_G) * g + + FIX(Y_B) * b) >> SCALEBITS) + Y_ADD; + + b4 += (b = src[3]); + g4 += (g = src[4]); + r4 += (r = src[5]); + y_out[stride + 1] = (uint8_t)(( + FIX(Y_R) * r + + FIX(Y_G) * g + + FIX(Y_B) * b) >> SCALEBITS) + Y_ADD; + + b4 += (b = src[width3 + 0]); + g4 += (g = src[width3 + 1]); + r4 += (r = src[width3 + 2]); + y_out[0] = (uint8_t)(( + FIX(Y_R) * r + + FIX(Y_G) * g + + FIX(Y_B) * b) >> SCALEBITS) + Y_ADD; + + b4 += (b = src[width3 + 3]); + g4 += (g = src[width3 + 4]); + r4 += (r = src[width3 + 5]); + y_out[1] = (uint8_t)(( + FIX(Y_R) * r + + FIX(Y_G) * g + + FIX(Y_B) * b) >> SCALEBITS) + Y_ADD; + + *u_out++ = (uint8_t)(( + - FIX(U_R) * r4 + - FIX(U_G) * g4 + + FIX(U_B) * b4) >> (SCALEBITS + 2)) + U_ADD; + + + *v_out++ = (uint8_t)(( + FIX(V_R) * r4 + - FIX(V_G) * g4 + - FIX(V_B) * b4) >> (SCALEBITS + 2)) + V_ADD; + + + src += 6; + y_out += 2; + } + src -= src_dif; + y_out += y_dif; + u_out += uv_dif; + v_out += uv_dif; + } + } + + + /* rgb32 -> yuv 4:2:0 planar + + NOTE: always flips + */ + + void rgb32_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride) + { + uint32_t width4 = (width << 2); /* width * 4 */ + uint32_t src_dif = 3 * width4; + uint32_t y_dif = (stride << 1) - width; + uint32_t uv_dif = (stride - width) >> 1; + uint32_t x, y; + + src += (height - 2) * width4; + + for(y = height >> 1; y; y--) { + for(x = width >> 1; x; x--) { + uint32_t r, g, b, r4, g4, b4; + + b4 = b = src[0]; + g4 = g = src[1]; + r4 = r = src[2]; + y_out[stride + 0] =(uint8_t)(( + FIX(Y_R) * r + + FIX(Y_G) * g + + FIX(Y_B) * b) >> SCALEBITS) + Y_ADD; + + b4 += (b = src[4]); + g4 += (g = src[5]); + r4 += (r = src[6]); + y_out[stride + 1] =(uint8_t)(( + FIX(Y_R) * r + + FIX(Y_G) * g + + FIX(Y_B) * b) >> SCALEBITS) + Y_ADD; + + b4 += (b = src[width4 + 0]); + g4 += (g = src[width4 + 1]); + r4 += (r = src[width4 + 2]); + + y_out[0] =(uint8_t)(( + FIX(Y_R) * r + + FIX(Y_G) * g + + FIX(Y_B) * b) >> SCALEBITS) + Y_ADD; + + b4 += (b = src[width4 + 4]); + g4 += (g = src[width4 + 5]); + r4 += (r = src[width4 + 6]); + y_out[1] =(uint8_t)(( + FIX(Y_R) * r + + FIX(Y_G) * g + + FIX(Y_B) * b) >> SCALEBITS) + Y_ADD; + + *u_out++ = (uint8_t)(( + - FIX(U_R) * r4 + - FIX(U_G) * g4 + + FIX(U_B) * b4) >> (SCALEBITS + 2)) + U_ADD; + + *v_out++ = (uint8_t)(( + FIX(V_R) * r4 + - FIX(V_G) * g4 + - FIX(V_B) * b4) >> (SCALEBITS + 2)) + V_ADD; + + src += 8; + y_out += 2; + } + src -= src_dif; + y_out += y_dif; + u_out += uv_dif; + v_out += uv_dif; + } + } + + + + + /* yuv planar -> yuv 4:2:0 planar + + NOTE: does not flip */ + + void yuv_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride) + { + uint32_t stride2 = stride >> 1; + uint32_t width2 = width >> 1; + uint32_t y; + + for (y = height; y; y--) { + memcpy(y_out, src, width); + src += width; + y_out += stride; + } + + for (y = height >> 1; y; y--) { + memcpy(u_out, src, width2); + src += width2; + u_out += stride2; + } + + for (y = height >> 1; y; y--) { + memcpy(v_out, src, width2); + src += width2; + v_out+= stride2; + } + } + + + + /* yuyv (yuv2) packed -> yuv 4:2:0 planar + + NOTE: does not flip */ + + void yuyv_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride) + { + uint32_t width2 = width + width; + uint32_t y_dif = stride - width; + uint32_t uv_dif = y_dif >> 1; + uint32_t x, y; + + for (y = height >> 1; y; y--) { + + for (x = width >> 1; x; x--) { + *y_out++ = *src++; + //*u_out++ = *src++; + *u_out++ = (*(src+width2) + *src++) >> 1; + *y_out++ = *src++; + //*v_out++ = *src++; + *v_out++ = (*(src+width2) + *src++) >> 1; + + } + + y_out += y_dif; + u_out += uv_dif; + v_out += uv_dif; + + for (x = width >> 1; x; x--) { + *y_out++ = *src++; + src++; + *y_out++ = *src++; + src++; + } + + y_out += y_dif; + + } + + } + + + + /* uyvy packed -> yuv 4:2:0 planar + + NOTE: does not flip */ + + + void uyvy_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride) + { + uint32_t width2 = width + width; + uint32_t y_dif = stride - width; + uint32_t uv_dif = y_dif >> 1; + uint32_t x, y; + + for (y = height >> 1; y; y--) { + + for (x = width >> 1; x; x--) { + *u_out++ = *src++; + // *u_out++ = (*(src+width2) + *src++) >> 1; + *y_out++ = *src++; + //*v_out++ = *src++; + *v_out++ = (*(src+width2) + *src++) >> 1; + *y_out++ = *src++; + } + + y_out += y_dif; + u_out += uv_dif;; + v_out += uv_dif;; + + for (x = width >> 1; x; x--) { + src++; + *y_out++ = *src++; + src++; + *y_out++ = *src++; + } + + y_out += y_dif; + } + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/enc_colorspace.h bcast-2000c-mf3/quicktime/encore2/src/colorspace/enc_colorspace.h *** bcast-2000c/quicktime/encore2/src/colorspace/enc_colorspace.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/enc_colorspace.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,40 ---- + #ifndef _COLORSPACE_H + #define _COLORSPACE_H + + #include "enc_portab.h" + + + void rgb24_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride); + + void rgb32_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride); + + void yuv_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride); + + void yuyv_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride); + + void uyvy_to_yuv(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride); + + + /* mmx */ + + void rgb24_to_yuv_mmx(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride); + + void rgb32_to_yuv_mmx(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride); + + void yuv_to_yuv_mmx(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride); + + /* xmm */ + + void yuv_to_yuv_xmm(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + uint8_t *src, int width, int height, int stride); + + + #endif /* _COLORSPACE_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/CVS/Entries *** bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/CVS/Entries Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,3 ---- + /colorspace_mmx.asm/1.1/Fri Nov 30 01:09:03 2001// + /yuv_to_yuv.asm/1.1/Fri Nov 30 01:09:03 2001// + D diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/CVS/Repository *** bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/colorspace/intel_mmx diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/CVS/Root *** bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/colorspace_mmx.asm bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/colorspace_mmx.asm *** bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/colorspace_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/colorspace_mmx.asm Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,469 ---- + ;/************************************************************************** + ; * + ; * XVID MPEG-4 VIDEO CODEC + ; * mmx colorspace conversions + ; * + ; * This program is an implementation of a part of one or more MPEG-4 + ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + ; * to use this software module in hardware or software products are + ; * advised that its use may infringe existing patents or copyrights, and + ; * any such use would be at such party's own risk. The original + ; * developer of this software module and his/her company, and subsequent + ; * editors and their companies, will have no liability for use of this + ; * software or modifications or derivatives thereof. + ; * + ; * This program is free software; you can redistribute it and/or modify + ; * it under the terms of the GNU General Public License as published by + ; * the Free Software Foundation; either version 2 of the License, or + ; * (at your option) any later version. + ; * + ; * This program 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 General Public License for more details. + ; * + ; * You should have received a copy of the GNU General Public License + ; * along with this program; if not, write to the Free Software + ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ; * + ; *************************************************************************/ + + ;/************************************************************************** + ; * + ; * History: + ; * + ; * 24.11.2001 added cglobal macro (Isibaar) + ; * 23.11.2001 initial version; (c)2001 peter ross + ; * + ; *************************************************************************/ + + bits 32 + + + section .data + + %macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif + %endmacro + + align 16 + + + ;=========================================================================== + ; yuv constants + ;=========================================================================== + + %define Y_R 0.257 + %define Y_G 0.504 + %define Y_B 0.098 + %define Y_ADD 16 + + %define U_R 0.148 + %define U_G 0.291 + %define U_B 0.439 + %define U_ADD 128 + + %define V_R 0.439 + %define V_G 0.368 + %define V_B 0.071 + %define V_ADD 128 + + + ;=========================================================================== + ; multiplication matrices + ;=========================================================================== + + ; %define SCALEBITS 8 + + y_mul dw 25 ; FIX(Y_B) + dw 129 ; FIX(Y_G) + dw 66 ; FIX(Y_R) + dw 0 + + u_mul dw 112 ; FIX(U_B) + dw -74 ; FIX(U_G) + dw -38 ; FIX(U_R) + dw 0 + + v_mul dw -18 ; FIX(V_B) + dw -94 ; FIX(V_G) + dw 112 ; FIX(V_R) + dw 0 + + + + section .text + + ;=========================================================================== + ; + ; void yuyv_to_rgb24_mmx(uint8_t * const y_out, + ; uint8_t * const u_out, + ; uint8_t * const v_out, + ; const uint8_t * const src, + ; const uint32_t width, + ; const uint32_t height, + ; const uint32_t stride) + ; + ; always flips + ; + ;=========================================================================== + + align 16 + cglobal rgb24_to_yuv_mmx + rgb24_to_yuv_mmx + + push ebx + push ecx + push esi + push edi + push ebp ; STACK BASE = 20 + + ; global consants + + mov eax, [esp + 20 + 28] ; stride + mov ecx, [esp + 20 + 20] ; width + mov ebx, eax + sub ebx, ecx + shr ebx, 1 ; ebx = (stride-width) / 2; + push ebx ; [esp + 20] = uv_dif + ; STACK BASE = 24 + + add eax, eax + sub eax, ecx ; eax = 2*stride - width + push eax ; [esp + 16] = y_dif + ; STACK BASE = 28 + + mov ebx, ecx ; + shr ebx, 1 ; + push ebx ; [esp + 12] = width/2 + ; STACK BASE = 32 + + mov edx, ecx + add ecx, edx + add ecx, edx ; ecx = 3*width (use 4 for rgb32) + push ecx ; [esp + 8] = width3 + ; STACK BASE = 36 + + mov edx, ecx + add edx, ecx + add edx, ecx ; edx = 3*width3 + push edx ; [esp + 4] = src_dif + ; STACK BASE = 40 + + mov esi, [esp + 40 + 16] ; src + mov ebp, [esp + 40 + 24] ; eax = height + mov eax, ebp + sub eax, 2 + mul ecx + add esi, eax ; src += (height-2) * width3 + + mov edi, [esp + 40 + 4] ; y_out + mov ecx, [esp + 40 + 8] ; u_out + mov edx, [esp + 40 + 12] ; v_out + movq mm7, [y_mul] + + shr ebp, 1 ; ebp = height / 2 + push ebp ; [esp+0] = tmp + ; STACK BASE = 44 + + .yloop + mov ebp, [esp + 12] ; ebp = width /2 + + .xloop + ; y_out + + mov ebx, [esp + 8] ; ebx = width3 + + pxor mm4, mm4 + pxor mm5, mm5 + movd mm0, [esi] ; src[0...] + movd mm2, [esi+ebx] ; src[width3...] + punpcklbw mm0, mm4 ; [ |b |g |r ] + punpcklbw mm2, mm5 ; [ |b |g |r ] + movq mm6, mm0 ; = [ |b4|g4|r4] + paddw mm6, mm2 ; +[ |b4|g4|r4] + pmaddwd mm0, mm7 ; *= Y_MUL + pmaddwd mm2, mm7 ; *= Y_MUL + movq mm4, mm0 ; [r] + movq mm5, mm2 ; [r] + psrlq mm4, 32 ; +[g] + psrlq mm5, 32 ; +[g] + paddd mm0, mm4 ; +[b] + paddd mm2, mm5 ; +[b] + + pxor mm4, mm4 + pxor mm5, mm5 + movd mm1, [esi+3] ; src[4...] + movd mm3, [esi+ebx+3] ; src[width3+4...] + punpcklbw mm1, mm4 ; [ |b |g |r ] + punpcklbw mm3, mm5 ; [ |b |g |r ] + paddw mm6, mm1 ; +[ |b4|g4|r4] + paddw mm6, mm3 ; +[ |b4|g4|r4] + pmaddwd mm1, mm7 ; *= Y_MUL + pmaddwd mm3, mm7 ; *= Y_MUL + movq mm4, mm1 ; [r] + movq mm5, mm3 ; [r] + psrlq mm4, 32 ; +[g] + psrlq mm5, 32 ; +[g] + paddd mm1, mm4 ; +[b] + paddd mm3, mm5 ; +[b] + + mov ebx, [esp + 44 + 28] ; stride + + movd eax, mm0 + shr eax, 8 + add eax, Y_ADD + mov [edi + ebx], al + + movd eax, mm1 + shr eax, 8 + add eax, Y_ADD + mov [edi + ebx + 1], al + + movd eax, mm2 + shr eax, 8 + add eax, Y_ADD + mov [edi], al + + movd eax, mm3 + shr eax, 8 + add eax, Y_ADD + mov [edi + 1], al + + ; u_out, v_out + + movq mm0, mm6 ; = [ |b4|g4|r4] + pmaddwd mm6, [v_mul] ; *= V_MUL + pmaddwd mm0, [u_mul] ; *= U_MUL + movq mm1, mm0 + movq mm2, mm6 + psrlq mm1, 32 + psrlq mm2, 32 + paddd mm0, mm1 + paddd mm2, mm6 + + movd eax, mm0 + shr eax, 10 + add eax, U_ADD + mov [ecx], al + + movd eax, mm2 + shr eax, 10 + add eax, V_ADD + mov [edx], al + + add esi, 2 * 3 ; (use 4 for rgb32) + add edi, 2 + inc ecx + inc edx + + dec ebp + jnz near .xloop + + sub esi, [esp + 4] ; src -= src_dif + add edi, [esp + 16] ; y_out += y_dif + add ecx, [esp + 20] ; u_out += uv_dif + add edx, [esp + 20] ; v_out += uv_dif + + dec dword [esp+0] + jnz near .yloop + + emms + + add esp, 24 + pop ebp + pop edi + pop esi + pop ecx + pop ebx + + ret + + + + ;=========================================================================== + ; + ; void yuyv_to_rgb32_mmx(uint8_t * const y_out, + ; uint8_t * const u_out, + ; uint8_t * const v_out, + ; const uint8_t * const src, + ; const uint32_t width, + ; const uint32_t height, + ; const uint32_t stride) + ; + ; always flips + ; + ;=========================================================================== + + align 16 + cglobal rgb32_to_yuv_mmx + rgb32_to_yuv_mmx + + push ebx + push ecx + push esi + push edi + push ebp ; STACK BASE = 20 + + ; global consants + + mov eax, [esp + 20 + 28] ; stride + mov ecx, [esp + 20 + 20] ; width + mov ebx, eax + sub ebx, ecx + shr ebx, 1 ; ebx = (stride-width) / 2; + push ebx ; [esp + 20] = uv_dif + ; STACK BASE = 24 + + add eax, eax + sub eax, ecx ; eax = 2*stride - width + push eax ; [esp + 16] = y_dif + ; STACK BASE = 28 + + mov ebx, ecx ; + shr ebx, 1 ; + push ebx ; [esp + 12] = width/2 + ; STACK BASE = 32 + + mov edx, ecx + shl ecx, 2 ; ecx = 4*width (use 4 for rgb32) + push ecx ; [esp + 8] = width4 + ; STACK BASE = 36 + + mov edx, ecx + add edx, ecx + add edx, ecx ; edx = 3*width4 + push edx ; [esp + 4] = src_dif + ; STACK BASE = 40 + + mov esi, [esp + 40 + 16] ; src + mov ebp, [esp + 40 + 24] ; eax = height + mov eax, ebp + sub eax, 2 + mul ecx + add esi, eax ; src += (height-2) * width4 + + mov edi, [esp + 40 + 4] ; y_out + mov ecx, [esp + 40 + 8] ; u_out + mov edx, [esp + 40 + 12] ; v_out + movq mm7, [y_mul] + + shr ebp, 1 ; ebp = height / 2 + push ebp ; [esp+0] = tmp + ; STACK BASE = 44 + + .yloop + mov ebp, [esp + 12] ; ebp = width /2 + + .xloop + ; y_out + + mov ebx, [esp + 8] ; ebx = width4 + + pxor mm4, mm4 + movq mm0, [esi] ; src[4... |0... ] + movq mm2, [esi+ebx] ; src[width4+4...|width4...] + movq mm1, mm0 + movq mm3, mm2 + punpcklbw mm0, mm4 ; [ |b |g |r ] + punpcklbw mm2, mm4 ; [ |b |g |r ] + punpckhbw mm1, mm4 ; [ |b |g |r ] + punpckhbw mm3, mm4 ; [ |b |g |r ] + + movq mm6, mm0 ; = [ |b4|g4|r4] + paddw mm6, mm2 ; +[ |b4|g4|r4] + pmaddwd mm0, mm7 ; *= Y_MUL + pmaddwd mm2, mm7 ; *= Y_MUL + movq mm4, mm0 ; [r] + movq mm5, mm2 ; [r] + psrlq mm4, 32 ; +[g] + psrlq mm5, 32 ; +[g] + paddd mm0, mm4 ; +[b] + paddd mm2, mm5 ; +[b] + + paddw mm6, mm1 ; +[ |b4|g4|r4] + paddw mm6, mm3 ; +[ |b4|g4|r4] + pmaddwd mm1, mm7 ; *= Y_MUL + pmaddwd mm3, mm7 ; *= Y_MUL + movq mm4, mm1 ; [r] + movq mm5, mm3 ; [r] + psrlq mm4, 32 ; +[g] + psrlq mm5, 32 ; +[g] + paddd mm1, mm4 ; +[b] + paddd mm3, mm5 ; +[b] + + mov ebx, [esp + 44 + 28] ; stride + + movd eax, mm0 + shr eax, 8 + add eax, Y_ADD + mov [edi + ebx], al + + movd eax, mm1 + shr eax, 8 + add eax, Y_ADD + mov [edi + ebx + 1], al + + movd eax, mm2 + shr eax, 8 + add eax, Y_ADD + mov [edi], al + + movd eax, mm3 + shr eax, 8 + add eax, Y_ADD + mov [edi + 1], al + + ; u_out, v_out + + movq mm0, mm6 ; = [ |b4|g4|r4] + pmaddwd mm6, [v_mul] ; *= V_MUL + pmaddwd mm0, [u_mul] ; *= U_MUL + movq mm1, mm0 + movq mm2, mm6 + psrlq mm1, 32 + psrlq mm2, 32 + paddd mm0, mm1 + paddd mm2, mm6 + + movd eax, mm0 + shr eax, 10 + add eax, U_ADD + mov [ecx], al + + movd eax, mm2 + shr eax, 10 + add eax, V_ADD + mov [edx], al + + add esi, 2 * 4 ; (use 4 for rgb32) + add edi, 2 + inc ecx + inc edx + + dec ebp + jnz near .xloop + + sub esi, [esp + 4] ; src -= src_dif + add edi, [esp + 16] ; y_out += y_dif + add ecx, [esp + 20] ; u_out += uv_dif + add edx, [esp + 20] ; v_out += uv_dif + + dec dword [esp+0] + jnz near .yloop + + emms + + add esp, 24 + pop ebp + pop edi + pop esi + pop ecx + pop ebx + + ret diff -C2 -r -N bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/yuv_to_yuv.asm bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/yuv_to_yuv.asm *** bcast-2000c/quicktime/encore2/src/colorspace/intel_mmx/yuv_to_yuv.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/colorspace/intel_mmx/yuv_to_yuv.asm Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,515 ---- + ;/****************************************************************************** + ; * * + ; * This file is part of XviD, a free MPEG-4 video encoder/decoder * + ; * * + ; * XviD is an implementation of a part of one or more MPEG-4 Video tools * + ; * as specified in ISO/IEC 14496-2 standard. Those intending to use this * + ; * software module in hardware or software products are advised that its * + ; * use may infringe existing patents or copyrights, and any such use * + ; * would be at such party's own risk. The original developer of this * + ; * software module and his/her company, and subsequent editors and their * + ; * companies, will have no liability for use of this software or * + ; * modifications or derivatives thereof. * + ; * * + ; * XviD is free software; you can redistribute it and/or modify it * + ; * under the terms of the GNU General Public License as published by * + ; * the Free Software Foundation; either version 2 of the License, or * + ; * (at your option) any later version. * + ; * * + ; * XviD 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 General Public License for more details. * + ; * * + ; * You should have received a copy of the GNU General Public License * + ; * along with this program; if not, write to the Free Software * + ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + ; * * + ; ******************************************************************************/ + ; + ;/****************************************************************************** + ; * * + ; * yuv_to_yuv.asm, MMX optimized color conversion * + ; * * + ; * Copyright (C) 2001 - Michael Militzer , * + ; * * + ; * For more information visit the XviD homepage: http://www.xvid.org * + ; * * + ; ******************************************************************************/ + ; + ;/****************************************************************************** + ; * * + ; * Revision history: * + ; * * + ; * 24.11.2001 initial version (Isibaar) * + ; * * + ; ******************************************************************************/ + + BITS 32 + + %macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif + %endmacro + + SECTION .data + remainder dw 0 + + SECTION .text + + ALIGN 64 + + ; Attention: This code assumes that width is a multiple of 16 + ; This function probably also runs on PentiumII class cpu's + + ;;void yuv_to_yuv_xmm(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, uint8_t *src, + ;; int width, int height, int stride); + cglobal yuv_to_yuv_xmm + yuv_to_yuv_xmm: + + push ebx + push esi + push edi + push ebp + + mov eax, [esp + 40] ; height -> eax + mov ebx, [esp + 44] ; stride -> ebx + mov esi, [esp + 32] ; src -> esi + mov edi, [esp + 20] ; y_out -> edi + mov ecx, [esp + 36] ; width -> ecx + + sub ebx, ecx ; stride - width -> ebx + + mov edx, ecx + mov ebp, ecx + shr edx, 6 + mov ecx, edx ; 64 bytes copied per iteration + shl edx, 6 + sub ebp, edx ; remainder -> ebp + shr ebp, 4 ; 16 bytes per iteration + add ebp, 1 + mov [remainder], ebp + + mov edx, ecx + + .y_inner_loop: + prefetchnta [esi + 64] ; non temporal prefetch + prefetchnta [esi + 96] + + movq mm1, [esi] ; read from src + movq mm2, [esi + 8] + movq mm3, [esi + 16] + movq mm4, [esi + 24] + movq mm5, [esi + 32] + movq mm6, [esi + 40] + movq mm7, [esi + 48] + movq mm0, [esi + 56] + + movntq [edi], mm1 ; write to y_out + movntq [edi + 8], mm2 + movntq [edi + 16], mm3 + movntq [edi + 24], mm4 + movntq [edi + 32], mm5 + movntq [edi + 40], mm6 + movntq [edi + 48], mm7 + movntq [edi + 56], mm0 + + add esi, 64 + add edi, 64 + dec ecx + jnz .y_inner_loop + + dec ebp + jz .y_outer_loop + + .y_remainder_loop: + movq mm1, [esi] ; read from src + movq mm2, [esi + 8] + + movntq [edi], mm1 ; write to y_out + movntq [edi + 8], mm2 + + add esi, 16 + add edi, 16 + dec ebp + jnz .y_remainder_loop + + .y_outer_loop: + mov ebp, [remainder] + mov ecx, edx + add edi, ebx + + dec eax + jnz near .y_inner_loop + + mov eax, [esp + 40] ; height -> eax + mov ebx, [esp + 44] ; stride -> ebx + mov ecx, [esp + 36] ; width -> ecx + mov edi, [esp + 24] ; u_out -> edi + + shr ecx, 1 ; width / 2 -> ecx + shr ebx, 1 ; stride / 2 -> ebx + shr eax, 1 ; height / 2 -> eax + + sub ebx, ecx ; stride / 2 - width / 2 -> ebx + + mov edx, ecx + mov ebp, ecx + shr edx, 6 + mov ecx, edx ; 64 bytes copied per iteration + shl edx, 6 + sub ebp, edx ; remainder -> ebp + shr ebp, 3 ; 8 bytes per iteration + add ebp, 1 + mov [remainder], ebp + + mov edx, ecx + + .u_inner_loop: + prefetchnta [esi + 64] ; non temporal prefetch + prefetchnta [esi + 96] + + movq mm1, [esi] ; read from src + movq mm2, [esi + 8] + movq mm3, [esi + 16] + movq mm4, [esi + 24] + movq mm5, [esi + 32] + movq mm6, [esi + 40] + movq mm7, [esi + 48] + movq mm0, [esi + 56] + + movntq [edi], mm1 ; write to u_out + movntq [edi + 8], mm2 + movntq [edi + 16], mm3 + movntq [edi + 24], mm4 + movntq [edi + 32], mm5 + movntq [edi + 40], mm6 + movntq [edi + 48], mm7 + movntq [edi + 56], mm0 + + + add esi, 64 + add edi, 64 + dec ecx + jnz .u_inner_loop + + dec ebp + jz .u_outer_loop + + .u_remainder_loop: + movq mm1, [esi] ; read from src + movntq [edi], mm1 ; write to y_out + + add esi, 8 + add edi, 8 + dec ebp + jnz .u_remainder_loop + + .u_outer_loop: + mov ebp, [remainder] + mov ecx, edx + add edi, ebx + + dec eax + jnz .u_inner_loop + + mov eax, [esp + 40] ; height -> eax + mov ecx, [esp + 36] ; width -> ecx + mov edi, [esp + 28] ; v_out -> edi + + shr ecx, 1 ; width / 2 -> ecx + shr eax, 1 ; height / 2 -> eax + + mov edx, ecx + mov ebp, ecx + shr edx, 6 + mov ecx, edx ; 64 bytes copied per iteration + shl edx, 6 + sub ebp, edx ; remainder -> ebp + shr ebp, 3 ; 8 bytes per iteration + add ebp, 1 + mov [remainder], ebp + + mov edx, ecx + + .v_inner_loop: + prefetchnta [esi + 64] ; non temporal prefetch + prefetchnta [esi + 96] + + movq mm1, [esi] ; read from src + movq mm2, [esi + 8] + movq mm3, [esi + 16] + movq mm4, [esi + 24] + movq mm5, [esi + 32] + movq mm6, [esi + 40] + movq mm7, [esi + 48] + movq mm0, [esi + 56] + + movntq [edi], mm1 ; write to u_out + movntq [edi + 8], mm2 + movntq [edi + 16], mm3 + movntq [edi + 24], mm4 + movntq [edi + 32], mm5 + movntq [edi + 40], mm6 + movntq [edi + 48], mm7 + movntq [edi + 56], mm0 + + + add esi, 64 + add edi, 64 + dec ecx + jnz .v_inner_loop + + dec ebp + jz .v_outer_loop + + .v_remainder_loop: + movq mm1, [esi] ; read from src + movntq [edi], mm1 ; write to y_out + + add esi, 8 + add edi, 8 + dec ebp + jnz .v_remainder_loop + + .v_outer_loop: + mov ebp, [remainder] + mov ecx, edx + add edi, ebx + + dec eax + jnz .v_inner_loop + + pop ebp + pop edi + pop esi + pop ebx + + emms + + ret + + + + ; Attention: This code assumes that width is a multiple of 16 + ;;void yuv_to_yuv_mmx(uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, uint8_t *src, + ;; int width, int height, int stride); + cglobal yuv_to_yuv_mmx + yuv_to_yuv_mmx: + + push ebx + push esi + push edi + push ebp + + mov eax, [esp + 40] ; height -> eax + mov ebx, [esp + 44] ; stride -> ebx + mov esi, [esp + 32] ; src -> esi + mov edi, [esp + 20] ; y_out -> edi + mov ecx, [esp + 36] ; width -> ecx + + sub ebx, ecx ; stride - width -> ebx + + mov edx, ecx + mov ebp, ecx + shr edx, 6 + mov ecx, edx ; 64 bytes copied per iteration + shl edx, 6 + sub ebp, edx ; remainder -> ebp + shr ebp, 4 ; 16 bytes per iteration + add ebp, 1 + mov [remainder], ebp + + mov edx, ecx + + .y_inner_loop: + movq mm1, [esi] ; read from src + movq mm2, [esi + 8] + movq mm3, [esi + 16] + movq mm4, [esi + 24] + movq mm5, [esi + 32] + movq mm6, [esi + 40] + movq mm7, [esi + 48] + movq mm0, [esi + 56] + + movq [edi], mm1 ; write to y_out + movq [edi + 8], mm2 + movq [edi + 16], mm3 + movq [edi + 24], mm4 + movq [edi + 32], mm5 + movq [edi + 40], mm6 + movq [edi + 48], mm7 + movq [edi + 56], mm0 + + add esi, 64 + add edi, 64 + dec ecx + jnz .y_inner_loop + + dec ebp + jz .y_outer_loop + + .y_remainder_loop: + movq mm1, [esi] ; read from src + movq mm2, [esi + 8] + + movq [edi], mm1 ; write to y_out + movq [edi + 8], mm2 + + add esi, 16 + add edi, 16 + dec ebp + jnz .y_remainder_loop + + .y_outer_loop: + mov ebp, [remainder] + mov ecx, edx + add edi, ebx + + dec eax + jnz near .y_inner_loop + + mov eax, [esp + 40] ; height -> eax + mov ebx, [esp + 44] ; stride -> ebx + mov ecx, [esp + 36] ; width -> ecx + mov edi, [esp + 24] ; u_out -> edi + + shr ecx, 1 ; width / 2 -> ecx + shr ebx, 1 ; stride / 2 -> ebx + shr eax, 1 ; height / 2 -> eax + + sub ebx, ecx ; stride / 2 - width / 2 -> ebx + + mov edx, ecx + mov ebp, ecx + shr edx, 6 + mov ecx, edx ; 64 bytes copied per iteration + shl edx, 6 + sub ebp, edx ; remainder -> ebp + shr ebp, 3 ; 8 bytes per iteration + add ebp, 1 + mov [remainder], ebp + + mov edx, ecx + + .u_inner_loop: + movq mm1, [esi] ; read from src + movq mm2, [esi + 8] + movq mm3, [esi + 16] + movq mm4, [esi + 24] + movq mm5, [esi + 32] + movq mm6, [esi + 40] + movq mm7, [esi + 48] + movq mm0, [esi + 56] + + movq [edi], mm1 ; write to u_out + movq [edi + 8], mm2 + movq [edi + 16], mm3 + movq [edi + 24], mm4 + movq [edi + 32], mm5 + movq [edi + 40], mm6 + movq [edi + 48], mm7 + movq [edi + 56], mm0 + + + add esi, 64 + add edi, 64 + dec ecx + jnz .u_inner_loop + + dec ebp + jz .u_outer_loop + + .u_remainder_loop: + movq mm1, [esi] ; read from src + movq [edi], mm1 ; write to y_out + + add esi, 8 + add edi, 8 + dec ebp + jnz .u_remainder_loop + + .u_outer_loop: + mov ebp, [remainder] + mov ecx, edx + add edi, ebx + + dec eax + jnz .u_inner_loop + + mov eax, [esp + 40] ; height -> eax + mov ecx, [esp + 36] ; width -> ecx + mov edi, [esp + 28] ; v_out -> edi + + shr ecx, 1 ; width / 2 -> ecx + shr eax, 1 ; height / 2 -> eax + + mov edx, ecx + mov ebp, ecx + shr edx, 6 + mov ecx, edx ; 64 bytes copied per iteration + shl edx, 6 + sub ebp, edx ; remainder -> ebp + shr ebp, 3 ; 8 bytes per iteration + add ebp, 1 + mov [remainder], ebp + + mov edx, ecx + + .v_inner_loop: + movq mm1, [esi] ; read from src + movq mm2, [esi + 8] + movq mm3, [esi + 16] + movq mm4, [esi + 24] + movq mm5, [esi + 32] + movq mm6, [esi + 40] + movq mm7, [esi + 48] + movq mm0, [esi + 56] + + movq [edi], mm1 ; write to u_out + movq [edi + 8], mm2 + movq [edi + 16], mm3 + movq [edi + 24], mm4 + movq [edi + 32], mm5 + movq [edi + 40], mm6 + movq [edi + 48], mm7 + movq [edi + 56], mm0 + + + add esi, 64 + add edi, 64 + dec ecx + jnz .v_inner_loop + + dec ebp + jz .v_outer_loop + + .v_remainder_loop: + movq mm1, [esi] ; read from src + movq [edi], mm1 ; write to y_out + + add esi, 8 + add edi, 8 + dec ebp + jnz .v_remainder_loop + + .v_outer_loop: + mov ebp, [remainder] + mov ecx, edx + add edi, ebx + + dec eax + jnz .v_inner_loop + + pop ebp + pop edi + pop esi + pop ebx + + emms + + ret \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/encore2/src/copyblock.c bcast-2000c-mf3/quicktime/encore2/src/copyblock.c *** bcast-2000c/quicktime/encore2/src/copyblock.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/copyblock.c Sat Dec 1 02:45:44 2001 *************** *** 0 **** --- 1,10 ---- + #include "copyblock.h" + + void EncCopyBlock(uint8_t *pSrc, int16_t *pDest, int stride) + { + int x, y; + + for (y = 0; y < 8; y++) + for (x = 0; x < 8; x++) + pDest[x + y * 8] = (int16_t) pSrc[x + y * stride]; + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/enc_bitstream.h bcast-2000c-mf3/quicktime/encore2/src/enc_bitstream.h *** bcast-2000c/quicktime/encore2/src/enc_bitstream.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/enc_bitstream.h Fri Dec 7 14:28:24 2001 *************** *** 0 **** --- 1,161 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * bitstream writer + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 17.11.2001 moved bswap -> portab.h (Isibaar) + * 16.11.2001 inital version; (c)2001 peter ross + * + *************************************************************************/ + + + #ifndef ENCORE_BITSTREAM_H_ + #define ENCORE_BITSTREAM_H_ + + #include "enctypes.h" + #include + + + void BitstreamVolHeader(Bitstream * const bs, + const int width, + const int height); + + + void BitstreamVopHeader(Bitstream * const bs, + VOP_TYPE prediction_type, + const int rounding_type, + const uint8_t quant, + const uint8_t fcode); + + + /* reset bitstream state */ + + static void __inline BitstreamReset(Bitstream * const bs) + { + bs->pos = 0; + bs->buf = 0; + bs->tail = bs->start; + } + + + /* initialise bitstream structure */ + + static void __inline BitstreamInit(Bitstream * const bs, + void * const pointer) + { + bs->start = bs->tail = (unsigned char *)pointer; + BitstreamReset(bs); + } + + + /* bitstream length (unit bits) */ + + static uint32_t __inline BsPos(const Bitstream * const bs) + { + return 8 * (bs->tail - bs->start) + bs->pos; + } + + + + /* flush the bitsream & return length (unit bytes) + NOTE: assumes no futher bitsream functions will be called. + */ + + static uint32_t __inline BitstreamLength(Bitstream * const bs) + { + while(bs->pos > 0) + { + *bs->tail++ = (bs->buf & 0xff00000000000000LL) >> 56; + bs->buf <<= 8; + bs->pos -= 8; + } + return bs->tail - bs->start; + } + + + /* Flush enough data from buf to write bits */ + + static void BitStreamAllocate(Bitstream * const bs, const uint32_t bits) + { + while(64 - bs->pos < bits) + { + *bs->tail++ = (bs->buf & 0xff00000000000000LL) >> 56; + bs->buf <<= 8; + bs->pos -= 8; + } + } + + + /* pad bitstream to the next byte boundary */ + + static void __inline BitstreamPad(Bitstream * const bs) + { + BitstreamSkip(bs, (64 - bs->pos) % 8); + } + + + /* write n bits to bitstream */ + + static void __inline BitstreamPutBits(Bitstream * const bs, + const uint32_t value, + const uint32_t size) + { + BitStreamAllocate(bs, size); + + + //if(size > 32) printf("BitstreamPutBits size=%d\n", size); + bs->buf |= ((uint64_t)value) << (64 - size - bs->pos); + bs->pos += size; + } + + + /* write single bit to bitstream */ + + static void __inline BitstreamPutBit(Bitstream * const bs, + const uint32_t bit) + { + BitstreamPutBits(bs, bit, 1); + } + + /* move bitstream position forward by n bits + */ + + static void __inline BitstreamSkip(Bitstream * const bs, const uint32_t bits) + { + BitstreamPutBits(bs, + 0, + bits); + } + + + + #endif /* _BITSTREAM_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/enc_copyblock.h bcast-2000c-mf3/quicktime/encore2/src/enc_copyblock.h *** bcast-2000c/quicktime/encore2/src/enc_copyblock.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/enc_copyblock.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,54 ---- + /************************************************************************** + * + * Modifications: + * + * 28.10.2001 merged & inlined c/mmx EncCopyBlock + * + **************************************************************************/ + + #ifndef ENC_COPYBLOCK_H_ + #define ENC_COPYBLOCK_H_ + + #include "portab.h" + + + static void __inline EncCopyBlock(uint8_t* pSrc, int16_t* pDest, int stride) + { + + #if defined(WIN32) && defined(_MMX_) + + __asm + { + mov ecx, pDest + mov edx, pSrc + mov eax, stride + mov edi, 8 + pxor mm1, mm1 + p3: + + movq mm0, [edx] + movq mm2, mm0 + punpcklbw mm2, mm1 + movq [ecx], mm2 + punpckhbw mm0, mm1 + movq [ecx+8], mm0 + add ecx, 16 + add edx, eax + dec edi + + jnz p3 + emms + } + #else if + + int x, y; + + for (y = 0; y < 8; y++) + for (x = 0; x < 8; x++) + pDest[x + y * 8] = (int16_t) pSrc[x + y * stride]; + + #endif + } + + + #endif /* _COPYBLOCK_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/enc_image.h bcast-2000c-mf3/quicktime/encore2/src/enc_image.h *** bcast-2000c/quicktime/encore2/src/enc_image.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/enc_image.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,28 ---- + #ifndef _ENCORE_VOP_H + + #define _ENCORE_VOP_H + + + + #include "enctypes.h" + + + + int CreateImage(Image * pImage, int width, int height); + + void FreeImage(Image * pImage); + + void SwapImages(Image * pIm1, Image * pIm2); + + void CopyImages(Image * pIm1, Image * pIm2); + + void SetEdges(Image * pImage); + + void Interpolate(const Image * pRef, Image * pInterH, Image * pInterV, + + Image * pInterHV, const int iRounding, int iChromOnly); + + + + #endif + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/enc_mbfunctions.h bcast-2000c-mf3/quicktime/encore2/src/enc_mbfunctions.h *** bcast-2000c/quicktime/encore2/src/enc_mbfunctions.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/enc_mbfunctions.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,79 ---- + /************************************************************************** + * + * Modifications: + * + * 16.11.2001 const/uint32_t changes to MBMotionEstComp() + * 26.08.2001 added inter4v_mode parameter to MBMotionEstComp() + * + * Michael Militzer + * + **************************************************************************/ + + #ifndef _ENCORE_BLOCK_H + #define _ENCORE_BLOCK_H + + #include "enctypes.h" + #include "bitstream.h" + + + + /** MBMotionEstComp.c **/ + + bool MBMotionEstComp(const MBParam * const pParam, /* <-- Motion estimation parameters */ + const uint32_t xpos, /* <-- X position of the MB to be searched */ + const uint32_t ypos, /* <-- Y position of the MB to be searched */ + const Image * const pvRef, /* <-- Image, reconstructed during last call to encore() */ + const Image * const pvInterH, /* <-- Same as above, interpolated horizontally */ + const Image * const pvInterV, /* <-- Same as above, interpolated vertically */ + const Image * const pvInterHV, /* <-- Same as above, interpolated both horizontally and vertically */ + Image * const pCurrent, /* --> Compensated reconstructed image */ + int16_t dct_codes[][64], /* --> Motion compensation error */ + const int inter4v_mode /* <-- enc_mode: RC_MODE / VBR_MODE / EXT_MODE */ + ); + + + /** MBPrediction.c **/ + + void MBPrediction(const MBParam *pParam, /* <-- the parameter for ACDC and MV prediction */ + uint16_t x_pos, /* <-- The x position of the MB to be searched */ + uint16_t y_pos, /* <-- The y position of the MB to be searched */ + uint16_t x_dim, /* <-- Number of macroblocks in a row */ + int16_t qcoeff[][64], /* <-> The quantized DCT coefficients */ + Macroblock *MB_array /* <-> the array of all the MB Infomations */ + ); + + + /** MBCoding.c **/ + + void MBCoding(const MBParam *pParam, /* <-- the parameter for coding of the bitstream */ + const Macroblock *pMB, /* <-- Info of the MB to be coded */ + int16_t qcoeff[][64], /* <-- the quantized DCT coefficients */ + Bitstream * bs, /* <-> the bitstream */ + Statistics * pStat /* <-> statistical data collected for current frame */ + ); + + + /** MBTransQuant.c **/ + + + + void MBTransQuantIntra(const MBParam *pParam, + const uint16_t x_pos, /* <-- The x position of the MB to be searched */ + const uint16_t y_pos, /* <-- The y position of the MB to be searched */ + int16_t data[][64], /* <-> the data of the MB to be coded */ + int16_t qcoeff[][64], /* <-> the quantized DCT coefficients */ + Image * const pCurrent /* <-> the reconstructed image ( function will update one + MB in it with data from data[] ) */ + ); + + uint8_t MBTransQuantInter(const MBParam *pParam, /* <-- the parameter for DCT transformation + and Quantization */ + const uint16_t x_pos, /* <-- The x position of the MB to be searched */ + const uint16_t y_pos, /* <-- The y position of the MB to be searched */ + int16_t data[][64], /* <-> the data of the MB to be coded */ + int16_t qcoeff[][64], /* <-> the quantized DCT coefficients */ + Image * const pCurrent /* <-> the reconstructed image ( function will + update one MB in it with data from data[] ) */ + ); + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/src/enc_mv_hint.h bcast-2000c-mf3/quicktime/encore2/src/enc_mv_hint.h *** bcast-2000c/quicktime/encore2/src/enc_mv_hint.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/enc_mv_hint.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,46 ---- + /* mv_hint.h */ + + /* API version 1 */ + + #ifndef ENC_MV_HINT_H + #define ENC_MV_HINT_H + + #ifdef __cplusplus + extern "C" { + #endif + + + + + #define MV_HINT_API_VERSION 1 + + /* this version of the API is only really suitable for IPPPPPPPP GOVs */ + + + typedef struct { + int dx; /* in half-pel units */ + int dy; /* in half-pel units */ + } mv_hint_vector_t; + + + typedef struct { + int num_vectors; /* 0 <= num_vectors <= 8 */ + mv_hint_vector_t vectors[8]; + } mv_hint_mb_t; + + + typedef struct { + int version; + int valid; + int ref_frame; + int mb_width; /* should correspond to encoder's image dimensions */ + int mb_height; /* should correspond to encoder's image dimensions */ + mv_hint_mb_t *mb; + } mv_hint_frame_t; + + + #ifdef __cplusplus + } + #endif + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/src/enc_portab.h bcast-2000c-mf3/quicktime/encore2/src/enc_portab.h *** bcast-2000c/quicktime/encore2/src/enc_portab.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/enc_portab.h Fri Nov 30 02:18:48 2001 *************** *** 0 **** --- 1,86 ---- + #ifndef ENC_PORTAB_H_ + #define ENC_PORTAB_H_ + + #if defined(WIN32) + + #include + + #define int8_t char + #define uint8_t unsigned char + #define int16_t short + #define uint16_t unsigned short + #define int32_t int + #define uint32_t unsigned int + #define int64_t __int64 + #define uint64_t unsigned __int64 + + #if defined(_MMX_) + #define EMMS __asm {emms} + #else + #define EMMS + #endif + + // needed for bitstream.h + #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax + + // needed for timer.c + static __inline int64_t read_counter() { + int64_t ts; + uint32_t ts1, ts2; + + __asm { + rdtsc + mov ts1, eax + mov ts2, edx + } + + ts = ((uint64_t) ts2 << 32) | ((uint64_t) ts1); + + return ts; + } + + #elif defined(LINUX) + + #include + + #if defined(_MMX_) + #define EMMS __asm__("emms\n\t") + #else + #define EMMS + #endif + + // needed for bitstream.h + #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ) + + // needed for timer.c + static __inline int64_t read_counter() { + int64_t ts; + uint32_t ts1, ts2; + + // __asm__ __volatile__("rdtsc\n\t":"=a"(ts1), "=d"(ts2)); + + // ts = ((uint64_t) ts2 << 32) | ((uint64_t) ts1); + + return ts; + } + + #else // OTHER OS + + #include + + #define EMMS + + // needed for bitstream.h + #define BSWAP(a) \ + ((a) = ( ((a)&0xff)<<24) | (((a)&0xff00)<<8) | (((a)>>8)&0xff00) | (((a)>>24)&0xff)) + + // rdtsc command most likely not supported, + // so just dummy code here + static __inline int64_t read_counter() { + return 0; + } + + #endif + + #endif // _PORTAB_H_ + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/enc_timer.h bcast-2000c-mf3/quicktime/encore2/src/enc_timer.h *** bcast-2000c/quicktime/encore2/src/enc_timer.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/enc_timer.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,46 ---- + #ifndef _ENCORE_TIMER_H + #define _ENCORE_TIMER_H + + #if defined(_PROFILING_) + + #include "enc_portab.h" + + uint64_t count_frames; + + extern void start_timer(); + extern void start_global_timer(); + extern void stop_dct_timer(); + extern void stop_idct_timer(); + extern void stop_motion_timer(); + extern void stop_inter_timer(); + extern void stop_quant_timer(); + extern void stop_iquant_timer(); + extern void stop_conv_timer(); + extern void stop_transfer_timer(); + extern void stop_coding_timer(); + extern void stop_prediction_timer(); + extern void stop_global_timer(); + extern void init_timer(); + extern void write_timer(); + + #else + + static __inline void start_timer() {} + static __inline void start_global_timer() {} + static __inline void stop_dct_timer() {} + static __inline void stop_idct_timer() {} + static __inline void stop_motion_timer() {} + static __inline void stop_inter_timer() {} + static __inline void stop_quant_timer() {} + static __inline void stop_iquant_timer() {} + static __inline void stop_conv_timer() {} + static __inline void stop_transfer_timer() {} + static __inline void init_timer() {} + static __inline void write_timer() {} + static __inline void stop_coding_timer() {} + static __inline void stop_prediction_timer() {} + static __inline void stop_global_timer() {} + + #endif + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/src/encoder.c bcast-2000c-mf3/quicktime/encore2/src/encoder.c *** bcast-2000c/quicktime/encore2/src/encoder.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/encoder.c Thu Dec 6 15:28:44 2001 *************** *** 0 **** --- 1,960 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + + /************************************************************************** + * + * encoder.c, video encoder kernel + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + + /************************************************************************** + * + * Modifications: + * + * 24.11.2001 mmx rgb24/32 support + * 23.11.2001 'dirty keyframes' bugfix + * 18.11.2001 introduced new encoding mode quality=0 (keyframes only) + * 17.11.2001 aquant bug fix + * 16.11.2001 support for new bitstream headers; relocated dquant malloc + * 10.11.2001 removed init_dct_codes(); now done in mbtransquant.c + * removed old idct/fdct init, added new idct init + * 03.11.2001 case ENC_CSP_IYUV break was missing, thanks anon + * 28.10.2001 added new colorspace switch, reset minQ/maxQ limited to 1/31 + * 01.10.2001 added experimental luminance masking support + * 26.08.2001 reactivated INTER4V encoding mode for EXT_MODE + * 26.08.2001 dquants are filled with absolute quant value after MB coding + * 24.08.2001 fixed bug in EncodeFrameP which lead to ugly keyframes + * 23.08.2001 fixed bug when EXT_MODE is called without options + * 22.08.2001 support for EXT_MODE encoding + * support for setting quantizer on a per macro block level + * 10.08.2001 fixed some compiling errors, get rid of compiler warnings + * + * Michael Militzer + * + **************************************************************************/ + + #include "encoder.h" + #include "enc_mbfunctions.h" + #include "enc_bitstream.h" + #include "colorspace/enc_colorspace.h" + #include + #include + #include + #include + #include "mbtransquant/enc_dct.h" + #include "enc_timer.h" + #include "ratecontrol.h" + + static int FrameCodeI(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, int enc_mode); + static int FrameCodeP(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, bool force_inter, int enc_mode); + + #define MAX(a,b) (((a) > (b)) ? (a) : (b)) + + // gruel's normalize code + // should be moved to a seperate file + // *********** + // *********** + int MBXDIM; + int MBYDIM; + + int normalize_quantizer_field(float *in, int *out, int num, int min_quant, int max_quant); + int adaptive_quantization(unsigned char* buf, int stride, int* intquant, + int framequant, int min_quant, int max_quant); // no qstride because normalization + + #define RDIFF(a,b) ((int)(a+0.5)-(int)(b+0.5)) + int normalize_quantizer_field(float *in, int *out, int num, int min_quant, int max_quant) + { + int i; + int finished; + + do + { + finished = 1; + for(i = 1; i < num; i++) + { + if(RDIFF(in[i], in[i-1]) > 2) + { + in[i] -= (float) 0.5; + finished = 0; + } + else if(RDIFF(in[i], in[i-1]) < -2) + { + in[i-1] -= (float) 0.5; + finished = 0; + } + + if(in[i] > max_quant) + { + in[i] = (float) max_quant; + finished = 0; + } + if(in[i] < min_quant) + { + in[i] = (float) min_quant; + finished = 0; + } + if(in[i-1] > max_quant) + { + in[i-1] = (float) max_quant; + finished = 0; + } + if(in[i-1] < min_quant) + { + in[i-1] = (float) min_quant; + finished = 0; + } + } + } while(!finished); + + out[0] = 0; + for (i = 1; i < num; i++) + out[i] = RDIFF(in[i], in[i-1]); + + return (int) (in[0] + 0.5); + } + + int adaptive_quantization(unsigned char* buf, int stride, int* intquant, + int framequant, int min_quant, int max_quant) // no qstride because normalization + { + int i,j,k,l; + + static float *quant; + unsigned char *ptr; + float val; + + const float DarkAmpl = 14 / 2; + const float BrightAmpl = 10 / 2; + const float DarkThres = 70; + const float BrightThres = 200; + + if(!quant) + if(!(quant = (float *) malloc(MBXDIM*MBYDIM * sizeof(float)))) + return -1; + + + for(k = 0; k < MBYDIM; k++) + { + for(l = 0;l < MBXDIM; l++) // do this for all macroblocks individually + { + quant[k*MBXDIM+l] = (float) framequant; + + // calculate luminance-masking + ptr = &buf[16*k*stride+16*l]; // address of MB + + val = 0.; + + for(i = 0; i < 16; i++) + for(j = 0; j < 16; j++) + val += ptr[i*stride+j]; + val /= 256.; + + if(val < DarkThres) + quant[k*MBXDIM+l] += DarkAmpl*(DarkThres-val)/DarkThres; + else if (val>BrightThres) + quant[k*MBXDIM+l] += BrightAmpl*(val-BrightThres)/(255-BrightThres); + } + } + + return normalize_quantizer_field(quant, intquant, MBXDIM*MBYDIM, min_quant, max_quant); + } + // *********** + // *********** + + static __inline uint8_t get_fcode(uint16_t sr) + { + if (sr <= 16) + return 1; + + else if (sr <= 32) + return 2; + + else if (sr <= 64) + return 3; + + else if (sr <= 128) + return 4; + + else if (sr <= 256) + return 5; + + else if (sr <= 512) + return 6; + + else if (sr <= 1024) + return 7; + + else + return 0; + } + + #define ENC_CHECK(X) if(!(X)) return ENC_BAD_FORMAT + + int CreateEncoder(ENC_PARAM * pParam) + { + Encoder *pEnc; + + pParam->handle = NULL; + + ENC_CHECK(pParam); + + + /* Validate input parameters */ + + ENC_CHECK(pParam->x_dim > 0); + ENC_CHECK(pParam->y_dim > 0); + ENC_CHECK(!(pParam->x_dim % 2)); + ENC_CHECK(!(pParam->y_dim % 2)); + + /* + these two limits are introduced by limitations of decore */ + + // ENC_CHECK(pParam->x_dim <= 720); + // ENC_CHECK(pParam->y_dim <= 576); + + + /* Set default values for all other parameters if they are outside + acceptable range */ + + if (pParam->framerate <= 0) + pParam->framerate = 25.; + + if (pParam->bitrate <= 0) + pParam->bitrate = 910000; + + if (pParam->rc_period <= 0) + pParam->rc_period = 50; + + if (pParam->rc_reaction_period <= 0) + pParam->rc_reaction_period = 10; + + if (pParam->rc_reaction_ratio <= 0) + pParam->rc_reaction_ratio = 10; + + if ((pParam->min_quantizer <= 0) || (pParam->min_quantizer > 31)) + pParam->min_quantizer = 1; + + if ((pParam->max_quantizer <= 0) || (pParam->max_quantizer > 31)) + pParam->max_quantizer = 31; + + if (pParam->max_key_interval == 0) + pParam->max_key_interval = 250; /* 1 keyframe each 10 seconds */ + + if (pParam->max_quantizer < pParam->min_quantizer) + pParam->max_quantizer = pParam->min_quantizer; + + if ((pParam->quality < 0) || (pParam->quality > 5)) + pParam->quality = 5; + + pEnc = (Encoder *) malloc(sizeof(Encoder)); + + if (pEnc == 0) + return ENC_MEMORY; + + /* Fill members of Encoder structure */ + + pEnc->mbParam.width = pParam->x_dim; + pEnc->mbParam.height = pParam->y_dim; + pEnc->mbParam.quality = pParam->quality; + pEnc->sStat.fMvPrevSigma = -1; + + /* Fill rate control parameters */ + + pEnc->rateCtlParam.max_quant = pParam->max_quantizer; + pEnc->rateCtlParam.min_quant = pParam->min_quantizer; + + pEnc->mbParam.quant = 4; + + if (pEnc->rateCtlParam.max_quant < pEnc->mbParam.quant) + pEnc->mbParam.quant = pEnc->rateCtlParam.max_quant; + + if (pEnc->rateCtlParam.min_quant > pEnc->mbParam.quant) + pEnc->mbParam.quant = pEnc->rateCtlParam.min_quant; + + pEnc->iFrameNum = 0; + pEnc->iMaxKeyInterval = pParam->max_key_interval; + + if (CreateImage(&(pEnc->sCurrent), pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&(pEnc->sBackup), pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&(pEnc->sReference), pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&pEnc->vInterH, pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + FreeImage(&(pEnc->sReference)); + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&pEnc->vInterV, pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + FreeImage(&(pEnc->sReference)); + FreeImage(&(pEnc->vInterH)); + free(pEnc); + return ENC_MEMORY; + } + + if (CreateImage(&pEnc->vInterHV, pEnc->mbParam.width, pEnc->mbParam.height) < 0) + { + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + FreeImage(&(pEnc->sReference)); + FreeImage(&(pEnc->vInterH)); + FreeImage(&(pEnc->vInterV)); + free(pEnc); + return ENC_MEMORY; + } + + pParam->handle = (void *) pEnc; + + RateCtlInit(&(pEnc->rateCtlParam), pEnc->mbParam.quant, + pParam->bitrate / pParam->framerate, + pParam->rc_period, + pParam->rc_reaction_period, pParam->rc_reaction_ratio); + + #if !(defined(WIN32) && defined(_MMX_)) + enc_idct_int32_init(); + #endif + + init_timer(); + + return ENC_OK; + } + + + int FreeEncoder(Encoder * pEnc) + { + ENC_CHECK(pEnc); + ENC_CHECK(pEnc->sCurrent.pY); + ENC_CHECK(pEnc->sReference.pY); + + + FreeImage(&(pEnc->sCurrent)); + FreeImage(&(pEnc->sBackup)); + FreeImage(&(pEnc->sReference)); + FreeImage(&(pEnc->vInterH)); + FreeImage(&(pEnc->vInterV)); + FreeImage(&(pEnc->vInterHV)); + free(pEnc); + + return ENC_OK; + } + + + #if defined(_MMX_) + + + + + + + #define RGB24_TO_YUV rgb24_to_yuv_mmx + #define RGB32_TO_YUV rgb32_to_yuv_mmx + + + + + #if defined(_XMM_) + + #define YUV_TO_YUV yuv_to_yuv_xmm + + + + + #else + + #define YUV_TO_YUV yuv_to_yuv_mmx + + + + #endif + #else + + + + + #define RGB24_TO_YUV rgb24_to_yuv + #define RGB32_TO_YUV rgb32_to_yuv + #define YUV_TO_YUV yuv_to_yuv + + + + + + #endif + + int EncodeFrame(Encoder * pEnc, + ENC_FRAME * pFrame, + ENC_RESULT * pResult, + int enc_mode) + { + int result; + uint16_t x, y; + Bitstream bs; + uint32_t bits; + ENC_FRAME_EXT *pFrame_ext; + Image *pCurrent = &(pEnc->sCurrent); + int *temp_dquants; + + //printf("EncodeFrame 1\n"); + start_global_timer(); + + temp_dquants = NULL; + + ENC_CHECK(pEnc); + ENC_CHECK(pFrame); + ENC_CHECK(pFrame->bitstream); + ENC_CHECK(pFrame->image); + + + /* convert input colorspace into yuv planar + * + * testing results + * rgb24 yes + * rgb32 yes + * iyuv + * yv12 + * yuy2 yes + * yvyu + * uyvy yes + */ + //printf("EncodeFrame 1\n"); + + start_timer(); + //printf("EncodeFrame 1\n"); + + switch(pFrame->colorspace) { + + case ENC_CSP_RGB24 : + RGB24_TO_YUV(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + case ENC_CSP_RGB32 : + RGB32_TO_YUV(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + case ENC_CSP_IYUV : /* ENC_CSP_I420 : */ + YUV_TO_YUV(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + case ENC_CSP_YV12 : /* u/v simply swapped */ + //printf("EncodeFrame 1.1 %p\n", pEnc); + YUV_TO_YUV(pEnc->sCurrent.pY, + pEnc->sCurrent.pV, + pEnc->sCurrent.pU, + pFrame->image, + pEnc->mbParam.width, + pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + //printf("EncodeFrame 1.2\n"); + break; + + case ENC_CSP_YUY2 : + yuyv_to_yuv(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + case ENC_CSP_YVYU : /* u/v simply swapped */ + yuyv_to_yuv(pEnc->sCurrent.pY, pEnc->sCurrent.pV, pEnc->sCurrent.pU, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + + case ENC_CSP_UYVY : + uyvy_to_yuv(pEnc->sCurrent.pY, pEnc->sCurrent.pU, pEnc->sCurrent.pV, + pFrame->image, + pEnc->mbParam.width, pEnc->mbParam.height, + pEnc->sCurrent.iEdgedWidth); + break; + + default : + return ENC_BAD_FORMAT; + } + //printf("EncodeFrame 1\n"); + + stop_conv_timer(); + //printf("EncodeFrame 1\n"); + + BitstreamInit(&bs, pFrame->bitstream); + //printf("EncodeFrame 1\n"); + + switch (enc_mode) + { + case RC_MODE: + pEnc->mbParam.quant = RateCtlGetQ(&(pEnc->rateCtlParam), 0); + break; + + case VBR_MODE: + pEnc->mbParam.quant = pFrame->quant; + break; + + case EXT_MODE: + + temp_dquants = (int *) malloc(pCurrent->iMbHcount * pCurrent->iMbWcount * sizeof(int)); + + MBXDIM = pCurrent->iMbWcount; + MBYDIM = pCurrent->iMbHcount; + + pFrame_ext = (ENC_FRAME_EXT *) pFrame->mvs; + + if((pFrame_ext->ext_opt & EXT_OPT_LUMINANCE_MASKING) > 0) { + pEnc->mbParam.quant = adaptive_quantization(pEnc->sCurrent.pY, pEnc->mbParam.width, + temp_dquants, pFrame->quant, pFrame->quant, + MAX(pEnc->rateCtlParam.max_quant, pFrame->quant)); + + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + pMB->dquant = iDQtab[(temp_dquants[y * pCurrent->iMbWcount + x] + 2)]; + } + break; + } + + if((pFrame_ext->ext_opt & EXT_OPT_QUANT_ARRAY) > 0) { + pEnc->mbParam.quant = normalize_quantizer_field((float *) pFrame_ext->quant_array, + temp_dquants, pCurrent->iMbHcount * pCurrent->iMbWcount, 1, 31); + + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + pMB->dquant = iDQtab[(temp_dquants[y * pCurrent->iMbWcount + x] + 2)]; + } + break; + } + + if(pFrame_ext->ext_opt == 0) { + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + pMB->dquant = NO_CHANGE; + } + pEnc->mbParam.quant = pFrame->quant; + } + + break; + + default: + return ENC_FAIL; // should never happen + } + //printf("EncodeFrame 1\n"); + + if ((enc_mode == RC_MODE) || (pFrame->intra < 0)) + { + //printf("EncodeFrame 1\n"); + if ((pEnc->iFrameNum == 0) || ((pEnc->iMaxKeyInterval > 0) + && (pEnc->iFrameNum >= pEnc->iMaxKeyInterval)) + || (pEnc->mbParam.quality==0) ) + + result = FrameCodeI(pEnc, &bs, &bits, enc_mode); + else + result = FrameCodeP(pEnc, &bs, &bits, 0, enc_mode); + } + else + { + //printf("EncodeFrame 2\n"); + if (pFrame->intra == 1) + result = FrameCodeI(pEnc, &bs, &bits, enc_mode); + else + result = FrameCodeP(pEnc, &bs, &bits, 1, enc_mode); + } + + //printf("EncodeFrame 1 %d\n", pFrame->intra); + if (pResult) + { + pResult->is_key_frame = result; + pResult->texture_bits = pEnc->sStat.iTextBits; + pResult->motion_bits = pEnc->sStat.iMvBits; + pResult->total_bits = bits; + pResult->quantizer = pEnc->mbParam.quant; + } + //printf("EncodeFrame 2\n"); + + + BitstreamPutBits(&bs, 0x0000, 16); + BitstreamPutBits(&bs, 0x0000, 16); + + BitstreamPad(&bs); + pFrame->length = BitstreamLength(&bs); + pEnc->iFrameNum++; + + if (enc_mode == RC_MODE) + RateCtlUpdate(&(pEnc->rateCtlParam), bits); + + SwapImages(&(pEnc->sCurrent), &(pEnc->sReference)); + + if (temp_dquants) + { + free(temp_dquants); + } + + stop_global_timer(); + write_timer(); + + return ENC_OK; + } + + + static int FrameCodeI(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, int enc_mode) + { + int16_t dct_codes[6][64]; + int16_t qcoeff[6][64]; + uint16_t x, y; + Image *pCurrent = &(pEnc->sCurrent); + + pEnc->iFrameNum = 0; + pEnc->mbParam.rounding_type = 1; + pEnc->mbParam.coding_type = I_VOP; + + //printf("FrameCodeI 1\n"); + + BitstreamVolHeader(bs, pEnc->mbParam.width, pEnc->mbParam.height); + BitstreamVopHeader(bs, I_VOP, pEnc->mbParam.rounding_type, + pEnc->mbParam.quant, + pEnc->mbParam.fixed_code); + + //printf("FrameCodeI 2\n"); + *pBits = BsPos(bs); + + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + + //printf("FrameCodeI 1 %d %d %p %p\n", x, y, bs->tail, bs->start); + if(enc_mode == EXT_MODE) { + //printf("FrameCodeI 3.1\n"); + if(pMB->dquant == NO_CHANGE) + pMB->mode = MODE_INTRA; + else { + pMB->mode = MODE_INTRA_Q; + //printf("FrameCodeI 3.2\n"); + pEnc->mbParam.quant += DQtab[pMB->dquant]; + //printf("FrameCodeI 3.3\n"); + if(pEnc->mbParam.quant > 31) pEnc->mbParam.quant = 31; + //printf("FrameCodeI 3.4\n"); + if(pEnc->mbParam.quant < 1) pEnc->mbParam.quant = 1; + //printf("FrameCodeI 3.5\n"); + } + } + else + pMB->mode = MODE_INTRA; + + + pMB->aquant = pEnc->mbParam.quant; + + //printf("FrameCodeI 3.6\n"); + MBTransQuantIntra(&pEnc->mbParam, x, y, dct_codes, qcoeff, pCurrent); + //printf("FrameCodeI 3.7\n"); + + start_timer(); + //printf("FrameCodeI 3\n"); + + MBPrediction(&pEnc->mbParam, x, y, pCurrent->iMbWcount, qcoeff, pCurrent->pMBs); + //printf("FrameCodeI 3\n"); + + stop_prediction_timer(); + //printf("FrameCodeI 3\n"); + + start_timer(); + //printf("FrameCodeI 3\n"); + + //printf("FrameCodeI 3\n"); + MBCoding(&pEnc->mbParam, + pCurrent->pMBs + x + y * pCurrent->iMbWcount, + qcoeff, + bs, + &pEnc->sStat); + + //printf("FrameCodeI 4\n"); + stop_coding_timer(); + //printf("FrameCodeI 5\n"); + } + + EMMS; + + *pBits = BsPos(bs) - *pBits; + pEnc->sStat.fMvPrevSigma = -1; + pEnc->sStat.iTextBits = *pBits; + pEnc->sStat.iMvBits = 0; + pEnc->sStat.iMvSum = 0; + pEnc->sStat.iMvCount = 0; + pEnc->mbParam.fixed_code = 2; + //printf("FrameCodeI 5\n"); + + return 1; // intra + } + + + #define INTRA_THRESHOLD 0.5 + + static int FrameCodeP(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, + bool force_inter, int enc_mode) + { + float fSigma; + int16_t dct_codes[6][64]; + int16_t qcoeff[6][64]; + int x, y; + int iIntra, iLimit; + int iSearchRange; + int backup_quant; + + Image *pCurrent = &(pEnc->sCurrent); + Image *pRef = &(pEnc->sReference); + + //printf("FrameCodeP 1\n"); + SetEdges(pRef); + //printf("FrameCodeP 1\n"); + + // DumpImage(pRef, "ref.bmp"); + + pEnc->mbParam.rounding_type = 1 - pEnc->mbParam.rounding_type; + + //printf("FrameCodeP 1\n"); + backup_quant = pEnc->mbParam.quant; + CopyImages(&(pEnc->sBackup), &(pEnc->sCurrent)); + //printf("FrameCodeP 1\n"); + + iIntra = 0; + + if (!force_inter) + iLimit = (int)(pCurrent->iMbWcount * pCurrent->iMbHcount * INTRA_THRESHOLD); + else + iLimit = pCurrent->iMbWcount * pCurrent->iMbHcount + 1; + + start_timer(); + + Interpolate(pRef, &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV, + pEnc->mbParam.rounding_type, + (pEnc->mbParam.quality < 4)); + //printf("FrameCodeP 1\n"); + + stop_inter_timer(); + + pEnc->mbParam.coding_type = P_VOP; + //printf("FrameCodeP 1\n"); + + BitstreamVopHeader(bs, P_VOP, pEnc->mbParam.rounding_type, + pEnc->mbParam.quant, + pEnc->mbParam.fixed_code); + //printf("FrameCodeP 1\n"); + + *pBits = BsPos(bs); + pEnc->sStat.iTextBits = 0; + pEnc->sStat.iMvBits = 0; + pEnc->sStat.iMvSum = 0; + pEnc->sStat.iMvCount = 0; + + //printf("FrameCodeP 1\n"); + + for (y = 0; y < pCurrent->iMbHcount; y++) + for (x = 0; x < pCurrent->iMbWcount; x++) + { + + // + + // No floating calculations inside this loop please! + + // + + //printf("FrameCodeP 1\n"); + bool bIntra; + + Macroblock *pMB = &pCurrent->pMBs[x + y * pCurrent->iMbWcount]; + //printf("FrameCodeP 1\n"); + + start_timer(); + //printf("FrameCodeP 1\n"); + + bIntra = MBMotionEstComp(&pEnc->mbParam, + x, + y, + &pEnc->sReference, + &pEnc->vInterH, + &pEnc->vInterV, + &pEnc->vInterHV, + &pEnc->sCurrent, + dct_codes, + (pMB->dquant == NO_CHANGE || + enc_mode != EXT_MODE)); + //printf("FrameCodeP 1\n"); + + stop_motion_timer(); + //printf("FrameCodeP 1\n"); + + if (bIntra) + { + iIntra++; + if (iIntra >= iLimit) + { + BitstreamReset(bs); + pEnc->mbParam.quant = backup_quant; + CopyImages(&(pEnc->sCurrent), &(pEnc->sBackup)); + return FrameCodeI(pEnc, bs, pBits, enc_mode); + } + } + + bIntra = (pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q); + + if (bIntra) + { + if(enc_mode == EXT_MODE) { + if(pMB->dquant != NO_CHANGE) { + pMB->mode = MODE_INTRA_Q; + pEnc->mbParam.quant += DQtab[pMB->dquant]; + if(pEnc->mbParam.quant > 31) pEnc->mbParam.quant = 31; + if(pEnc->mbParam.quant < 1) pEnc->mbParam.quant = 1; + } + } + pMB->aquant = pEnc->mbParam.quant; + + MBTransQuantIntra(&pEnc->mbParam, x, y, + dct_codes, qcoeff, pCurrent); + } + + else { + if(enc_mode == EXT_MODE) { + if(pMB->dquant != NO_CHANGE) { + pMB->mode = MODE_INTER_Q; + pEnc->mbParam.quant += DQtab[pMB->dquant]; + if(pEnc->mbParam.quant > 31) pEnc->mbParam.quant = 31; + if(pEnc->mbParam.quant < 1) pEnc->mbParam.quant = 1; + } + } + pMB->aquant = pEnc->mbParam.quant; + + pEnc->sCurrent.pMBs[x + y * pCurrent->iMbWcount].cbp + = MBTransQuantInter(&pEnc->mbParam, x, y, + dct_codes, qcoeff, pCurrent); + } + + //printf("FrameCodeP 1\n"); + start_timer(); + + MBPrediction(&pEnc->mbParam, x, y, pCurrent->iMbWcount, qcoeff, pCurrent->pMBs); + //printf("FrameCodeP 1\n"); + + stop_prediction_timer(); + + //printf("FrameCodeP 1\n"); + start_timer(); + + //printf("FrameCodeP 1\n"); + MBCoding(&pEnc->mbParam, + pCurrent->pMBs + x + y * pCurrent->iMbWcount, qcoeff, bs, + &pEnc->sStat); + //printf("FrameCodeP 1\n"); + + stop_coding_timer(); + //printf("FrameCodeP 2\n"); + } + //printf("FrameCodeP 1\n"); + + EMMS; + + // DumpImage(pCurrent, "cur.bmp"); + + if (pEnc->sStat.iMvCount == 0) + + pEnc->sStat.iMvCount = 1; + + fSigma = (float)sqrt((float) pEnc->sStat.iMvSum / pEnc->sStat.iMvCount); + //printf("FrameCodeP 1\n"); + + //printf("Texture: %d bits, motion: %d bits, mv sigma: %f\n", + // pEnc->sStat.iTextBits, pEnc->sStat.iMvBits, fSigma); + + iSearchRange = 1 << (3 + pEnc->mbParam.fixed_code); + + //printf("FrameCodeP 1\n"); + if ((fSigma > iSearchRange / 3) && (pEnc->mbParam.fixed_code <= 3)) // maximum search + + // range 128 + + { + pEnc->mbParam.fixed_code++; + iSearchRange *= 2; + // printf("New search range: %d\n", iSearchRange); + } + + else + if ((fSigma < iSearchRange / 6) + && (pEnc->sStat.fMvPrevSigma >= 0) + && (pEnc->sStat.fMvPrevSigma < iSearchRange / 6) + && (pEnc->mbParam.fixed_code >= 2)) // minimum search range 16 + { + + pEnc->mbParam.fixed_code--; + iSearchRange /= 2; + // printf("New search range: %d\n", iSearchRange); + } + + //printf("FrameCodeP 1\n"); + + pEnc->sStat.fMvPrevSigma = fSigma; + *pBits = BsPos(bs) - *pBits; + + //printf("FrameCodeP 2\n"); + return 0; // inter + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/encoder.h bcast-2000c-mf3/quicktime/encore2/src/encoder.h *** bcast-2000c/quicktime/encore2/src/encoder.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/encoder.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,49 ---- + /************************************************************************** + * + * Modifications: + * + * 22.08.2001 added support for EXT_MODE encoding mode + * support for EXTENDED API + * 22.08.2001 fixed bug in iDQtab + * + * Michael Militzer + * + **************************************************************************/ + + #ifndef _ENCORE_ENCODER_H + + #define _ENCORE_ENCODER_H + + #include "enc_image.h" + #include "encore2.h" + #include "encore_ext.h" + + // internal encoder modes: + + #define RC_MODE 0 + #define VBR_MODE 1 + #define EXT_MODE 2 + + // indicates no quantizer changes in INTRA_Q/INTER_Q modes + #define NO_CHANGE 64 + + static int DQtab[4] = { + -1, -2, 1, 2 + }; + + static int iDQtab[5] = { + 1, 0, NO_CHANGE, 2, 3 + }; + + int CreateEncoder(ENC_PARAM * pParam); + + int FreeEncoder(Encoder * pEnc); + + int EncodeFrame(Encoder * pEnc, ENC_FRAME * pFrame, ENC_RESULT * pResult, + + int enc_mode); + + + + #endif + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/encore.c bcast-2000c-mf3/quicktime/encore2/src/encore.c *** bcast-2000c/quicktime/encore2/src/encore.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/encore.c Fri Nov 30 10:49:41 2001 *************** *** 0 **** --- 1,104 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + + /************************************************************************** + * + * encore.c, front-end to encoder + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + /************************************************************************** + * + * Modifications: + * + * 22.08.2001 added support for ENC_OPT_ENCODE_EXT encoding mode + * + * Michael Militzer + * + **************************************************************************/ + + + #include "encore2.h" + + #include "encoder.h" + + int encore(void *handle, int enc_opt, void *param1, void *param2) + + { + + Encoder *pEnc = (Encoder *) handle; + + + + switch (enc_opt) + + { + + case ENC_OPT_INIT: + + return CreateEncoder((ENC_PARAM *) param1); + + + + case ENC_OPT_RELEASE: + + return FreeEncoder(pEnc); + + + + case ENC_OPT_ENCODE: + + return EncodeFrame(pEnc, + (ENC_FRAME *) param1, + (ENC_RESULT *) param2, + RC_MODE); + + + + case ENC_OPT_ENCODE_VBR: + + return EncodeFrame(pEnc, (ENC_FRAME *) param1, + (ENC_RESULT *) param2, + VBR_MODE); + + + + case ENC_OPT_ENCODE_EXT: + + return EncodeFrame(pEnc, (ENC_FRAME *) param1, (ENC_RESULT *) param2, EXT_MODE); + + + default: + + return ENC_FAIL; + + } + + } + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/encore2.h bcast-2000c-mf3/quicktime/encore2/src/encore2.h *** bcast-2000c/quicktime/encore2/src/encore2.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/encore2.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,125 ---- + #ifndef _ENCORE_ENCORE_H + #define _ENCORE_ENCORE_H + // This is the header file describing + // the entrance function of the encoder core + // or the encore ... + + #ifdef __cplusplus + extern "C" + { + #endif + /** + Structure passed as an argument when creating encoder. + You have to initialize at least x_dim and y_dim ( valid range: + 0 + * + **************************************************************************/ + + #ifndef _ENCORE_ENCORE_EXT_H + #define _ENCORE_ENCORE_EXT_H + + #ifdef __cplusplus + extern "C" + { + #endif + + typedef struct _ENC_FRAME_EXT_ + { + int ext_opt; // specific options for ENC_OPT_ENCODE_EXT encoding mode + void *quant_array; // pointer to an array of quantizer values + // for now: float quant_array[width/16 * height/16] + // or int quant_aray[width/16 * height/16] in DQUANT-mode + void *mvs; // Pointer to mv_hint_frame_t structure (see mv_hint.h) + } + ENC_FRAME_EXT; + + // extensions to encore options (the enc_opt parameter of encore()) + #define ENC_OPT_ENCODE_EXT 5 + + // valid ext_opt flags + // if ext_opt = 0, encoder runs in standard mode with all additional options switched off + + #define EXT_OPT_LUMINANCE_MASKING 32 // switch on Lumi Masking + #define EXT_OPT_QUANT_ARRAY 64 // this option indicates the use of quant_array + // out of ENC_FRAME_EXT + #define EXT_OPT_DQUANT_ARRAY 128 // same with integer-[-2,2] dquant + #define EXT_OPT_MVS_ARRAY 256 // mv_hint_frame_t structure for MVs, + // like in mv_hint.h + + /* additional colorspaces */ + + #define ENC_CSP_RGB32 1000 + #define ENC_CSP_YVYU 1002 + + + #ifdef __cplusplus + } + #endif + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/src/enctypes.h bcast-2000c-mf3/quicktime/encore2/src/enctypes.h *** bcast-2000c/quicktime/encore2/src/enctypes.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/enctypes.h Wed Dec 5 15:06:07 2001 *************** *** 0 **** --- 1,259 ---- + /************************************************************************** + * + * Modifications: + * + * 23.11.2001 added sBackup to Encoder_s struct + * 16.11.2001 new bitstream internals + * 02.11.2001 included MBPRED_SIZE + * 24.08.2001 removed MODE_INTER4V_Q support (not MPEG4 compliant) + * 20.08.2001 added support for MODE_INTER4V_Q + * + * Michael Militzer + * + **************************************************************************/ + + #ifndef _ENCORE_ENCTYPES_H + #define _ENCORE_ENCTYPES_H + + #include "enc_portab.h" + + typedef int8_t bool; + + + typedef enum + { + /* Inter-coded macroblock, 1 motion vector */ + MODE_INTER = 0, + /* Inter-coded macroblock + dquant */ + MODE_INTER_Q = 1, + /* Inter-coded macroblock, 4 motion vectors */ + MODE_INTER4V = 2, + /* Intra-coded macroblock */ + MODE_INTRA = 3, + /* Intra-coded macroblock + dquant */ + MODE_INTRA_Q = 4, + } + MBMODE; + + typedef enum + { + I_VOP = 0, + P_VOP = 1 + } + VOP_TYPE; + + + typedef struct MotionVector_s + { + int16_t x; + int16_t y; + } + MotionVector; + + + typedef struct Bitstream_s + { + uint64_t buf; + uint32_t pos; + unsigned char *start; + unsigned char *tail; + } + Bitstream; + + + /* for each block we store the DC and first AC column & row coeffs + */ + #define MBPRED_SIZE 15 + + typedef struct + { + /* + Motion vectors for this macroblock. Initialized in MBMotionEstComp(). + When mode is MODE_INTER or MODE_INTER_Q, all four vectors are equal. + When mode is MODE_INTRA or MODE_INTRA_Q, all four vectors are zero. + */ + + MotionVector mvs[4]; + + /* + Difference between found and predicted MVs ( will be sent into bitstream ). + Initialized in MBPrediction(). + */ + + MotionVector pmvs[4]; + + /* + Values used for AC/DC prediction. Initialized in MBPrediction() + */ + + int16_t pred_values[6][MBPRED_SIZE]; + uint8_t acpred_directions[6]; + + /* + Macroblock mode. Initialized for P-VOP's in MBMotionEstComp(), + for I-VOP's in FrameCodeI() ( encoder.c ) + */ + + MBMODE mode; + + /* + only meaningful when mode=MODE_INTRA_Q or mode=MODE_INTER_Q ( i.e. never ) + */ + + uint8_t dquant; + + uint8_t aquant; // absolute quantizer for given MB + + /* + Coded block pattern. For inter MBs calculated in MBTransQuant(), for + intra MBs in MBPrediction(). + */ + + uint8_t cbp; + } + Macroblock; + + + typedef struct Image_s + { + /* Various kinds of dimensions */ + + uint16_t iWidth; + uint16_t iHeight; + uint16_t iEdgedWidth; + uint16_t iEdgedHeight; + uint16_t iMbWcount; + uint16_t iMbHcount; + + /* Pointers to (0,0) pixels */ + + uint8_t *pY; + uint8_t *pU; + uint8_t *pV; + VOP_TYPE ePredictionType; + Macroblock *pMBs; + } + Image; + + + /*********************************** + + Encoding Parameters + + ************************************/ + + typedef struct + { + uint16_t width; + uint16_t height; + VOP_TYPE coding_type; + + /* + Rounding type for image interpolation + Switched 0->1 and back after each interframe + Used in motion compensation, methods Interpolate*, vop.c + */ + + uint8_t rounding_type; + + + /* + Motion estimation parameter + 1<=iFcode<=4; motion vector search range is +/- 1<<(iFcode+3) pixels + Automatically adjusted using motion vector statistics inside + EncodeDeltaFrame() ( encoder.c ) + */ + + uint8_t fixed_code; + + /* + Motion estimation quality/performance balance + Supplied by user + 1<=iQuality<=9 + 5: highest quality, slowest encoding ( everything turned on ) + 4: faster 16x16 vector search method + disabled half-pel search + ( + ~10% bitrate, +~40% fps ) + 3: disabled search for 8x8 vectors + ( + ~20% bitrate, +80-90% fps ) + 2: lower quality of SAD calculation for 16x16 vectors + ( + 30-50% bitrate, +120% fps ) + 1: fastest encoding + ( + 60-70% bitrate, +150% fps ) + all bitrates & fps are relative to quality 9, performance is for + non-MMX version. + */ + + uint8_t quality; + + uint8_t quant; + + /* + uint8_t enable_8x8_MV; + double frame_rate; + uint16_t time_base; + uint8_t intra_acdc_pred_disable; + uint8_t intra_dc_vlc_thr; + uint8_t intra_acdc_pred_disable; + uint8_t RVLC_enabled; + */ + } + MBParam; + + + + /*********************************** + + Rate Control Parameters + + ************************************/ + + + typedef struct + { + double quant; + uint32_t rc_period; + double target_rate; + double average_rate; + double reaction_rate; + double average_delta; + double reaction_delta; + double reaction_ratio; + uint32_t max_key_interval; + uint8_t max_quant; + uint8_t min_quant; + } + RateCtlParam; + + + typedef struct + { + int iTextBits; + int iMvBits; + float fMvPrevSigma; + int iMvSum; + int iMvCount; + } + Statistics; + + + typedef struct Encoder_s + { + MBParam mbParam; + RateCtlParam rateCtlParam; + + int iFrameNum; + int iMaxKeyInterval; + + Image sCurrent; + Image sBackup; + Image sReference; + Image vInterH; + Image vInterV; + Image vInterHV; + + Statistics sStat; + } + Encoder; + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/src/image.c bcast-2000c-mf3/quicktime/encore2/src/image.c *** bcast-2000c/quicktime/encore2/src/image.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/image.c Fri Nov 30 10:49:41 2001 *************** *** 0 **** --- 1,925 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + + /************************************************************************** + * + * vop.c, various VOP-level utility functions. + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + + /************************************************************************** + * + * Modifications: + * + * 23.11.2001 added CopyImages() (Isibaar) + * 10.11.2001 support for new c/mmx/3dnow interpolation + * + **************************************************************************/ + + + #include "enctypes.h" + #include + #include + #include + #include "mbmotionestcomp/halfpel.h" + + #define PUT_COMPONENT(p,v,i) \ + tmp=(unsigned int)(v); \ + if(tmp < 0x10000) \ + p[i]=tmp>>8; \ + else \ + p[i]=(tmp >> 24) ^ 0xff; + + const int iEdgeSize = 32; + + int CreateImage(Image * pImage, int width, int height) + + { + + assert(pImage); + + pImage->iWidth = width; + + pImage->iHeight = height; + + pImage->iMbWcount = (width + 15) / 16; + + pImage->iMbHcount = (height + 15) / 16; + + // pImage->iEdgedWidth=width+2*iEdgeSize; + + // pImage->iEdgedHeight=height+2*iEdgeSize; + + pImage->iEdgedWidth = pImage->iMbWcount * 16 + 2 * iEdgeSize; + + pImage->iEdgedHeight = pImage->iMbHcount * 16 + 2 * iEdgeSize; + + + + /** allocate a little more memory, so that MMX routines won't run over + + the buffer **/ + + pImage->pY = + + (uint8_t *) malloc(pImage->iEdgedWidth * pImage->iEdgedHeight + 64); + + if (pImage->pY == 0) + + return -1; + + pImage->pY += (iEdgeSize + iEdgeSize * pImage->iEdgedWidth); + + pImage->pU = + + (uint8_t *) malloc(pImage->iEdgedWidth * pImage->iEdgedHeight / 4 + 64); + + if (pImage->pU == 0) + + { + + free(pImage->pY - (iEdgeSize + iEdgeSize * pImage->iEdgedWidth)); + + return -1; + + } + + pImage->pU += (iEdgeSize / 2 + iEdgeSize / 2 * pImage->iEdgedWidth / 2); + + pImage->pV = + + (uint8_t *) malloc(pImage->iEdgedWidth * pImage->iEdgedHeight / 4 + 64); + + if (pImage->pV == 0) + + { + + free(pImage->pY - (iEdgeSize + iEdgeSize * pImage->iEdgedWidth)); + + free(pImage->pU - + + (iEdgeSize / 2 + iEdgeSize / 2 * pImage->iEdgedWidth / 2)); + + return -1; + + } + + pImage->pV += (iEdgeSize / 2 + iEdgeSize / 2 * pImage->iEdgedWidth / 2); + + pImage->pMBs = + + (Macroblock *) malloc(pImage->iMbWcount * pImage->iMbHcount * + + + + sizeof(Macroblock)); + + if (pImage->pMBs == 0) + + { + + free(pImage->pY - (iEdgeSize + iEdgeSize * pImage->iEdgedWidth)); + + free(pImage->pU - + + (iEdgeSize / 2 + iEdgeSize / 2 * pImage->iEdgedWidth / 2)); + + free(pImage->pV - + + (iEdgeSize / 2 + iEdgeSize / 2 * pImage->iEdgedWidth / 2)); + + return -1; + + } + + return 0; + + } + + + + void FreeImage(Image * pImage) + + { + + uint8_t *pTmp; + + + + assert(pImage->pY); + + assert(pImage->pU); + + assert(pImage->pV); + + pImage->pY -= (iEdgeSize + iEdgeSize * (pImage->iEdgedWidth)); + + pImage->pU -= (iEdgeSize / 2 + iEdgeSize / 2 * (pImage->iEdgedWidth) / 2); + + pImage->pV -= (iEdgeSize / 2 + iEdgeSize / 2 * (pImage->iEdgedWidth) / 2); + + pTmp = pImage->pY; + + pImage->pY = 0; + + free(pTmp); + + free(pImage->pU); + + free(pImage->pV); + + } + + void CopyImages(Image *pImage1, Image *pImage2) { + memcpy(pImage1->pY, pImage2->pY, pImage1->iEdgedWidth * pImage1->iHeight); + memcpy(pImage1->pU, pImage2->pU, pImage1->iEdgedWidth * pImage1->iHeight / 4); + memcpy(pImage1->pV, pImage2->pV, pImage1->iEdgedWidth * pImage1->iHeight / 4); + } + + void SwapImages(Image * pImage1, Image * pImage2) + + { + + uint8_t *tmp; + + + + assert(pImage1); + + assert(pImage2); + + assert(pImage1->iWidth == pImage2->iWidth); + + assert(pImage1->iHeight == pImage2->iHeight); + + + + tmp = pImage1->pY; + + pImage1->pY = pImage2->pY; + + pImage2->pY = tmp; + + tmp = pImage1->pU; + + pImage1->pU = pImage2->pU; + + pImage2->pU = tmp; + + tmp = pImage1->pV; + + pImage1->pV = pImage2->pV; + + pImage2->pV = tmp; + + } + + + + void SetEdges(Image * pImage) + + { + + uint8_t *c_ptr; + + unsigned char *src_ptr; + + + + int i; + + int c_width; + + int _width, _height; + + + + assert(pImage); + + c_width = pImage->iEdgedWidth; + + _width = pImage->iWidth; + + _height = pImage->iHeight; + + // Y + + c_ptr = pImage->pY - (iEdgeSize + iEdgeSize * c_width); + + src_ptr = pImage->pY; + + for (i = 0; i < iEdgeSize; i++) + + { + + memset(c_ptr, *src_ptr, iEdgeSize); + + memcpy(c_ptr + iEdgeSize, src_ptr, _width); + + memset(c_ptr + c_width - iEdgeSize, src_ptr[_width - 1], iEdgeSize); + + c_ptr += c_width; + + } + + for (i = 0; i < _height; i++) + + { + + memset(c_ptr, *src_ptr, iEdgeSize); + + memset(c_ptr + c_width - iEdgeSize, src_ptr[_width - 1], iEdgeSize); + + c_ptr += c_width; + + src_ptr += c_width; + + } + + src_ptr -= c_width; + + for (i = 0; i < iEdgeSize; i++) + + { + + memset(c_ptr, *src_ptr, iEdgeSize); + + memcpy(c_ptr + iEdgeSize, src_ptr, _width); + + memset(c_ptr + c_width - iEdgeSize, src_ptr[_width - 1], iEdgeSize); + + c_ptr += c_width; + + } + + + + //U + + c_ptr = pImage->pU - (iEdgeSize / 2 + iEdgeSize / 2 * c_width / 2); + + src_ptr = pImage->pU; + + for (i = 0; i < iEdgeSize / 2; i++) + + + + + { + + memset(c_ptr, src_ptr[0], iEdgeSize / 2); + + memcpy(c_ptr + iEdgeSize / 2, src_ptr, _width / 2); + + memset(c_ptr + c_width / 2 - iEdgeSize / 2, src_ptr[_width / 2 - 1], + + iEdgeSize / 2); + + c_ptr += c_width / 2; + + } + + for (i = 0; i < _height / 2; i++) + + { + + memset(c_ptr, src_ptr[0], iEdgeSize / 2); + + memset(c_ptr + c_width / 2 - iEdgeSize / 2, src_ptr[_width / 2 - 1], + + iEdgeSize / 2); + + c_ptr += c_width / 2; + + src_ptr += c_width / 2; + + } + + src_ptr -= c_width / 2; + + for (i = 0; i < iEdgeSize / 2; i++) + + + + + { + + memset(c_ptr, src_ptr[0], iEdgeSize / 2); + + memcpy(c_ptr + iEdgeSize / 2, src_ptr, _width / 2); + + memset(c_ptr + c_width / 2 - iEdgeSize / 2, src_ptr[_width / 2 - 1], + + iEdgeSize / 2); + + c_ptr += c_width / 2; + + } + + // V + + c_ptr = pImage->pV - (iEdgeSize / 2 + iEdgeSize / 2 * c_width / 2); + + src_ptr = pImage->pV; + + for (i = 0; i < iEdgeSize / 2; i++) + + + + + { + + memset(c_ptr, src_ptr[0], iEdgeSize / 2); + + memcpy(c_ptr + iEdgeSize / 2, src_ptr, _width / 2); + + memset(c_ptr + c_width / 2 - iEdgeSize / 2, src_ptr[_width / 2 - 1], + + iEdgeSize / 2); + + c_ptr += c_width / 2; + + } + + for (i = 0; i < _height / 2; i++) + + { + + memset(c_ptr, src_ptr[0], iEdgeSize / 2); + + memset(c_ptr + c_width / 2 - iEdgeSize / 2, src_ptr[_width / 2 - 1], + + iEdgeSize / 2); + + c_ptr += c_width / 2; + + src_ptr += c_width / 2; + + } + + src_ptr -= c_width / 2; + + for (i = 0; i < iEdgeSize / 2; i++) + + + + + { + + memset(c_ptr, src_ptr[0], iEdgeSize / 2); + + memcpy(c_ptr + iEdgeSize / 2, src_ptr, _width / 2); + + memset(c_ptr + c_width / 2 - iEdgeSize / 2, src_ptr[_width / 2 - 1], + + iEdgeSize / 2); + + c_ptr += c_width / 2; + + } + } + + + + #if (defined(_3DNOW_)) + + #define interpolate_halfpel_h interpolate_halfpel_h_3dn + #define interpolate_halfpel_v interpolate_halfpel_v_3dn + #define interpolate_halfpel_hv interpolate_halfpel_hv_mmx + + #elif defined(_MMX_) + + #define interpolate_halfpel_h interpolate_halfpel_h_mmx + #define interpolate_halfpel_v interpolate_halfpel_v_mmx + #define interpolate_halfpel_hv interpolate_halfpel_hv_mmx + + #endif + + + void Interpolate(const Image * pRef, Image * pInterH, Image * pInterV, + Image * pInterHV, const int iRounding, int iChromOnly) + { + uint32_t iSize = iEdgeSize; + uint32_t offset; + + //Y + if (!iChromOnly) + { + offset = iSize * (pRef->iEdgedWidth + 1); + + interpolate_halfpel_h( + pInterH->pY - offset, + pRef->pY - offset, + pRef->iEdgedWidth, pRef->iEdgedHeight, + iRounding); + + interpolate_halfpel_v( + pInterV->pY - offset, + pRef->pY - offset, + pRef->iEdgedWidth, pRef->iEdgedHeight, + iRounding); + + interpolate_halfpel_hv( + pInterHV->pY - offset, + pRef->pY - offset, + pRef->iEdgedWidth, pRef->iEdgedHeight, + iRounding); + + } + // U + iSize /= 2; + offset = iSize * (pRef->iEdgedWidth / 2 + 1); + + interpolate_halfpel_h( + pInterH->pU - offset, + pRef->pU - offset, + pRef->iEdgedWidth / 2, pRef->iEdgedHeight / 2, + iRounding); + + interpolate_halfpel_v( + pInterV->pU - offset, + pRef->pU - offset, + pRef->iEdgedWidth / 2, pRef->iEdgedHeight / 2, + iRounding); + + interpolate_halfpel_hv( + pInterHV->pU - offset, + pRef->pU - offset, + pRef->iEdgedWidth / 2, pRef->iEdgedHeight / 2, + iRounding); + + // V + interpolate_halfpel_h( + pInterH->pV - offset, + pRef->pV - offset, + pRef->iEdgedWidth / 2, pRef->iEdgedHeight / 2, + iRounding); + + interpolate_halfpel_v( + pInterV->pV - offset, + pRef->pV - offset, + pRef->iEdgedWidth / 2, pRef->iEdgedHeight / 2, + iRounding); + + interpolate_halfpel_hv( + pInterHV->pV - offset, + pRef->pV - offset, + pRef->iEdgedWidth / 2, pRef->iEdgedHeight / 2, + iRounding); + } + + + + #ifdef LINUX + + + + struct lookuptable + + { + + int32_t m_plY[256]; + + int32_t m_plRV[256]; + + int32_t m_plGV[256]; + + int32_t m_plGU[256]; + + int32_t m_plBU[256]; + + }; + + static struct lookuptable lut; + + static void init_yuv2rgb() + + { + + int i; + + + + for (i = 0; i < 256; i++) + + { + + if (i >= 16) + + if (i > 240) + + lut.m_plY[i] = lut.m_plY[240]; + + else + + lut.m_plY[i] = 298 * (i - 16); + + else + + lut.m_plY[i] = 0; + + if ((i >= 16) && (i <= 240)) + + { + + lut.m_plRV[i] = 408 * (i - 128); + + lut.m_plGV[i] = -208 * (i - 128); + + lut.m_plGU[i] = -100 * (i - 128); + + lut.m_plBU[i] = 517 * (i - 128); + + } + + else if (i < 16) + + { + + lut.m_plRV[i] = 408 * (16 - 128); + + lut.m_plGV[i] = -208 * (16 - 128); + + lut.m_plGU[i] = -100 * (16 - 128); + + lut.m_plBU[i] = 517 * (16 - 128); + + } + + else + + { + + lut.m_plRV[i] = lut.m_plRV[240]; + + lut.m_plGV[i] = lut.m_plGV[240]; + + lut.m_plGU[i] = lut.m_plGU[240]; + + lut.m_plBU[i] = lut.m_plBU[240]; + + } + + } + + } + + static void yuv2rgb_24(uint8_t *puc_y, int stride_y, + + uint8_t *puc_u, uint8_t *puc_v, int stride_uv, + + uint8_t *puc_out, int width_y, int height_y, + + unsigned int _stride_out) + + { + + + + int x, y; + + int stride_diff = 6 * _stride_out - 3 * width_y; + + + + if (height_y < 0) + + { + + /* + + we are flipping our output upside-down */ + + height_y = -height_y; + + puc_y += (height_y - 1) * stride_y; + + puc_u += (height_y / 2 - 1) * stride_uv; + + puc_v += (height_y / 2 - 1) * stride_uv; + + stride_y = -stride_y; + + stride_uv = -stride_uv; + + } + + + + for (y = 0; y < height_y; y += 2) + + { + + uint8_t *pY = puc_y; + + uint8_t *pY1 = puc_y + stride_y; + + uint8_t *pU = puc_u; + + uint8_t *pV = puc_v; + + uint8_t *pOut2 = puc_out + 3 * _stride_out; + + + + for (x = 0; x < width_y; x += 2) + + { + + int R, G, B; + + int Y; + + unsigned int tmp; + + + + R = lut.m_plRV[*pV]; + + G = lut.m_plGV[*pV]; + + pV++; + + G += lut.m_plGU[*pU]; + + B = lut.m_plBU[*pU]; + + pU++; + + Y = lut.m_plY[*pY]; + + pY++; + + PUT_COMPONENT(puc_out, B + Y, 0); + + PUT_COMPONENT(puc_out, G + Y, 1); + + PUT_COMPONENT(puc_out, R + Y, 2); + + Y = lut.m_plY[*pY]; + + pY++; + + PUT_COMPONENT(puc_out, B + Y, 3); + + PUT_COMPONENT(puc_out, G + Y, 4); + + PUT_COMPONENT(puc_out, R + Y, 5); + + Y = lut.m_plY[*pY1]; + + pY1++; + + PUT_COMPONENT(pOut2, B + Y, 0); + + PUT_COMPONENT(pOut2, G + Y, 1); + + PUT_COMPONENT(pOut2, R + Y, 2); + + Y = lut.m_plY[*pY1]; + + pY1++; + + PUT_COMPONENT(pOut2, B + Y, 3); + + PUT_COMPONENT(pOut2, G + Y, 4); + + PUT_COMPONENT(pOut2, R + Y, 5); + + puc_out += 6; + + pOut2 += 6; + + } + + + + puc_y += 2 * stride_y; + + puc_u += stride_uv; + + puc_v += stride_uv; + + puc_out += stride_diff; + + } + + } + + typedef struct + + + { + + + + int biSize; + + + + int biWidth; + + + + int biHeight; + + + + short biPlanes; + + + + short biBitCount; + + + + int biCompression; + + + + int biSizeImage; + + + + int biXPelsPerMeter; + + + + int biYPelsPerMeter; + + + + int biClrUsed; + + + + int biClrImportant; + + + + } + + BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER; + + + + + + + #include + + #include + + void DumpImage(Image * pImage, const char *filename) + + { + + int bs = abs(pImage->iWidth * pImage->iHeight * 3); + + short bfh[7]; + + uint8_t *pPix; + + static int needs_init = 1; + + BITMAPINFOHEADER bi; + + int fd; + + + + + + if (needs_init) + + { + + needs_init = 0; + + init_yuv2rgb(); + + } + + fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 00666); + + + + if (fd < 0) + + return; + + pPix = malloc(bs); + + yuv2rgb_24(pImage->pY, pImage->iEdgedWidth, + + pImage->pU, pImage->pV, pImage->iEdgedWidth / 2, + + pPix, pImage->iWidth, -pImage->iHeight, pImage->iWidth); + + bfh[0] = 'B' + 256 * 'M'; + + *(int *) &bfh[1] = bs + 0x36; + + *(int *) &bfh[3] = 0; + + *(int *) &bfh[5] = 0x36; + + + + bi.biSize = sizeof(bi); + + bi.biWidth = pImage->iWidth; + + bi.biHeight = pImage->iHeight; + + bi.biBitCount = 24; + + bi.biCompression = 0; + + bi.biSizeImage = 0; + + bi.biPlanes = 1; + + + + write(fd, bfh, 14); + + write(fd, &bi, 40); + + write(fd, pPix, bs); + + close(fd); + + free(pPix); + + } + + #endif + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/CVS/Entries *** bcast-2000c/quicktime/encore2/src/intel_mmx/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/CVS/Entries Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,8 ---- + /copyblock_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /halfpel_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /mad_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /rdtsc.asm/1.1/Fri Nov 30 01:09:03 2001// + /text_fdct_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /text_idct_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /transferidct_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + D diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/CVS/Repository *** bcast-2000c/quicktime/encore2/src/intel_mmx/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/intel_mmx diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/CVS/Root *** bcast-2000c/quicktime/encore2/src/intel_mmx/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/copyblock_mmx.c bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/copyblock_mmx.c *** bcast-2000c/quicktime/encore2/src/intel_mmx/copyblock_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/copyblock_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,25 ---- + #include "../copyblock.h" + + void EncCopyBlock(uint8_t* pSrc, int16_t* pDest, int stride) + { + __asm + { + mov ecx, pDest + mov edx, pSrc + mov eax, stride + mov edi, 8 + pxor mm1, mm1 + p3: + movq mm0, [edx] + movq mm2, mm0 + punpcklbw mm2, mm1 + movq [ecx], mm2 + punpckhbw mm0, mm1 + movq [ecx+8], mm0 + add ecx, 16 + add edx, eax + dec edi + jnz p3 + emms + } + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/halfpel_mmx.c bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/halfpel_mmx.c *** bcast-2000c/quicktime/encore2/src/intel_mmx/halfpel_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/halfpel_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,347 ---- + /************************************************************************** + * * + * This code is developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * halfpel_mmx.c, half-pixel interpolation routines, MMX version, + * Intel syntax + * + * Copyright (C) 2001 Project Mayo + * + * John Funnell + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* + + interpolate_halfpel.c + + Generates interpolated planes for use by the encoder in half-pel motion estimation + and motion compensation. + + John Funnell, 23 March 2001 + + (C) Project Mayo 2001 + + */ + #include "../halfpel.h" + + //#define PENTIUMIII + + #ifdef PENTIUMIII + #define MOVNTQ movntq + #else + #define MOVNTQ movq + #define prefetchnta // + #endif + + const uint64_t mm_7f7f7f7f7f7f7f7f = 0x7f7f7f7f7f7f7f7f; + const uint64_t mm_0002000200020002 = 0x0002000200020002; + const uint64_t mm_0001000100010001 = 0x0001000100010001; + const uint64_t mm_0202020202020202 = 0x0202020202020202; + const uint64_t mm_3f3f3f3f3f3f3f3f = 0x3f3f3f3f3f3f3f3f; + const uint64_t mm_0101010101010101 = 0x0101010101010101; + const uint64_t mm_f0f0f0f0f0f0f0f0 = 0xf0f0f0f0f0f0f0f0; + const uint64_t mm_0f0f0f0f0f0f0f0f = 0x0f0f0f0f0f0f0f0f; + + static __inline void interpolate_halfpel_h_noround( + uint8_t *src, + uint8_t *dstH, + int width, /* width % 16 == 0 */ + int height) + { + int y, xcount, flyback; + + // flyback = stride - width; + + xcount = width >> 4; + __asm { + push eax + push ebx + push edi + push esi + mov eax, src + mov ebx, dstH + movq mm7, mm_7f7f7f7f7f7f7f7f; + mov edi, height + horiz_round0_loop_y: + mov esi, xcount + horiz_round0_loop_x: + movq mm0, [eax] + movq mm4, [eax+8] + movq mm1, [eax+1] + movq mm5, [eax+9] + movq mm2, mm0 + pxor mm0, mm1 + por mm1, mm2 + psrlq mm0, 1 + add eax, 16 + pand mm0, mm7 + psubb mm1, mm0 + MOVNTQ [ebx], mm1 + movq mm6, mm4 + pxor mm4, mm5 + por mm5, mm6 + psrlq mm4, 1 + pand mm4, mm7 + psubb mm5, mm4 + MOVNTQ [ebx+8], mm5 + add ebx, 16 + dec esi + jne horiz_round0_loop_x + // add eax, flyback + // add ebx, flyback + dec edi + jne horiz_round0_loop_y + pop esi + pop edi + pop ebx + pop eax + emms + } + } + static __inline void interpolate_halfpel_v_noround( + uint8_t *src, + uint8_t *dstV, + int width, /* width % 16 == 0 */ + int height) + { + int y, xcount, flyback; + + // flyback = stride - width; + + xcount = width >> 4; + __asm { + push eax + push ebx + push ecx + push edi + push esi + mov eax, src + mov ecx, src + add ecx, width + mov ebx, dstV + movq mm7, mm_7f7f7f7f7f7f7f7f; + mov edi, height + vert_round0_loop_y: + mov esi, xcount + vert_round0_loop_x: + movq mm0, [eax] + movq mm4, [eax+8] + movq mm1, [ecx] + movq mm5, [ecx+8] + movq mm2, mm0 + pxor mm0, mm1 + por mm1, mm2 + psrlq mm0, 1 + add eax, 16 + pand mm0, mm7 + psubb mm1, mm0 + MOVNTQ [ebx], mm1 + movq mm6, mm4 + pxor mm4, mm5 + por mm5, mm6 + psrlq mm4, 1 + add ecx, 16 + pand mm4, mm7 + psubb mm5, mm4 + MOVNTQ [ebx+8], mm5 + add ebx, 16 + dec esi + jne vert_round0_loop_x + // add eax, flyback + // add ebx, flyback + // add ecx, flyback + dec edi + jne vert_round0_loop_y + pop esi + pop edi + pop ecx + pop ebx + pop eax + emms + } + } + + static __inline void interpolate_halfpel_hv_noround( + uint8_t *src, + uint8_t *dstHV, + int width, /* width % 16 == 0 */ + int height) + { + } + + void interpolate_halfpel_h( + uint8_t *src, + uint8_t *dstH, + int width, /* width % 16 == 0 */ + int height, + int rounding) + { + int i; + if(!rounding) + { + interpolate_halfpel_h_noround(src, dstH, width, height); + return; + } + for(i=0; i>1; + src++; + } + + } + + void interpolate_halfpel_v( + uint8_t *src, + uint8_t *dstV, + int width, /* width % 16 == 0 */ + int height, + int rounding) + { + int i; + if(!rounding) + { + interpolate_halfpel_v_noround(src, dstV, width, height); + return; + } + for(i=0; i>1; + src++; + } + + } + + void interpolate_halfpel_hv( + uint8_t *src, + uint8_t *dstHV, + int width, /* width % 16 == 0 */ + int height, + int rounding) + { + int y, xcount, flyback; + + // flyback = stride - width; + + xcount = width >> 4; + __asm { + push eax + push ebx + push ecx + push edi + push esi + mov eax, rounding + test eax, eax + jnz has_rounding + movq mm6, mm_0002000200020002 + jmp cont + has_rounding: + movq mm6, mm_0001000100010001 + cont: + mov eax, src + mov ecx, src + add ecx, width + mov ebx, dstHV + pxor mm7, mm7 + mov edi, height + horizvert_round0_loop_y: + mov esi, xcount + horizvert_round0_loop_x: + movq mm0, [eax] + movq mm1, mm0 + punpcklbw mm0, mm7 + movq mm2, [eax+1] + punpckhbw mm1, mm7 + movq mm3, mm2 + punpcklbw mm2, mm7 + paddw mm0, mm6 + punpckhbw mm3, mm7 + paddw mm1, mm6 + movq mm4, [ecx] + paddw mm0, mm2 + movq mm5, mm4 + punpcklbw mm4, mm7 + paddw mm1, mm3 + punpckhbw mm5, mm7 + paddw mm0, mm4 + paddw mm1, mm5 + movq mm4, [ecx+1] + movq mm5, mm4 + punpcklbw mm4, mm7 + // prefetchnta [ecx+32] + punpckhbw mm5, mm7 + paddw mm4, mm0 + paddw mm5, mm1 + psrlw mm4, 2 + movq mm0, [eax+8] + psrlw mm5, 2 + movq mm1, mm0 + punpcklbw mm0, mm7 + movq mm2, [eax+9] + punpckhbw mm1, mm7 + movq mm3, mm2 + packuswb mm4, mm5 + paddw mm0, mm6 + punpcklbw mm2, mm7 + add eax, 16 + punpckhbw mm3, mm7 + MOVNTQ [ebx], mm4 + paddw mm1, mm6 + movq mm4, [ecx+8] + paddw mm0, mm2 + movq mm5, mm4 + punpcklbw mm4, mm7 + paddw mm1, mm3 + punpckhbw mm5, mm7 + paddw mm0, mm4 + paddw mm1, mm5 + movq mm4, [ecx+9] + movq mm5, mm4 + punpcklbw mm4, mm7 + add ecx, 16 + punpckhbw mm5, mm7 + paddw mm4, mm0 + paddw mm5, mm1 + psrlw mm4, 2 + psrlw mm5, 2 + packuswb mm4, mm5 + MOVNTQ [ebx+8], mm4 + add ebx, 16 + dec esi + jne horizvert_round0_loop_x + // add eax, flyback + // add ebx, flyback + // add ecx, flyback + dec edi + jne horizvert_round0_loop_y + pop esi + pop edi + pop ecx + pop ebx + pop eax + emms + } + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/mad_mmx.c bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/mad_mmx.c *** bcast-2000c/quicktime/encore2/src/intel_mmx/mad_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/mad_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,281 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mad.c, utility functions that calculate MADs and SADs. + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + #include "../mad.h" + #define ABS(X) (((X)>0)?(X):-(X)) + float MAD_Image(const Vop* pIm, const Vop* pVop) + { + int x, y; + int32_t sum=0; + // int iStride=pVop->iWidth; + int iStride2=pVop->iEdgedWidth; + for(y=0; yiHeight; y++) + for(x=0; xiWidth; x++) + sum+=ABS((int32_t)pVop->pY[x+y*iStride2]-(int32_t)pIm->pY[x+y*iStride2]); + // iStride/=2; + iStride2/=2; + for(y=0; yiHeight/2; y++) + for(x=0; xiWidth/2; x++) + sum+=ABS((int32_t)pVop->pU[x+y*iStride2]-(int32_t)pIm->pU[x+y*iStride2]); + for(y=0; yiHeight/2; y++) + for(x=0; xiWidth/2; x++) + sum+=ABS((int32_t)pVop->pV[x+y*iStride2]-(int32_t)pIm->pV[x+y*iStride2]); + return ((float)sum)/(pVop->iWidth*pVop->iHeight*3/2); + } + + // x & y in blocks ( 8 pixel units ) + // dx & dy in pixels + static const int64_t mm_FFFFFFFFFFFFFFFF=0xFFFFFFFFFFFFFFFFi64; + + #define SAD_INIT \ + __asm xor eax, eax \ + __asm movq mm7, mm_FFFFFFFFFFFFFFFF \ + __asm pxor mm0, mm0 \ + __asm pxor mm1, mm1 + // "movl %1, %%ecx\n" + // "movl %2, %%edx\n" + + #define SAD_ONE_STEP(X) \ + __asm movq mm2, [ecx+X] \ + __asm movq mm3, [edx+X] \ + \ + __asm movq mm4, mm2 \ + __asm movq mm5, mm3 \ + __asm punpcklbw mm2, mm0 \ + __asm punpckhbw mm4, mm0 \ + __asm punpcklbw mm3, mm0 \ + __asm punpckhbw mm5, mm0 \ + \ + __asm psubw mm3, mm2 \ + __asm psubw mm5, mm4 \ + \ + __asm movq mm2, mm3 \ + __asm movq mm4, mm5 \ + __asm pcmpgtw mm2, mm0 \ + __asm pcmpgtw mm4, mm0 \ + __asm pxor mm2, mm7 \ + __asm pxor mm4, mm7 \ + __asm pxor mm3, mm2 \ + __asm pxor mm5, mm4 \ + __asm psubw mm3, mm2 \ + __asm psubw mm5, mm4 \ + __asm paddusw mm1, mm3 \ + __asm paddusw mm1, mm5 + + #define SAD_PACK \ + __asm movq mm2, mm1 \ + __asm psrlq mm1, 32 \ + __asm paddusw mm1, mm2 \ + __asm movq mm2, mm1 \ + __asm psrlq mm1, 16 \ + __asm paddusw mm1, mm2 \ + __asm movd ecx, mm1 \ + __asm and ecx, 0xFFFF + + int32_t SAD_Block(const Vop* pIm, const Vop* pVop, + int x, int y, + int dx, int dy, + int sad_opt, + int component) + { + int32_t sum=0; + int i, j; + const uint8_t *pRef; + const uint8_t *pCur; + int iWidth=pVop->iWidth; + int iEdgedWidth=pVop->iEdgedWidth; + switch(component) + { + case 0: + pRef=pIm->pY+x*8+y*8*pVop->iEdgedWidth; + pCur=pVop->pY+(x*8+dx)+(y*8+dy)*pVop->iEdgedWidth; + break; + case 1: + pRef=pIm->pU+x*8+y*8*pVop->iEdgedWidth/2; + pCur=pVop->pU+(x*8+dx)+(y*8+dy)*pVop->iEdgedWidth/2; + break; + case 2: + default: + pRef=pIm->pV+x*8+y*8*pVop->iEdgedWidth/2; + pCur=pVop->pV+(x*8+dx)+(y*8+dy)*pVop->iEdgedWidth/2; + break; + } + if(component) + { + iWidth/=2; + iEdgedWidth/=2; + } + + SAD_INIT + __asm mov edi, 8 + __asm mov ecx, pRef + __asm mov edx, pCur + + p1: + SAD_ONE_STEP(0) + __asm add ecx, iEdgedWidth + __asm add edx, iEdgedWidth + __asm dec edi + __asm jnz p1 + + SAD_PACK + __asm mov sum, ecx + + return sum; + } + + int32_t SAD_Macroblock(const Vop* pIm, + const Vop* pVopN, const Vop* pVopH, const Vop* pVopV, const Vop* pVopHV, + int x, int y, int dx, int dy, int sad_opt, int iQuality) + { + const Vop* pVop; + int32_t sum=0; + int i, j; + const uint8_t *pRef; + const uint8_t *pCur; + int iWidth=pVopN->iEdgedWidth; + int iEdgedWidth=pVopN->iEdgedWidth; + switch(((dx%2)?2:0)+((dy%2)?1:0)) + { + case 0: + pVop=pVopN; + break; + case 1: + pVop=pVopV; + dy--; + break; + case 2: + pVop=pVopH; + dx--; + break; + case 3: + default: + pVop=pVopHV; + dx--; + dy--; + break; + } + dx/=2; + dy/=2; + + pRef=pIm->pY+x*16+y*16*iEdgedWidth; + pCur=pVop->pY+(x*16+dx)+(y*16+dy)*iEdgedWidth; + + switch(iQuality) + { + case 1: + iEdgedWidth*=4; + iEdgedWidth*=4; + SAD_INIT + __asm mov edi, 4 + __asm mov ecx, pRef + __asm mov edx, pCur + + p4: + SAD_ONE_STEP(0) + SAD_ONE_STEP(8) + __asm add ecx, iEdgedWidth + __asm add edx, iEdgedWidth + __asm dec edi + __asm jnz p4 + + SAD_PACK + __asm mov sum, ecx + + return sum*4; + case 2: + iEdgedWidth*=2; + iEdgedWidth*=2; + SAD_INIT + __asm mov edi, 8 + __asm mov ecx, pRef + __asm mov edx, pCur + + p3: + SAD_ONE_STEP(0) + SAD_ONE_STEP(8) + __asm add ecx, iEdgedWidth + __asm add edx, iEdgedWidth + __asm dec edi + __asm jnz p3 + + SAD_PACK + __asm mov sum, ecx + + return sum*2; + default: + SAD_INIT + __asm mov ecx, pRef + __asm mov edx, pCur + __asm mov edi, 16 + + p2: + SAD_ONE_STEP(0) + SAD_ONE_STEP(8) + __asm add ecx, iEdgedWidth + __asm add edx, iEdgedWidth + __asm dec edi + __asm jnz p2 + + SAD_PACK + __asm mov sum, ecx + + return sum; + } + } + + int32_t SAD_Deviation_MB(const Vop* pIm, int x, int y) + { + int32_t sum=0, avg=0; + const uint8_t *pRef; + int i, j; + int width=pIm->iEdgedWidth; + + pRef=pIm->pY+x*16+y*16*width; + for(i=0; i<16; i++) + { + for(j=0; j<16; j++) + sum+=(int32_t)pRef[j]; + pRef+=width; + } + sum/=256; + pRef=pIm->pY+x*16+y*16*width; + for(i=0; i<16; i++) + { + for(j=0; j<16; j++) + avg+=ABS((int32_t)pRef[j]-sum); + pRef+=width; + } + return avg; + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/rdtsc.asm bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/rdtsc.asm *** bcast-2000c/quicktime/encore2/src/intel_mmx/rdtsc.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/rdtsc.asm Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,65 ---- + ;/****************************************************************************** + ; * * + ; * This file is part of XviD, a free MPEG-4 video encoder/decoder * + ; * * + ; * XviD is an implementation of a part of one or more MPEG-4 Video tools * + ; * as specified in ISO/IEC 14496-2 standard. Those intending to use this * + ; * software module in hardware or software products are advised that its * + ; * use may infringe existing patents or copyrights, and any such use * + ; * would be at such party's own risk. The original developer of this * + ; * software module and his/her company, and subsequent editors and their * + ; * companies, will have no liability for use of this software or * + ; * modifications or derivatives thereof. * + ; * * + ; * XviD is free software; you can redistribute it and/or modify it * + ; * under the terms of the GNU General Public License as published by * + ; * the Free Software Foundation; either version 2 of the License, or * + ; * (at your option) any later version. * + ; * * + ; * XviD 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 General Public License for more details. * + ; * * + ; * You should have received a copy of the GNU General Public License * + ; * along with this program; if not, write to the Free Software * + ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + ; * * + ; ******************************************************************************/ + ; + ;/****************************************************************************** + ; * * + ; * rdtsc.asm, read processor's timestamp counter * + ; * * + ; * Copyright (C) 2001 - Michael Militzer * + ; * * + ; * For more information visit the XviD homepage: http://www.xvid.org * + ; * * + ; ******************************************************************************/ + ; + ;/****************************************************************************** + ; * * + ; * Revision history: * + ; * * + ; * 02.11.2001 initial version (Isibaar) * + ; * * + ; ******************************************************************************/ + + + BITS 32 + + GLOBAL @get_TSC@0 + + EXTERN _t_stampl + EXTERN _t_stamph + + SECTION .text + + ; void _fastcall get_TSC(); + @get_TSC@0: + + rdtsc + mov [_t_stampl], eax + mov [_t_stamph], edx + + ret \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/text_fdct_mmx.c bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/text_fdct_mmx.c *** bcast-2000c/quicktime/encore2/src/intel_mmx/text_fdct_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/text_fdct_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,896 ---- + + ////////////////////////////////////////////////////////////////////////////// + // + // fdctmm32.c - AP922 MMX fDCT + // ---------- + // Intel Application Note AP-922 - fast, precise implementation of DCT + // http://developer.intel.com/vtune/cbts/appnotes.htm + // ---------- + // + // This code will run on any MMX CPU. The dct_row operation can be + // further optimized using PentiumIII/Athlon instructions (pshufw.) + // If the code will be run on a 3D-Now CPU (AMD K6-2/Athlon), a slight + // accruacy-boost can be obtained. Please see fdctam32.c for details. + // + // For a fast, precise MMX implementation of inverse-DCT + // visit http://www.elecard.com/peter + // or check out Avery Lee's Virtualdub source-code + // http://www.concentric.net/~psilon + // + // Revision history + // ---------------- + // + // v1.01 08/26/2000 (clipper bugfix) + // In my haste to get this code out the door, I neglected to consider + // the numerical range of output. I *believe* an IEEE-1180/1990 fdct + // is range-limited to {-2048, +2047}. + // fdctmm32.c now saturates the output DCT coefficients to this range. + // A few comment typos were corrected. Equivalent-C code for + // the forward_dct column stage has also been added. The pseudo-C + // code in Intel's AP-922 omits several important operations that + // would cause dct8_frw_col() to fail, if it were used directly without + // modification. + // There is still room for additional optimization in the + // frw_dct_row_mmx() function. The data pack/unpack operation could be + // shortened with pshufw. + // + // v1.0 07/20/2000 (initial release) + // Initial release of AP922 MMX forward_DCT. + // + // + // liaor@iname.com http://members.tripod.com/~liaor + ////////////////////////////////////////////////////////////////////////////// + + #define INP eax // pointer to (short *blk) + #define OUT ecx // pointer to output (temporary store space qwTemp[]) + #define TABLE ebx // pointer to tab_frw_01234567[] + #define TABLEF ebx // pointer to tg_all_16 + #define round_frw_row edx + //#define round_frw_col edx + + #define x0 INP + 0*16 + #define x1 INP + 1*16 + #define x2 INP + 2*16 + #define x3 INP + 3*16 + #define x4 INP + 4*16 + #define x5 INP + 5*16 + #define x6 INP + 6*16 + #define x7 INP + 7*16 + #define y0 OUT + 0*16 + #define y1 OUT + 1*16 + #define y2 OUT + 2*16 + #define y3 OUT + 3*16 + #define y4 OUT + 4*16 + #define y5 OUT + 5*16 + #define y6 OUT + 6*16 + #define y7 OUT + 7*16 + + + ////////////////////////////////////////////////////////////////////// + // + // constants for the forward DCT + // ----------------------------- + // + // Be sure to check that your compiler is aligning all constants to QWORD + // (8-byte) memory boundaries! Otherwise the unaligned memory access will + // severely stall MMX execution. + // + ////////////////////////////////////////////////////////////////////// + + #define BITS_FRW_ACC 3 //; 2 or 3 for accuracy + #define SHIFT_FRW_COL BITS_FRW_ACC + #define SHIFT_FRW_ROW (BITS_FRW_ACC + 17) + + // v1.01 The original SHIFT_FRW_ROW constant has been replaced by a + // "two stage" shift operation. The 1st-shift (CLIP1) aligns the + // intermediate 32-bit integer data to a {-32768, +32768} (16-bit word) + // range. The MMX instruction "packssdw" simultaneous clips and packs + // the intermediate-data into 16-bit format. + // The 2nd-shift (CLIP2) restores the proper final range {-2048,+2047} + + #define SHIFT_FRW_ROW_CLIP2 (4) // 4-bit shift -> { 32768 <> 2048 } + #define SHIFT_FRW_ROW_CLIP1 ( SHIFT_FRW_ROW - SHIFT_FRW_ROW_CLIP2 ) + + //#define RND_FRW_ROW (262144 * (BITS_FRW_ACC - 1)) //; 1 << (SHIFT_FRW_ROW-1) + #define RND_FRW_ROW (1 << (SHIFT_FRW_ROW-1)) + //#define RND_FRW_COL (2 * (BITS_FRW_ACC - 1)) //; 1 << (SHIFT_FRW_COL-1) + #define RND_FRW_COL (1 << (SHIFT_FRW_COL-1)) + + const static __int64 one_corr = 0x0001000100010001; + const static long r_frw_row[2] = {RND_FRW_ROW, RND_FRW_ROW }; + + //const static short tg_1_16[4] = {13036, 13036, 13036, 13036 }; //tg * (2<<16) + 0.5 + //const static short tg_2_16[4] = {27146, 27146, 27146, 27146 }; //tg * (2<<16) + 0.5 + //const static short tg_3_16[4] = {-21746, -21746, -21746, -21746 }; //tg * (2<<16) + 0.5 + //const static short cos_4_16[4] = {-19195, -19195, -19195, -19195 }; //cos * (2<<16) + 0.5 + //const static short ocos_4_16[4] = {23170, 23170, 23170, 23170 }; //cos * (2<<15) + 0.5 + + //concatenated table, for forward DCT-column transformation + const static short tg_all_16[] = { + 13036, 13036, 13036, 13036, // tg * (2<<16) + 0.5 + 27146, 27146, 27146, 27146, // tg * (2<<16) + 0.5 + -21746, -21746, -21746, -21746, // tg * (2<<16) + 0.5 + -19195, -19195, -19195, -19195, //cos * (2<<16) + 0.5 + 23170, 23170, 23170, 23170 }; //cos * (2<<15) + 0.5 + + #define tg_1_16 (TABLEF + 0) + #define tg_2_16 (TABLEF + 8) + #define tg_3_16 (TABLEF + 16) + #define cos_4_16 (TABLEF + 24) + #define ocos_4_16 (TABLEF + 32) + + + // CONCATENATED IDCT COEFF TABLE, rows 0,1,2,3,4,5,6,7 (in order ) + // + /* + static const short tab_inv_01234567[] = { // inverse_dct coeff table + //row0, this row is required + 16384, 16384, 16384, -16384, // ; movq-> w06 w04 w02 w00 + 21407, 8867, 8867, -21407, // w07 w05 w03 w01 + 16384, -16384, 16384, 16384, //; w14 w12 w10 w08 + -8867, 21407, -21407, -8867, //; w15 w13 w11 w09 + 22725, 12873, 19266, -22725, //; w22 w20 w18 w16 + 19266, 4520, -4520, -12873, //; w23 w21 w19 w17 + 12873, 4520, 4520, 19266, //; w30 w28 w26 w24 + -22725, 19266, -12873, -22725, //w31 w29 w27 w25 + + //row1 + 22725, 22725, 22725, -22725, // ; movq-> w06 w04 w02 w00 + 29692, 12299, 12299, -29692, // ; w07 w05 w03 w01 + 22725, -22725, 22725, 22725, //; w14 w12 w10 w08 + -12299, 29692, -29692, -12299, //; w15 w13 w11 w09 + 31521, 17855, 26722, -31521, //; w22 w20 w18 w16 + 26722, 6270, -6270, -17855, //; w23 w21 w19 w17 + 17855, 6270, 6270, 26722, //; w30 w28 w26 w24 + -31521, 26722, -17855, -31521, // w31 w29 w27 w25 + + //row2 + 21407, 21407, 21407, -21407, // ; movq-> w06 w04 w02 w00 + 27969, 11585, 11585, -27969, // ; w07 w05 w03 w01 + 21407, -21407, 21407, 21407, // ; w14 w12 w10 w08 + -11585, 27969, -27969, -11585, // ;w15 w13 w11 w09 + 29692, 16819, 25172, -29692, // ;w22 w20 w18 w16 + 25172, 5906, -5906, -16819, // ;w23 w21 w19 w17 + 16819, 5906, 5906, 25172, // ;w30 w28 w26 w24 + -29692, 25172, -16819, -29692, // ;w31 w29 w27 w25 + + //row3 + 19266, 19266, 19266, -19266, //; movq-> w06 w04 w02 w00 + 25172, 10426, 10426, -25172, //; w07 w05 w03 w01 + 19266, -19266, 19266, 19266, //; w14 w12 w10 w08 + -10426, 25172, -25172, -10426, //; w15 w13 w11 w09 + 26722, 15137, 22654, -26722, //; w22 w20 w18 w16 + 22654, 5315, -5315, -15137, //; w23 w21 w19 w17 + 15137, 5315, 5315, 22654, //; w30 w28 w26 w24 + -26722, 22654, -15137, -26722, //; w31 w29 w27 w25 + + //row4 + 16384, 16384, 16384, -16384, // ; movq-> w06 w04 w02 w00 + 21407, 8867, 8867, -21407, // w07 w05 w03 w01 + 16384, -16384, 16384, 16384, //; w14 w12 w10 w08 + -8867, 21407, -21407, -8867, //; w15 w13 w11 w09 + 22725, 12873, 19266, -22725, //; w22 w20 w18 w16 + 19266, 4520, -4520, -12873, //; w23 w21 w19 w17 + 12873, 4520, 4520, 19266, //; w30 w28 w26 w24 + -22725, 19266, -12873, -22725, //w31 w29 w27 w25 + + //row5 + 19266, 19266, 19266, -19266, //; movq-> w06 w04 w02 w00 + 25172, 10426, 10426, -25172, //; w07 w05 w03 w01 + 19266, -19266, 19266, 19266, //; w14 w12 w10 w08 + -10426, 25172, -25172, -10426, //; w15 w13 w11 w09 + 26722, 15137, 22654, -26722, //; w22 w20 w18 w16 + 22654, 5315, -5315, -15137, //; w23 w21 w19 w17 + 15137, 5315, 5315, 22654, //; w30 w28 w26 w24 + -26722, 22654, -15137, -26722, //; w31 w29 w27 w25 + + //row6 + 21407, 21407, 21407, -21407, // ; movq-> w06 w04 w02 w00 + 27969, 11585, 11585, -27969, // ; w07 w05 w03 w01 + 21407, -21407, 21407, 21407, // ; w14 w12 w10 w08 + -11585, 27969, -27969, -11585, // ;w15 w13 w11 w09 + 29692, 16819, 25172, -29692, // ;w22 w20 w18 w16 + 25172, 5906, -5906, -16819, // ;w23 w21 w19 w17 + 16819, 5906, 5906, 25172, // ;w30 w28 w26 w24 + -29692, 25172, -16819, -29692, // ;w31 w29 w27 w25 + + //row7 + 22725, 22725, 22725, -22725, // ; movq-> w06 w04 w02 w00 + 29692, 12299, 12299, -29692, // ; w07 w05 w03 w01 + 22725, -22725, 22725, 22725, //; w14 w12 w10 w08 + -12299, 29692, -29692, -12299, //; w15 w13 w11 w09 + 31521, 17855, 26722, -31521, //; w22 w20 w18 w16 + 26722, 6270, -6270, -17855, //; w23 w21 w19 w17 + 17855, 6270, 6270, 26722, //; w30 w28 w26 w24 + -31521, 26722, -17855, -31521}; // w31 w29 w27 w25 + */ + + static const short tab_frw_01234567[] = { // forward_dct coeff table + //row0 + 16384, 16384, 21407, -8867, // w09 w01 w08 w00 + 16384, 16384, 8867, -21407, // w13 w05 w12 w04 + 16384, -16384, 8867, 21407, // w11 w03 w10 w02 + -16384, 16384, -21407, -8867, // w15 w07 w14 w06 + 22725, 12873, 19266, -22725, // w22 w20 w18 w16 + 19266, 4520, -4520, -12873, // w23 w21 w19 w17 + 12873, 4520, 4520, 19266, // w30 w28 w26 w24 + -22725, 19266, -12873, -22725, // w31 w29 w27 w25 + + //row1 + 22725, 22725, 29692, -12299, // w09 w01 w08 w00 + 22725, 22725, 12299, -29692, // w13 w05 w12 w04 + 22725, -22725, 12299, 29692, // w11 w03 w10 w02 + -22725, 22725, -29692, -12299, // w15 w07 w14 w06 + 31521, 17855, 26722, -31521, // w22 w20 w18 w16 + 26722, 6270, -6270, -17855, // w23 w21 w19 w17 + 17855, 6270, 6270, 26722, // w30 w28 w26 w24 + -31521, 26722, -17855, -31521, // w31 w29 w27 w25 + + //row2 + 21407, 21407, 27969, -11585, // w09 w01 w08 w00 + 21407, 21407, 11585, -27969, // w13 w05 w12 w04 + 21407, -21407, 11585, 27969, // w11 w03 w10 w02 + -21407, 21407, -27969, -11585, // w15 w07 w14 w06 + 29692, 16819, 25172, -29692, // w22 w20 w18 w16 + 25172, 5906, -5906, -16819, // w23 w21 w19 w17 + 16819, 5906, 5906, 25172, // w30 w28 w26 w24 + -29692, 25172, -16819, -29692, // w31 w29 w27 w25 + + //row3 + 19266, 19266, 25172, -10426, // w09 w01 w08 w00 + 19266, 19266, 10426, -25172, // w13 w05 w12 w04 + 19266, -19266, 10426, 25172, // w11 w03 w10 w02 + -19266, 19266, -25172, -10426, // w15 w07 w14 w06, + 26722, 15137, 22654, -26722, // w22 w20 w18 w16 + 22654, 5315, -5315, -15137, // w23 w21 w19 w17 + 15137, 5315, 5315, 22654, // w30 w28 w26 w24 + -26722, 22654, -15137, -26722, // w31 w29 w27 w25, + + //row4 + 16384, 16384, 21407, -8867, // w09 w01 w08 w00 + 16384, 16384, 8867, -21407, // w13 w05 w12 w04 + 16384, -16384, 8867, 21407, // w11 w03 w10 w02 + -16384, 16384, -21407, -8867, // w15 w07 w14 w06 + 22725, 12873, 19266, -22725, // w22 w20 w18 w16 + 19266, 4520, -4520, -12873, // w23 w21 w19 w17 + 12873, 4520, 4520, 19266, // w30 w28 w26 w24 + -22725, 19266, -12873, -22725, // w31 w29 w27 w25 + + //row5 + 19266, 19266, 25172, -10426, // w09 w01 w08 w00 + 19266, 19266, 10426, -25172, // w13 w05 w12 w04 + 19266, -19266, 10426, 25172, // w11 w03 w10 w02 + -19266, 19266, -25172, -10426, // w15 w07 w14 w06 + 26722, 15137, 22654, -26722, // w22 w20 w18 w16 + 22654, 5315, -5315, -15137, // w23 w21 w19 w17 + 15137, 5315, 5315, 22654, // w30 w28 w26 w24 + -26722, 22654, -15137, -26722, // w31 w29 w27 w25 + + //row6 + 21407, 21407, 27969, -11585, // w09 w01 w08 w00 + 21407, 21407, 11585, -27969, // w13 w05 w12 w04 + 21407, -21407, 11585, 27969, // w11 w03 w10 w02 + -21407, 21407, -27969, -11585, // w15 w07 w14 w06, + 29692, 16819, 25172, -29692, // w22 w20 w18 w16 + 25172, 5906, -5906, -16819, // w23 w21 w19 w17 + 16819, 5906, 5906, 25172, // w30 w28 w26 w24 + -29692, 25172, -16819, -29692, // w31 w29 w27 w25, + + //row7 + 22725, 22725, 29692, -12299, // w09 w01 w08 w00 + 22725, 22725, 12299, -29692, // w13 w05 w12 w04 + 22725, -22725, 12299, 29692, // w11 w03 w10 w02 + -22725, 22725, -29692, -12299, // w15 w07 w14 w06, + 31521, 17855, 26722, -31521, // w22 w20 w18 w16 + 26722, 6270, -6270, -17855, // w23 w21 w19 w17 + 17855, 6270, 6270, 26722, // w30 w28 w26 w24 + -31521, 26722, -17855, -31521 // w31 w29 w27 w25 + }; + + + + void + fdct_mm32( short *blk ) + { + static __int64 xt70[2]; // xt7xt6xt5xt4, xt3xt2xt1xt0 + static int a0, a1, a2, a3, b0, b1, b2, b3; + static short *sptr, *optr, *tf; // tf = table_ptr + static short *xt = (short *) &xt70[0]; + static int j; + + const static short _tg_1_16 = 13036; //tg * (2<<16) + 0.5 + const static short _tg_2_16 = 27146; //tg * (2<<16) + 0.5 + const static short _tg_3_16 =-21746; //tg * (2<<16) + 0.5 + const static short _cos_4_16 =-19195; //cos * (2<<16) + 0.5 + const static short _ocos_4_16 = 23170; //cos * (2<<15) + 0.5 + const static short _one_corr = 1; //rounding compensation + + static short t0, t1, t2, t3, t4, t5, t6, t7; + static short tp03, tm03, tp12, tm12, tp65, tm65; + static short tp465, tm465, tp765, tm765; + + __asm { + + //////////////////////////////////////////////////////////////////////// + // + // The high-level pseudocode for the fdct_mm32() routine : + // + // fdct_mm32() + // { + // forward_dct_col03(); // dct_column transform on cols 0-3 + // forward_dct_col47(); // dct_column transform on cols 4-7 + // for ( j = 0; j < 8; j=j+1 ) + // forward_dct_row1(j); // dct_row transform on row #j + // } + + mov INP, dword ptr [blk]; ;// input data is row 0 of blk[] + ;// transform the left half of the matrix (4 columns) + + lea TABLEF, dword ptr [tg_all_16]; + mov OUT, INP; + + // lea round_frw_col, dword ptr [r_frw_col] + // for ( i = 0; i < 2; i = i + 1) + // the for-loop is executed twice. We are better off unrolling the + // loop to avoid branch misprediction. + mmx32_fdct_col03: // begin processing columns 0-3 + movq mm0, [x1] ; 0 ; x1 + ;// + + movq mm1, [x6] ; 1 ; x6 + movq mm2, mm0 ; 2 ; x1 + + movq mm3, [x2] ; 3 ; x2 + paddsw mm0, mm1 ; t1 = x[1] + x[6] + + movq mm4, [x5] ; 4 ; x5 + psllw mm0, SHIFT_FRW_COL ; t1 + + movq mm5, [x0] ; 5 ; x0 + paddsw mm4, mm3 ; t2 = x[2] + x[5] + + paddsw mm5, [x7] ; t0 = x[0] + x[7] + psllw mm4, SHIFT_FRW_COL ; t2 + + movq mm6, mm0 ; 6 ; t1 + psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] + + movq mm1, qword ptr [tg_2_16] ; 1 ; tg_2_16 + psubsw mm0, mm4 ; tm12 = t1 - t2 + + movq mm7, [x3] ; 7 ; x3 + pmulhw mm1, mm0 ; tm12*tg_2_16 + + paddsw mm7, [x4] ; t3 = x[3] + x[4] + psllw mm5, SHIFT_FRW_COL ; t0 + + paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 + psllw mm7, SHIFT_FRW_COL ; t3 + + movq mm4, mm5 ; 4 ; t0 + psubsw mm5, mm7 ; tm03 = t0 - t3 + + paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 + paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 + + por mm1, qword ptr one_corr ; correction y2 +0.5 + psllw mm2, SHIFT_FRW_COL+1 ; t6 + + pmulhw mm5, qword ptr [tg_2_16] ; tm03*tg_2_16 + movq mm7, mm4 ; 7 ; tp03 + + psubsw mm3, [x5] ; t5 = x[2] - x[5] + psubsw mm4, mm6 ; y4 = tp03 - tp12 + + movq [y2], mm1 ; 1 ; save y2 + paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 + + movq mm1, [x3] ; 1 ; x3 + psllw mm3, SHIFT_FRW_COL+1 ; t5 + + psubsw mm1, [x4] ; t4 = x[3] - x[4] + movq mm6, mm2 ; 6 ; t6 + + movq [y4], mm4 ; 4 ; save y4 + paddsw mm2, mm3 ; t6 + t5 + + pmulhw mm2, qword ptr [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 + psubsw mm6, mm3 ; 3 ; t6 - t5 + + pmulhw mm6, qword ptr [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 + psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 + + por mm5, qword ptr one_corr ; correction y6 +0.5 + psllw mm1, SHIFT_FRW_COL ; t4 + + por mm2, qword ptr one_corr ; correction tp65 +0.5 + movq mm4, mm1 ; 4 ; t4 + + movq mm3, [x0] ; 3 ; x0 + paddsw mm1, mm6 ; tp465 = t4 + tm65 + + psubsw mm3, [x7] ; t7 = x[0] - x[7] + psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 + + movq mm0, qword ptr [tg_1_16] ; 0 ; tg_1_16 + psllw mm3, SHIFT_FRW_COL ; t7 + + movq mm6, qword ptr [tg_3_16] ; 6 ; tg_3_16 + pmulhw mm0, mm1 ; tp465*tg_1_16 + + movq [y0], mm7 ; 7 ; save y0 + pmulhw mm6, mm4 ; tm465*tg_3_16 + + movq [y6], mm5 ; 5 ; save y6 + movq mm7, mm3 ; 7 ; t7 + + movq mm5, qword ptr [tg_3_16] ; 5 ; tg_3_16 + psubsw mm7, mm2 ; tm765 = t7 - tp65 + + paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 + pmulhw mm5, mm7 ; tm765*tg_3_16 + + paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 + paddsw mm6, mm4 ; tm465*tg_3_16 + + pmulhw mm3, qword ptr [tg_1_16] ; tp765*tg_1_16 + ;// + + por mm0, qword ptr one_corr ; correction y1 +0.5 + paddsw mm5, mm7 ; tm765*tg_3_16 + + psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 + add INP, 0x08 ; // increment pointer + + movq [y1], mm0 ; 0 ; save y1 + paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 + + movq [y3], mm7 ; 7 ; save y3 + psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 + + movq [y5], mm5 ; 5 ; save y5 + + + mmx32_fdct_col47: // begin processing columns 4-7 + movq mm0, [x1] ; 0 ; x1 + ;// + movq [y7], mm3 ; 3 ; save y7 (columns 0-4) + ;// + + movq mm1, [x6] ; 1 ; x6 + movq mm2, mm0 ; 2 ; x1 + + movq mm3, [x2] ; 3 ; x2 + paddsw mm0, mm1 ; t1 = x[1] + x[6] + + movq mm4, [x5] ; 4 ; x5 + psllw mm0, SHIFT_FRW_COL ; t1 + + movq mm5, [x0] ; 5 ; x0 + paddsw mm4, mm3 ; t2 = x[2] + x[5] + + paddsw mm5, [x7] ; t0 = x[0] + x[7] + psllw mm4, SHIFT_FRW_COL ; t2 + + movq mm6, mm0 ; 6 ; t1 + psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] + + movq mm1, qword ptr [tg_2_16] ; 1 ; tg_2_16 + psubsw mm0, mm4 ; tm12 = t1 - t2 + + movq mm7, [x3] ; 7 ; x3 + pmulhw mm1, mm0 ; tm12*tg_2_16 + + paddsw mm7, [x4] ; t3 = x[3] + x[4] + psllw mm5, SHIFT_FRW_COL ; t0 + + paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 + psllw mm7, SHIFT_FRW_COL ; t3 + + movq mm4, mm5 ; 4 ; t0 + psubsw mm5, mm7 ; tm03 = t0 - t3 + + paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 + paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 + + por mm1, qword ptr one_corr ; correction y2 +0.5 + psllw mm2, SHIFT_FRW_COL+1 ; t6 + + pmulhw mm5, qword ptr [tg_2_16] ; tm03*tg_2_16 + movq mm7, mm4 ; 7 ; tp03 + + psubsw mm3, [x5] ; t5 = x[2] - x[5] + psubsw mm4, mm6 ; y4 = tp03 - tp12 + + movq [y2+8], mm1 ; 1 ; save y2 + paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 + + movq mm1, [x3] ; 1 ; x3 + psllw mm3, SHIFT_FRW_COL+1 ; t5 + + psubsw mm1, [x4] ; t4 = x[3] - x[4] + movq mm6, mm2 ; 6 ; t6 + + movq [y4+8], mm4 ; 4 ; save y4 + paddsw mm2, mm3 ; t6 + t5 + + pmulhw mm2, qword ptr [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 + psubsw mm6, mm3 ; 3 ; t6 - t5 + + pmulhw mm6, qword ptr [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 + psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 + + por mm5, qword ptr one_corr ; correction y6 +0.5 + psllw mm1, SHIFT_FRW_COL ; t4 + + por mm2, qword ptr one_corr ; correction tp65 +0.5 + movq mm4, mm1 ; 4 ; t4 + + movq mm3, [x0] ; 3 ; x0 + paddsw mm1, mm6 ; tp465 = t4 + tm65 + + psubsw mm3, [x7] ; t7 = x[0] - x[7] + psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 + + movq mm0, qword ptr [tg_1_16] ; 0 ; tg_1_16 + psllw mm3, SHIFT_FRW_COL ; t7 + + movq mm6, qword ptr [tg_3_16] ; 6 ; tg_3_16 + pmulhw mm0, mm1 ; tp465*tg_1_16 + + movq [y0+8], mm7 ; 7 ; save y0 + pmulhw mm6, mm4 ; tm465*tg_3_16 + + movq [y6+8], mm5 ; 5 ; save y6 + movq mm7, mm3 ; 7 ; t7 + + movq mm5, qword ptr [tg_3_16] ; 5 ; tg_3_16 + psubsw mm7, mm2 ; tm765 = t7 - tp65 + + paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 + pmulhw mm5, mm7 ; tm765*tg_3_16 + + paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 + paddsw mm6, mm4 ; tm465*tg_3_16 + + pmulhw mm3, qword ptr [tg_1_16] ; tp765*tg_1_16 + ;// + + por mm0, qword ptr one_corr ; correction y1 +0.5 + paddsw mm5, mm7 ; tm765*tg_3_16 + + psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 + ;// + + movq [y1+8], mm0 ; 0 ; save y1 + paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 + + movq [y3+8], mm7 ; 7 ; save y3 + psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 + + movq [y5+8], mm5 ; 5 ; save y5 + + movq [y7+8], mm3 ; 3 ; save y7 + + // emms; + // } // end of forward_dct_col07() + // done with dct_col transform + + + //////////////////////////////////////////////////////////////////////// + // + // fdct_mmx32_rows() -- + // the following subroutine performs the row-transform operation, + // + // The output is stored into blk[], destroying the original + // source data. + + // v1.01 - output is range-clipped to {-2048, +2047} + + mov INP, dword ptr [blk]; ;// row 0 + mov edi, 0x08; //x = 8 + + lea TABLE, dword ptr [tab_frw_01234567]; // row 0 + mov OUT, INP; + + lea round_frw_row, dword ptr [r_frw_row]; + // for ( x = 8; x > 0; --x ) // transform 1 row per iteration + + // ---------- loop begin + lp_mmx_fdct_row1: + movd mm5, dword ptr [INP+12]; // mm5 = 7 6 + + punpcklwd mm5, dword ptr [INP+8] // mm5 = 5 7 4 6 + + movq mm2, mm5; // mm2 = 5 7 4 6 + psrlq mm5, 32; // mm5 = _ _ 5 7 + + movq mm0, qword ptr [INP]; // mm0 = 3 2 1 0 + punpcklwd mm5, mm2;// mm5 = 4 5 6 7 + + movq mm1, mm0; // mm1 = 3 2 1 0 + paddsw mm0, mm5; // mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + psubsw mm1, mm5; // mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + movq mm2, mm0; // mm2 = [ xt3 xt2 xt1 xt0 ] + + //movq [ xt3xt2xt1xt0 ], mm0; // debugging + //movq [ xt7xt6xt5xt4 ], mm1; // debugging + + punpcklwd mm0, mm1;// mm0 = [ xt5 xt1 xt4 xt0 ] + + punpckhwd mm2, mm1;// mm2 = [ xt7 xt3 xt6 xt2 ] + movq mm1, mm2; // mm1 + + ;// shuffle bytes around + + // movq mm0, qword ptr [INP] ; 0 ; x3 x2 x1 x0 + + // movq mm1, qword ptr [INP+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, qword ptr [TABLE] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + movq mm4, qword ptr [TABLE+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, qword ptr [TABLE+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + pmaddwd mm0, qword ptr [TABLE+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + movq mm7, qword ptr [TABLE+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + //mm3 = a1, a0 (y2,y0) + //mm1 = b1, b0 (y3,y1) + //mm0 = a3,a2 (y6,y4) + //mm5 = b3,b2 (y7,y5) + + paddd mm3, qword ptr [round_frw_row] ; +rounder (y2,y0) + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, qword ptr [TABLE+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) // now ( y2, y0) + + pmaddwd mm5, qword ptr [TABLE+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + ;// + + pmaddwd mm6, qword ptr [TABLE+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) // now ( y3, y1) + + paddd mm0, qword ptr [round_frw_row] ; +rounder (y6,y4) + psrad mm3, SHIFT_FRW_ROW_CLIP1 ;// (y2, y0) + + paddd mm1, qword ptr [round_frw_row] ; +rounder (y3,y1) + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) // now (y6, y4) + + paddd mm5, qword ptr [round_frw_row] ; +rounder (y7,y5) + psrad mm1, SHIFT_FRW_ROW_CLIP1 ;// y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) // now ( y7, y5) + psrad mm0, SHIFT_FRW_ROW_CLIP1 ;//y3=a3+b3 y2=a2+b2 + + add OUT, 16; // increment row-output address by 1 row + psrad mm5, SHIFT_FRW_ROW_CLIP1;// y4=a3-b3 y5=a2-b2 + + add INP, 16; // increment row-address by 1 row + packssdw mm3, mm0 ;// 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + packssdw mm1, mm5 ;// 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + movq mm6, mm3; // mm0 = y6 y4 y2 y0 + + punpcklwd mm3, mm1; // y3 y2 y1 y0 + sub edi, 0x01; // i = i - 1 + + punpckhwd mm6, mm1; // y7 y6 y5 y4 + add TABLE,64; // increment to next table + + psraw mm3, SHIFT_FRW_ROW_CLIP2; // descale [y3 y2 y1 y0] to {-2048,+2047} + + psraw mm6, SHIFT_FRW_ROW_CLIP2; // descale [y7 y6 y5 y4] to {-2048,+2047} + + movq qword ptr [OUT-16], mm3 ; 1 ; save y3 y2 y1 y0 + + movq qword ptr [OUT-8], mm6 ; 7 ; save y7 y6 y5 y4 + + cmp edi, 0x00; + jg lp_mmx_fdct_row1; // begin fdct processing on next row + emms; + } + + /* + //////////////////////////////////////////////////////////////////////// + // + // DCT_8_FRW_COL(), equivalent c_code + // + // This C-code can be substituted for the same __asm block + // + // I found several *DISCREPANCIES* between the AP-922 C-listing + // and actual corrected code (shown below). + // + //////////////////////////////////////////////////////////////////////// + + sptr = (short *) blk; + optr = (short *) blk; // output will overwrite source data! + + for ( j = 0; j < 8; j=j+1 ) // dct_frw_col1 loop + { + // read source-data column #j into xt[0..7] + xt[7] = sptr[7*8]; + xt[6] = sptr[6*8]; + xt[5] = sptr[5*8]; + xt[4] = sptr[4*8]; + + xt[3] = sptr[3*8]; + xt[2] = sptr[2*8]; + xt[1] = sptr[1*8]; + xt[0] = sptr[0*8]; + + #define LEFT_SHIFT( x ) ((x) << (SHIFT_FRW_COL) ) // left shift + #define LEFT_SHIFT1( x ) ((x) << (SHIFT_FRW_COL+1) ) // left shift+1 + + t0 = LEFT_SHIFT ( xt[0] + xt[7] ); + t1 = LEFT_SHIFT ( xt[1] + xt[6] ); + t2 = LEFT_SHIFT ( xt[2] + xt[5] ); + t3 = LEFT_SHIFT ( xt[3] + xt[4] ); + t4 = LEFT_SHIFT ( xt[3] - xt[4] ); + t5 = LEFT_SHIFT1( xt[2] - xt[5] ); // *** DISCREPANCY + t6 = LEFT_SHIFT1( xt[1] - xt[6] ); // *** DISCREPANCY + t7 = LEFT_SHIFT ( xt[0] - xt[7] ); + + tp03 = t0 + t3; + tm03 = t0 - t3; + tp12 = t1 + t2; + tm12 = t1 - t2; + + // pmulhw/pmulhrw emulation macros + #define X86_PMULHW( X ) ((short) ( ((int)X)>>16 )) //Intel MMX + //#define X86_PMULHRW( X ) ((short) ( ( (((int)X)>>15)+1) >>1) ) //3DNow-MMX + + optr[0*8] = tp03 + tp12; + optr[4*8] = tp03 - tp12; + optr[2*8] = tm03 + X86_PMULHW( tm12 * _tg_2_16 ); + optr[2*8] = optr[2*8] | _one_corr; // one_correction + optr[6*8] = X86_PMULHW( tm03 * _tg_2_16 ) - tm12; + optr[6*8] = optr[6*8] | _one_corr; // one_correction + + tp65 = X86_PMULHW( (t6 +t5 )*_ocos_4_16 ); // *** DISCREPANCY + tp65 = tp65 | _one_corr; // one_correction + tm65 = X86_PMULHW( (t6 -t5 )*_ocos_4_16 ); // *** DISCREPANCY + + tp765 = t7 + tp65; + tm765 = t7 - tp65; + tp465 = t4 + tm65; + tm465 = t4 - tm65; + + optr[1*8] = tp765 + X86_PMULHW( tp465 * _tg_1_16 ); + optr[1*8] = optr[1*8] | _one_corr; // one_correction + optr[7*8] = X86_PMULHW( tp765 * _tg_1_16 ) - tp465; + + // optr[5*8] = X86_PMULHW( tm765 * _tg_3_16 ) + tm465; // *** DISCREPANCY + // from pg8 of AP-922, ICONST = [ const*(2^16) + 0.5 ] + // const * x = PMULHW( ICONST,x ) + x + // The constant "tg_3_16" > 0.5, thus _tg_3_16 is encoded as tg_3_16-1.0 + // optr[5*8] = X86_PMULHW( tm765 * ( tg_3_16 - 1.0 ) ) + tm465 + // = [tm765*tg_3_16 - tm765] + tm465 + // + // optr[5*8] + tm765 = [ tm765*tg_3_16 ] + tm465 + tm765 + // = [ tm765*tg_3_16 ] + tm465 <-- what we want + + optr[5*8] = X86_PMULHW( tm765 * _tg_3_16 ) + tm465 + tm765; + + // optr[3*8] = tm765 - X86_PMULHW( tm465 * _tg_3_16 ); // *** DISCREPANCY + // The following operations must be performed in the shown order! + // same trick (as shown for optr[5*8]) applies to optr[3*8] + + optr[3*8] = X86_PMULHW( tm465 * _tg_3_16 ) + tm465; + optr[3*8] = tm765 - optr[3*8]; + + ++sptr; // increment source pointer +1 column + ++optr; // increment output pointer +1 column + } // end for ( j = 0 ..., end of C_equivalent code for forward_dct_col_1 + + //////////////////////////////////////////////////////////////////////// + // + // DCT8_FRW_ROW1(), equivalent c_code + // + // This C-code can be substituted for the same __asm block + // For a derivation of this code, please read fdctmm32.doc + //////////////////////////////////////////////////////////////////////// + + sptr = (short *) blk; + optr = (short *) blk; // output will overwrite source data! + tf = &tab_frw_01234567[ 0 ]; // fdct_row load table_forward_w + + for ( j = 0; j < 8; j=j+1 ) // dct_frw_row1 loop + { + // forward_dct_row input arithmetic + shuffle + xt[3] = sptr[3] + sptr[4]; + xt[2] = sptr[2] + sptr[5]; + xt[1] = sptr[1] + sptr[6]; + xt[0] = sptr[0] + sptr[7]; + + xt[7] = sptr[3] - sptr[4]; + xt[6] = sptr[2] - sptr[5]; + xt[5] = sptr[1] - sptr[6]; + xt[4] = sptr[0] - sptr[7]; + + + a3 = ( xt[0]*tf[10]+ xt[2]*tf[11]) + ( xt[1]*tf[14]+ xt[3]*tf[15]); + a2 = ( xt[0]*tf[8] + xt[2]*tf[9] ) + ( xt[1]*tf[12]+ xt[3]*tf[13]); + a1 = ( xt[0]*tf[2] + xt[2]*tf[3] ) + ( xt[1]*tf[6] + xt[3]*tf[7] ); + a0 = ( xt[0]*tf[0] + xt[2]*tf[1] ) + ( xt[1]*tf[4] + xt[3]*tf[5] ); + tf += 16; // increment table pointer + + b3 = ( xt[4]*tf[10]+ xt[6]*tf[11]) + ( xt[5]*tf[14]+ xt[7]*tf[15]); + b2 = ( xt[4]*tf[8] + xt[6]*tf[9] ) + ( xt[5]*tf[12]+ xt[7]*tf[13]); + b1 = ( xt[4]*tf[2] + xt[6]*tf[3] ) + ( xt[5]*tf[6] + xt[7]*tf[7] ); + b0 = ( xt[4]*tf[0] + xt[6]*tf[1] ) + ( xt[5]*tf[4] + xt[7]*tf[5] ); + tf += 16; // increment table pointer + + // apply rounding constants to scaled elements + // note, in the MMX implementation, the shift&round is done *last.* + // Here, the C-code applies the shifts 1st, then the clipping. + #define SHIFT_AND_ROUND_FRW_ROW( x ) ( ((x)+RND_FRW_ROW) >> SHIFT_FRW_ROW ) + + a3 = SHIFT_AND_ROUND_FRW_ROW( a3 ); + a2 = SHIFT_AND_ROUND_FRW_ROW( a2 ); + a1 = SHIFT_AND_ROUND_FRW_ROW( a1 ); + a0 = SHIFT_AND_ROUND_FRW_ROW( a0 ); + + b3 = SHIFT_AND_ROUND_FRW_ROW( b3 ); + b2 = SHIFT_AND_ROUND_FRW_ROW( b2 ); + b1 = SHIFT_AND_ROUND_FRW_ROW( b1 ); + b0 = SHIFT_AND_ROUND_FRW_ROW( b0 ); + + // v1.01, clip output results to range {-2048, +2047} + + // In the MMX implementation, the "clipper" is integrated into + // the shift&round operation (thanks to packssdw) + a3 = (a3 > 2047) ? 2047 : a3; // ceiling @ +2047 + a2 = (a2 > 2047) ? 2047 : a2; // ceiling @ +2047 + a1 = (a1 > 2047) ? 2047 : a1; // ceiling @ +2047 + a0 = (a0 > 2047) ? 2047 : a0; // ceiling @ +2047 + b3 = (b3 > 2047) ? 2047 : b3; // ceiling @ +2047 + b2 = (b2 > 2047) ? 2047 : b2; // ceiling @ +2047 + b1 = (b1 > 2047) ? 2047 : b1; // ceiling @ +2047 + b0 = (b0 > 2047) ? 2047 : b0; // ceiling @ +2047 + + a3 = (a3 <-2048) ? -2048 : a3; // floor @ -2048 + a2 = (a2 <-2048) ? -2048 : a2; // floor @ -2048 + a1 = (a1 <-2048) ? -2048 : a1; // floor @ -2048 + a0 = (a0 <-2048) ? -2048 : a0; // floor @ -2048 + b3 = (b3 <-2048) ? -2048 : b3; // floor @ -2048 + b2 = (b2 <-2048) ? -2048 : b2; // floor @ -2048 + b1 = (b1 <-2048) ? -2048 : b1; // floor @ -2048 + b0 = (b0 <-2048) ? -2048 : b0; // floor @ -2048 + + + // forward_dct_row, assign outputs + optr[ 3 ] = b1; + optr[ 2 ] = a1; + optr[ 1 ] = b0; + optr[ 0 ] = a0; + + optr[ 7 ] = b3; + optr[ 6 ] = a3; + optr[ 5 ] = b2; + optr[ 4 ] = a2; + + sptr += 8; // increment source pointer +1 row + optr += 8; // increment output pointer +1 row + } // end for ( j = 0 ..., end of C_equivalent code for forward_dct_row_1 + */ + } // fdct_mm32( short *blk ) + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/text_idct_mmx.c bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/text_idct_mmx.c *** bcast-2000c/quicktime/encore2/src/intel_mmx/text_idct_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/text_idct_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,571 ---- + + /************************************************************************** + * * + * This code is developed by John Funnell. This software is an * + * an implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * text_idct_mmx.c + * + * Copyright (C) 2001 Project Mayo + * + * John Funnell + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains idct functions with MMX optimization. */ + /* Please see acknowledgement below. */ + + /* + ; + ; MMX iDCT + ; + ; Originally provided by Intel at AP-922 + ; http://developer.intel.com/vtune/cbts/strmsimd/922down.htm + ; (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm) + ; but in a limited edition. + ; New macro implements a column part for precise iDCT + ; The routine precision now satisfies IEEE standard 1180-1990. + ; + ; Copyright (c) 2000-2001 Peter Gubanov + ; Rounding trick Copyright (c) 2000 Michel Lespinasse + ; + ; http://www.elecard.com/peter/idct.html + ; http://www.linuxvideo.org/mpeg2dec/ + ; + ; Conversion to MS-style inline C format (c) 2001 Project Mayo Inc. John Funnell + ; + ; Version v1.0.0 10 January 2001 + ; + */ + + + /* + if you are not setting the name of you MMX idct function with compile flag MMX_IDCT_NAME, + then you need to choose a name to insert in here: + */ + #define DEFAULT_FUNCTION_NAME Fast_IDCT + + + + #ifndef MMX_IDCT_NAME + #define MMX_IDCT_NAME DEFAULT_FUNCTION_NAME + #endif + + + + /* some types */ + #define int16_t short + #define int32_t int + #define uint64_t unsigned __int64 + + #define MPTR qword ptr + + + /* some conversions from readable integer constants to qwords */ + #define SHORT4_TO_QWORD(A, B, C, D) ( \ + ( ( ((uint64_t)(A)) & ((uint64_t)(0xffff)) ) << 0 ) | \ + ( ( ((uint64_t)(B)) & ((uint64_t)(0xffff)) ) << 16 ) | \ + ( ( ((uint64_t)(C)) & ((uint64_t)(0xffff)) ) << 32 ) | \ + ( ( ((uint64_t)(D)) & ((uint64_t)(0xffff)) ) << 48 ) ) + + #define INT2_TO_QWORD(A, B) ( \ + ( ( ((uint64_t)(A)) & ((uint64_t)(0xffffffff)) ) << 0 ) | \ + ( ( ((uint64_t)(B)) & ((uint64_t)(0xffffffff)) ) << 32 ) ) + + + + + #define BITS_INV_ACC 5 /* 4 or 5 for IEEE */ + #define SHIFT_INV_ROW (16 - BITS_INV_ACC) + #define SHIFT_INV_COL (1 + BITS_INV_ACC) + #define RND_INV_ROW (1024 * (6 - BITS_INV_ACC)) /* 1 << (SHIFT_INV_ROW-1) */ + #define RND_INV_COL (16 * (BITS_INV_ACC - 3)) /* 1 << (SHIFT_INV_COL-1) */ + #define RND_INV_CORR (RND_INV_COL - 1) /* correction -1.0 and round */ + #define BITS_FRW_ACC 3 /* 2 or 3 for accuracy */ + #define SHIFT_FRW_COL BITS_FRW_ACC + #define SHIFT_FRW_ROW (BITS_FRW_ACC + 17) + #define RND_FRW_ROW (262144 * (BITS_FRW_ACC - 1)) /* 1 << (SHIFT_FRW_ROW-1) */ + + + + + + + static const uint64_t tg_1_16 = SHORT4_TO_QWORD( 13036, 13036, 13036, 13036 ); + static const uint64_t tg_2_16 = SHORT4_TO_QWORD( 27146, 27146, 27146, 27146 ); + static const uint64_t tg_3_16 = SHORT4_TO_QWORD(-21746, -21746, -21746, -21746 ); + static const uint64_t ocos_4_16 = SHORT4_TO_QWORD( 23170, 23170, 23170, 23170 ); + + + + + /* rounding value that is added before the row transform's rounding */ + + + #if SHIFT_INV_ROW == 12 + static const uint64_t rounder[8] = { + INT2_TO_QWORD( 65536, 65536), /* rounder_0 */ + INT2_TO_QWORD( 7195, 7195), /* rounder_1 */ + INT2_TO_QWORD( 4520, 4520), /* rounder_2 */ + INT2_TO_QWORD( 2407, 2407), /* rounder_3 */ + INT2_TO_QWORD( 0, 0), /* rounder_4 */ + INT2_TO_QWORD( 240, 240), /* rounder_5 */ + INT2_TO_QWORD( 1024, 1024), /* rounder_6 */ + INT2_TO_QWORD( 1024, 1024) /* rounder_7 */ + }; + #elif SHIFT_INV_ROW == 11 + static const uint64_t rounder[2*8] = { + INT2_TO_QWORD( 65536, 65536), /* rounder_0 */ + INT2_TO_QWORD( 3597, 3597), /* rounder_1 */ + INT2_TO_QWORD( 2260, 2260), /* rounder_2 */ + INT2_TO_QWORD( 1203, 1203), /* rounder_3 */ + INT2_TO_QWORD( 0, 0), /* rounder_4 */ + INT2_TO_QWORD( 120, 120), /* rounder_5 */ + INT2_TO_QWORD( 512, 512), /* rounder_6 */ + INT2_TO_QWORD( 512, 512) /* rounder_7 */ + }; + #endif + + + + /* + ;============================================================================= + ; + ; The first stage iDCT 8x8 - inverse DCTs of rows + ; + ;----------------------------------------------------------------------------- + ; The 8-point inverse DCT direct algorithm + ;----------------------------------------------------------------------------- + ; + ; static const short w[32] = { + ; FIX(cos_4_16), FIX(cos_2_16), FIX(cos_4_16), FIX(cos_6_16), + ; FIX(cos_4_16), FIX(cos_6_16), -FIX(cos_4_16), -FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_6_16), -FIX(cos_4_16), FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_2_16), FIX(cos_4_16), -FIX(cos_6_16), + ; FIX(cos_1_16), FIX(cos_3_16), FIX(cos_5_16), FIX(cos_7_16), + ; FIX(cos_3_16), -FIX(cos_7_16), -FIX(cos_1_16), -FIX(cos_5_16), + ; FIX(cos_5_16), -FIX(cos_1_16), FIX(cos_7_16), FIX(cos_3_16), + ; FIX(cos_7_16), -FIX(cos_5_16), FIX(cos_3_16), -FIX(cos_1_16) }; + ; + ; #define DCT_8_INV_ROW(x, y) + ;{ + ; int a0, a1, a2, a3, b0, b1, b2, b3; + ; + ; a0 =x[0]*w[0]+x[2]*w[1]+x[4]*w[2]+x[6]*w[3]; + ; a1 =x[0]*w[4]+x[2]*w[5]+x[4]*w[6]+x[6]*w[7]; + ; a2 = x[0] * w[ 8] + x[2] * w[ 9] + x[4] * w[10] + x[6] * w[11]; + ; a3 = x[0] * w[12] + x[2] * w[13] + x[4] * w[14] + x[6] * w[15]; + ; b0 = x[1] * w[16] + x[3] * w[17] + x[5] * w[18] + x[7] * w[19]; + ; b1 = x[1] * w[20] + x[3] * w[21] + x[5] * w[22] + x[7] * w[23]; + ; b2 = x[1] * w[24] + x[3] * w[25] + x[5] * w[26] + x[7] * w[27]; + ; b3 = x[1] * w[28] + x[3] * w[29] + x[5] * w[30] + x[7] * w[31]; + ; + ; y[0] = SHIFT_ROUND ( a0 + b0 ); + ; y[1] = SHIFT_ROUND ( a1 + b1 ); + ; y[2] = SHIFT_ROUND ( a2 + b2 ); + ; y[3] = SHIFT_ROUND ( a3 + b3 ); + ; y[4] = SHIFT_ROUND ( a3 - b3 ); + ; y[5] = SHIFT_ROUND ( a2 - b2 ); + ; y[6] = SHIFT_ROUND ( a1 - b1 ); + ; y[7] = SHIFT_ROUND ( a0 - b0 ); + ;} + ; + ;----------------------------------------------------------------------------- + ; + ; In this implementation the outputs of the iDCT-1D are multiplied + ; for rows 0,4 - by cos_4_16, + ; for rows 1,7 - by cos_1_16, + ; for rows 2,6 - by cos_2_16, + ; for rows 3,5 - by cos_3_16 + ; and are shifted to the left for better accuracy + ; + ; For the constants used, + ; FIX(float_const) = (short) (float_const * (1<<15) + 0.5) + ; + ;============================================================================= + */ + + + /* + ;============================================================================= + ; code for MMX + ;============================================================================= + ; Table for rows 0,4 - constants are multiplied by cos_4_16 + */ + static const uint64_t tab_i_04[8*8] = { + /* Table for rows 0,4 - constants are multiplied by cos_4_16 */ + SHORT4_TO_QWORD( 16384, 16384, 16384, -16384 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 21407, 8867, 8867, -21407 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 16384, -16384, 16384, 16384 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD( -8867, 21407, -21407, -8867 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 22725, 12873, 19266, -22725 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 19266, 4520, -4520, -12873 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 12873, 4520, 4520, 19266 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-22725, 19266, -12873, -22725 ), /* w31 w29 w27 w25 */ + /* Table for rows 1,7 - constants are multiplied by cos_1_16 */ + SHORT4_TO_QWORD( 22725, 22725, 22725, -22725 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 29692, 12299, 12299, -29692 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 22725, -22725, 22725, 22725 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-12299, 29692, -29692, -12299 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 31521, 17855, 26722, -31521 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 26722, 6270, -6270, -17855 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 17855, 6270, 6270, 26722 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-31521, 26722, -17855, -31521 ), /* w31 w29 w27 w25 */ + /* Table for rows 2,6 - constants are multiplied by cos_2_16 */ + SHORT4_TO_QWORD( 21407, 21407, 21407, -21407 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 27969, 11585, 11585, -27969 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 21407, -21407, 21407, 21407 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-11585, 27969, -27969, -11585 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 29692, 16819, 25172, -29692 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 25172, 5906, -5906, -16819 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 16819, 5906, 5906, 25172 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-29692, 25172, -16819, -29692 ), /* w31 w29 w27 w25 */ + /* Table for rows 3,5 - constants are multiplied by cos_3_16 */ + SHORT4_TO_QWORD( 19266, 19266, 19266, -19266 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 25172, 10426, 10426, -25172 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 19266, -19266, 19266, 19266 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-10426, 25172, -25172, -10426 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 26722, 15137, 22654, -26722 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 22654, 5315, -5315, -15137 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 15137, 5315, 5315, 22654 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-26722, 22654, -15137, -26722 ), /* w31 w29 w27 w25 */ + /* Table for rows 0,4 - constants are multiplied by cos_4_16 */ + SHORT4_TO_QWORD( 16384, 16384, 16384, -16384 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 21407, 8867, 8867, -21407 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 16384, -16384, 16384, 16384 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-8867, 21407, -21407, -8867 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 22725, 12873, 19266, -22725 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 19266, 4520, -4520, -12873 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 12873, 4520, 4520, 19266 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-22725, 19266, -12873, -22725 ), /* w31 w29 w27 w25 */ + /* Table for rows 3,5 - constants are multiplied by cos_3_16 */ + SHORT4_TO_QWORD( 19266, 19266, 19266, -19266 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 25172, 10426, 10426, -25172 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 19266, -19266, 19266, 19266 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-10426, 25172, -25172, -10426 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 26722, 15137, 22654, -26722 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 22654, 5315, -5315, -15137 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 15137, 5315, 5315, 22654 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-26722, 22654, -15137, -26722 ), /* w31 w29 w27 w25 */ + /* Table for rows 2,6 - constants are multiplied by cos_2_16 */ + SHORT4_TO_QWORD( 21407, 21407, 21407, -21407 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 27969, 11585, 11585, -27969 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 21407, -21407, 21407, 21407 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-11585, 27969, -27969, -11585 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 29692, 16819, 25172, -29692 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 25172, 5906, -5906, -16819 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 16819, 5906, 5906, 25172 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-29692, 25172, -16819, -29692 ), /* w31 w29 w27 w25 */ + /* Table for rows 1,7 - constants are multiplied by cos_1_16 */ + SHORT4_TO_QWORD( 22725, 22725, 22725, -22725 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 29692, 12299, 12299, -29692 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 22725, -22725, 22725, 22725 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-12299, 29692, -29692, -12299 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 31521, 17855, 26722, -31521 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 26722, 6270, -6270, -17855 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 17855, 6270, 6270, 26722 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-31521, 26722, -17855, -31521 ), /* w31 w29 w27 w25 */ + }; + + + + uint64_t tempMatrix[64/4]; + + + #define INP eax + #define ROUNDER ebx + #define TABLE ecx + #define OUTP edx + + + + + + /* the function itself */ + void MMX_IDCT_NAME + (int16_t *block) { + __asm { + + push eax + push ebx + push ecx + push edx + push edi + + mov INP, block + lea OUTP, [tempMatrix] + lea TABLE, [tab_i_04] + lea ROUNDER, [rounder] + + mov edi, -8; ; i=-8 + + align 16 + + rowloop: + + movq mm0, MPTR [INP] ; 0 ; x3 x2 x1 x0 + + movq mm1, MPTR [INP+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, MPTR [TABLE] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, MPTR [TABLE+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, MPTR [TABLE+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, MPTR [TABLE+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, MPTR [TABLE+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, MPTR [ROUNDER] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, MPTR [TABLE+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, MPTR [TABLE+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, MPTR [TABLE+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, MPTR [ROUNDER] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq MPTR [OUTP], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq MPTR [OUTP+8], mm7 ; 7 ; save y7 y6 y5 y4 + + + add INP, 16 ; add 1 row to input pointer + add ROUNDER, 8 ; go to next rounding values + add OUTP, 16 ; add 1 row to output pointer + add TABLE,64 ; move to next section of table + + add edi, 1 + jne rowloop; + + + /* column code starts here... */ + + + lea INP, [tempMatrix] + mov OUTP, block + mov edi, -2; ; i=-2 + + align 16 + colloop: + + // movq mm0, MPTR [tg_3_16] + movq mm0, tg_3_16 + + movq mm3, MPTR [INP+16*3] + movq mm1, mm0 ; tg_3_16 + + movq mm5, MPTR [INP+16*5] + pmulhw mm0, mm3 ; x3*(tg_3_16-1) + + // movq mm4, MPTR [tg_1_16] + movq mm4, tg_1_16 + pmulhw mm1, mm5 ; x5*(tg_3_16-1) + + movq mm7, MPTR [INP+16*7] + movq mm2, mm4 ; tg_1_16 + + movq mm6, MPTR [INP+16*1] + pmulhw mm4, mm7 ; x7*tg_1_16 + + paddsw mm0, mm3 ; x3*tg_3_16 + pmulhw mm2, mm6 ; x1*tg_1_16 + + paddsw mm1, mm3 ; x3+x5*(tg_3_16-1) + psubsw mm0, mm5 ; x3*tg_3_16-x5 = tm35 + + // movq mm3, MPTR [ocos_4_16] + movq mm3, ocos_4_16 + paddsw mm1, mm5 ; x3+x5*tg_3_16 = tp35 + + paddsw mm4, mm6 ; x1+tg_1_16*x7 = tp17 + psubsw mm2, mm7 ; x1*tg_1_16-x7 = tm17 + + movq mm5, mm4 ; tp17 + movq mm6, mm2 ; tm17 + + paddsw mm5, mm1 ; tp17+tp35 = b0 + psubsw mm6, mm0 ; tm17-tm35 = b3 + + psubsw mm4, mm1 ; tp17-tp35 = t1 + paddsw mm2, mm0 ; tm17+tm35 = t2 + + // movq mm7, MPTR [tg_2_16] + movq mm7, tg_2_16 + movq mm1, mm4 ; t1 + + ; movq MPTR [SCRATCH+0], mm5 ; save b0 + movq MPTR [OUTP+3*16], mm5 ; save b0 + paddsw mm1, mm2 ; t1+t2 + + ; movq MPTR [SCRATCH+8], mm6 ; save b3 + movq MPTR [OUTP+5*16], mm6 ; save b3 + psubsw mm4, mm2 ; t1-t2 + + movq mm5, MPTR [INP+2*16] + movq mm0, mm7 ; tg_2_16 + + movq mm6, MPTR [INP+6*16] + pmulhw mm0, mm5 ; x2*tg_2_16 + + pmulhw mm7, mm6 ; x6*tg_2_16 + ; slot + pmulhw mm1, mm3 ; ocos_4_16*(t1+t2) = b1/2 + ; slot + movq mm2, MPTR [INP+0*16] + pmulhw mm4, mm3 ; ocos_4_16*(t1-t2) = b2/2 + + psubsw mm0, mm6 ; t2*tg_2_16-x6 = tm26 + movq mm3, mm2 ; x0 + + movq mm6, MPTR [INP+4*16] + paddsw mm7, mm5 ; x2+x6*tg_2_16 = tp26 + + paddsw mm2, mm6 ; x0+x4 = tp04 + psubsw mm3, mm6 ; x0-x4 = tm04 + + movq mm5, mm2 ; tp04 + movq mm6, mm3 ; tm04 + + psubsw mm2, mm7 ; tp04-tp26 = a3 + paddsw mm3, mm0 ; tm04+tm26 = a1 + + paddsw mm1, mm1 ; b1 + paddsw mm4, mm4 ; b2 + + paddsw mm5, mm7 ; tp04+tp26 = a0 + psubsw mm6, mm0 ; tm04-tm26 = a2 + + movq mm7, mm3 ; a1 + movq mm0, mm6 ; a2 + + paddsw mm3, mm1 ; a1+b1 + paddsw mm6, mm4 ; a2+b2 + + psraw mm3, SHIFT_INV_COL ; dst1 + psubsw mm7, mm1 ; a1-b1 + + psraw mm6, SHIFT_INV_COL ; dst2 + psubsw mm0, mm4 ; a2-b2 + + ; movq mm1, MPTR [SCRATCH+0] ; load b0 + movq mm1, MPTR [OUTP+3*16] ; load b0 + psraw mm7, SHIFT_INV_COL ; dst6 + + movq mm4, mm5 ; a0 + psraw mm0, SHIFT_INV_COL ; dst5 + + movq MPTR [OUTP+1*16], mm3 + paddsw mm5, mm1 ; a0+b0 + + movq MPTR [OUTP+2*16], mm6 + psubsw mm4, mm1 ; a0-b0 + + ; movq mm3, MPTR [SCRATCH+8] ; load b3 + movq mm3, MPTR [OUTP+5*16] ; load b3 + psraw mm5, SHIFT_INV_COL ; dst0 + + movq mm6, mm2 ; a3 + psraw mm4, SHIFT_INV_COL ; dst7 + + movq MPTR [OUTP+5*16], mm0 + paddsw mm2, mm3 ; a3+b3 + + movq MPTR [OUTP+6*16], mm7 + psubsw mm6, mm3 ; a3-b3 + + movq MPTR [OUTP+0*16], mm5 + psraw mm2, SHIFT_INV_COL ; dst3 + + movq MPTR [OUTP+7*16], mm4 + psraw mm6, SHIFT_INV_COL ; dst4 + + movq MPTR [OUTP+3*16], mm2 + + movq MPTR [OUTP+4*16], mm6 + + lea INP, [tempMatrix] + mov OUTP, block + add INP, 8 ; add 4 cols to input pointer + add OUTP, 8 ; add 4 cols to output pointer + + add edi, 1 + jne colloop + + pop edi + pop edx + pop ecx + pop ebx + pop eax + + emms + + }; /* __asm */ + + }; diff -C2 -r -N bcast-2000c/quicktime/encore2/src/intel_mmx/transferidct_mmx.c bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/transferidct_mmx.c *** bcast-2000c/quicktime/encore2/src/intel_mmx/transferidct_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/intel_mmx/transferidct_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,510 ---- + #include "../transferidct.h" + + + + + + void EncTransferIDCT_add(uint8_t* pDest, int16_t* pSrc, int stride) + + + { + + + __asm + + + { + + + mov ecx, pDest + + + mov edx, pSrc + + + mov eax, stride + + + mov edi, 8 + + + pxor mm2, mm2 + + + p1: + + + movq mm0, [edx] + + + movq mm1, [edx+8] + + + movq mm3, [ecx] + + + movq mm4, mm3 + + + punpcklbw mm3, mm2 + + + punpckhbw mm4, mm2 + + + paddsw mm0, mm3 + + + paddsw mm1, mm4 + + + packuswb mm0, mm1 + + + movq [ecx], mm0 + + + add edx, 16 + + + add ecx, eax + + + dec edi + + + jnz p1 + + + emms + + + } + + + } + + + + + + void EncTransferIDCT_copy(uint8_t* pDest, int16_t* pSrc, int stride) + + + { + + + _asm { + + + + + + ; not sure about the state handling here - there must be a better way + + + push eax + + + push ebx + + + push edi + + + + + + mov eax, pSrc ; parameter 1, *sourceS16 + + + mov ebx, pDest ; parameter 2, *destU8 + + + mov edi, stride ; parameter 3, stride + + + + + + ; lines 0 to 7 schedueled into each other... + + + movq mm0, qword ptr [eax] ; move first four words into mm0 + + + + + + packuswb mm0, qword ptr [eax+8] ; pack mm0 and the next four words into mm0 + + + + + + movq mm1, qword ptr [eax+16] ; move first four words into mm1 + + + + + + packuswb mm1, qword ptr [eax+24]; pack mm0 and the next four words into mm1 + + + + + + movq mm2, qword ptr [eax+32] ; move first four words into mm2 + + + + + + packuswb mm2, qword ptr [eax+40]; pack mm0 and the next four words into mm2 + + + + + + movq mm3, qword ptr [eax+48] ; move first four words into mm3 + + + + + + packuswb mm3, qword ptr [eax+56] ; pack mm3 and the next four words into mm3 + + + + + + movq qword ptr [ebx], mm0 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm1 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm2 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm3 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq mm0, qword ptr [eax+64] ; move first four words into mm0 + + + add eax, 64 ; add 64 to source ptr + + + + + + packuswb mm0, qword ptr [eax+8] ; pack mm0 and the next four words into mm0 + + + + + + movq mm1, qword ptr [eax+16] ; move first four words into mm1 + + + + + + packuswb mm1, qword ptr [eax+24]; pack mm0 and the next four words into mm1 + + + + + + movq mm2, qword ptr [eax+32] ; move first four words into mm2 + + + + + + packuswb mm2, qword ptr [eax+40]; pack mm0 and the next four words into mm2 + + + + + + movq mm3, qword ptr [eax+48] ; move first four words into mm3 + + + + + + packuswb mm3, qword ptr [eax+56]; pack mm3 and the next four words into mm3 + + + + + + movq qword ptr [ebx], mm0 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm1 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm2 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm3 ; copy output to destination + + + + + + pop edi + + + pop ebx + + + pop eax + + + + + + emms + + + + + + } + + + } + + + + + + void EncTransferFDCT_sub(const uint8_t* pSrc, uint8_t* pSrc2, + + + int16_t* pDest, int stride) + + + { + + + __asm + + + { + + + mov edx, pSrc2 + + + mov ecx, pDest + + + mov eax, stride + + + mov esi, pSrc + + + mov edi, 8 + + + pxor mm1, mm1 + + + p2: + + + movq mm0, [edx] + + + movq mm2, mm0 + + + punpcklbw mm2, mm1 + + + punpckhbw mm0, mm1 + + + movq mm3, [esi] + + + movq mm4, mm3 + + + movq mm5, mm3 + + + punpcklbw mm4, mm1 + + + punpckhbw mm3, mm1 + + + + + + psubsw mm0, mm3 + + + psubsw mm2, mm4 + + + + + + movq [ecx], mm2 + + + movq [ecx+8], mm0 + + + movq [edx], mm5 + + + + + + add ecx, 16 + + + add edx, eax + + + add esi, eax + + + dec edi + + + jnz p2 + + + emms + + + } + + + } + + + + + + void EncTransferFDCT_copy(uint8_t* pSrc, int16_t* pDest, int stride) + + + { + + + __asm + + + { + + + mov ecx, pDest + + + mov edx, pSrc + + + mov eax, stride + + + mov edi, 8 + + + pxor mm1, mm1 + + + p3: + + + movq mm0, [edx] + + + movq mm2, mm0 + + + punpcklbw mm2, mm1 + + + movq [ecx], mm2 + + + punpckhbw mm0, mm1 + + + movq [ecx+8], mm0 + + + add ecx, 16 + + + add edx, eax + + + dec edi + + + jnz p3 + + + emms + + + } + + + } + + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbcoding/.#mbcoding.c.1.2 bcast-2000c-mf3/quicktime/encore2/src/mbcoding/.#mbcoding.c.1.2 *** bcast-2000c/quicktime/encore2/src/mbcoding/.#mbcoding.c.1.2 Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbcoding/.#mbcoding.c.1.2 Mon Dec 3 18:31:36 2001 *************** *** 0 **** --- 1,331 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + + + /************************************************************************** + * + * MBCoding.c + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + /************************************************************************** + * + * Modifications: + * + * 02.11.2001 cleanup; removed ancient debug stuff + * 24.08.2001 INTER_Q MBs shouldn't be skipped + * 22.08.2001 support for MODE_INTRA_Q/MODE_INTER_Q encoding modes + * + * Michael Militzer + * + **************************************************************************/ + + #include "putvlc.h" + #include "enc_mbfunctions.h" + + + + static const uint8_t zig_zag_scan[64] = { + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 + }; + + + + // other scan orders + + static const uint8_t alternate_horizontal_scan[64] = { + 0, 1, 2, 3, 8, 9, 16, 17, + 10, 11, 4, 5, 6, 7, 15, 14, + 13, 12, 19, 18, 24, 25, 32, 33, + 26, 27, 20, 21, 22, 23, 28, 29, + 30, 31, 34, 35, 40, 41, 48, 49, + 42, 43, 36, 37, 38, 39, 44, 45, + 46, 47, 50, 51, 56, 57, 58, 59, + 52, 53, 54, 55, 60, 61, 62, 63 + }; + + + + static const uint8_t alternate_vertical_scan[64] = { + 0, 8, 16, 24, 1, 9, 2, 10, + 17, 25, 32, 40, 48, 56, 57, 49, + 41, 33, 26, 18, 3, 11, 4, 12, + 19, 27, 34, 42, 50, 58, 35, 43, + 51, 59, 20, 28, 5, 13, 6, 14, + 21, 29, 36, 44, 52, 60, 37, 45, + 53, 61, 22, 30, 7, 15, 23, 31, + 38, 46, 54, 62, 39, 47, 55, 63 + }; + + + + static void EncodeBlockInter(Bitstream * bs, + Statistics * pStat, const int16_t dct_codes[64]) + { + int run; + int prev_run = 0, prev_level = 0; + const uint8_t *zigzag = zig_zag_scan; + int pos; + int bits; + + bits = BsPos(bs); + run = 0; + + for (pos = 0; pos < 64; pos++) + { + int index = zigzag[pos]; + int value = dct_codes[index]; + + if (value == 0) + { + run++; + continue; + } + + if (prev_level) + PutCoeff(bs, prev_run, prev_level, 0, MODE_INTER); + + prev_run = run; + prev_level = value; + + run = 0; + + // level=value; + } + + PutCoeff(bs, prev_run, prev_level, 1, MODE_INTER); + + bits = BsPos(bs) - bits; + pStat->iTextBits += bits; + } + + + + static void EncodeBlockIntra(Bitstream * bs, const int16_t dct_codes[64], + uint8_t acpred_direction) + + { + int run; + int prev_run = 0, prev_level = 0; + const uint8_t *zigzag; + int pos; + + + //printf("EncodeBlockIntra 1 %p %p\n", bs->start, bs->tail); + if (acpred_direction == 0) + zigzag = zig_zag_scan; + else if (acpred_direction == 1) + zigzag = alternate_horizontal_scan; + else // acpred_direction == 2 + zigzag = alternate_vertical_scan; + + //printf("EncodeBlockIntra 1\n"); + run = 0; + + //printf("EncodeBlockIntra 1\n"); + for (pos = 1; pos < 64; pos++) + { + int index = zigzag[pos]; + int value = dct_codes[index]; + + if (value == 0) + { + run++; + continue; + } + + //printf("EncodeBlockIntra 2\n"); + if (prev_level) + PutCoeff(bs, prev_run, prev_level, 0, MODE_INTRA); + + //printf("EncodeBlockIntra 3\n"); + prev_run = run; + prev_level = value; + + run = 0; + + // level=value; + + } + //printf("EncodeBlockIntra 4\n"); + + PutCoeff(bs, prev_run, prev_level, 1, MODE_INTRA); + //printf("EncodeBlockIntra 5\n"); + } + + + + static __inline void putMVData(Bitstream * bs, Statistics * pStat, + int16_t fcode, int16_t value) + + { + int scale_fac = 1 << (fcode - 1); + int high = (32 * scale_fac) - 1; + int low = ((-32) * scale_fac); + int range = (64 * scale_fac); + int bits; + + + if (value < low) + value += range; + + if (value > high) + value -= range; + + + pStat->iMvSum += value * value; + pStat->iMvCount++; + + + bits = BsPos(bs); + + if ((scale_fac == 1) || (value == 0)) + { + if (value < 0) + value = value + 65; + + PutMV(bs, value); + } + else + { + int mv_res, mv_data; + int mv_sign; + + if (value < 0) + { + value = -value; + mv_sign = -1; + } + else + { + mv_sign = 1; + } + + mv_res = (value - 1) % scale_fac; + mv_data = (value - 1 - mv_res) / scale_fac + 1; + + if (mv_sign == -1) + mv_data = -mv_data + 65; + + PutMV(bs, mv_data); + BitstreamPutBits(bs, mv_res, fcode - 1); + } + + bits = BsPos(bs) - bits; + pStat->iMvBits += bits; + } + + + + void MBCoding(const MBParam * pParam, + const Macroblock *pMB, + int16_t qcoeff[][64], + Bitstream * bs, + Statistics * pStat) + { + + int i; + VOP_TYPE vop_type = pParam->coding_type; + bool bIntra = (pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q); + + //printf("MBCoding 1\n"); + if (vop_type == P_VOP) + { + if (((pMB->mode == MODE_INTER)) + && (pMB->cbp == 0) + && (pMB->mvs[0].x == 0) && (pMB->mvs[0].y == 0)) + { // skipped + BitstreamPutBit(bs, 1); + return; + } + else + { + BitstreamPutBit(bs, 0); + } + } + + //printf("MBCoding 1\n"); + if (vop_type == I_VOP) + PutMCBPC_intra(bs, pMB->cbp & 3, pMB->mode); + else + { + PutMCBPC_inter(bs, pMB->cbp & 3, pMB->mode); + // Debug printf(" %d: CBPC 0x%x\n", BsPos(bs), pMB->cbp & 3); + } + + //printf("MBCoding 1\n"); + + if (bIntra) + { + if (pMB->acpred_directions[0]) + BitstreamPutBits(bs, 1, 1); + else + BitstreamPutBits(bs, 0, 1); + } + + //printf("MBCoding 1\n"); + + PutCBPY(bs, pMB->cbp >> 2, bIntra ? 1 : 0); + + //printf("MBCoding 1\n"); + if ((pMB->mode == MODE_INTER_Q) || (pMB->mode == MODE_INTRA_Q)) + BitstreamPutBits(bs, pMB->dquant, 2); + + //printf("MBCoding 1\n"); + + if (!bIntra) + { + for (i = 0; i < ((pMB->mode == MODE_INTER4V) ? 4 : 1); i++) + { + putMVData(bs, pStat, pParam->fixed_code, pMB->pmvs[i].x); + putMVData(bs, pStat, pParam->fixed_code, pMB->pmvs[i].y); + } + } + + //if (vop_type == P_VOP) + //Debug printf(" %d: CBPY 0x%x\n", BsPos(bs), pMB->cbp >> 2); + + printf("MBCoding 1 %p %p\n", bs->tail, bs->start); + for (i = 0; i < 6; i++) + { + if (bIntra) + { + PutIntraDC(bs, qcoeff[i][0], (i < 4) ? 1 : 0); + if (pMB->cbp & (1 << (5 - i))) + EncodeBlockIntra(bs, qcoeff[i], pMB->acpred_directions[i]); + } + else if (pMB->cbp & (1 << (5 - i))) + EncodeBlockInter(bs, pStat, qcoeff[i]); + } + + //printf("MBCoding 2\n"); + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbcoding/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/mbcoding/CVS/Entries *** bcast-2000c/quicktime/encore2/src/mbcoding/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbcoding/CVS/Entries Thu Dec 13 18:20:40 2001 *************** *** 0 **** --- 1,6 ---- + /max_level.h/1.2/Sat Dec 1 01:48:32 2001// + /putvlc.c/1.2/Sat Dec 1 01:48:32 2001// + /putvlc.h/1.2/Sat Dec 1 01:48:32 2001// + /vlc_codes.h/1.2/Sat Dec 1 01:48:32 2001// + /mbcoding.c/1.4/Wed Dec 5 13:47:05 2001// + D diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbcoding/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/mbcoding/CVS/Repository *** bcast-2000c/quicktime/encore2/src/mbcoding/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbcoding/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/mbcoding diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbcoding/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/mbcoding/CVS/Root *** bcast-2000c/quicktime/encore2/src/mbcoding/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbcoding/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbcoding/max_level.h bcast-2000c-mf3/quicktime/encore2/src/mbcoding/max_level.h *** bcast-2000c/quicktime/encore2/src/mbcoding/max_level.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbcoding/max_level.h Sat Dec 1 02:48:32 2001 *************** *** 0 **** --- 1,73 ---- + + static int intra_max_level[2][64] = { + { + 27, 10, 5, 4, 3, 3, 3, 3, + 2, 2, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }, + + { + 8, 3, 2, 2, 2, 2, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0} + }; + + + static int inter_max_level[2][64] = { + { + 12, 6, 4, 3, 3, 3, 3, 2, + 2, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0}, + + { + 3, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0} + }; + + + static int intra_max_run0[28] = { + 999, 14, 9, 7, 3, 2, 1, + 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 + }; + + + static int intra_max_run1[9] = { + 999, 20, 6, + 1, 0, 0, + 0, 0, 0 + }; + + + static int inter_max_run0[13] = { + 999, + 26, 10, 6, 2, 1, 1, + 0, 0, 0, 0, 0, 0 + }; + + + static int inter_max_run1[4] = { + 999, 40, 1, 0 + }; diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbcoding/mbcoding.c bcast-2000c-mf3/quicktime/encore2/src/mbcoding/mbcoding.c *** bcast-2000c/quicktime/encore2/src/mbcoding/mbcoding.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbcoding/mbcoding.c Wed Dec 5 14:47:05 2001 *************** *** 0 **** --- 1,331 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + + + /************************************************************************** + * + * MBCoding.c + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + /************************************************************************** + * + * Modifications: + * + * 02.11.2001 cleanup; removed ancient debug stuff + * 24.08.2001 INTER_Q MBs shouldn't be skipped + * 22.08.2001 support for MODE_INTRA_Q/MODE_INTER_Q encoding modes + * + * Michael Militzer + * + **************************************************************************/ + + #include "putvlc.h" + #include "enc_mbfunctions.h" + + + + static const uint8_t zig_zag_scan[64] = { + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 + }; + + + + // other scan orders + + static const uint8_t alternate_horizontal_scan[64] = { + 0, 1, 2, 3, 8, 9, 16, 17, + 10, 11, 4, 5, 6, 7, 15, 14, + 13, 12, 19, 18, 24, 25, 32, 33, + 26, 27, 20, 21, 22, 23, 28, 29, + 30, 31, 34, 35, 40, 41, 48, 49, + 42, 43, 36, 37, 38, 39, 44, 45, + 46, 47, 50, 51, 56, 57, 58, 59, + 52, 53, 54, 55, 60, 61, 62, 63 + }; + + + + static const uint8_t alternate_vertical_scan[64] = { + 0, 8, 16, 24, 1, 9, 2, 10, + 17, 25, 32, 40, 48, 56, 57, 49, + 41, 33, 26, 18, 3, 11, 4, 12, + 19, 27, 34, 42, 50, 58, 35, 43, + 51, 59, 20, 28, 5, 13, 6, 14, + 21, 29, 36, 44, 52, 60, 37, 45, + 53, 61, 22, 30, 7, 15, 23, 31, + 38, 46, 54, 62, 39, 47, 55, 63 + }; + + + + static void EncodeBlockInter(Bitstream * bs, + Statistics * pStat, const int16_t dct_codes[64]) + { + int run; + int prev_run = 0, prev_level = 0; + const uint8_t *zigzag = zig_zag_scan; + int pos; + int bits; + + bits = BsPos(bs); + run = 0; + + for (pos = 0; pos < 64; pos++) + { + int index = zigzag[pos]; + int value = dct_codes[index]; + + if (value == 0) + { + run++; + continue; + } + + if (prev_level) + PutCoeff(bs, prev_run, prev_level, 0, MODE_INTER); + + prev_run = run; + prev_level = value; + + run = 0; + + // level=value; + } + + PutCoeff(bs, prev_run, prev_level, 1, MODE_INTER); + + bits = BsPos(bs) - bits; + pStat->iTextBits += bits; + } + + + + static void EncodeBlockIntra(Bitstream * bs, const int16_t dct_codes[64], + uint8_t acpred_direction) + + { + int run; + int prev_run = 0, prev_level = 0; + const uint8_t *zigzag; + int pos; + + + //printf("EncodeBlockIntra 1 %p %p\n", bs->start, bs->tail); + if (acpred_direction == 0) + zigzag = zig_zag_scan; + else if (acpred_direction == 1) + zigzag = alternate_horizontal_scan; + else // acpred_direction == 2 + zigzag = alternate_vertical_scan; + + //printf("EncodeBlockIntra 1\n"); + run = 0; + + //printf("EncodeBlockIntra 1\n"); + for (pos = 1; pos < 64; pos++) + { + int index = zigzag[pos]; + int value = dct_codes[index]; + + if (value == 0) + { + run++; + continue; + } + + //printf("EncodeBlockIntra 2\n"); + if (prev_level) + PutCoeff(bs, prev_run, prev_level, 0, MODE_INTRA); + + //printf("EncodeBlockIntra 3\n"); + prev_run = run; + prev_level = value; + + run = 0; + + // level=value; + + } + //printf("EncodeBlockIntra 4\n"); + + PutCoeff(bs, prev_run, prev_level, 1, MODE_INTRA); + //printf("EncodeBlockIntra 5\n"); + } + + + + static __inline void putMVData(Bitstream * bs, Statistics * pStat, + int16_t fcode, int16_t value) + + { + int scale_fac = 1 << (fcode - 1); + int high = (32 * scale_fac) - 1; + int low = ((-32) * scale_fac); + int range = (64 * scale_fac); + int bits; + + + if (value < low) + value += range; + + if (value > high) + value -= range; + + + pStat->iMvSum += value * value; + pStat->iMvCount++; + + + bits = BsPos(bs); + + if ((scale_fac == 1) || (value == 0)) + { + if (value < 0) + value = value + 65; + + PutMV(bs, value); + } + else + { + int mv_res, mv_data; + int mv_sign; + + if (value < 0) + { + value = -value; + mv_sign = -1; + } + else + { + mv_sign = 1; + } + + mv_res = (value - 1) % scale_fac; + mv_data = (value - 1 - mv_res) / scale_fac + 1; + + if (mv_sign == -1) + mv_data = -mv_data + 65; + + PutMV(bs, mv_data); + BitstreamPutBits(bs, mv_res, fcode - 1); + } + + bits = BsPos(bs) - bits; + pStat->iMvBits += bits; + } + + + + void MBCoding(const MBParam * pParam, + const Macroblock *pMB, + int16_t qcoeff[][64], + Bitstream * bs, + Statistics * pStat) + { + + int i; + VOP_TYPE vop_type = pParam->coding_type; + bool bIntra = (pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q); + + //printf("MBCoding 1\n"); + if (vop_type == P_VOP) + { + if (((pMB->mode == MODE_INTER)) + && (pMB->cbp == 0) + && (pMB->mvs[0].x == 0) && (pMB->mvs[0].y == 0)) + { // skipped + BitstreamPutBit(bs, 1); + return; + } + else + { + BitstreamPutBit(bs, 0); + } + } + + //printf("MBCoding 1\n"); + if (vop_type == I_VOP) + PutMCBPC_intra(bs, pMB->cbp & 3, pMB->mode); + else + { + PutMCBPC_inter(bs, pMB->cbp & 3, pMB->mode); + // Debug printf(" %d: CBPC 0x%x\n", BsPos(bs), pMB->cbp & 3); + } + + //printf("MBCoding 1\n"); + + if (bIntra) + { + if (pMB->acpred_directions[0]) + BitstreamPutBits(bs, 1, 1); + else + BitstreamPutBits(bs, 0, 1); + } + + //printf("MBCoding 1\n"); + + PutCBPY(bs, pMB->cbp >> 2, bIntra ? 1 : 0); + + //printf("MBCoding 1\n"); + if ((pMB->mode == MODE_INTER_Q) || (pMB->mode == MODE_INTRA_Q)) + BitstreamPutBits(bs, pMB->dquant, 2); + + //printf("MBCoding 1\n"); + + if (!bIntra) + { + for (i = 0; i < ((pMB->mode == MODE_INTER4V) ? 4 : 1); i++) + { + putMVData(bs, pStat, pParam->fixed_code, pMB->pmvs[i].x); + putMVData(bs, pStat, pParam->fixed_code, pMB->pmvs[i].y); + } + } + + //if (vop_type == P_VOP) + //Debug printf(" %d: CBPY 0x%x\n", BsPos(bs), pMB->cbp >> 2); + + //printf("MBCoding 1 %p %p %d\n", bs->tail, bs->start, bs->tail - bs->start); + for (i = 0; i < 6; i++) + { + if (bIntra) + { + PutIntraDC(bs, qcoeff[i][0], (i < 4) ? 1 : 0); + if (pMB->cbp & (1 << (5 - i))) + EncodeBlockIntra(bs, qcoeff[i], pMB->acpred_directions[i]); + } + else if (pMB->cbp & (1 << (5 - i))) + EncodeBlockInter(bs, pStat, qcoeff[i]); + } + + //printf("MBCoding 2\n"); + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbcoding/putvlc.c bcast-2000c-mf3/quicktime/encore2/src/mbcoding/putvlc.c *** bcast-2000c/quicktime/encore2/src/mbcoding/putvlc.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbcoding/putvlc.c Sat Dec 1 02:48:32 2001 *************** *** 0 **** --- 1,1202 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * putvlc.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions to code the RVLC code for bitstream. */ + + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "vlc_codes.h" + #include "putvlc.h" + #include "max_level.h" + #include + + /***********************************************************CommentBegin****** + * + * -- Putxxx -- Write bits from huffman tables to file + * + * Purpose : + * Writes bits from huffman tables to bitstream + * + * Arguments in : + * various + * + * Return values : + * Number of bits written + * + ***********************************************************CommentEnd********/ + + int PutDCsize_lum(Bitstream * bitstream, int size) + { + assert(size >= 0 && size < 13); + + BitstreamPutBits(bitstream, DCtab_lum[size].code, DCtab_lum[size].len); + + return DCtab_lum[size].len; + } + + + int PutDCsize_chrom(Bitstream * bitstream, int size) + { + assert(size >= 0 && size < 13); + + BitstreamPutBits(bitstream, DCtab_chrom[size].code, + DCtab_chrom[size].len); + + return DCtab_chrom[size].len; + } + + + int PutMV(Bitstream * bitstream, int mvint) + { + int sign = 0; + int absmv; + + if (mvint > 32) + { + absmv = -mvint + 65; + sign = 1; + } + else + absmv = mvint; + + BitstreamPutBits(bitstream, mvtab[absmv].code, mvtab[absmv].len); + + if (mvint != 0) + { + BitstreamPutBits(bitstream, sign, 1); + return mvtab[absmv].len + 1; + } + else + return mvtab[absmv].len; + } + + + int PutMCBPC_intra(Bitstream * bitstream, int cbpc, int mode) + { + int ind; + + ind = ((mode >> 1) & 3) | ((cbpc & 3) << 2); + + BitstreamPutBits(bitstream, mcbpc_intra_tab[ind].code, + mcbpc_intra_tab[ind].len); + + return mcbpc_intra_tab[ind].len; + } + + + int PutMCBPC_inter(Bitstream * bitstream, int cbpc, int mode) + { + int ind; + + ind = (mode & 7) | ((cbpc & 3) << 3); + + BitstreamPutBits(bitstream, mcbpc_inter_tab[ind].code, + mcbpc_inter_tab[ind].len); + + return mcbpc_inter_tab[ind].len; + } + + + int PutMCBPC_Sprite(Bitstream * bitstream, int cbpc, int mode) + { + int ind; + + ind = (mode & 7) | ((cbpc & 3) << 3); + + BitstreamPutBits(bitstream, mcbpc_sprite_tab[ind].code, + mcbpc_sprite_tab[ind].len); + + return mcbpc_sprite_tab[ind].len; + } + + + int PutCBPY(Bitstream * bitstream, int cbpy, bool intra) + { + if (intra == 0) + cbpy = 15 - cbpy; + BitstreamPutBits(bitstream, cbpy_tab[cbpy].code, cbpy_tab[cbpy].len); + return cbpy_tab[cbpy].len; + } + + + int PutCoeff_inter(Bitstream * bitstream, int run, int level, int last) + { + int length = 0; + + assert(last >= 0 && last < 2); + assert(run >= 0 && run < 64); + assert(level > 0 && level < 128); + + if (last == 0) + { + if (run < 2 && level < 13) + { + BitstreamPutBits(bitstream, coeff_tab0[run][level - 1].code, + coeff_tab0[run][level - 1].len); + + length = coeff_tab0[run][level - 1].len; + } + else if (run > 1 && run < 27 && level < 5) + { + BitstreamPutBits(bitstream, coeff_tab1[run - 2][level - 1].code, + coeff_tab1[run - 2][level - 1].len); + + length = coeff_tab1[run - 2][level - 1].len; + } + } + else if (last == 1) + { + if (run < 2 && level < 4) + { + BitstreamPutBits(bitstream, coeff_tab2[run][level - 1].code, + coeff_tab2[run][level - 1].len); + + length = coeff_tab2[run][level - 1].len; + } + else if (run > 1 && run < 42 && level == 1) + { + BitstreamPutBits(bitstream, coeff_tab3[run - 2].code, + coeff_tab3[run - 2].len); + + length = coeff_tab3[run - 2].len; + } + } + return length; + } + + + int PutCoeff_intra(Bitstream * bitstream, int run, int level, int last) + { + int length = 0; + + assert(last >= 0 && last < 2); + assert(run >= 0 && run < 64); + assert(level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 28) + { + BitstreamPutBits(bitstream, coeff_tab4[level - 1].code, + coeff_tab4[level - 1].len); + + length = coeff_tab4[level - 1].len; + } + else if (run == 1 && level < 11) + { + BitstreamPutBits(bitstream, coeff_tab5[level - 1].code, + coeff_tab5[level - 1].len); + + length = coeff_tab5[level - 1].len; + } + else if (run > 1 && run < 10 && level < 6) + { + BitstreamPutBits(bitstream, coeff_tab6[run - 2][level - 1].code, + coeff_tab6[run - 2][level - 1].len); + + length = coeff_tab6[run - 2][level - 1].len; + } + else if (run > 9 && run < 15 && level == 1) + { + BitstreamPutBits(bitstream, coeff_tab7[run - 10].code, + coeff_tab7[run - 10].len); + + length = coeff_tab7[run - 10].len; + } + } + else if (last == 1) + { + if (run == 0 && level < 9) + { + BitstreamPutBits(bitstream, coeff_tab8[level - 1].code, + coeff_tab8[level - 1].len); + + length = coeff_tab8[level - 1].len; + } + else if (run > 0 && run < 7 && level < 4) + { + BitstreamPutBits(bitstream, coeff_tab9[run - 1][level - 1].code, + coeff_tab9[run - 1][level - 1].len); + + length = coeff_tab9[run - 1][level - 1].len; + } + else if (run > 6 && run < 21 && level == 1) + { + BitstreamPutBits(bitstream, coeff_tab10[run - 7].code, + coeff_tab10[run - 7].len); + + length = coeff_tab10[run - 7].len; + } + } + return length; + } + + + int PutCoeff_inter_RVLC(Bitstream * bitstream, int run, int level, int last) + { + int length = 0; + + assert(last >= 0 && last < 2); + assert(run >= 0 && run < 64); + assert(level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 20) + { + BitstreamPutBits(bitstream, coeff_RVLCtab14[level - 1].code, + coeff_RVLCtab14[level - 1].len); + + length = coeff_RVLCtab14[level - 1].len; + } + else if (run == 1 && level < 11) + { + BitstreamPutBits(bitstream, coeff_RVLCtab15[level - 1].code, + coeff_RVLCtab15[level - 1].len); + + length = coeff_RVLCtab15[level - 1].len; + } + else if (run > 1 && run < 4 && level < 8) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab16[run - 2][level - 1].code, + coeff_RVLCtab16[run - 2][level - 1].len); + length = coeff_RVLCtab16[run - 2][level - 1].len; + } + else if (run == 4 && level < 6) + { + BitstreamPutBits(bitstream, coeff_RVLCtab17[level - 1].code, + coeff_RVLCtab17[level - 1].len); + + length = coeff_RVLCtab17[level - 1].len; + } + else if (run > 4 && run < 8 && level < 5) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab18[run - 5][level - 1].code, + coeff_RVLCtab18[run - 5][level - 1].len); + + length = coeff_RVLCtab18[run - 5][level - 1].len; + } + else if (run > 7 && run < 10 && level < 4) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab19[run - 8][level - 1].code, + coeff_RVLCtab19[run - 8][level - 1].len); + + length = coeff_RVLCtab19[run - 8][level - 1].len; + } + else if (run > 9 && run < 18 && level < 3) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab20[run - 10][level - 1].code, + coeff_RVLCtab20[run - 10][level - 1].len); + + length = coeff_RVLCtab20[run - 10][level - 1].len; + } + else if (run > 17 && run < 39 && level == 1) + { + BitstreamPutBits(bitstream, coeff_RVLCtab21[run - 18].code, + coeff_RVLCtab21[run - 18].len); + + length = coeff_RVLCtab21[run - 18].len; + } + } + else if (last == 1) + { + if (run >= 0 && run < 2 && level < 6) + { + BitstreamPutBits(bitstream, coeff_RVLCtab22[run][level - 1].code, + coeff_RVLCtab22[run][level - 1].len); + + length = coeff_RVLCtab22[run][level - 1].len; + } + else if (run == 2 && level < 4) + { + BitstreamPutBits(bitstream, coeff_RVLCtab23[level - 1].code, + coeff_RVLCtab23[level - 1].len); + + length = coeff_RVLCtab23[level - 1].len; + } + else if (run > 2 && run < 14 && level < 3) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab24[run - 3][level - 1].code, + coeff_RVLCtab24[run - 3][level - 1].len); + + length = coeff_RVLCtab24[run - 3][level - 1].len; + } + else if (run > 13 && run < 46 && level == 1) + { + BitstreamPutBits(bitstream, coeff_RVLCtab25[run - 14].code, + coeff_RVLCtab25[run - 14].len); + + length = coeff_RVLCtab25[run - 14].len; + } + } + return length; + } + + + int PutCoeff_intra_RVLC(Bitstream * bitstream, int run, int level, int last) + { + int length = 0; + + assert(last >= 0 && last < 2); + assert(run >= 0 && run < 64); + assert(level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 28) + { + BitstreamPutBits(bitstream, coeff_RVLCtab1[level - 1].code, + coeff_RVLCtab1[level - 1].len); + + length = coeff_RVLCtab1[level - 1].len; + } + else if (run == 1 && level < 14) + { + BitstreamPutBits(bitstream, coeff_RVLCtab2[level - 1].code, + coeff_RVLCtab2[level - 1].len); + + length = coeff_RVLCtab2[level - 1].len; + } + else if (run == 2 && level < 12) + { + BitstreamPutBits(bitstream, coeff_RVLCtab3[level - 1].code, + coeff_RVLCtab3[level - 1].len); + + length = coeff_RVLCtab3[level - 1].len; + } + else if (run == 3 && level < 10) + { + BitstreamPutBits(bitstream, coeff_RVLCtab4[level - 1].code, + coeff_RVLCtab4[level - 1].len); + + length = coeff_RVLCtab4[level - 1].len; + } + else if (run > 3 && run < 6 && level < 7) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab5[run - 4][level - 1].code, + coeff_RVLCtab5[run - 4][level - 1].len); + + length = coeff_RVLCtab5[run - 4][level - 1].len; + } + else if (run > 5 && run < 8 && level < 6) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab6[run - 6][level - 1].code, + coeff_RVLCtab6[run - 6][level - 1].len); + + length = coeff_RVLCtab6[run - 6][level - 1].len; + } + else if (run > 7 && run < 10 && level < 5) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab7[run - 8][level - 1].code, + coeff_RVLCtab7[run - 8][level - 1].len); + + length = coeff_RVLCtab7[run - 8][level - 1].len; + } + else if (run > 9 && run < 13 && level < 3) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab8[run - 10][level - 1].code, + coeff_RVLCtab8[run - 10][level - 1].len); + + length = coeff_RVLCtab8[run - 10][level - 1].len; + } + else if (run > 12 && run < 20 && level == 1) + { + BitstreamPutBits(bitstream, coeff_RVLCtab9[run - 13].code, + coeff_RVLCtab9[run - 13].len); + + length = coeff_RVLCtab9[run - 13].len; + } + } + else if (last == 1) + { + if (run >= 0 && run < 2 && level < 6) + { + BitstreamPutBits(bitstream, coeff_RVLCtab10[run][level - 1].code, + coeff_RVLCtab10[run][level - 1].len); + + length = coeff_RVLCtab10[run][level - 1].len; + } + else if (run == 2 && level < 4) + { + BitstreamPutBits(bitstream, coeff_RVLCtab11[level - 1].code, + coeff_RVLCtab11[level - 1].len); + + length = coeff_RVLCtab11[level - 1].len; + } + else if (run > 2 && run < 14 && level < 3) + { + BitstreamPutBits(bitstream, + coeff_RVLCtab12[run - 3][level - 1].code, + coeff_RVLCtab12[run - 3][level - 1].len); + + length = coeff_RVLCtab12[run - 3][level - 1].len; + } + else if (run > 13 && run < 46 && level == 1) + { + BitstreamPutBits(bitstream, coeff_RVLCtab13[run - 14].code, + coeff_RVLCtab13[run - 14].len); + + length = coeff_RVLCtab13[run - 14].len; + } + } + return length; + } + + + /* The following is for 3-mode VLC */ + + int PutRunCoeff_inter(Bitstream * bitstream, int run, int level, int last) + { + int length = 0; + + assert(last >= 0 && last < 2); + assert(run >= 0 && run < 64); + assert(level > 0 && level < 128); + + if (last == 0) + { + if (run < 2 && level < 13) + { + length = coeff_tab0[run][level - 1].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab0[run][level - 1].code, + coeff_tab0[run][level - 1].len); + } + } + else if (run > 1 && run < 27 && level < 5) + { + length = coeff_tab1[run - 2][level - 1].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, + coeff_tab1[run - 2][level - 1].code, + coeff_tab1[run - 2][level - 1].len); + } + } + } + else if (last == 1) + { + if (run < 2 && level < 4) + { + length = coeff_tab2[run][level - 1].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab2[run][level - 1].code, + coeff_tab2[run][level - 1].len); + } + } + else if (run > 1 && run < 42 && level == 1) + { + length = coeff_tab3[run - 2].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab3[run - 2].code, + coeff_tab3[run - 2].len); + } + } + } + return length; + } + + + int PutRunCoeff_intra(Bitstream * bitstream, int run, int level, int last) + { + int length = 0; + + assert(last >= 0 && last < 2); + assert(run >= 0 && run < 64); + assert(level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 28) + { + length = coeff_tab4[level - 1].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab4[level - 1].code, + coeff_tab4[level - 1].len); + } + } + else if (run == 1 && level < 11) + { + length = coeff_tab5[level - 1].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab5[level - 1].code, + coeff_tab5[level - 1].len); + } + } + else if (run > 1 && run < 10 && level < 6) + { + length = coeff_tab6[run - 2][level - 1].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, + coeff_tab6[run - 2][level - 1].code, + coeff_tab6[run - 2][level - 1].len); + } + } + else if (run > 9 && run < 15 && level == 1) + { + length = coeff_tab7[run - 10].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab7[run - 10].code, + coeff_tab7[run - 10].len); + } + } + } + else if (last == 1) + { + if (run == 0 && level < 9) + { + length = coeff_tab8[level - 1].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab8[level - 1].code, + coeff_tab8[level - 1].len); + } + } + else if (run > 0 && run < 7 && level < 4) + { + length = coeff_tab9[run - 1][level - 1].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, + coeff_tab9[run - 1][level - 1].code, + coeff_tab9[run - 1][level - 1].len); + } + } + else if (run > 6 && run < 21 && level == 1) + { + length = coeff_tab10[run - 7].len; + if (length != 0) + { + /* + boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab10[run - 7].code, + coeff_tab10[run - 7].len); + } + } + } + return length; + } + + + int PutLevelCoeff_inter(Bitstream * bitstream, int run, int level, int last) + { + int length = 0; + + assert(last >= 0 && last < 2); + assert(run >= 0 && run < 64); + assert(level > 0 && level < 128); + + if (last == 0) + { + if (run < 2 && level < 13) + { + length = coeff_tab0[run][level - 1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab0[run][level - 1].code, + coeff_tab0[run][level - 1].len); + } + } + else if (run > 1 && run < 27 && level < 5) + { + length = coeff_tab1[run - 2][level - 1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, + coeff_tab1[run - 2][level - 1].code, + coeff_tab1[run - 2][level - 1].len); + } + } + } + else if (last == 1) + { + if (run < 2 && level < 4) + { + length = coeff_tab2[run][level - 1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab2[run][level - 1].code, + coeff_tab2[run][level - 1].len); + } + } + else if (run > 1 && run < 42 && level == 1) + { + length = coeff_tab3[run - 2].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab3[run - 2].code, + coeff_tab3[run - 2].len); + } + } + } + return length; + } + + + int PutLevelCoeff_intra(Bitstream * bitstream, int run, int level, int last) + { + int length = 0; + + assert(last >= 0 && last < 2); + assert(run >= 0 && run < 64); + assert(level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 28) + { + length = coeff_tab4[level - 1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab4[level - 1].code, + coeff_tab4[level - 1].len); + } + } + else if (run == 1 && level < 11) + { + length = coeff_tab5[level - 1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab5[level - 1].code, + coeff_tab5[level - 1].len); + } + } + else if (run > 1 && run < 10 && level < 6) + { + length = coeff_tab6[run - 2][level - 1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, + coeff_tab6[run - 2][level - 1].code, + coeff_tab6[run - 2][level - 1].len); + } + } + else if (run > 9 && run < 15 && level == 1) + { + length = coeff_tab7[run - 10].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab7[run - 10].code, + coeff_tab7[run - 10].len); + } + } + } + else if (last == 1) + { + if (run == 0 && level < 9) + { + length = coeff_tab8[level - 1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab8[level - 1].code, + coeff_tab8[level - 1].len); + } + } + else if (run > 0 && run < 7 && level < 4) + { + length = coeff_tab9[run - 1][level - 1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, + coeff_tab9[run - 1][level - 1].code, + coeff_tab9[run - 1][level - 1].len); + } + } + else if (run > 6 && run < 21 && level == 1) + { + length = coeff_tab10[run - 7].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* + boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* + boon */ + BitstreamPutBits(bitstream, coeff_tab10[run - 7].code, + coeff_tab10[run - 7].len); + } + } + } + return length; + } + + /***********************************************************CommentBegin****** + * + * -- PutIntraDC -- DPCM Encoding of INTRADC in case of Intra macroblocks + * + * Purpose : + * DPCM Encoding of INTRADC in case of Intra macroblocks + * + * Arguments in : + * int val : the difference value with respect to the previous + * INTRADC value + * int lum : indicates whether the block is a luminance block (lum=1) or + * a chrominance block ( lum = 0) + * + * Arguments out : + * Bitstream* bitstream : a pointer to the output bitstream + * + ***********************************************************CommentEnd********/ + + int PutIntraDC(Bitstream * bitstream, int val, bool lum) + { + int n_bits; + int absval, size = 0; + + absval = (val < 0) ? -val : val; /* + abs(val) */ + + /* + compute dct_dc_size */ + + size = 0; + while (absval) + { + absval >>= 1; + size++; + } + + if (lum) + n_bits = PutDCsize_lum(bitstream, size); + else + n_bits = PutDCsize_chrom(bitstream, size); + + if (size != 0) + { + if (val < 0) + { + absval = -val; /* + set to "-val" MW 14-NOV-1996 */ + // val = (absval ^( (int)pow(2.0,(double)size)-1) ); + val = absval ^ ((1 << size) - 1); + } + BitstreamPutBits(bitstream, (long) (val), (long) (size)); + n_bits += size; + + if (size > 8) + BitstreamPutBits(bitstream, (long) 1, (long) 1); + } + return n_bits; /* + # bits for intra_dc dpcm */ + } + + static int PutCoeff_Last(Bitstream * bitstream, int run, int level, int Mode) + { + int s = 0; + bool intra = 0; + int length = 0; + + assert(level != 0); + assert(bitstream); + assert(run < 64); + assert(run >= 0); + if (level < 0) + { + s = 1; + level = -level; + } + if ((Mode == MODE_INTRA) || (Mode == MODE_INTRA_Q)) + intra = 1; + if ((run < 64) && (((level < 4) && !intra) || ((level < 9) && intra))) + { + /* + Separate tables for Intra luminance blocks */ + if (intra) + length = PutCoeff_intra(bitstream, run, level, 1); + else + length = PutCoeff_inter(bitstream, run, level, 1); + } + + /* + First escape mode. Level offset */ + if (length == 0) + { + /* + subtraction of Max level, last = 0 */ + int level_minus_max; + + if (intra) + level_minus_max = level - intra_max_level[1][run]; + else + level_minus_max = level - inter_max_level[1][run]; + if (((level_minus_max < 4) && (!intra)) || + ((level_minus_max < 9) && intra)) + { + /* + Separate tables for Intra luminance blocks */ + if (intra) + length = + PutLevelCoeff_intra(bitstream, run, level_minus_max, 1); + else + length = + PutLevelCoeff_inter(bitstream, run, level_minus_max, 1); + } + } + + /* + Second escape mode. Run offset */ + if (length == 0) + { + if (((level < 4) && (!intra)) || ((level < 9) && intra)) + { + /* + subtraction of Max Run, last = 1 */ + int run_minus_max; + + assert(level); + + if (intra) + run_minus_max = run - (intra_max_run1[level] + 1); + else + run_minus_max = run - (inter_max_run1[level] + 1); + + /* + Separate tables for Intra luminance blocks */ + if (intra) + length = + PutRunCoeff_intra(bitstream, run_minus_max, level, 1); + else + length = + PutRunCoeff_inter(bitstream, run_minus_max, level, 1); + } + } + + /* + Third escape mode. FLC */ + if (length == 0) + { /* + Escape coding */ + if (s == 1) + level = (level ^ 0xfff) + 1; + BitstreamPutBits(bitstream, 3, 7); + BitstreamPutBits(bitstream, 3, 2); + BitstreamPutBits(bitstream, 1, 1); + BitstreamPutBits(bitstream, run, 6); + + BitstreamPutBits(bitstream, MARKER_BIT, 1); + BitstreamPutBits(bitstream, level, 12); + + BitstreamPutBits(bitstream, MARKER_BIT, 1); + + return 30; + } + else + { + BitstreamPutBits(bitstream, s, 1); + return length + 1; + } + } + static int PutCoeff_NotLast(Bitstream * bitstream, int run, int level, + int Mode) + { + int s = 0; + bool intra = 0; + int length = 0; + + assert(level != 0); + assert(bitstream); + assert(run < 64); + assert(run >= 0); + if (level < 0) + { + s = 1; + level = -level; + } + if ((Mode == MODE_INTRA) || (Mode == MODE_INTRA_Q)) + intra = 1; + if ((run < 64) && + ((((level < 13) && (!intra))) || ((level < 28) && intra))) + { + if (intra) + length = PutCoeff_intra(bitstream, run, level, 0); + else + length = PutCoeff_inter(bitstream, run, level, 0); + } + + /* + First escape mode. Level offset */ + if (length == 0) + { + if (run < 64) + { + /* + subtraction of Max level, last = 0 */ + int level_minus_max; + + if (intra) + level_minus_max = level - intra_max_level[0][run]; + else + level_minus_max = level - inter_max_level[0][run]; + + if (((level_minus_max < 13) && (!intra)) || + ((level_minus_max < 28) && intra)) + { + /* + Separate tables for Intra luminance blocks */ + if (intra) + length = + PutLevelCoeff_intra(bitstream, run, level_minus_max, + 0); + else + length = + PutLevelCoeff_inter(bitstream, run, level_minus_max, + 0); + } + } + } + + /* + Second escape mode. Run offset */ + if (length == 0) + { + if (((level < 13) && (!intra)) || ((level < 28) && intra)) + { + /* + subtraction of Max Run, last = 0 */ + int run_minus_max; + + assert(level); + if (intra) + run_minus_max = run - (intra_max_run0[level] + 1); + else + run_minus_max = run - (inter_max_run0[level] + 1); + + { + /* + Separate tables for Intra luminance blocks */ + if (intra) + length = + PutRunCoeff_intra(bitstream, run_minus_max, level, 0); + else + length = + PutRunCoeff_inter(bitstream, run_minus_max, level, 0); + } + } + } + + /* + Third escape mode. FLC */ + if (length == 0) + { /* + Escape coding */ + if (s) + level = (level ^ 0xfff) + 1; + BitstreamPutBits(bitstream, 3, 7); + BitstreamPutBits(bitstream, 3, 2); + BitstreamPutBits(bitstream, 0, 1); + BitstreamPutBits(bitstream, run, 6); + BitstreamPutBits(bitstream, MARKER_BIT, 1); + BitstreamPutBits(bitstream, level, 12); + BitstreamPutBits(bitstream, MARKER_BIT, 1); + return 30; + } + else + { + BitstreamPutBits(bitstream, s, 1); + return length + 1; + } + } + int PutCoeff(Bitstream * bitstream, int run, int level, int last, int Mode) + { + if (last) + return PutCoeff_Last(bitstream, run, level, Mode); + else + return PutCoeff_NotLast(bitstream, run, level, Mode); + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbcoding/putvlc.h bcast-2000c-mf3/quicktime/encore2/src/mbcoding/putvlc.h *** bcast-2000c/quicktime/encore2/src/mbcoding/putvlc.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbcoding/putvlc.h Sat Dec 1 02:48:32 2001 *************** *** 0 **** --- 1,44 ---- + /***********************************************************HeaderBegin******* + * + * File: putvlc.h + * + * Description: Header file to include prototypes for vlc functions + * + ***********************************************************HeaderEnd*********/ + + #ifndef _ENCORE_PUTVLC_H + #define _ENCORE_PUTVLC_H + #include "enc_bitstream.h" + + #define MARKER_BIT 1 + /** + Public interface of VLC coding module + Methods defined in putvlc.c + Referenced from block.c + **/ + int PutCoeff(Bitstream * bitstream, int run, int level, int last, int Mode); + int PutIntraDC(Bitstream * bitstream, int val, bool lum); + int PutMV(Bitstream * bitstream, int mvint); + int PutMCBPC_intra(Bitstream * bitstream, int cbpc, int mode); + int PutMCBPC_inter(Bitstream * bitstream, int cbpc, int mode); + int PutCBPY(Bitstream * bitstream, int cbpy, bool intra); + + /** + Internal vlc methods, defined in putvlc.c + **/ + + int PutDCsize_lum(Bitstream * bitstream, int size); + int PutDCsize_chrom(Bitstream * bitstream, int size); + int PutCoeff_inter(Bitstream * bitstream, int run, int level, int last); + int PutCoeff_intra(Bitstream * bitstream, int run, int level, int last); + int PutRunCoeff_inter(Bitstream * bitstream, int run, int level, int last); + int PutRunCoeff_intra(Bitstream * bitstream, int run, int level, int last); + int PutLevelCoeff_inter(Bitstream * bitstream, int run, int level, int last); + int PutLevelCoeff_intra(Bitstream * bitstream, int run, int level, int last); + + /** Currently unused **/ + int PutMCBPC_Sprite(Bitstream * bitstream, int cbpc, int mode); + int PutCoeff_inter_RVLC(Bitstream * bitstream, int run, int level, int last); + int PutCoeff_intra_RVLC(Bitstream * bitstream, int run, int level, int last); + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbcoding/vlc_codes.h bcast-2000c-mf3/quicktime/encore2/src/mbcoding/vlc_codes.h *** bcast-2000c/quicktime/encore2/src/mbcoding/vlc_codes.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbcoding/vlc_codes.h Sat Dec 1 02:48:32 2001 *************** *** 0 **** --- 1,1122 ---- + #ifndef _ENCORE_VLC_H + #define _ENCORE_VLC_H + #include "enc_portab.h" + /* type definitions for variable length code table entries */ + + typedef struct + { + uint16_t code; /* right justified */ + uint16_t len; + } + VLCtable; + + + /* DC prediction sizes */ + + static VLCtable DCtab_lum[13] = { + {3, 3}, {3, 2}, {2, 2}, {2, 3}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {1, 7}, + {1, 8}, {1, 9}, {1, 10}, {1, 11} + }; + + static VLCtable DCtab_chrom[13] = { + {3, 2}, {2, 2}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {1, 7}, {1, 8}, + {1, 9}, {1, 10}, {1, 11}, {1, 12} + }; + + + /* + Motion vectors + */ + + static VLCtable mvtab[33] = { + {1, 1}, {1, 2}, {1, 3}, {1, 4}, {3, 6}, {5, 7}, {4, 7}, {3, 7}, + {11, 9}, {10, 9}, {9, 9}, {17, 10}, {16, 10}, {15, 10}, {14, 10}, {13, 10}, + {12, 10}, {11, 10}, {10, 10}, {9, 10}, {8, 10}, {7, 10}, {6, 10}, {5, 10}, + {4, 10}, {7, 11}, {6, 11}, {5, 11}, {4, 11}, {3, 11}, {2, 11}, {3, 12}, + {2, 12} + }; + + + /* MCBPC Indexing by cbpc in first two bits, mode in last two. + CBPC as in table 4/H.263, MB type (mode): 3 = 01, 4 = 10. + Example: cbpc = 01 and mode = 4 gives index = 0110 = 6. */ + + static VLCtable mcbpc_intra_tab[15] = { + {0x01, 9}, {0x01, 1}, {0x01, 4}, {0x00, 0}, + {0x00, 0}, {0x01, 3}, {0x01, 6}, {0x00, 0}, + {0x00, 0}, {0x02, 3}, {0x02, 6}, {0x00, 0}, + {0x00, 0}, {0x03, 3}, {0x03, 6} + }; + + + /* MCBPC inter. + Addressing: 5 bit ccmmm (cc = CBPC, mmm = mode (1-4 binary)) */ + + static VLCtable mcbpc_inter_tab[29] = { + {1, 1}, {3, 3}, {2, 3}, {3, 5}, {4, 6}, {1, 9}, {0, 0}, {0, 0}, + {3, 4}, {7, 7}, {5, 7}, {4, 8}, {4, 9}, {0, 0}, {0, 0}, {0, 0}, + {2, 4}, {6, 7}, {4, 7}, {3, 8}, {3, 9}, {0, 0}, {0, 0}, {0, 0}, + {5, 6}, {5, 9}, {5, 8}, {3, 7}, {2, 9} + }; + + static VLCtable mcbpc_sprite_tab[31] = { + {1, 1}, {0, 12}, {2, 3}, {3, 5}, {4, 6}, {3, 3}, {12, 4}, {1, 9}, + {3, 4}, {1, 12}, {5, 7}, {4, 8}, {4, 9}, {7, 7}, {12, 5}, {0, 0}, + {2, 4}, {2, 12}, {4, 7}, {3, 8}, {3, 9}, {6, 7}, {12, 6}, {0, 0}, + {5, 6}, {3, 12}, {5, 8}, {3, 7}, {2, 9}, {5, 9}, {12, 7} + }; + + /* CBPY. Straightforward indexing */ + + static VLCtable cbpy_tab[16] = { + {3, 4}, {5, 5}, {4, 5}, {9, 4}, {3, 5}, {7, 4}, {2, 6}, {11, 4}, + {2, 5}, {3, 6}, {5, 4}, {10, 4}, {4, 4}, {8, 4}, {6, 4}, {3, 2} + }; + + /* DCT coefficients. Four tables, two for last = 0, two for last = 1. + the sign bit must be added afterwards. */ + + /* first part of coeffs for last = 0. Indexed by [run][level-1] */ + + static VLCtable coeff_tab0[2][12] = { + /* + run = 0 + */ + { + {0x02, 2}, {0x0f, 4}, {0x15, 6}, {0x17, 7}, + {0x1f, 8}, {0x25, 9}, {0x24, 9}, {0x21, 10}, + {0x20, 10}, {0x07, 11}, {0x06, 11}, {0x20, 11} + }, + /* + run = 1 + */ + { + {0x06, 3}, {0x14, 6}, {0x1e, 8}, {0x0f, 10}, + {0x21, 11}, {0x50, 12}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0} + } + }; + + /* rest of coeffs for last = 0. indexing by [run-2][level-1] */ + + static VLCtable coeff_tab1[25][4] = { + /* + run = 2 + */ + { + {0x0e, 4}, {0x1d, 8}, {0x0e, 10}, {0x51, 12} + }, + /* + run = 3 + */ + { + {0x0d, 5}, {0x23, 9}, {0x0d, 10}, {0x00, 0} + }, + /* + run = 4-26 + */ + { + {0x0c, 5}, {0x22, 9}, {0x52, 12}, {0x00, 0} + }, + { + {0x0b, 5}, {0x0c, 10}, {0x53, 12}, {0x00, 0} + }, + { + {0x13, 6}, {0x0b, 10}, {0x54, 12}, {0x00, 0} + }, + { + {0x12, 6}, {0x0a, 10}, {0x00, 0}, {0x00, 0} + }, + { + {0x11, 6}, {0x09, 10}, {0x00, 0}, {0x00, 0} + }, + { + {0x10, 6}, {0x08, 10}, {0x00, 0}, {0x00, 0} + }, + { + {0x16, 7}, {0x55, 12}, {0x00, 0}, {0x00, 0} + }, + { + {0x15, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x14, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1c, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1b, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x21, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x20, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1f, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1e, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1d, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1c, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1b, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1a, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x22, 11}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x23, 11}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x56, 12}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x57, 12}, {0x00, 0}, {0x00, 0}, {0x00, 0} + } + }; + + /* first coeffs of last = 1. indexing by [run][level-1] */ + + static VLCtable coeff_tab2[2][3] = { + /* + run = 0 + */ + { + {0x07, 4}, {0x19, 9}, {0x05, 11} + }, + /* + run = 1 + */ + { + {0x0f, 6}, {0x04, 11}, {0x00, 0} + } + }; + + /* rest of coeffs for last = 1. indexing by [run-2] */ + + static VLCtable coeff_tab3[40] = { + {0x0e, 6}, {0x0d, 6}, {0x0c, 6}, + {0x13, 7}, {0x12, 7}, {0x11, 7}, {0x10, 7}, + {0x1a, 8}, {0x19, 8}, {0x18, 8}, {0x17, 8}, + {0x16, 8}, {0x15, 8}, {0x14, 8}, {0x13, 8}, + {0x18, 9}, {0x17, 9}, {0x16, 9}, {0x15, 9}, + {0x14, 9}, {0x13, 9}, {0x12, 9}, {0x11, 9}, + {0x07, 10}, {0x06, 10}, {0x05, 10}, {0x04, 10}, + {0x24, 11}, {0x25, 11}, {0x26, 11}, {0x27, 11}, + {0x58, 12}, {0x59, 12}, {0x5a, 12}, {0x5b, 12}, + {0x5c, 12}, {0x5d, 12}, {0x5e, 12}, {0x5f, 12}, + {0x00, 0} + }; + + /* New tables for Intra luminance coefficients. Same codewords, + different meaning */ + + /* Coeffs for last = 0, run = 0. Indexed by [level-1] */ + + static VLCtable coeff_tab4[27] = { + /* + run = 0 + */ + {0x02, 2}, {0x06, 3}, {0x0f, 4}, {0x0d, 5}, + {0x0c, 5}, {0x15, 6}, {0x13, 6}, {0x12, 6}, + {0x17, 7}, {0x1f, 8}, {0x1e, 8}, {0x1d, 8}, + {0x25, 9}, {0x24, 9}, {0x23, 9}, {0x21, 9}, + {0x21, 10}, {0x20, 10}, {0x0f, 10}, {0x0e, 10}, + {0x07, 11}, {0x06, 11}, {0x20, 11}, {0x21, 11}, + {0x50, 12}, {0x51, 12}, {0x52, 12} + }; + + /* Coeffs for last = 0, run = 1. Indexed by [level-1] */ + + static VLCtable coeff_tab5[10] = { + {0x0e, 4}, {0x14, 6}, {0x16, 7}, {0x1c, 8}, + {0x20, 9}, {0x1f, 9}, {0x0d, 10}, {0x22, 11}, + {0x53, 12}, {0x55, 12} + }; + + /* Coeffs for last = 0, run = 2 -> 9. Indexed by [run-2][level-1] */ + + static VLCtable coeff_tab6[8][5] = { + /* + run = 2 + */ + { + {0x0b, 5}, {0x15, 7}, {0x1e, 9}, {0x0c, 10}, + {0x56, 12} + }, + /* + run = 3 + */ + { + {0x11, 6}, {0x1b, 8}, {0x1d, 9}, {0x0b, 10}, + {0x00, 0} + }, + /* + run = 4 + */ + { + {0x10, 6}, {0x22, 9}, {0x0a, 10}, {0x00, 0}, + {0x00, 0} + }, + /* + run = 5 + */ + { + {0x0d, 6}, {0x1c, 9}, {0x08, 10}, {0x00, 0}, + {0x00, 0} + }, + /* + run = 6 + */ + { + {0x12, 7}, {0x1b, 9}, {0x54, 12}, {0x00, 0}, + {0x00, 0} + }, + /* + run = 7 + */ + { + {0x14, 7}, {0x1a, 9}, {0x57, 12}, {0x00, 0}, + {0x00, 0} + }, + /* + run = 8 + */ + { + {0x19, 8}, {0x09, 10}, {0x00, 0}, {0x00, 0}, + {0x00, 0} + }, + /* + run = 9 + */ + { + {0x18, 8}, {0x23, 11}, {0x00, 0}, {0x00, 0}, + {0x00, 0} + } + }; + + /* Coeffs for last = 0, run = 10 -> 14. Indexed by [run-10] */ + + static VLCtable coeff_tab7[5] = { + {0x17, 8}, {0x19, 9}, {0x18, 9}, {0x07, 10}, + {0x58, 12} + }; + + /* Coeffs for last = 1, run = 0. Indexed by [level-1] */ + + static VLCtable coeff_tab8[8] = { + {0x07, 4}, {0x0c, 6}, {0x16, 8}, {0x17, 9}, + {0x06, 10}, {0x05, 11}, {0x04, 11}, {0x59, 12} + }; + + /* Coeffs for last = 1, run = 1 -> 6. Indexed by [run-1][level-1] */ + + static VLCtable coeff_tab9[6][3] = { + /* + run = 1 + */ + { + {0x0f, 6}, {0x16, 9}, {0x05, 10} + }, + /* + run = 2 + */ + { + {0x0e, 6}, {0x04, 10}, {0x00, 0} + }, + /* + run = 3 + */ + { + {0x11, 7}, {0x24, 11}, {0x00, 0} + }, + /* + run = 4 + */ + { + {0x10, 7}, {0x25, 11}, {0x00, 0} + }, + /* + run = 5 + */ + { + {0x13, 7}, {0x5a, 12}, {0x00, 0} + }, + /* + run = 6 + */ + { + {0x15, 8}, {0x5b, 12}, {0x00, 0} + } + }; + + /* Coeffs for last = 1, run = 7 -> 20. Indexed by [run-7] */ + + static VLCtable coeff_tab10[14] = { + {0x14, 8}, {0x13, 8}, {0x1a, 8}, {0x15, 9}, + {0x14, 9}, {0x13, 9}, {0x12, 9}, {0x11, 9}, + {0x26, 11}, {0x27, 11}, {0x5c, 12}, {0x5d, 12}, + {0x5e, 12}, {0x5f, 12} + }; + + + + /* RVLC tables */ + /* DCT coefficients. Four tables, two for last = 0, two for last = 1. + the sign bit must be added afterwards. */ + + /* DCT coeffs (intra) for last = 0. */ + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab1[27] = { + /* + run = 0 + */ + {0x6, 3}, + {0x7, 3}, + {0xa, 4}, + {0x9, 5}, + {0x14, 6}, + {0x15, 6}, + {0x34, 7}, + {0x74, 8}, + {0x75, 8}, + {0xdd, 9}, + {0xec, 9}, + {0x1ec, 10}, + {0x1ed, 10}, + {0x1f4, 10}, + {0x3ec, 11}, + {0x3ed, 11}, + {0x3f4, 11}, + {0x77d, 12}, + {0x7bc, 12}, + {0xfbd, 13}, + {0xfdc, 13}, + {0x7bd, 12}, + {0xfdd, 13}, + {0x1fbd, 14}, + {0x1fdc, 14}, + {0x1fdd, 14}, + {0x1ffc, 15} + }; + + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab2[13] = { + /* + run = 1 + */ + {0x1, 4}, + {0x8, 5}, + {0x2d, 7}, + {0x6c, 8}, + {0x6d, 8}, + {0xdc, 9}, + {0x1dd, 10}, + {0x3dc, 11}, + {0x3dd, 11}, + {0x77c, 12}, + {0xfbc, 13}, + {0x1f7d, 14}, + {0x1fbc, 14} + }; + + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab3[11] = { + /* + run = 2 + */ + {0x4, 5}, + {0x2c, 7}, + {0xbc, 9}, + {0x1dc, 10}, + {0x3bc, 11}, + {0x3bd, 11}, + {0xefd, 13}, + {0xf7c, 13}, + {0xf7d, 13}, + {0x1efd, 14}, + {0x1f7c, 14} + }; + + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab4[9] = { + /* + run = 3 + */ + {0x5, 5}, + {0x5c, 8}, + {0xbd, 9}, + {0x37d, 11}, + {0x6fc, 12}, + {0xefc, 13}, + {0x1dfd, 14}, + {0x1efc, 14}, + {0x1ffd, 15} + }; + + + /* Indexed by [run-4][level-1] */ + + static VLCtable coeff_RVLCtab5[2][6] = { + /* + run = 4 + */ + { + {0xc, 6}, + {0x5d, 8}, + {0x1bd, 10}, + {0x3fd, 12}, + {0x6fd, 12}, + {0x1bfd, 14} + }, + /* + run = 5 + */ + { + {0xd, 6}, + {0x7d, 9}, + {0x2fc, 11}, + {0x5fc, 12}, + {0x1bfc, 14}, + {0x1dfc, 14} + } + }; + + + /* Indexed by [run-6][level-1] */ + + static VLCtable coeff_RVLCtab6[2][5] = { + /* + run = 6 + */ + { + {0x1c, 7}, + {0x17c, 10}, + {0x2fd, 11}, + {0x5fd, 12}, + {0x2ffc, 15} + }, + /* + run = 7 + */ + { + {0x1d, 7}, + {0x17d, 10}, + {0x37c, 11}, + {0xdfd, 13}, + {0x2ffd, 15} + } + }; + + + /* Indexed by [run-8][level-1] */ + + static VLCtable coeff_RVLCtab7[2][4] = { + /* + run = 8 + */ + { + {0x3c, 8}, + {0x1bc, 10}, + {0xbfd, 13}, + {0x17fd, 14} + }, + /* + run = 9 + */ + { + {0x3d, 8}, + {0x1fd, 11}, + {0xdfc, 13}, + {0x37fc, 15}, + } + }; + + + /* Indexed by [run-10][level-1] */ + + static VLCtable coeff_RVLCtab8[3][2] = { + /* + run = 10 + */ + { + {0x7c, 9}, + {0x3fc, 12} + }, + /* + run = 11 + */ + { + {0xfc, 10}, + {0xbfc, 13} + }, + /* + run = 12 + */ + { + {0xfd, 10}, + {0x37fd, 15} + } + }; + + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab9[7] = { + /* + run = 13 -> 19 + */ + {0x1fc, 11}, + {0x7fc, 13}, + {0x7fd, 13}, + {0xffc, 14}, + {0xffd, 14}, + {0x17fc, 14}, + {0x3bfc, 15} + }; + + + /* first coeffs of last = 1. indexing by [run][level-1] */ + + static VLCtable coeff_RVLCtab10[2][5] = { + /* + run = 0 + */ + { + {0xb, 4}, + {0x78, 8}, + {0x3f5, 11}, + {0xfec, 13}, + {0x1fec, 14} + }, + /* + run = 1 + */ + { + {0x12, 5}, + {0xed, 9}, + {0x7dc, 12}, + {0x1fed, 14}, + {0x3bfd, 15} + } + }; + + + static VLCtable coeff_RVLCtab11[3] = { + /* + run = 2 + */ + {0x13, 5}, + {0x3f8, 11}, + {0x3dfc, 15} + }; + + + static VLCtable coeff_RVLCtab12[11][2] = { + /* + run = 3 + */ + { + {0x18, 6}, + {0x7dd, 12} + }, + /* + run = 4 + */ + { + {0x19, 6}, + {0x7ec, 12} + }, + /* + run = 5 + */ + { + {0x22, 6}, + {0xfed, 13} + }, + /* + run = 6 + */ + { + {0x23, 6}, + {0xff4, 13} + }, + /* + run = 7 + */ + { + {0x35, 7}, + {0xff5, 13} + }, + /* + run = 8 + */ + { + {0x38, 7}, + {0xff8, 13} + }, + /* + run = 9 + */ + { + {0x39, 7}, + {0xff9, 13} + }, + /* + run = 10 + */ + { + {0x42, 7}, + {0x1ff4, 14} + }, + /* + run = 11 + */ + { + {0x43, 7}, + {0x1ff5, 14} + }, + /* + run = 12 + */ + { + {0x79, 8}, + {0x1ff8, 14} + }, + /* + run = 13 + */ + { + {0x82, 8}, + {0x3dfd, 15} + } + }; + + + static VLCtable coeff_RVLCtab13[32] = { + /* + run = 14 -> 45 + */ + {0x83, 8}, + {0xf4, 9}, + {0xf5, 9}, + {0xf8, 9}, + {0xf9, 9}, + {0x102, 9}, + {0x103, 9}, + {0x1f5, 10}, + {0x1f8, 10}, + {0x1f9, 10}, + {0x202, 10}, + {0x203, 10}, + {0x3f9, 11}, + {0x402, 11}, + {0x403, 11}, + {0x7ed, 12}, + {0x7f4, 12}, + {0x7f5, 12}, + {0x7f8, 12}, + {0x7f9, 12}, + {0x802, 12}, + {0x803, 12}, + {0x1002, 13}, + {0x1003, 13}, + {0x1ff9, 14}, + {0x2002, 14}, + {0x2003, 14}, + {0x3efc, 15}, + {0x3efd, 15}, + {0x3f7c, 15}, + {0x3f7d, 15} + }; + + + /* Coeffs for last = 0, run = 0. Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab14[19] = { + /* + run = 0 + */ + {0x6, 3}, + {0x1, 4}, + {0x4, 5}, + {0x1c, 7}, + {0x3c, 8}, + {0x3d, 8}, + {0x7c, 9}, + {0xfc, 10}, + {0xfd, 10}, + {0x1fc, 11}, + {0x1fd, 11}, + {0x3fc, 12}, + {0x7fc, 13}, + {0x7fd, 13}, + {0xbfc, 13}, + {0xbfd, 13}, + {0xffc, 14}, + {0xffd, 14}, + {0x1ffc, 15} + }; + + static VLCtable coeff_RVLCtab15[10] = { + /* + run = 1 + */ + {0x7, 3}, + {0xc, 6}, + {0x5c, 8}, + {0x7d, 9}, + {0x17c, 10}, + {0x2fc, 11}, + {0x3fd, 12}, + {0xdfc, 13}, + {0x17fc, 14}, + {0x17fd, 14} + }; + + static VLCtable coeff_RVLCtab16[2][7] = { + /* + run = 2 + */ + { + {0xa, 4}, + {0x1d, 7}, + {0xbc, 9}, + {0x2fd, 11}, + {0x5fc, 12}, + {0x1bfc, 14}, + {0x1bfd, 14} + }, + /* + run = 3 + */ + { + {0x5, 5}, + {0x5d, 8}, + {0x17d, 10}, + {0x5fd, 12}, + {0xdfd, 13}, + {0x1dfc, 14}, + {0x1ffd, 15} + } + }; + + static VLCtable coeff_RVLCtab17[5] = { + /* + run = 4 + */ + {0x8, 5}, + {0x6c, 8}, + {0x37c, 11}, + {0xefc, 13}, + {0x2ffc, 15} + }; + + static VLCtable coeff_RVLCtab18[3][4] = { + /* + run = 5 + */ + { + {0x9, 5}, + {0xbd, 9}, + {0x37d, 11}, + {0xefd, 13} + }, + /* + run = 6 + */ + { + {0xd, 6}, + {0x1bc, 10}, + {0x6fc, 12}, + {0x1dfd, 14} + }, + /* + run = 7 + */ + { + {0x14, 6}, + {0x1bd, 10}, + {0x6fd, 12}, + {0x2ffd, 15} + } + }; + + static VLCtable coeff_RVLCtab19[2][3] = { + /* + run = 8 + */ + { + {0x15, 6}, + {0x1dc, 10}, + {0xf7c, 13} + }, + /* + run = 9 + */ + { + {0x2c, 7}, + {0x1dd, 10}, + {0x1efc, 14} + } + }; + + static VLCtable coeff_RVLCtab20[8][2] = { + /* + run = 10 + */ + { + {0x2d, 7}, + {0x3bc, 11} + }, + /* + run = 11 + */ + { + {0x34, 7}, + {0x77c, 12} + }, + /* + run = 12 + */ + { + {0x6d, 8}, + {0xf7d, 13} + }, + /* + run = 13 + */ + { + {0x74, 8}, + {0x1efd, 14} + }, + /* + run = 14 + */ + { + {0x75, 8}, + {0x1f7c, 14} + }, + /* + run = 15 + */ + { + {0xdc, 9}, + {0x1f7d, 14} + }, + /* + run = 16 + */ + { + {0xdd, 9}, + {0x1fbc, 14} + }, + /* + run = 17 + */ + { + {0xec, 9}, + {0x37fc, 15} + } + }; + + static VLCtable coeff_RVLCtab21[21] = { + /* + run = 18 -> 38 + */ + {0x1ec, 10}, + {0x1ed, 10}, + {0x1f4, 10}, + {0x3bd, 11}, + {0x3dc, 11}, + {0x3dd, 11}, + {0x3ec, 11}, + {0x3ed, 11}, + {0x3f4, 11}, + {0x77d, 12}, + {0x7bc, 12}, + {0x7bd, 12}, + {0xfbc, 13}, + {0xfbd, 13}, + {0xfdc, 13}, + {0xfdd, 13}, + {0x1fbd, 14}, + {0x1fdc, 14}, + {0x1fdd, 14}, + {0x37fd, 15}, + {0x3bfc, 15} + }; + + + /* first coeffs of last = 1. indexing by [run][level-1] */ + + static VLCtable coeff_RVLCtab22[2][5] = { + /* + run = 0 + */ + { + {0xb, 4}, + {0x78, 8}, + {0x3f5, 11}, + {0xfec, 13}, + {0x1fec, 14} + }, + /* + run = 1 + */ + { + {0x12, 5}, + {0xed, 9}, + {0x7dc, 12}, + {0x1fed, 14}, + {0x3bfd, 15} + } + }; + + static VLCtable coeff_RVLCtab23[3] = { + /* + run = 2 + */ + {0x13, 5}, + {0x3f8, 11}, + {0x3dfc, 15} + }; + + static VLCtable coeff_RVLCtab24[11][2] = { + /* + run = 3 + */ + { + {0x18, 6}, + {0x7dd, 12} + }, + /* + run = 4 + */ + { + {0x19, 6}, + {0x7ec, 12} + }, + /* + run = 5 + */ + { + {0x22, 6}, + {0xfed, 13} + }, + /* + run = 6 + */ + { + {0x23, 6}, + {0xff4, 13} + }, + /* + run = 7 + */ + { + {0x35, 7}, + {0xff5, 13} + }, + /* + run = 8 + */ + { + {0x38, 7}, + {0xff8, 13} + }, + /* + run = 9 + */ + { + {0x39, 7}, + {0xff9, 13} + }, + /* + run = 10 + */ + { + {0x42, 7}, + {0x1ff4, 14} + }, + /* + run = 11 + */ + { + {0x43, 7}, + {0x1ff5, 14} + }, + /* + run = 12 + */ + { + {0x79, 8}, + {0x1ff8, 14} + }, + /* + run = 13 + */ + { + {0x82, 8}, + {0x3dfd, 15} + } + }; + + + static VLCtable coeff_RVLCtab25[32] = { + /* + run = 14 -> 45 + */ + {0x83, 8}, + {0xf4, 9}, + {0xf5, 9}, + {0xf8, 9}, + {0xf9, 9}, + {0x102, 9}, + {0x103, 9}, + {0x1f5, 10}, + {0x1f8, 10}, + {0x1f9, 10}, + {0x202, 10}, + {0x203, 10}, + {0x3f9, 11}, + {0x402, 11}, + {0x403, 11}, + {0x7ed, 12}, + {0x7f4, 12}, + {0x7f5, 12}, + {0x7f8, 12}, + {0x7f9, 12}, + {0x802, 12}, + {0x803, 12}, + {0x1002, 13}, + {0x1003, 13}, + {0x1ff9, 14}, + {0x2002, 14}, + {0x2003, 14}, + {0x3efc, 15}, + {0x3efd, 15}, + {0x3f7c, 15}, + {0x3f7d, 15} + }; + + #endif /* _VLC_H */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/CVS/Entries *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/CVS/Entries Thu Dec 13 18:20:40 2001 *************** *** 0 **** --- 1,10 ---- + /compensate.c/1.1/Fri Nov 30 01:09:03 2001// + /compensate.h/1.1/Fri Nov 30 01:09:03 2001// + /halfpel.c/1.1/Fri Nov 30 01:09:03 2001// + /halfpel.h/1.1/Fri Nov 30 01:09:03 2001// + /mad.c/1.1/Fri Nov 30 01:09:03 2001// + /mad.h/1.2/Sat Dec 1 01:48:32 2001// + /mbmotionestcomp.c/1.2/Sat Dec 1 01:45:44 2001// + /sad.c/1.2/Sat Dec 1 01:45:44 2001// + /sad.h/1.1/Fri Nov 30 01:09:03 2001// + D/intel_mmx//// diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/CVS/Repository *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/mbmotionestcomp diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/CVS/Root *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/compensate.c bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/compensate.c *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/compensate.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/compensate.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,65 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * motion compensation + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 06.11.2001 inital version; (c)2001 peter ross + * + *************************************************************************/ + + + + #include "compensate.h" + + + /* + perform motion compensation (and 8bit->16bit dct transfer) + */ + + void compensate(int16_t * const dct, + uint8_t * const cur, + const uint8_t * ref, + const uint32_t stride) + { + uint32_t i, j; + + for (j = 0; j < 8; j++) + { + for (i = 0; i < 8; i++) + { + uint8_t c = cur[j * stride + i]; + uint8_t r = ref[j * stride + i]; + cur[j * stride + i] = r; + dct[j * 8 + i] = (int16_t)c - (int16_t)r; + } + } + } \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/compensate.h bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/compensate.h *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/compensate.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/compensate.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,18 ---- + #ifndef _COMPENSATE_H_ + #define _COMPENSATE_H_ + + #include "enc_portab.h" + + + void compensate(int16_t * const dct, + uint8_t * const cur, + const uint8_t * ref, + const uint32_t stride); + + void compensate_mmx(int16_t * const dct, + uint8_t * const cur, + const uint8_t * const ref, + const uint32_t stride); + + + #endif /* _COMPENSATE_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/halfpel.c bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/halfpel.c *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/halfpel.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/halfpel.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,94 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * mmx quantization/dequantization + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 05.11.2001 initial version; (c)2001 peter ross + * + *************************************************************************/ + + + #include "halfpel.h" + + + + void interpolate_halfpel_h(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding) + { + const uint32_t n = width * height - 1; + uint32_t i; + + for (i = 0; i < n; i++) + { + uint16_t tot = src[i] + src[i + 1]; + dst[i] = (tot + 1 - rounding) >> 1; + } + } + + + + void interpolate_halfpel_v(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding) + { + const uint32_t n = width * (height - 1); + uint32_t i; + + for (i = 0; i < n; i++) + { + uint16_t tot = src[i] + src[i + width]; + dst[i] = (tot + 1 - rounding) >> 1; + } + } + + + + void interpolate_halfpel_hv(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding) + { + const uint32_t n = width * (height - 1) - 1; + uint32_t i; + + for (i = 0; i < n; i++) + { + uint16_t tot = src[i] + src[i + 1] + src[i + width] + src[i + width + 1]; + dst[i] = (tot + 2 - rounding) >> 2; + } + } \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/halfpel.h bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/halfpel.h *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/halfpel.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/halfpel.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,63 ---- + #ifndef _HALFPEL_H_ + #define _HALFPEL_H_ + + + #include "enc_portab.h" + + + /* plain c */ + + void interpolate_halfpel_h(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding); + + void interpolate_halfpel_v(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding); + + void interpolate_halfpel_hv(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding); + + + + /* mmx & 3dnow */ + + void interpolate_halfpel_h_3dn(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding); + + void interpolate_halfpel_h_mmx(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding); + + void interpolate_halfpel_v_3dn(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding); + + void interpolate_halfpel_v_mmx(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding); + + void interpolate_halfpel_hv_mmx(uint8_t * const dst, + const uint8_t * const src, + const uint32_t width, + const uint32_t height, + const uint32_t rounding); + + + #endif /* _HALFPEL_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Entries *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Entries Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,7 ---- + /compensate_mmx.asm/1.1/Fri Nov 30 01:09:03 2001// + /compensate_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /halfpel_mmx.asm/1.1/Fri Nov 30 01:09:03 2001// + /halfpel_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /mad_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /sad_mmx.asm/1.1/Fri Nov 30 01:09:03 2001// + D diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Repository *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/mbmotionestcomp/intel_mmx diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Root *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/compensate_mmx.asm bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/compensate_mmx.asm *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/compensate_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/compensate_mmx.asm Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,108 ---- + ;/************************************************************************** + ; * + ; * XVID MPEG-4 VIDEO CODEC + ; * mmx motion compensation + ; * + ; * This program is an implementation of a part of one or more MPEG-4 + ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + ; * to use this software module in hardware or software products are + ; * advised that its use may infringe existing patents or copyrights, and + ; * any such use would be at such party's own risk. The original + ; * developer of this software module and his/her company, and subsequent + ; * editors and their companies, will have no liability for use of this + ; * software or modifications or derivatives thereof. + ; * + ; * This program is free software; you can redistribute it and/or modify + ; * it under the terms of the GNU General Public License as published by + ; * the Free Software Foundation; either version 2 of the License, or + ; * (at your option) any later version. + ; * + ; * This program 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 General Public License for more details. + ; * + ; * You should have received a copy of the GNU General Public License + ; * along with this program; if not, write to the Free Software + ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ; * + ; *************************************************************************/ + + ;/************************************************************************** + ; * + ; * History: + ; * + ; * 06.11.2001 inital version; (c)2001 peter ross + ; * + ; *************************************************************************/ + + + bits 32 + + %macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif + %endmacro + + section .text + + + ;=========================================================================== + ; + ; void compensate_mmx(int16_t * const dct, + ; uint8_t * const cur, + ; const uint8_t * const ref, + ; const uint32_t stride); + ; + ;=========================================================================== + + align 16 + cglobal compensate_mmx + compensate_mmx + push esi + push edi + + mov edi, [esp + 8 + 4] ; dct [out] + mov edx, [esp + 8 + 8] ; cur [in/out] + mov esi, [esp + 8 + 12] ; ref [in] + mov ecx, [esp + 8 + 16] ; stride [in] + + pxor mm7, mm7 ; mm7 = zero + + mov eax, 8 + + .loop + movq mm0, [edx] ; mm01 = [cur] + movq mm1, mm0 + punpcklbw mm0, mm7 + punpckhbw mm1, mm7 + + movq mm2, [esi] ; mm23 = [ref] + movq mm3, mm2 + + movq [edx], mm2 ; [cur] = [ref] + + punpcklbw mm2, mm7 + punpckhbw mm3, mm7 + + psubsw mm0, mm2 ; mm01 -= mm23 + psubsw mm1, mm3 + + movq [edi], mm0 ; dct[] = mm01 + movq [edi + 8], mm1 + + add edx, ecx + add esi, ecx + add edi, 16 + + dec eax + jnz .loop + + pop edi + pop esi + + ret \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/compensate_mmx.c bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/compensate_mmx.c *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/compensate_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/compensate_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,39 ---- + #include "../compensate.h" + + void Compensate(const uint8_t* pSrc, uint8_t* pSrc2, + int16_t* pDest, int stride) + { + __asm + { + mov edx, pSrc2 + mov ecx, pDest + mov eax, stride + mov esi, pSrc + mov edi, 8 + pxor mm1, mm1 + p2: + movq mm0, [edx] + movq mm2, mm0 + punpcklbw mm2, mm1 + punpckhbw mm0, mm1 + movq mm3, [esi] + movq mm4, mm3 + movq mm5, mm3 + punpcklbw mm4, mm1 + punpckhbw mm3, mm1 + + psubsw mm0, mm3 + psubsw mm2, mm4 + + movq [ecx], mm2 + movq [ecx+8], mm0 + movq [edx], mm5 + + add ecx, 16 + add edx, eax + add esi, eax + dec edi + jnz p2 + emms + } + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/halfpel_mmx.asm bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/halfpel_mmx.asm *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/halfpel_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/halfpel_mmx.asm Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,404 ---- + ;/************************************************************************** + ; * + ; * XVID MPEG-4 VIDEO CODEC + ; * mmx/3dnow halfpel interpolation + ; * + ; * This program is an implementation of a part of one or more MPEG-4 + ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + ; * to use this software module in hardware or software products are + ; * advised that its use may infringe existing patents or copyrights, and + ; * any such use would be at such party's own risk. The original + ; * developer of this software module and his/her company, and subsequent + ; * editors and their companies, will have no liability for use of this + ; * software or modifications or derivatives thereof. + ; * + ; * This program is free software; you can redistribute it and/or modify + ; * it under the terms of the GNU General Public License as published by + ; * the Free Software Foundation; either version 2 of the License, or + ; * (at your option) any later version. + ; * + ; * This program 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 General Public License for more details. + ; * + ; * You should have received a copy of the GNU General Public License + ; * along with this program; if not, write to the Free Software + ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ; * + ; *************************************************************************/ + + ;/************************************************************************** + ; * + ; * History: + ; * + ; * 16.11.2001 reordered instructions + ; * 05.11.2001 inital version; (c)2001 peter ross + ; * note: assumes src is allocated atleast width*height+1 pixels + ; * + ; *************************************************************************/ + + + bits 32 + + %macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif + %endmacro + + section .data + + + align 16 + + + ;=========================================================================== + ; (1 - r) rounding table + ;=========================================================================== + + rounding1_mmx + times 4 dw 1 + times 4 dw 0 + + + + ;=========================================================================== + ; (2 - r) rounding table + ;=========================================================================== + + rounding2_mmx + times 4 dw 2 + times 4 dw 1 + + + + section .text + + + ;=========================================================================== + ; + ; void interpolate_halfpel_h_3dn(uint8_t * const dst, + ; const uint8_t * const src, + ; const uint32_t width, + ; const uint32_t height, + ; const uint32_t rounding); + ; + ;=========================================================================== + + align 16 + cglobal interpolate_halfpel_h_3dn + interpolate_halfpel_h_3dn + push esi + push edi + + mov eax, [esp + 8 + 20] ; rounding + + or al,al + jnz interpolate_halfpel_h_mmx.start + + ; pavgusb only works when rounding = 0 + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + + mov eax, [esp + 8 + 12] + mul dword [esp + 8 + 16] + shr eax, 4 ; eax = width * height / 16 + + .loop + movq mm0, [esi] + movq mm1, [esi + 8] + pavgusb mm0, [esi + 1] ; mm0 = avg([src], [src+1]) + pavgusb mm1, [esi + 9] ; mm1 = avg([src+8], [src+9]) + movq [edi], mm0 + movq [edi + 8], mm1 + + add esi, 16 + add edi, 16 + dec eax + jnz .loop + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; void interpolate_halfpel_h_mmx(uint8_t * const dst, + ; const uint8_t * const src, + ; const uint32_t width, + ; const uint32_t height, + ; const uint32_t rounding); + ; + ;=========================================================================== + + align 16 + cglobal interpolate_halfpel_h_mmx + interpolate_halfpel_h_mmx + + push esi + push edi + + mov eax, [esp + 8 + 20] ; rounding + + interpolate_halfpel_h_mmx.start + movq mm7, [rounding1_mmx + eax * 8] + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + + pxor mm6, mm6 ; zero + + mov eax, [esp + 8 + 12] + mul dword [esp + 8 + 16] + shr eax, 3 ; eax = width * height / 8 + + .loop + movq mm0, [esi] + movq mm2, [esi + 1] + movq mm1, mm0 + movq mm3, mm2 + punpcklbw mm0, mm6 ; mm01 = [src] + punpcklbw mm2, mm6 ; mm23 = [src + 1] + punpckhbw mm1, mm6 + punpckhbw mm3, mm6 + + paddusw mm0, mm2 ; mm01 += mm23 + paddusw mm1, mm3 + paddusw mm0, mm7 ; mm01 += rounding + paddusw mm1, mm7 + + psrlw mm0, 1 ; mm01 >>= 1 + psrlw mm1, 1 + + packuswb mm0, mm1 + movq [edi], mm0 ; [dst] = mm01 + + add esi, 8 + add edi, 8 + dec eax + jnz .loop + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; void interpolate_halfpel_v_3dn(uint8_t * const dst, + ; const uint8_t * const src, + ; const uint32_t width, + ; const uint32_t height, + ; const uint32_t rounding); + ; + ;=========================================================================== + + align 16 + cglobal interpolate_halfpel_v_3dn + interpolate_halfpel_v_3dn + + push esi + push edi + + mov eax, [esp + 8 + 20] ; rounding + + or al,al + jnz interpolate_halfpel_v_mmx.start + + ; pavgusb only works when rounding = 0 + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + + mov eax, [esp + 8 + 16] + dec eax ; eax = height - 1 + mov ecx, [esp + 8 + 12] ; width + mul ecx + shr eax, 4 ; eax = width * (height-1) / 16 + + .loop + movq mm0, [esi] + movq mm1, [esi + 8] + pavgusb mm0, [esi + ecx] ; mm0 = avg([src], [src+width]) + pavgusb mm1, [esi + ecx + 8] ; mm1 = avg([src+8], [src+width+8]) + movq [edi], mm0 + movq [edi + 8], mm1 + + add esi, 16 + add edi, 16 + dec eax + jnz .loop + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; void interpolate_halfpel_v_mmx(uint8_t * const dst, + ; const uint8_t * const src, + ; const uint32_t width, + ; const uint32_t height, + ; const uint32_t rounding); + ; + ;=========================================================================== + + align 16 + cglobal interpolate_halfpel_v_mmx + interpolate_halfpel_v_mmx + + push esi + push edi + + mov eax, [esp + 8 + 20] ; rounding + + interpolate_halfpel_v_mmx.start + movq mm7, [rounding1_mmx + eax * 8] + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + + pxor mm6, mm6 ; zero + + mov eax, [esp + 8 + 16] + dec eax ; eax = height - 1 + mov ecx, [esp + 8 + 12] ; width + mul ecx + shr eax, 3 ; eax = width * (height-1) / 8 + + .loop + movq mm0, [esi] + movq mm2, [esi + ecx] + + movq mm1, mm0 + movq mm3, mm2 + + punpcklbw mm0, mm6 ; mm01 = [src] + punpcklbw mm2, mm6 ; mm23 = [src + width] + punpckhbw mm1, mm6 + punpckhbw mm3, mm6 + + paddusw mm0, mm2 ; mm01 += mm23 + paddusw mm1, mm3 + paddusw mm0, mm7 ; mm01 += rounding + paddusw mm1, mm7 + + psrlw mm0, 1 ; mm01 >>= 1 + psrlw mm1, 1 + + packuswb mm0, mm1 + movq [edi], mm0 ; [dst] = mm01 + + add esi, 8 + add edi, 8 + dec eax + jnz .loop + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; void interpolate_halfpel_hv_mmx(uint8_t * const dst, + ; const uint8_t * const src, + ; const uint32_t width, + ; const uint32_t height, + ; const uint32_t rounding); + ; + ; 3dnow(pavgusb) is no help to us here! + ; + ;=========================================================================== + + align 16 + cglobal interpolate_halfpel_hv_mmx + interpolate_halfpel_hv_mmx + + push esi + push edi + + mov eax, [esp + 8 + 20] ; rounding + movq mm7, [rounding2_mmx + eax * 8] + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + + pxor mm6, mm6 ; zero + + mov eax, [esp + 8 + 16] + dec eax ; eax = height - 1 + mov ecx, [esp + 8 + 12] ; width + mul ecx + shr eax, 3 ; eax = width * (height - 1) / 8 + + .loop + ; current row + + movq mm0, [esi] + movq mm2, [esi + 1] + + movq mm1, mm0 + movq mm3, mm2 + + punpcklbw mm0, mm6 ; mm01 = [src] + punpcklbw mm2, mm6 ; mm23 = [src + 1] + punpckhbw mm1, mm6 + punpckhbw mm3, mm6 + + paddusw mm0, mm2 ; mm01 += mm23 + paddusw mm1, mm3 + + ; next row + + movq mm4, [esi + ecx] + movq mm2, [esi + ecx + 1] + + movq mm5, mm4 + movq mm3, mm2 + + punpcklbw mm4, mm6 ; mm45 = [src + width] + punpcklbw mm2, mm6 ; mm23 = [src + width + 1] + punpckhbw mm5, mm6 + punpckhbw mm3, mm6 + + paddusw mm4, mm2 ; mm45 += mm23 + paddusw mm5, mm3 + + ; add current + next row + + paddusw mm0, mm4 ; mm01 += mm45 + paddusw mm1, mm5 + paddusw mm0, mm7 ; mm01 += rounding2 + paddusw mm1, mm7 + + psrlw mm0, 2 ; mm01 >>= 2 + psrlw mm1, 2 + + packuswb mm0, mm1 + movq [edi], mm0 ; [dst] = mm01 + + add esi, 8 + add edi, 8 + dec eax + jnz .loop + + pop edi + pop esi + + ret \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/halfpel_mmx.c bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/halfpel_mmx.c *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/halfpel_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/halfpel_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,347 ---- + /************************************************************************** + * * + * This code is developed by John Funnell. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * halfpel_mmx.c, half-pixel interpolation routines, MMX version, + * Intel syntax + * + * Copyright (C) 2001 Project Mayo + * + * John Funnell + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* + + interpolate_halfpel.c + + Generates interpolated planes for use by the encoder in half-pel motion estimation + and motion compensation. + + John Funnell, 23 March 2001 + + (C) Project Mayo 2001 + + */ + #include "../halfpel.h" + + //#define PENTIUMIII + + #ifdef PENTIUMIII + #define MOVNTQ movntq + #else + #define MOVNTQ movq + #define prefetchnta // + #endif + + const uint64_t mm_7f7f7f7f7f7f7f7f = 0x7f7f7f7f7f7f7f7f; + const uint64_t mm_0002000200020002 = 0x0002000200020002; + const uint64_t mm_0001000100010001 = 0x0001000100010001; + const uint64_t mm_0202020202020202 = 0x0202020202020202; + const uint64_t mm_3f3f3f3f3f3f3f3f = 0x3f3f3f3f3f3f3f3f; + const uint64_t mm_0101010101010101 = 0x0101010101010101; + const uint64_t mm_f0f0f0f0f0f0f0f0 = 0xf0f0f0f0f0f0f0f0; + const uint64_t mm_0f0f0f0f0f0f0f0f = 0x0f0f0f0f0f0f0f0f; + + static __inline void interpolate_halfpel_h_noround( + uint8_t *src, + uint8_t *dstH, + int width, /* width % 16 == 0 */ + int height) + { + int y, xcount, flyback; + + // flyback = stride - width; + + xcount = width >> 4; + __asm { + push eax + push ebx + push edi + push esi + mov eax, src + mov ebx, dstH + movq mm7, mm_7f7f7f7f7f7f7f7f; + mov edi, height + horiz_round0_loop_y: + mov esi, xcount + horiz_round0_loop_x: + movq mm0, [eax] + movq mm4, [eax+8] + movq mm1, [eax+1] + movq mm5, [eax+9] + movq mm2, mm0 + pxor mm0, mm1 + por mm1, mm2 + psrlq mm0, 1 + add eax, 16 + pand mm0, mm7 + psubb mm1, mm0 + MOVNTQ [ebx], mm1 + movq mm6, mm4 + pxor mm4, mm5 + por mm5, mm6 + psrlq mm4, 1 + pand mm4, mm7 + psubb mm5, mm4 + MOVNTQ [ebx+8], mm5 + add ebx, 16 + dec esi + jne horiz_round0_loop_x + // add eax, flyback + // add ebx, flyback + dec edi + jne horiz_round0_loop_y + pop esi + pop edi + pop ebx + pop eax + emms + } + } + static __inline void interpolate_halfpel_v_noround( + uint8_t *src, + uint8_t *dstV, + int width, /* width % 16 == 0 */ + int height) + { + int y, xcount, flyback; + + // flyback = stride - width; + + xcount = width >> 4; + __asm { + push eax + push ebx + push ecx + push edi + push esi + mov eax, src + mov ecx, src + add ecx, width + mov ebx, dstV + movq mm7, mm_7f7f7f7f7f7f7f7f; + mov edi, height + vert_round0_loop_y: + mov esi, xcount + vert_round0_loop_x: + movq mm0, [eax] + movq mm4, [eax+8] + movq mm1, [ecx] + movq mm5, [ecx+8] + movq mm2, mm0 + pxor mm0, mm1 + por mm1, mm2 + psrlq mm0, 1 + add eax, 16 + pand mm0, mm7 + psubb mm1, mm0 + MOVNTQ [ebx], mm1 + movq mm6, mm4 + pxor mm4, mm5 + por mm5, mm6 + psrlq mm4, 1 + add ecx, 16 + pand mm4, mm7 + psubb mm5, mm4 + MOVNTQ [ebx+8], mm5 + add ebx, 16 + dec esi + jne vert_round0_loop_x + // add eax, flyback + // add ebx, flyback + // add ecx, flyback + dec edi + jne vert_round0_loop_y + pop esi + pop edi + pop ecx + pop ebx + pop eax + emms + } + } + + static __inline void interpolate_halfpel_hv_noround( + uint8_t *src, + uint8_t *dstHV, + int width, /* width % 16 == 0 */ + int height) + { + } + + void interpolate_halfpel_h( + uint8_t *src, + uint8_t *dstH, + int width, /* width % 16 == 0 */ + int height, + int rounding) + { + int i; + if(!rounding) + { + interpolate_halfpel_h_noround(src, dstH, width, height); + return; + } + for(i=0; i>1; + src++; + } + + } + + void interpolate_halfpel_v( + uint8_t *src, + uint8_t *dstV, + int width, /* width % 16 == 0 */ + int height, + int rounding) + { + int i; + if(!rounding) + { + interpolate_halfpel_v_noround(src, dstV, width, height); + return; + } + for(i=0; i>1; + src++; + } + + } + + void interpolate_halfpel_hv( + uint8_t *src, + uint8_t *dstHV, + int width, /* width % 16 == 0 */ + int height, + int rounding) + { + int y, xcount, flyback; + + // flyback = stride - width; + + xcount = width >> 4; + __asm { + push eax + push ebx + push ecx + push edi + push esi + mov eax, rounding + test eax, eax + jnz has_rounding + movq mm6, mm_0002000200020002 + jmp cont + has_rounding: + movq mm6, mm_0001000100010001 + cont: + mov eax, src + mov ecx, src + add ecx, width + mov ebx, dstHV + pxor mm7, mm7 + mov edi, height + horizvert_round0_loop_y: + mov esi, xcount + horizvert_round0_loop_x: + movq mm0, [eax] + movq mm1, mm0 + punpcklbw mm0, mm7 + movq mm2, [eax+1] + punpckhbw mm1, mm7 + movq mm3, mm2 + punpcklbw mm2, mm7 + paddw mm0, mm6 + punpckhbw mm3, mm7 + paddw mm1, mm6 + movq mm4, [ecx] + paddw mm0, mm2 + movq mm5, mm4 + punpcklbw mm4, mm7 + paddw mm1, mm3 + punpckhbw mm5, mm7 + paddw mm0, mm4 + paddw mm1, mm5 + movq mm4, [ecx+1] + movq mm5, mm4 + punpcklbw mm4, mm7 + // prefetchnta [ecx+32] + punpckhbw mm5, mm7 + paddw mm4, mm0 + paddw mm5, mm1 + psrlw mm4, 2 + movq mm0, [eax+8] + psrlw mm5, 2 + movq mm1, mm0 + punpcklbw mm0, mm7 + movq mm2, [eax+9] + punpckhbw mm1, mm7 + movq mm3, mm2 + packuswb mm4, mm5 + paddw mm0, mm6 + punpcklbw mm2, mm7 + add eax, 16 + punpckhbw mm3, mm7 + MOVNTQ [ebx], mm4 + paddw mm1, mm6 + movq mm4, [ecx+8] + paddw mm0, mm2 + movq mm5, mm4 + punpcklbw mm4, mm7 + paddw mm1, mm3 + punpckhbw mm5, mm7 + paddw mm0, mm4 + paddw mm1, mm5 + movq mm4, [ecx+9] + movq mm5, mm4 + punpcklbw mm4, mm7 + add ecx, 16 + punpckhbw mm5, mm7 + paddw mm4, mm0 + paddw mm5, mm1 + psrlw mm4, 2 + psrlw mm5, 2 + packuswb mm4, mm5 + MOVNTQ [ebx+8], mm4 + add ebx, 16 + dec esi + jne horizvert_round0_loop_x + // add eax, flyback + // add ebx, flyback + // add ecx, flyback + dec edi + jne horizvert_round0_loop_y + pop esi + pop edi + pop ecx + pop ebx + pop eax + emms + } + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/mad_mmx.c bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/mad_mmx.c *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/mad_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/mad_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,339 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mad.c, utility functions that calculate MADs and SADs. + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + /************************************************************************** + * + * Modifications: + * + * 19.09.2001 removed some warnings + * + * Michael Militzer + * + **************************************************************************/ + + #include "../mad.h" + #define ABS(X) (((X)>0)?(X):-(X)) + + float MAD_Image(const Image* pIm, const Image* pImage) + { + int x, y; + int32_t sum=0; + // int iStride=pImage->iWidth; + int iStride2=pImage->iEdgedWidth; + + for(y=0; yiHeight; y++) + for(x=0; xiWidth; x++) + sum+=ABS((int32_t)pImage->pY[x+y*iStride2]-(int32_t)pIm->pY[x+y*iStride2]); + + // iStride/=2; + iStride2/=2; + + for(y=0; yiHeight/2; y++) + for(x=0; xiWidth/2; x++) + sum+=ABS((int32_t)pImage->pU[x+y*iStride2]-(int32_t)pIm->pU[x+y*iStride2]); + + for(y=0; yiHeight/2; y++) + for(x=0; xiWidth/2; x++) + sum+=ABS((int32_t)pImage->pV[x+y*iStride2]-(int32_t)pIm->pV[x+y*iStride2]); + + return ((float)sum)/(pImage->iWidth*pImage->iHeight*3/2); + } + + // x & y in blocks ( 8 pixel units ) + // dx & dy in pixels + + static const int64_t mm_FFFFFFFFFFFFFFFF=0xFFFFFFFFFFFFFFFFi64; + + #define SAD_INIT \ + __asm xor eax, eax \ + __asm movq mm7, mm_FFFFFFFFFFFFFFFF \ + __asm pxor mm0, mm0 \ + __asm pxor mm1, mm1 + // "movl %1, %%ecx\n" + // "movl %2, %%edx\n" + + #define SAD_ONE_STEP(X) \ + __asm movq mm2, [ecx+X] \ + __asm movq mm3, [edx+X] \ + \ + __asm movq mm4, mm2 \ + __asm movq mm5, mm3 \ + __asm punpcklbw mm2, mm0 \ + __asm punpckhbw mm4, mm0 \ + __asm punpcklbw mm3, mm0 \ + __asm punpckhbw mm5, mm0 \ + \ + __asm psubw mm3, mm2 \ + __asm psubw mm5, mm4 \ + \ + __asm movq mm2, mm3 \ + __asm movq mm4, mm5 \ + __asm pcmpgtw mm2, mm0 \ + __asm pcmpgtw mm4, mm0 \ + __asm pxor mm2, mm7 \ + __asm pxor mm4, mm7 \ + __asm pxor mm3, mm2 \ + __asm pxor mm5, mm4 \ + __asm psubw mm3, mm2 \ + __asm psubw mm5, mm4 \ + __asm paddusw mm1, mm3 \ + __asm paddusw mm1, mm5 + + + #define SAD_PACK \ + __asm movq mm2, mm1 \ + __asm psrlq mm1, 32 \ + __asm paddusw mm1, mm2 \ + __asm movq mm2, mm1 \ + __asm psrlq mm1, 16 \ + __asm paddusw mm1, mm2 \ + __asm movd ecx, mm1 \ + __asm and ecx, 0xFFFF + + + int32_t SAD_Block(const Image* pIm, const Image* pImage, + int x, int y, + int dx, int dy, + int sad_opt, + int component) + { + int32_t sum=0; + // int i, j; + const uint8_t *pRef; + const uint8_t *pCur; + int iWidth=pImage->iWidth; + int iEdgedWidth=pImage->iEdgedWidth; + + switch(component) + { + case 0: + + pRef=pIm->pY+x*8+y*8*pImage->iEdgedWidth; + pCur=pImage->pY+(x*8+dx)+(y*8+dy)*pImage->iEdgedWidth; + break; + + case 1: + pRef=pIm->pU+x*8+y*8*pImage->iEdgedWidth/2; + pCur=pImage->pU+(x*8+dx)+(y*8+dy)*pImage->iEdgedWidth/2; + break; + + case 2: + + default: + pRef=pIm->pV+x*8+y*8*pImage->iEdgedWidth/2; + pCur=pImage->pV+(x*8+dx)+(y*8+dy)*pImage->iEdgedWidth/2; + break; + } + + if(component) + { + iWidth/=2; + iEdgedWidth/=2; + } + + + SAD_INIT + __asm mov edi, 8 + __asm mov ecx, pRef + __asm mov edx, pCur + + p1: + + SAD_ONE_STEP(0) + + __asm add ecx, iEdgedWidth + __asm add edx, iEdgedWidth + __asm dec edi + __asm jnz p1 + + SAD_PACK + __asm mov sum, ecx + + return sum; + } + + int32_t SAD_Macroblock(const Image* pIm, + const Image* pImageN, const Image* pImageH, const Image* pImageV, const Image* pImageHV, + int x, int y, int dx, int dy, int sad_opt, int iQuality) + { + const Image* pImage; + int32_t sum=0; + // int i, j; + + const uint8_t *pRef; + const uint8_t *pCur; + int iWidth=pImageN->iEdgedWidth; + int iEdgedWidth=pImageN->iEdgedWidth; + + switch(((dx%2)?2:0)+((dy%2)?1:0)) + { + case 0: + + pImage=pImageN; + break; + + case 1: + + pImage=pImageV; + dy--; + break; + + case 2: + + pImage=pImageH; + dx--; + break; + + case 3: + + default: + pImage=pImageHV; + dx--; + dy--; + break; + } + dx/=2; + dy/=2; + + pRef=pIm->pY+x*16+y*16*iEdgedWidth; + pCur=pImage->pY+(x*16+dx)+(y*16+dy)*iEdgedWidth; + + switch(iQuality) + { + case 1: + + iEdgedWidth*=4; + iEdgedWidth*=4; + SAD_INIT + __asm mov edi, 4 + __asm mov ecx, pRef + __asm mov edx, pCur + + + p4: + + SAD_ONE_STEP(0) + + SAD_ONE_STEP(8) + __asm add ecx, iEdgedWidth + __asm add edx, iEdgedWidth + __asm dec edi + __asm jnz p4 + + + SAD_PACK + __asm mov sum, ecx + + return sum*4; + + case 2: + + iEdgedWidth*=2; + iEdgedWidth*=2; + + SAD_INIT + __asm mov edi, 8 + __asm mov ecx, pRef + __asm mov edx, pCur + + + + p3: + SAD_ONE_STEP(0) + SAD_ONE_STEP(8) + __asm add ecx, iEdgedWidth + __asm add edx, iEdgedWidth + __asm dec edi + __asm jnz p3 + + + SAD_PACK + __asm mov sum, ecx + + return sum*2; + + default: + + SAD_INIT + __asm mov ecx, pRef + __asm mov edx, pCur + __asm mov edi, 16 + + + p2: + SAD_ONE_STEP(0) + SAD_ONE_STEP(8) + __asm add ecx, iEdgedWidth + __asm add edx, iEdgedWidth + __asm dec edi + __asm jnz p2 + + + SAD_PACK + __asm mov sum, ecx + + return sum; + } + } + + + int32_t SAD_Deviation_MB(const Image* pIm, int x, int y) + { + int32_t sum=0, avg=0; + const uint8_t *pRef; + int i, j; + int width=pIm->iEdgedWidth; + + + pRef=pIm->pY+x*16+y*16*width; + + for(i=0; i<16; i++) + { + for(j=0; j<16; j++) + sum+=(int32_t)pRef[j]; + pRef+=width; + } + + sum/=256; + + pRef=pIm->pY+x*16+y*16*width; + + for(i=0; i<16; i++) + { + for(j=0; j<16; j++) + avg+=ABS((int32_t)pRef[j]-sum); + pRef+=width; + } + return avg; + } \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/sad_mmx.asm bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/sad_mmx.asm *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/intel_mmx/sad_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/intel_mmx/sad_mmx.asm Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,497 ---- + ;/************************************************************************** + ; * + ; * XVID MPEG-4 VIDEO CODEC + ; * mmx/xmm sum of absolute difference + ; * + ; * This program is an implementation of a part of one or more MPEG-4 + ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + ; * to use this software module in hardware or software products are + ; * advised that its use may infringe existing patents or copyrights, and + ; * any such use would be at such party's own risk. The original + ; * developer of this software module and his/her company, and subsequent + ; * editors and their companies, will have no liability for use of this + ; * software or modifications or derivatives thereof. + ; * + ; * This program is free software; you can redistribute it and/or modify + ; * it under the terms of the GNU General Public License as published by + ; * the Free Software Foundation; either version 2 of the License, or + ; * (at your option) any later version. + ; * + ; * This program 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 General Public License for more details. + ; * + ; * You should have received a copy of the GNU General Public License + ; * along with this program; if not, write to the Free Software + ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ; * + ; *************************************************************************/ + + ;/************************************************************************** + ; * + ; * History: + ; * + ; * 17.11.2001 bugfix and small improvement for dev16_xmm, + ; * removed terminate early in sad16_xmm + ; * 12.11.2001 inital version; (c)2001 peter ross + ; * + ; *************************************************************************/ + + + bits 32 + + %macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif + %endmacro + + section .data + + + align 16 + mmx_one times 4 dw 1 + + + section .text + + + ;=========================================================================== + ; + ; uint32_t sad16_mmx(const uint8_t * const cur, + ; const uint8_t * const ref, + ; const uint32_t stride, + ; const uint32_t best_sad); + ; + ; (early termination ignore; slows this down) + ; + ;=========================================================================== + + align 16 + cglobal sad16_mmx + sad16_mmx + push esi + push edi + + mov esi, [esp + 8 + 4] ; ref + mov edi, [esp + 8 + 8] ; cur + mov ecx, [esp + 8 + 12] ; stride + mov edx, 16 + + pxor mm6, mm6 ; mm6 = sum = 0 + pxor mm7, mm7 ; mm7 = 0 + .loop + movq mm0, [esi] ; ref + movq mm1, [edi] ; cur + + movq mm2, [esi+8] ; ref2 + movq mm3, [edi+8] ; cur2 + + movq mm4, mm0 + movq mm5, mm2 + + psubusb mm0, mm1 + psubusb mm2, mm3 + + psubusb mm1, mm4 + psubusb mm3, mm5 + + por mm0, mm1 ; mm0 = |ref - cur| + por mm2, mm3 ; mm2 = |ref2 - cur2| + + movq mm1,mm0 + movq mm3,mm2 + + punpcklbw mm0,mm7 + punpcklbw mm2,mm7 + + punpckhbw mm1,mm7 + punpckhbw mm3,mm7 + + paddusw mm0,mm1 + paddusw mm2,mm3 + + paddusw mm6,mm0 ; sum += mm01 + paddusw mm6,mm2 ; sum += mm23 + + add esi, ecx + add edi, ecx + dec edx + jnz .loop + + pmaddwd mm6, [mmx_one] ; merge sum + movq mm7, mm6 + psrlq mm7, 32 + paddd mm6, mm7 + movd eax, mm6 + + pop edi + pop esi + + ret + + + ;=========================================================================== + ; + ; uint32_t sad16_xmm(const uint8_t * const cur, + ; const uint8_t * const ref, + ; const uint32_t stride, + ; const uint32_t best_sad); + ; + ; experimental! + ; + ;=========================================================================== + + align 16 + cglobal sad16_xmm + sad16_xmm + push esi + push edi + push ebx + + mov esi, [esp + 12 + 4] ; ref + mov edi, [esp + 12 + 8] ; cur + mov ecx, [esp + 12 + 12] ; stride + mov ebx, [esp + 12 + 16] ; best_sad + mov edx, 16 + + pxor mm6, mm6 ; mm6 = sum = 0 + .loop + movq mm0, [esi] ; ref + movq mm2, [esi+8] ; ref2 + + psadbw mm0, [edi] ; mm0 = |ref - cur| + psadbw mm2, [edi+8] ; mm0 = |ref2 - cur2| + + paddusw mm6,mm0 ; sum += mm01 + paddusw mm6,mm2 ; sum += mm23 + + add esi, ecx + add edi, ecx + dec edx + jnz .loop + + movd eax, mm6 + + .ret pop ebx + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; uint32_t sad8_mmx(const uint8_t * const cur, + ; const uint8_t * const ref, + ; const uint32_t stride); + ; + ;=========================================================================== + align 16 + cglobal sad8_mmx + sad8_mmx + push esi + push edi + + mov esi, [esp + 8 + 4] ; ref + mov edi, [esp + 8 + 8] ; cur + mov ecx, [esp + 8 + 12] ; stride + mov eax, 4 + + pxor mm6, mm6 ; mm6 = sum = 0 + pxor mm7, mm7 ; mm7 = 0 + .loop + movq mm0, [esi] ; ref + movq mm1, [edi] ; cur + + movq mm2, [esi+ecx] ; ref2 + movq mm3, [edi+ecx] ; cur2 + + movq mm4, mm0 + movq mm5, mm2 + + psubusb mm0, mm1 + psubusb mm2, mm3 + + psubusb mm1, mm4 + psubusb mm3, mm5 + + por mm0, mm1 ; mm0 = |ref - cur| + por mm2, mm3 ; mm2 = |ref2 - cur2| + + movq mm1,mm0 + movq mm3,mm2 + + punpcklbw mm0,mm7 + punpcklbw mm2,mm7 + + punpckhbw mm1,mm7 + punpckhbw mm3,mm7 + + paddusw mm0,mm1 + paddusw mm2,mm3 + + paddusw mm6,mm0 ; sum += mm01 + paddusw mm6,mm2 ; sum += mm23 + + add esi, ecx + add edi, ecx + add esi, ecx + add edi, ecx + dec eax + jnz .loop + + pmaddwd mm6, [mmx_one] ; merge sum + movq mm7, mm6 + psrlq mm7, 32 + paddd mm6, mm7 + movd eax, mm6 + + pop edi + pop esi + + ret + + + + + ;=========================================================================== + ; + ; uint32_t sad8_xmm(const uint8_t * const cur, + ; const uint8_t * const ref, + ; const uint32_t stride); + ; + ; experimental! + ; + ;=========================================================================== + align 16 + cglobal sad8_xmm + sad8_xmm + push esi + push edi + + mov esi, [esp + 8 + 4] ; ref + mov edi, [esp + 8 + 8] ; cur + mov ecx, [esp + 8 + 12] ; stride + mov edx, ecx + shl edx, 1 + + mov eax, 4 + + pxor mm6, mm6 ; mm6 = sum = 0 + .loop + movq mm0, [esi] ; ref + movq mm2, [esi+ecx] ; ref2 + + psadbw mm0, [edi] ; mm0 = |ref - cur| + psadbw mm2, [edi+ecx] ; mm0 = |ref2 - cur2| + + paddusw mm6,mm0 ; sum += mm01 + paddusw mm6,mm2 ; sum += mm23 + + add esi, edx + add edi, edx + dec eax + jnz .loop + + movd eax, mm6 + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; uint32_t dev16_mmx(const uint8_t * const cur, + ; const uint32_t stride); + ; + ;=========================================================================== + + align 16 + cglobal dev16_mmx + dev16_mmx + + push esi + push edi + + pxor mm4, mm4 ; mm23 = sum = 0 + pxor mm5, mm5 + + mov esi, [esp + 8 + 4] ; cur + mov ecx, [esp + 8 + 8] ; stride + mov edi, esi + + mov eax, 16 + pxor mm7, mm7 ; mm7 = 0 + .loop1 + movq mm0, [esi] + movq mm2, [esi + 8] + + movq mm1, mm0 + movq mm3, mm2 + + punpcklbw mm0, mm7 + punpcklbw mm2, mm7 + + punpckhbw mm1, mm7 + punpckhbw mm3, mm7 + + paddw mm0, mm1 + paddw mm2, mm3 + + paddw mm4, mm0 + paddw mm5, mm2 + + add esi, ecx + dec eax + jnz .loop1 + + paddusw mm4, mm5 + pmaddwd mm4, [mmx_one] ; merge sum + movq mm5, mm4 + psrlq mm5, 32 + paddd mm4, mm5 + + psllq mm4, 32 ; blank upper dword + psrlq mm4, 32 + 8 ; mm4 /= (16*16) + + punpckldq mm4, mm4 + packssdw mm4, mm4 ; mm4 = mean + + pxor mm6, mm6 ; mm6 = dev = 0 + mov eax, 16 + .loop2 + movq mm0, [edi] + movq mm2, [edi + 8] + + movq mm1, mm0 + movq mm3, mm2 + + punpcklbw mm0, mm7 + punpcklbw mm2, mm7 + + punpckhbw mm1, mm7 ; mm01 = cur + punpckhbw mm3, mm7 ; mm23 = cur2 + + movq mm5, mm4 ; + psubusw mm5, mm0 ; + psubusw mm0, mm4 ; + por mm0, mm5 ; + movq mm5, mm4 ; + psubusw mm5, mm1 ; + psubusw mm1, mm4 ; + por mm1, mm5 ; mm01 = |mm01 - mm4| + + + movq mm5, mm4 ; + psubusw mm5, mm2 ; + psubusw mm2, mm4 ; + por mm2, mm5 ; + + movq mm5, mm4 ; + psubusw mm5, mm3 ; + psubusw mm3, mm4 ; + por mm3, mm5 ; mm23 = |mm23 - mm4| + + paddw mm0, mm1 + paddw mm2, mm3 + + paddw mm6, mm0 + paddw mm6, mm2 ; dev += mm01 + mm23 + + add edi, ecx + dec eax + jnz .loop2 + + pmaddwd mm6, [mmx_one] ; merge dev + movq mm7, mm6 + psrlq mm7, 32 + paddd mm6, mm7 + movd eax, mm6 + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; uint32_t dev16_xmm(const uint8_t * const cur, + ; const uint32_t stride); + ; + ; experimental! + ; + ;=========================================================================== + + align 16 + cglobal dev16_xmm + dev16_xmm + + push esi + push edi + + pxor mm4, mm4 ; mm23 = sum = 0 + + mov esi, [esp + 8 + 4] ; cur + mov ecx, [esp + 8 + 8] ; stride + mov edi, esi + + mov eax, 16 + pxor mm7, mm7 ; mm7 = 0 + .loop1 + movq mm0, [esi] + movq mm2, [esi + 8] + + psadbw mm0, mm7 ; abs(cur0 - 0) + abs(cur1 - 0) + ... + abs(cur7 - 0) -> mm0 + psadbw mm2, mm7 ; abs(cur8 - 0) + abs(cur9 - 0) + ... + abs(cur15 - 0) -> mm2 + + paddw mm4,mm0 ; mean += mm0 + paddw mm4,mm2 ; mean += mm2 + + add esi, ecx + dec eax + jnz .loop1 + + movq mm5, mm4 + psllq mm5, 32 + paddd mm4, mm5 + + psrld mm4, 8 + packssdw mm4, mm4 + packuswb mm4, mm4 + + pxor mm6, mm6 ; mm6 = dev = 0 + mov eax, 16 + .loop2 + movq mm0, [edi] + movq mm2, [edi + 8] + + psadbw mm0, mm4 ; mm0 = |cur - mean| + psadbw mm2, mm4 ; mm0 = |cur2 - mean| + + paddw mm6,mm0 ; dev += mm01 + paddw mm6,mm2 ; dev += mm23 + + add edi, ecx + dec eax + jnz .loop2 + + movq mm7, mm6 + psllq mm7, 32 + paddd mm6, mm7 + movd eax, mm6 + + pop edi + pop esi + + ret \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/mad.c bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/mad.c *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/mad.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/mad.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,274 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + + /************************************************************************** + * + * mad.c, utility functions that calculate MADs and SADs. + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + /************************************************************************** + * + * Modifications: + * + * 10.09.2001 improved/corrected mad calculation for iQuality = 1 and 2 + * + * (C) Michael Militzer + * + **************************************************************************/ + + #include "mad.h" + + #define ABS(X) (((X)>0)?(X):-(X)) + + float MAD_Image(const Image * pIm, const Image * pImage) + { + int x, y; + int32_t sum = 0; + + int iStride = pImage->iEdgedWidth; + + + for (y = 0; y < pImage->iHeight; y++) + for (x = 0; x < pImage->iWidth; x++) + sum += + ABS((int32_t) pImage->pY[x + y * iStride] - + (int32_t) pIm->pY[x + y * iStride]); + + iStride /= 2; + + for (y = 0; y < pImage->iHeight / 2; y++) + for (x = 0; x < pImage->iWidth / 2; x++) + sum += + ABS((int32_t) pImage->pU[x + y * iStride] - + (int32_t) pIm->pU[x + y * iStride]); + + for (y = 0; y < pImage->iHeight / 2; y++) + for (x = 0; x < pImage->iWidth / 2; x++) + sum += + ABS((int32_t) pImage->pV[x + y * iStride] - + (int32_t) pIm->pV[x + y * iStride]); + + return ((float) sum) / (pImage->iWidth * pImage->iHeight * 3 / 2); + } + + + // x & y in blocks ( 8 pixel units ) + // dx & dy in pixels + + int32_t SAD_Block(const Image * pIm, const Image * pImage, + int x, int y, int dx, int dy, int sad_opt, int component) + { + int32_t sum = 0; + int i, j; + + const uint8_t *pRef; + const uint8_t *pCur; + + int iEdgedWidth = pImage->iEdgedWidth; + + + switch (component) + { + case 0: + + pRef = pIm->pY + x * 8 + y * 8 * pImage->iEdgedWidth; + pCur = pImage->pY + (x * 8 + dx) + (y * 8 + dy) * pImage->iEdgedWidth; + break; + + case 1: + + pRef = pIm->pU + x * 8 + y * 8 * pImage->iEdgedWidth / 2; + pCur = pImage->pU + (x * 8 + dx) + (y * 8 + dy) * pImage->iEdgedWidth / 2; + break; + + case 2: + + default: + + pRef = pIm->pV + x * 8 + y * 8 * pImage->iEdgedWidth / 2; + pCur = pImage->pV + (x * 8 + dx) + (y * 8 + dy) * pImage->iEdgedWidth / 2; + break; + } + + if (component) + iEdgedWidth /= 2; + + for (i = 0; i < 8; i++) + { + for (j = 0; j < 8; j++) + sum += ABS((int32_t) pRef[j] - (int32_t) pCur[j]); + + if (sum > sad_opt) + return sum; + + pRef += iEdgedWidth; + pCur += iEdgedWidth; + } + + return sum; + } + + + int32_t SAD_Macroblock(const Image * pIm, + const Image * pImageN, const Image * pImageH, + const Image * pImageV, const Image * pImageHV, int x, int y, + int dx, int dy, int sad_opt, int iQuality) + { + const Image *pImage; + int32_t sum = 0; + + int i, j; + + const uint8_t *pRef; + const uint8_t *pCur; + + int iEdgedWidth = pImageN->iEdgedWidth; + + switch (((dx % 2) ? 2 : 0) + ((dy % 2) ? 1 : 0)) + { + case 0: + + pImage = pImageN; + break; + + case 1: + + pImage = pImageV; + dy--; + break; + + case 2: + + pImage = pImageH; + dx--; + break; + + case 3: + + default: + + pImage = pImageHV; + dx--; + dy--; + break; + } + + dx /= 2; + dy /= 2; + + pRef = pIm->pY + x * 16 + y * 16 * iEdgedWidth; + pCur = pImage->pY + (x * 16 + dx) + (y * 16 + dy) * iEdgedWidth; + + switch (iQuality) + { + + case 1: + + for (i = 0; i < 16; i += 4) + { + for (j = 0; j < 16; j += 4) + sum += ABS((int32_t) pRef[j] - (int32_t) pCur[j]); + + if (sum * 16 > sad_opt) + return sum * 16; + + pRef += 4 * iEdgedWidth; + pCur += 4 * iEdgedWidth; + } + + return sum * 16; + + case 2: + + for (i = 0; i < 16; i += 2) + { + for (j = 0; j < 16; j += 2) + sum += ABS((int32_t) pRef[j] - (int32_t) pCur[j]); + + if (sum * 4 > sad_opt) + return sum * 4; + + pRef += 2 * iEdgedWidth; + pCur += 2 * iEdgedWidth; + } + + return sum * 4; + + default: + + for (i = 0; i < 16; i++) + { + for (j = 0; j < 16; j++) + sum += ABS((int32_t) pRef[j] - (int32_t) pCur[j]); + + if (sum > sad_opt) + return sum; + + pRef += iEdgedWidth; + pCur += iEdgedWidth; + } + + return sum; + } + } + + int32_t SAD_Deviation_MB(const Image * pIm, int x, int y) + { + + int32_t sum = 0, avg = 0; + const uint8_t *pRef; + + int i, j; + int width = pIm->iEdgedWidth; + + pRef = pIm->pY + x * 16 + y * 16 * width; + + for (i = 0; i < 16; i++) + { + for (j = 0; j < 16; j++) + sum += (int32_t) pRef[j]; + + pRef += width; + } + + sum /= 256; + + pRef = pIm->pY + x * 16 + y * 16 * width; + + for (i = 0; i < 16; i++) + { + for (j = 0; j < 16; j++) + avg += ABS((int32_t) pRef[j] - sum); + + pRef += width; + } + + return avg; + } \ No newline at end of file diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/mad.h bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/mad.h *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/mad.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/mad.h Sat Dec 1 02:48:32 2001 *************** *** 0 **** --- 1,23 ---- + + #ifndef _ENCORE_MAD_H + #define _ENCORE_MAD_H + #include "enc_image.h" + float MAD_Image(const Image * pIm, const Image * pImage); + + // x & y in blocks ( 8 pixel units ) + // dx & dy in pixels + int32_t SAD_Block(const Image * pIm, const Image * pImage, int x, int y, int dx, + int dy, int32_t sad_opt, int component); + + // x & y in macroblocks + // dx & dy in half-pixels + + int32_t SAD_Macroblock(const Image * pIm, + const Image * pImageN, const Image * pImageH, + const Image * pImageV, const Image * pImageHV, int x, int y, + int dx, int dy, int sad_opt, int quality); + + // x & y in macroblocks + int32_t SAD_Deviation_MB(const Image * pIm, int x, int y); + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/mbmotionestcomp.c bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/mbmotionestcomp.c *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/mbmotionestcomp.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/mbmotionestcomp.c Sat Dec 1 02:45:44 2001 *************** *** 0 **** --- 1,1301 ---- + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + + /************************************************************************** + * + * MBMotionEstComp.c, motion estimation/compensation module + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + + /************************************************************************** + * + * Modifications: + * + * 16.11.2001 rewrote/tweaked search algorithms; pross@cs.rmit.edu.au + * 10.11.2001 support for sad16/sad8 functions + * 28.08.2001 reactivated MODE_INTER4V for EXT_MODE + * 24.08.2001 removed MODE_INTER4V_Q, disabled MODE_INTER4V for EXT_MODE + * 22.08.2001 added MODE_INTER4V_Q + * 20.08.2001 added pragma to get rid of internal compiler error with VC6 + * idea by Cyril. Thanks. + * + * Michael Militzer + * + **************************************************************************/ + + #include "enc_mbfunctions.h" + #include "encoder.h" + #include "enc_image.h" + #include "timer.h" + #include + #include + #include "sad.h" + #include "compensate.h" + + + #if defined(_MMX_) + + #if defined(_XMM_) + + #define SAD16 sad16_xmm + #define SAD8 sad8_xmm + #define DEV16 dev16_xmm + + #else + + #define SAD16 sad16_mmx + #define SAD8 sad8_mmx + #define DEV16 dev16_mmx + + #endif + + #define COMPENSATE compensate_mmx + + #else + + #define SAD16 sad16 + #define SAD8 sad8 + #define DEV16 dev16 + #define COMPENSATE compensate + + #endif + + // very large value + #define MV_MAX_ERROR (4096 * 256) + + // stop search if sdelta < THRESHOLD + #define MV16_THRESHOLD 192 + #define MV8_THRESHOLD 56 + + /* sad16(0,0) bias; mpeg4 spec suggests nb/2+1 */ + /* nb = vop pixels * 2^(bpp-8) */ + #define MV16_00_BIAS (128+1) + + /* INTER bias for INTER/INTRA decision; mpeg4 spec suggests 2*nb */ + #define INTER_BIAS 432 + + /* Parameters which control inter/inter4v decision */ + #define IMV16X16 5 + + /* vector map (vlc delta size) smoother parameters */ + #define NEIGH_TEND_16X16 2 + #define NEIGH_TEND_8X8 2 + + + // fast ((A)/2)*2 + #define EVEN(A) (((A)<0?(A)+1:(A)) & ~1) + + + #define MIN(X, Y) ((X)<(Y)?(X):(Y)) + #define MAX(X, Y) ((X)>(Y)?(X):(Y)) + #define ABS(X) (((X)>0)?(X):-(X)) + #define SIGN(X) (((X)>0)?1:-1) + + + /* diamond search stuff + keep the the sequence in circular order (so optimization works) + */ + + typedef struct + { + int32_t dx; + int32_t dy; + } + DPOINT; + + + static const DPOINT diamond_small[4] = + { + {0, 1}, {1, 0}, {0, -1}, {-1, 0} + }; + + + static const DPOINT diamond_large[8] = + { + {0, 2}, {1, 1}, {2, 0}, {1, -1}, {0, -2}, {-1, -1}, {-2, 0}, {-1, 1} + }; + + + + + + /* + static __inline const uint8_t * getref16( + const uint8_t * const refn, + const uint8_t * const refh, + const uint8_t * const refv, + const uint8_t * const refhv, + const uint32_t x, const uint32_t y, + const int32_t dx, const int32_t dy, + const uint32_t stride) + { + switch ( ((dx&1)<<1) + (dy&1) ) // ((dx%2)?2:0)+((dy%2)?1:0) + { + case 0 : return refn + (x*16+dx/2) + (y*16+dy/2)*stride; + case 1 : return refv + (x*16+dx/2) + (y*16+(dy-1)/2)*stride; + case 2 : return refh + (x*16+(dx-1)/2) + (y*16+dy/2)*stride; + default : + case 3 : return refhv + (x*16+(dx-1)/2) + (y*16+(dy-1)/2)*stride; + } + } + + + static __inline const uint8_t * getref8( + const uint8_t * const refn, + const uint8_t * const refh, + const uint8_t * const refv, + const uint8_t * const refhv, + const uint32_t x, const uint32_t y, + const int32_t dx, const int32_t dy, + const uint32_t stride) + { + switch ( ((dx&1)<<1) + (dy&1) ) + { + case 0 : return refn + (x*8+dx/2) + (y*8+dy/2)*stride; + case 1 : return refv + (x*8+dx/2) + (y*8+(dy-1)/2)*stride; + case 2 : return refh + (x*8+(dx-1)/2) + (y*8+dy/2)*stride; + default : + case 3 : return refhv + (x*8+(dx-1)/2) + (y*8+(dy-1)/2)*stride; + } + } */ + + /* + typedef struct + { + uint32_t code; // right justified + uint32_t len; + } + VLCtable; + + + static const VLCtable mvtab[33] = { + {1, 1}, {1, 2}, {1, 3}, {1, 4}, {3, 6}, {5, 7}, {4, 7}, {3, 7}, + {11, 9}, {10, 9}, {9, 9}, {17, 10}, {16, 10}, {15, 10}, {14, 10}, {13, 10}, + {12, 10}, {11, 10}, {10, 10}, {9, 10}, {8, 10}, {7, 10}, {6, 10}, {5, 10}, + {4, 10}, {7, 11}, {6, 11}, {5, 11}, {4, 11}, {3, 11}, {2, 11}, {3, 12}, + {2, 12} + }; */ + + + static const uint32_t mvtab[33] = { + 1, 2, 3, 4, 6, 7, 7, 7, + 9, 9, 9, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, + 10, 11, 11, 11, 11, 11, 11, 12, 12 + }; + + + static __inline uint32_t mv_bits(int32_t component, const uint8_t iFcode) + { + if (component == 0) + return 1; + + if (component < 0) + component = -component; + + if (iFcode == 1) + { + if (component > 32) + component = 32; + + return mvtab[component] + 1; + } + + component += (1 << (iFcode - 1)) - 1; + component >>= (iFcode - 1); + + if (component > 32) + component = 32; + + return mvtab[component] + 1 + iFcode - 1; + } + + + static __inline uint32_t calc_delta_16(const int32_t dx, const int32_t dy, const uint8_t iFcode) + { + return NEIGH_TEND_16X16 * (mv_bits(dx, iFcode) + mv_bits(dy, iFcode)); + } + + static __inline uint32_t calc_delta_8(const int32_t dx, const int32_t dy, const uint8_t iFcode) + + { + return NEIGH_TEND_8X8 * (mv_bits(dx, iFcode) + mv_bits(dy, iFcode)); + + } + + + + + /* calculate the pmv (predicted motion vector) + (take the median of surrounding motion vectors) + + (x,y) = the macroblock + block = the block within the macroblock + */ + static __inline void get_pmv(const Macroblock * const pMBs, + const uint32_t x, const uint32_t y, + const uint32_t x_dim, + const uint32_t block, + int32_t * const pred_x, int32_t * const pred_y) + { + int x1, x2, x3; + int y1, y2, y3; + int xin1, xin2, xin3; + int yin1, yin2, yin3; + int vec1, vec2, vec3; + + uint32_t index = x + y * x_dim; + + // first row (special case) + if (y == 0 && (block == 0 || block == 1)) + { + if (x == 0 && block == 0) // first column + { + *pred_x = 0; + *pred_y = 0; + return; + } + if (block == 1) + { + MotionVector mv = pMBs[index].mvs[0]; + *pred_x = mv.x; + *pred_y = mv.y; + return; + } + // else + { + MotionVector mv = pMBs[index - 1].mvs[1]; + *pred_x = mv.x; + *pred_y = mv.y; + return; + } + } + + /* + MODE_INTER, vm18 page 48 + MODE_INTER4V vm18 page 51 + + (x,y-1) (x+1,y-1) + [ | ] [ | ] + [ 2 | 3 ] [ 2 | ] + + (x-1,y) (x,y) (x+1,y) + [ | 1 ] [ 0 | 1 ] [ 0 | ] + [ | 3 ] [ 2 | 3 ] [ | ] + */ + + switch (block) + { + case 0: + xin1 = x - 1; yin1 = y; vec1 = 1; + xin2 = x; yin2 = y - 1; vec2 = 2; + xin3 = x + 1; yin3 = y - 1; vec3 = 2; + break; + case 1: + xin1 = x; yin1 = y; vec1 = 0; + xin2 = x; yin2 = y - 1; vec2 = 3; + xin3 = x + 1; yin3 = y - 1; vec3 = 2; + break; + case 2: + xin1 = x - 1; yin1 = y; vec1 = 3; + xin2 = x; yin2 = y; vec2 = 0; + xin3 = x; yin3 = y; vec3 = 1; + break; + default: + xin1 = x; yin1 = y; vec1 = 2; + xin2 = x; yin2 = y; vec2 = 0; + xin3 = x; yin3 = y; vec3 = 1; + } + + //printf("get_pmv 1\n"); + + if (xin1 < 0 || /* yin1 < 0 || */ xin1 >= (int32_t)x_dim) + { + x1 = 0; + y1 = 0; + } + else + { + const MotionVector * const mv = &(pMBs[xin1 + yin1 * x_dim].mvs[vec1]); + x1 = mv->x; + y1 = mv->y; + } + + if (xin2 < 0 || /* yin2 < 0 || */ xin2 >= (int32_t)x_dim) + { + x2 = 0; + y2 = 0; + } + else + { + const MotionVector * const mv = &(pMBs[xin2 + yin2 * x_dim].mvs[vec2]); + x2 = mv->x; + y2 = mv->y; + } + + if (xin3 < 0 || /* yin3 < 0 || */ xin3 >= (int32_t)x_dim) + { + x3 = 0; + y3 = 0; + } + else + { + const MotionVector * const mv = &(pMBs[xin3 + yin3 * x_dim].mvs[vec3]); + x3 = mv->x; + y3 = mv->y; + } + //printf("get_pmv 2\n"); + + // median + + *pred_x = MIN(MAX(x1, x2), MIN(MAX(x2, x3), MAX(x1, x3))); + *pred_y = MIN(MAX(y1, y2), MIN(MAX(y2, y3), MAX(y1, y3))); + //printf("get_pmv 3\n"); + } + + + + /* calculate the min/max range (in halfpixels) relative to the pmv + */ + + static void __inline get_range( + int32_t * const min_dx, int32_t * const max_dx, + int32_t * const min_dy, int32_t * const max_dy, + const uint32_t x, const uint32_t y, + const uint32_t block, // block dimension, 8 or 16 + const uint32_t width, const uint32_t height, + const int32_t pred_x, const int32_t pred_y, + const uint32_t edge, + const uint32_t fcode) + { + const int search_range = 32 << (fcode - 1); + int high = search_range - 1; + int low = -search_range; + + *max_dx = MIN(MIN( + high, + ((int32_t)(width + edge - 2) - (int32_t)(x*block) - pred_x)), + (high - pred_x)); + + *max_dy = MIN(MIN( + high, + ((int32_t)(height + edge - 2) - (int32_t)(y*block) - pred_y)), + (high - pred_y)); + + *min_dx = MAX(MAX( + low, + (-(int32_t)(edge + x*block) + 2 - pred_x)), + (low - pred_x)); + + *min_dy = MAX(MAX( + low, + (-(int32_t)(edge + y*block) + 2 - pred_y)), + (low - pred_y)); + } + + + + /* getref: calculate reference image pointer + the decision to use interpolation h/v/hv or the normal image is + based on dx & dy. + */ + + static __inline const uint8_t * get_ref( + const uint8_t * const refn, + const uint8_t * const refh, + const uint8_t * const refv, + const uint8_t * const refhv, + const uint32_t x, + const uint32_t y, + const uint32_t block, // block dimension, 8 or 16 + const int32_t dx, + const int32_t dy, + const uint32_t stride) + { + switch ( ((dx&1)<<1) + (dy&1) ) // ((dx%2)?2:0)+((dy%2)?1:0) + { + case 0 : return refn + (int)((x*block+dx/2) + (y*block+dy/2)*stride); + case 1 : return refv + (int)((x*block+dx/2) + (y*block+(dy-1)/2)*stride); + case 2 : return refh + (int)((x*block+(dx-1)/2) + (y*block+dy/2)*stride); + + default : + case 3 : + { + uint8_t *result; + //printf("get_ref 1 %p %d %p\n", refhv - 784, dy * stride, refhv + (int32_t)(dy * stride) ); + result = refhv + + (int)((x * block + (dx - 1) / 2) + + (y * block + (dy - 1) / 2) * stride); + //printf("get_ref 2\n"); + return result; + } + } + } + + + + // ******************************************************************** + + /** + Search for a single motion vector corresponding to macroblock (x,y), + starting from motion vector ( in half-pixels ), + with search window determined by search_range & iFcode. + Store the result in '*pmv' and return optimal SAD. + pRef - reconstructed image + pRefH - reconstructed image, interpolated along H axis. + pRefV, + pRefHV - same as above + **/ + + static int32_t MotionSearch16( + const uint8_t * const pRef, + const uint8_t * const pRefH, + const uint8_t * const pRefV, + const uint8_t * const pRefHV, + const Image * const pCur, + const int x, const int y, + const int pred_x, int pred_y, + const uint32_t iFcode, + const int iQuant, + const int iQuality, + MotionVector * const pmv) + { + const uint32_t iEdgedWidth = pCur->iEdgedWidth; + const uint8_t * cur = pCur->pY + x*16 + y*16*iEdgedWidth; + const uint32_t iEdgeSize = iEdgedWidth - pCur->iWidth; + const DPOINT * diamond; + + int32_t min_dx, max_dx; + int32_t min_dy, max_dy; + int32_t dx, dy; + int32_t center_dx, center_dy; + + int32_t best_sdelta; + int32_t best_dx, best_dy; + + int32_t best_sdelta2; + int32_t best_dx2, best_dy2; + + uint32_t point; + uint32_t best_point; + uint32_t count; + + uint32_t first_pass = 1; + + + if (iQuality <= 4) + first_pass = 0; + + // if (pCur->iWidth % 16) + // iEdgeSize += (pCur->iWidth % 16) - 16; + + get_range( + &min_dx, &max_dx, + &min_dy, &max_dy, + x, y, 16, + pCur->iWidth, pCur->iHeight, + pred_x, pred_y, + iEdgeSize, + iFcode); + + min_dx = EVEN(min_dx); + max_dx = EVEN(max_dx); + min_dy = EVEN(min_dy); + max_dy = EVEN(max_dy); + + // for 1st pass search, center=(0,0) + center_dx = EVEN(-pred_x); + center_dy = EVEN(-pred_y); + + // set sdelta2 to max (since we may not do 2nd pass) + + best_sdelta2 = MV_MAX_ERROR; + best_dx2 = center_dx; + best_dy2 = center_dy; + + start: + + // sad/delta for center + + best_sdelta = SAD16(cur, + get_ref(pRef, pRefH, pRefV, pRefHV, x, y, 16, pred_x + center_dx, pred_y + center_dy, iEdgedWidth), + iEdgedWidth, + MV_MAX_ERROR); + if (center_dx == -pred_x && center_dy == -pred_y && best_sdelta <= iQuant * 96) + { + best_sdelta -= MV16_00_BIAS; + } + best_sdelta += calc_delta_16(center_dx, center_dy, (uint8_t)iFcode) * iQuant; + best_dx = center_dx; + best_dy = center_dy; + + diamond = diamond_large; + point = 0; + count = 8; + best_point = 99; //0; + + if (!(best_sdelta < MV16_THRESHOLD)) + while (1) + { + while (count--) + { + int32_t sdelta; + + dx = center_dx + 2*diamond[point].dx; + dy = center_dy + 2*diamond[point].dy; + + if (dx < min_dx || dx > max_dx || dy < min_dy || dy > max_dy) + { + point = (point + 1) & 7; // % 8 + continue; + } + + if (dx == 0 && dy == 0) + { + first_pass = 0; + } + + sdelta = SAD16(cur, + get_ref(pRef, pRefH, pRefV, pRefHV, x, y, 16, pred_x + dx, pred_y + dy, iEdgedWidth), + iEdgedWidth, + best_sdelta); + + sdelta += calc_delta_16(dx, dy, (uint8_t)iFcode) * iQuant; + + if (sdelta < best_sdelta) + { + best_sdelta = sdelta; + best_dx = dx; + best_dy = dy; + if (best_sdelta < MV16_THRESHOLD) + { + break; + } + best_point = point; + } + + point = (point + 1) & 7; // % 8 + } + + if (best_sdelta < MV16_THRESHOLD) + { + break; + } + if (diamond == diamond_small) + { + break; + } + + if ((best_dx == center_dx) && (best_dy == center_dy)) + { + diamond = diamond_small; + point = 0; + count = 4; + } + else + { + if (best_dx == center_dx || best_dy == center_dy) + { + point = (best_point + 6) & 7; // % 8 + count = 5; + } + else + { + point = (best_point + 7) & 7; // % 8 + count = 3; + } + + if (best_point == 99) + { + // we're getting cases where min=-30 & max=-34 + // under normal circumstances we should never get here! + // likely cause: buggy obtainrange16 + // char tmp[1000]; + // wsprintf(tmp, "16c:%i,%i min:%i,%i max:%i,%i\n", center_dx, center_dy, min_dx, min_dy, max_dx, max_dy); + // OutputDebugString(tmp); + + // set point=6 for binary compatibility with latest cvs snapshot + point = 6; + } + + center_dx = best_dx; + center_dy = best_dy; + } + } + + if (first_pass) + { + best_sdelta2 = best_sdelta; + best_dx2 = best_dx; + best_dy2 = best_dy; + + // perform 2nd pass search, center=pmv + first_pass = 0; + center_dx = 0; + center_dy = 0; + goto start; + } + + if (best_sdelta2 < best_sdelta) + { + best_sdelta = best_sdelta2; + best_dx = best_dx2; + best_dy = best_dy2; + } + + + /* + refinement step + (only neccessary when diamond points are multiplied by 2) + */ + + center_dx = best_dx; + center_dy = best_dy; + + if (!(best_sdelta < MV16_THRESHOLD)) + for (dx = center_dx - 1; dx <= center_dx + 1; dx++) + { + for (dy = center_dy - 1; dy <= center_dy + 1; dy++) + { + int32_t sdelta; + + if ((dx == center_dx && dy == center_dy) || + dx < min_dx || dx > max_dx || dy < min_dy || dy > max_dy) + { + continue; + } + + sdelta = SAD16(cur, + get_ref(pRef, pRefH, pRefV, pRefHV, x, y, 16, pred_x + dx, pred_y + dy, iEdgedWidth), + iEdgedWidth, + best_sdelta); + + sdelta += calc_delta_16(dx, dy, (uint8_t)iFcode) * iQuant; + + if (sdelta < best_sdelta) + { + best_sdelta = sdelta; + best_dx = dx; + best_dy = dy; + if (sdelta < MV16_THRESHOLD) + { + break; + } + } + } + } + + pmv->x = pred_x + best_dx; + pmv->y = pred_y + best_dy; + + return best_sdelta; + } + + + + static uint32_t MotionSearch8( + const uint8_t * const pRef, + const uint8_t * const pRefH, + const uint8_t * const pRefV, + const uint8_t * const pRefHV, + const Image * const pCur, + const uint32_t x, const uint32_t y, + const int32_t pred_x, const int32_t pred_y, + const int32_t start_x, const int32_t start_y, + const uint32_t iFcode, + const uint32_t iQuant, + MotionVector * const pmv) + { + const uint32_t iEdgedWidth = pCur->iEdgedWidth; + const uint8_t * cur = pCur->pY + x*8 + y*8*iEdgedWidth; + const uint32_t iEdgeSize = iEdgedWidth - pCur->iWidth; + const DPOINT * diamond; + + int32_t min_dx, max_dx; + int32_t min_dy, max_dy; + int32_t dx, dy; + int32_t center_dx, center_dy; + + uint32_t best_sdelta; + int32_t best_dx, best_dy; + + uint32_t point; + uint32_t best_point; + uint32_t count; + + // if (pCur->iWidth % 16) + // iEdgeSize += (pCur->iWidth % 16) - 16; + + + + + //printf("MotionSearch8 1\n"); + get_range( + &min_dx, &max_dx, + &min_dy, &max_dy, + x, y, 8, + pCur->iWidth, pCur->iHeight, + pred_x, pred_y, + iEdgeSize, + iFcode); + + //printf("MotionSearch8 1\n"); + min_dx = EVEN(min_dx); + max_dx = EVEN(max_dx); + min_dy = EVEN(min_dy); + max_dy = EVEN(max_dy); + + // center search on start_x/y (mv from previous frame) + + //printf("MotionSearch8 1\n"); + center_dx = EVEN(start_x - pred_x); + center_dy = EVEN(start_y - pred_y); + + //printf("MotionSearch8 1\n"); + if (center_dx < min_dx) + center_dx = min_dx; + else if (center_dx > max_dx) + center_dx = max_dx; + + //printf("MotionSearch8 1\n"); + if (center_dy < min_dy) + center_dy = min_dy; + else if (center_dy > max_dy) + center_dy = max_dy; + + //printf("MotionSearch8 1\n"); + // sad/delta for center + + best_sdelta = SAD8(cur, + get_ref(pRef, pRefH, pRefV, pRefHV, x, y, 8, pred_x + center_dx, pred_y + center_dy, iEdgedWidth), + iEdgedWidth); + best_sdelta += calc_delta_8(center_dx, center_dy, (uint8_t)iFcode) * iQuant; + + //printf("MotionSearch8 1\n"); + if (best_sdelta < MV8_THRESHOLD) { + pmv->x = pred_x + center_dx; + pmv->y = pred_y + center_dy; + return best_sdelta; + } + best_dx = center_dx; + best_dy = center_dy; + + //printf("MotionSearch8 1\n"); + + diamond = diamond_large; + point = 0; + count = 8; + best_point = 99; + + //printf("MotionSearch8 1\n"); + while(1) + { + while(count--) + { + uint32_t sdelta; + uint8_t *tmp; + + dx = center_dx + diamond[point].dx; + dy = center_dy + diamond[point].dy; + + if (dx < min_dx || dx > max_dx || dy < min_dy || dy > max_dy) + { + point = (point + 1) & 7; // % 8 + continue; + } + + //printf("MotionSearch8 1 %d\n", iEdgedWidth); + tmp = get_ref(pRef, + pRefH, + pRefV, + pRefHV, + x, + y, + 8, + pred_x + dx, + pred_y + dy, + iEdgedWidth); + //printf("MotionSearch8 1 %p %p %d\n", cur, tmp, iEdgedWidth); + + sdelta = SAD8(cur, + tmp, + iEdgedWidth); + //printf("MotionSearch8 1\n"); + + sdelta += calc_delta_8(dx, dy, (uint8_t)iFcode) * iQuant; + //printf("MotionSearch8 1\n"); + + if (sdelta < best_sdelta) + { + if (sdelta < MV8_THRESHOLD) { + pmv->x = pred_x + dx; + pmv->y = pred_y + dy; + return sdelta; + } + best_sdelta = sdelta; + best_dx = dx; + best_dy = dy; + best_point = point; + } + + //printf("MotionSearch8 2\n"); + point = (point + 1) & 7; // % 8 + } + + if (diamond == diamond_small) + { + break; + } + + if (best_dx == center_dx && best_dy == center_dy) + { + diamond = diamond_small; + point = 0; + count = 4; + } + else + { + if (best_dx == center_dx || best_dy == center_dy) + { + point = (best_point + 6) & 7; // % 8 + count = 5; + } + else + { + point = (best_point + 7) & 7; // % 8 + count = 3; + } + + if (best_point == 99) + { + // we're getting cases where min=-30 & max=-34 + // under normal circumstances we should never get here! + // likely cause: buggy obtainrange16 + // char tmp[1000]; + // wsprintf(tmp, "8c:%i,%i min:%i,%i max:%i,%i\n", center_dx, center_dy, min_dx, min_dy, max_dx, max_dy); + // OutputDebugString(tmp); + + // set point=6 for binary compatibility with latest cvs snapshot + point = 6; + } + + center_dx = best_dx; + center_dy = best_dy; + } + } + + //printf("MotionSearch8 1\n"); + /* + refinement step + (only neccessary when diamond points are multiplied by 2) + + center_dx = best_dx; + center_dy = best_dy; + + //printf("MotionSearch8 1\n"); + if (!(best_sdelta < MV8_THRESHOLD)) + for (dx = center_dx - 1; dx <= center_dx + 1; dx++) + { + for (dy = center_dy - 1; dy <= center_dy + 1; dy++) + { + uint32_t sdelta; + + if ((dx == center_dx && dy == center_dy) || + dx < min_dx || dx > max_dx || dy < min_dy || dy > max_dy) + { + continue; + } + + sdelta = SAD8(cur, + get_ref(pRef, pRefH, pRefV, pRefHV, x, y, 8, pred_x + dx, pred_y + dy, iEdgedWidth), + iEdgedWidth); + + sdelta += calc_delta_8(dx, dy, (uint8_t)iFcode) * iQuant; + + if (sdelta < best_sdelta) + { + best_sdelta = sdelta; + best_dx = dx; + best_dy = dy; + if (sdelta < MV8_THRESHOLD) + { + break; + } + } + } + } */ + + //printf("MotionSearch8 2\n"); + pmv->x = pred_x + best_dx; + pmv->y = pred_y + best_dy; + + return best_sdelta; + } + + + + + static __inline void CompensateBlock(Image * const pVcur, + const Image * const pRefN, + const Image * const pRefH, + const Image * const pRefV, + const Image * const pRefHV, + uint32_t x, uint32_t y, + const int32_t comp, + const int32_t dx, const int dy, + int16_t * const dct_codes) + { + uint32_t stride = pVcur->iEdgedWidth; // (comp ? 2 : 1); + uint8_t * pCur; + const uint8_t * pRef; + const Image * pVref; + int32_t ddx; + int32_t ddy; + + //printf("CompensateBlock 1\n"); + switch ( ((dx&1)<<1) + (dy&1) ) // ((dx%2)?2:0)+((dy%2)?1:0) + { + case 0: + pVref = pRefN; + ddx = dx/2; + ddy = dy/2; + break; + + case 1: + pVref = pRefV; + ddx = dx/2; + ddy = (dy-1)/2; + break; + + case 2: + pVref = pRefH; + ddx = (dx-1)/2; + ddy = dy/2; + break; + + case 3: + default: + pVref = pRefHV; + ddx = (dx-1)/2; + ddy = (dy-1)/2; + break; + } + + //printf("CompensateBlock 1\n"); + switch (comp) + { + case 0: + pCur = pVcur->pY; + pRef = pVref->pY; + break; + + case 1: + pCur = pVcur->pU; + pRef = pVref->pU; + stride /=2; + break; + + case 2: + default: + pCur = pVcur->pV; + pRef = pVref->pV; + stride /=2; + break; + } + + //printf("CompensateBlock 1 %p %p\n", pRef, pCur); + pCur += (int)(y * stride + x); + pRef += (int)((y + ddy) * stride + x + ddx); + //printf("CompensateBlock 2 %p %p\n", pRef, pCur); + + COMPENSATE(dct_codes, pCur, pRef, stride); + //printf("CompensateBlock 2\n"); + } + + + + #define SEARCH16 MotionSearch16 + #define SEARCH8 MotionSearch8 + + + bool MBMotionEstComp( + const MBParam * const pParam, + const uint32_t j, + const uint32_t i, + const Image * const pRef, + const Image * const pRefH, + const Image * const pRefV, + const Image * const pRefHV, + Image * const pCurrent, + int16_t dct_codes[][64], + const int inter4v_mode) + + { + static const uint32_t roundtab[16] = + { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 }; + + + const uint32_t iWcount = pCurrent->iMbWcount; + Macroblock * const pMB = pCurrent->pMBs + j + i * iWcount; + + + int32_t pred_x; + int32_t pred_y; + + MotionVector mv16; + + int32_t sad8_result = 0; + int32_t sad16_result; + int32_t deviation; + + int32_t sum; + int32_t dx, dy; + + + //printf("MBMotionEstComp 1\n"); + get_pmv(pCurrent->pMBs, j, i, iWcount, 0, &pred_x, &pred_y); + sad16_result = SEARCH16(pRef->pY, pRefH->pY, pRefV->pY, pRefHV->pY, + pCurrent, + j, i, pred_x, pred_y, + pParam->fixed_code, + pParam->quant,pParam->quality, + &mv16); + //printf("MBMotionEstComp 1\n"); + + if (pParam->quality > 3) + { + //printf("MBMotionEstComp 1\n"); + sad8_result = SEARCH8(pRef->pY, + pRefH->pY, + pRefV->pY, + pRefHV->pY, + pCurrent, + 2 * j, 2 * i, + pred_x, + pred_y, + mv16.x, + mv16.y, + pParam->fixed_code, + pParam->quant, + &pMB->mvs[0]); + + //printf("MBMotionEstComp 1\n"); + get_pmv(pCurrent->pMBs, j, i, iWcount, 1, &pred_x, &pred_y); + //printf("MBMotionEstComp 1\n"); + sad8_result += SEARCH8(pRef->pY, + pRefH->pY, + pRefV->pY, + pRefHV->pY, + pCurrent, + 2 * j + 1, + 2 * i, + pred_x, + pred_y, + mv16.x, + mv16.y, + pParam->fixed_code, + pParam->quant, + &pMB->mvs[1]); + + //printf("MBMotionEstComp 1\n"); + get_pmv(pCurrent->pMBs, j, i, iWcount, 2, &pred_x, &pred_y); + //printf("MBMotionEstComp 1\n"); + sad8_result += SEARCH8(pRef->pY, pRefH->pY, pRefV->pY, pRefHV->pY, + pCurrent, 2 * j, 2 * i + 1, pred_x, pred_y, + mv16.x, mv16.y, pParam->fixed_code, + pParam->quant, &pMB->mvs[2]); + + //printf("MBMotionEstComp 1\n"); + get_pmv(pCurrent->pMBs, j, i, iWcount, 3, &pred_x, &pred_y); + //printf("MBMotionEstComp 1\n"); + sad8_result += SEARCH8(pRef->pY, pRefH->pY, pRefV->pY, pRefHV->pY, + pCurrent, 2 * j + 1, 2 * i + 1, pred_x, + pred_y, mv16.x, mv16.y, + pParam->fixed_code, pParam->quant, + &pMB->mvs[3]); + + //printf("MBMotionEstComp 1\n"); + } + + + //printf("MBMotionEstComp 1\n"); + + /* decide: MODE_INTER or MODE_INTER4V + mpeg4: if (sad8 < sad16 - nb/2+1) use_inter4v + */ + + if (inter4v_mode == 1) { + if ((pParam->quality <= 3) || + (sad16_result < (sad8_result + (IMV16X16 * pParam->quant)))) { + + sad8_result = sad16_result; + pMB->mode = MODE_INTER; + pMB->mvs[0].x = pMB->mvs[1].x = pMB->mvs[2].x = pMB->mvs[3].x = mv16.x; + pMB->mvs[0].y = pMB->mvs[1].y = pMB->mvs[2].y = pMB->mvs[3].y = mv16.y; + } + else + pMB->mode = MODE_INTER4V; + } + else + { + sad8_result = sad16_result; + pMB->mode = MODE_INTER; + pMB->mvs[0].x = pMB->mvs[1].x = pMB->mvs[2].x = pMB->mvs[3].x = mv16.x; + pMB->mvs[0].y = pMB->mvs[1].y = pMB->mvs[2].y = pMB->mvs[3].y = mv16.y; + } + + //printf("MBMotionEstComp 1\n"); + + /* decide: MODE_INTER/4V or MODE_INTRA + if (dev_intra < sad_inter - 2 * nb) use_intra + */ + + deviation = DEV16(pCurrent->pY + j*16 + i*16*pCurrent->iEdgedWidth, pCurrent->iEdgedWidth); + + if (deviation < sad8_result - INTER_BIAS) + { + pMB->mode = MODE_INTRA; + pMB->mvs[0].x = pMB->mvs[1].x = pMB->mvs[2].x = pMB->mvs[3].x = 0; + pMB->mvs[0].y = pMB->mvs[1].y = pMB->mvs[2].y = pMB->mvs[3].y = 0; + + return 1; + } + //printf("MBMotionEstComp 1\n"); + + + /** Motion compensation **/ + + switch (pMB->mode) + { + case MODE_INTER: + case MODE_INTER_Q: + dx = pMB->mvs[0].x; + dy = pMB->mvs[0].y; + + /*if (pParam->quality <= 3) + { + assert(!(dx % 2)); + assert(!(dy % 2)); + } */ + + CompensateBlock(pCurrent, + pRef, pRefH, pRefV, pRefHV, + 16 * j, 16 * i, 0, dx, dy, dct_codes[0]); + + CompensateBlock(pCurrent, + pRef, pRefH, pRefV, pRefHV, + 16 * j + 8, 16 * i, 0, dx, dy, dct_codes[1]); + + CompensateBlock(pCurrent, + pRef, pRefH, pRefV, pRefHV, + 16 * j, 16 * i + 8, 0, dx, dy, dct_codes[2]); + + CompensateBlock(pCurrent, + pRef, pRefH, pRefV, pRefHV, + 16 * j + 8, 16 * i + 8, 0, dx, dy, dct_codes[3]); + + + if (!(dx & 3)) // % 4 + dx /= 2; + else + dx = (dx >> 1) | 1; + + if (!(dy & 3)) // % 4 + dy /= 2; + else + dy = (dy >> 1) | 1; + + CompensateBlock(pCurrent, + pRef, pRefH, pRefV, pRefHV, + 8*j, 8*i, 1, dx, dy, dct_codes[4]); + + CompensateBlock(pCurrent, + pRef, pRefH, pRefV, pRefHV, + 8*j, 8*i, 2, dx, dy, dct_codes[5]); + + break; + + + case MODE_INTER4V: + // assert(pParam->quality >= 4); + + + CompensateBlock(pCurrent, + pRef, pRefH, pRefV, pRefHV, + 16 * j, 16 * i, 0, pMB->mvs[0].x, pMB->mvs[0].y, + dct_codes[0]); + + CompensateBlock(pCurrent, pRef, pRefH, pRefV, pRefHV, + 16 * j + 8, 16 * i, 0, pMB->mvs[1].x, + pMB->mvs[1].y, dct_codes[1]); + + CompensateBlock(pCurrent, pRef, pRefH, pRefV, pRefHV, + 16 * j, 16 * i + 8, 0, pMB->mvs[2].x, + pMB->mvs[2].y, dct_codes[2]); + + CompensateBlock(pCurrent, pRef, pRefH, pRefV, pRefHV, + 16 * j + 8, 16 * i + 8, 0, pMB->mvs[3].x, + pMB->mvs[3].y, dct_codes[3]); + + + sum = pMB->mvs[0].x + pMB->mvs[1].x + pMB->mvs[2].x + pMB->mvs[3].x; + + if (sum == 0) + dx = 0; + else + dx = SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2); + + sum = pMB->mvs[0].y + pMB->mvs[1].y + pMB->mvs[2].y + pMB->mvs[3].y; + + if (sum == 0) + dy = 0; + else + dy = SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2); + + CompensateBlock(pCurrent, pRef, pRefH, pRefV, pRefHV, + 8*j, 8*i, 1, dx, dy, dct_codes[4]); + + CompensateBlock(pCurrent, pRef, pRefH, pRefV, pRefHV, + 8*j, 8*i, 2, dx, dy, dct_codes[5]); + + break; + + + case MODE_INTRA: + case MODE_INTRA_Q: + + break; + + } // switch + + //printf("MBMotionEstComp 2\n"); + return 0; + + // return (pMB->mode == MODE_INTRA || pMB->mode == MODE_INTRA_Q); + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/sad.c bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/sad.c *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/sad.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/sad.c Sat Dec 1 02:45:44 2001 *************** *** 0 **** --- 1,114 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * sum of absolute difference + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 10.11.2001 initial version; (c)2001 peter ross + * + *************************************************************************/ + + + #include "enc_portab.h" + #include "sad.h" + + uint32_t sad16(const uint8_t * const cur, + const uint8_t * const ref, + const uint32_t stride, + const uint32_t best_sad) + { + uint32_t sad = 0; + uint32_t i,j; + + for (j = 0; j < 16; j++) { + for (i = 0; i < 16; i++) { + sad += abs(cur[j*stride + i] - ref[j*stride + i]); + if (sad >= best_sad) { + return sad; + } + } + } + + return sad; + } + + + + uint32_t sad8(const uint8_t * const cur, + const uint8_t * const ref, + const uint32_t stride) + { + uint32_t sad = 0; + uint32_t i, j; + + //printf("sad8 %p %p %d\n", cur[0], ref[0], stride); + for (j = 0; j < 8; j++) + { + sad += abs(cur[j * stride + 0] - ref[j * stride + 0]); + sad += abs(cur[j * stride + 1] - ref[j * stride + 1]); + sad += abs(cur[j * stride + 2] - ref[j * stride + 2]); + sad += abs(cur[j * stride + 3] - ref[j * stride + 3]); + sad += abs(cur[j * stride + 4] - ref[j * stride + 4]); + sad += abs(cur[j * stride + 5] - ref[j * stride + 5]); + sad += abs(cur[j * stride + 6] - ref[j * stride + 6]); + sad += abs(cur[j * stride + 7] - ref[j * stride + 7]); + } + + return sad; + } + + + + + /* average deviation from mean */ + + uint32_t dev16(const uint8_t * const cur, + const uint32_t stride) + { + uint32_t mean = 0; + uint32_t dev = 0; + uint32_t i,j; + + for (j = 0; j < 16; j++) { + for (i = 0; i < 16; i++) { + mean += cur[j*stride + i]; + } + } + mean /= (16 * 16); + + for (j = 0; j < 16; j++) { + for (i = 0; i < 16; i++) { + dev += abs(cur[j*stride + i] - mean); + } + } + + return dev; + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbmotionestcomp/sad.h bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/sad.h *** bcast-2000c/quicktime/encore2/src/mbmotionestcomp/sad.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbmotionestcomp/sad.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,55 ---- + #ifndef _SAD_H_ + #define _SAD_H_ + + + #include "enc_portab.h" + + + /* plain c */ + + + uint32_t sad16(const uint8_t * const cur, + const uint8_t * const ref, + const uint32_t stride, + const uint32_t best_sad); + + uint32_t sad8(const uint8_t * const cur, + const uint8_t * const ref, + const uint32_t stride); + + uint32_t dev16(const uint8_t * const cur, + const uint32_t stride); + + /* mmx */ + + + uint32_t sad16_mmx(const uint8_t * const cur, + const uint8_t * const ref, + const uint32_t stride, + const uint32_t best_sad); + + uint32_t sad8_mmx(const uint8_t * const cur, + const uint8_t * const ref, + const uint32_t stride); + + + uint32_t dev16_mmx(const uint8_t * const cur, + const uint32_t stride); + + + /* xmm */ + + uint32_t sad16_xmm(const uint8_t * const cur, + const uint8_t * const ref, + const uint32_t stride, + const uint32_t best_sad); + + uint32_t sad8_xmm(const uint8_t * const cur, + const uint8_t * const ref, + const uint32_t stride); + + uint32_t dev16_xmm(const uint8_t * const cur, + const uint32_t stride); + + + #endif /* _SAD_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbprediction/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/mbprediction/CVS/Entries *** bcast-2000c/quicktime/encore2/src/mbprediction/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbprediction/CVS/Entries Thu Dec 13 18:20:40 2001 *************** *** 0 **** --- 1,2 ---- + /mbprediction.c/1.2/Sat Dec 8 02:52:52 2001// + D diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbprediction/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/mbprediction/CVS/Repository *** bcast-2000c/quicktime/encore2/src/mbprediction/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbprediction/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/mbprediction diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbprediction/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/mbprediction/CVS/Root *** bcast-2000c/quicktime/encore2/src/mbprediction/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbprediction/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbprediction/mbprediction.c bcast-2000c-mf3/quicktime/encore2/src/mbprediction/mbprediction.c *** bcast-2000c/quicktime/encore2/src/mbprediction/mbprediction.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbprediction/mbprediction.c Sat Dec 8 03:52:52 2001 *************** *** 0 **** --- 1,562 ---- + /****************************************************************************** + * * + * This file is part of XviD, a free MPEG-4 video encoder/decoder * + * * + * XviD is an implementation of a part of one or more MPEG-4 Video tools * + * as specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies, will have no liability for use of this software or * + * modifications or derivatives thereof. * + * * + * XviD is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * XviD 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * * + ******************************************************************************/ + + /****************************************************************************** + * * + * mbprediction.c * + * * + * Copyright (C) 2001 - Michael Militzer * + * Copyright (C) 2001 - Peter Ross * + * * + * For more information visit the XviD homepage: http://www.xvid.org * + * * + ******************************************************************************/ + + /****************************************************************************** + * * + * Revision history: * + * * + * 17.11.2001 initial version * + * * + ******************************************************************************/ + + + #include + #include "enctypes.h" + #include "enc_mbfunctions.h" + + #define MIN(X, Y) ((X)<(Y)?(X):(Y)) + #define MAX(X, Y) ((X)>(Y)?(X):(Y)) + #define _div_div(a, b) (a>0) ? (a+(b>>1))/b : (a-(b>>1))/b + + /* + scale 'predictor coefficient' to match the current coefficient + + scaled_coeff = (pred_coeff * pred_quant) // current_quant + */ + #define _rescale(predict_quant, current_quant, coeff) (coeff != 0) ? \ + _div_div((coeff) * (predict_quant), (current_quant)) : 0 + + static const int16_t default_acdc_values[15] = { 1024, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 + }; + + + static __inline uint8_t calc_cbp_intra(int16_t codes[6][64]) + /* + PLEASE NOTE: + This function has been duplicated in MBTransQuant and MBPrediction + to enforce modularity + */ + { + uint8_t i, j; + uint8_t cbp = 0; + uint8_t shl_val[6] = {32, 16, 8, 4, 2, 1}; + + for (i = 0; i < 6; i++) { + for (j = 1; j < 64; j++) { + int16_t value = codes[i][j]; + + if (value != 0) { + cbp |= shl_val[i]; + break; + } + } + } + return cbp; + } + + + static __inline int8_t get_dc_scaler(int8_t quant, bool lum) + /* + PLEASE NOTE: + This function has been duplicated in MBTransQuant and MBPrediction + to enforce modularity + */ + { + int8_t dc_scaler; + + if(quant > 0 && quant < 5) { + dc_scaler = 8; + return dc_scaler; + } + + if(quant < 25 && !lum) { + dc_scaler = (quant + 13) >> 1; + return dc_scaler; + } + + if(quant < 9) { + dc_scaler = quant << 1; + return dc_scaler; + } + + if(quant < 25) { + dc_scaler = quant + 8; + return dc_scaler; + } + + if(lum) + dc_scaler = (quant << 1) - 16; + else + dc_scaler = quant - 6; + + return dc_scaler; + } + + + /* calculate the pmv (predicted motion vector) + (take the median of surrounding motion vectors) + + (x,y) = the macroblock + block = the block within the macroblock + */ + static __inline void get_pmv(const Macroblock * const pMBs, + const uint32_t x, const uint32_t y, + const uint32_t x_dim, + const uint32_t block, + int32_t * const pred_x, int32_t * const pred_y) + /* + PLEASE NOTE: + This function has been duplicated in MBMotionEstComp and MBPrediction + to enforce modularity + */ + { + int x1, x2, x3; + int y1, y2, y3; + int xin1, xin2, xin3; + int yin1, yin2, yin3; + int vec1, vec2, vec3; + + uint32_t index = x + y * x_dim; + + // first row (special case) + if (y == 0 && (block == 0 || block == 1)) + { + if (x == 0 && block == 0) // first column + { + *pred_x = 0; + *pred_y = 0; + return; + } + if (block == 1) + { + MotionVector mv = pMBs[index].mvs[0]; + *pred_x = mv.x; + *pred_y = mv.y; + return; + } + // else + { + MotionVector mv = pMBs[index - 1].mvs[1]; + *pred_x = mv.x; + *pred_y = mv.y; + return; + } + } + + /* + MODE_INTER, vm18 page 48 + MODE_INTER4V vm18 page 51 + + (x,y-1) (x+1,y-1) + [ | ] [ | ] + [ 2 | 3 ] [ 2 | ] + + (x-1,y) (x,y) (x+1,y) + [ | 1 ] [ 0 | 1 ] [ 0 | ] + [ | 3 ] [ 2 | 3 ] [ | ] + */ + + switch (block) + { + case 0: + xin1 = x - 1; yin1 = y; vec1 = 1; + xin2 = x; yin2 = y - 1; vec2 = 2; + xin3 = x + 1; yin3 = y - 1; vec3 = 2; + break; + case 1: + xin1 = x; yin1 = y; vec1 = 0; + xin2 = x; yin2 = y - 1; vec2 = 3; + xin3 = x + 1; yin3 = y - 1; vec3 = 2; + break; + case 2: + xin1 = x - 1; yin1 = y; vec1 = 3; + xin2 = x; yin2 = y; vec2 = 0; + xin3 = x; yin3 = y; vec3 = 1; + break; + default: + xin1 = x; yin1 = y; vec1 = 2; + xin2 = x; yin2 = y; vec2 = 0; + xin3 = x; yin3 = y; vec3 = 1; + } + + + if (xin1 < 0 || /* yin1 < 0 || */ xin1 >= (int32_t)x_dim) + { + x1 = 0; + y1 = 0; + } + else + { + const MotionVector * const mv = &(pMBs[xin1 + yin1 * x_dim].mvs[vec1]); + x1 = mv->x; + y1 = mv->y; + } + + if (xin2 < 0 || /* yin2 < 0 || */ xin2 >= (int32_t)x_dim) + { + x2 = 0; + y2 = 0; + } + else + { + const MotionVector * const mv = &(pMBs[xin2 + yin2 * x_dim].mvs[vec2]); + x2 = mv->x; + y2 = mv->y; + } + + if (xin3 < 0 || /* yin3 < 0 || */ xin3 >= (int32_t)x_dim) + { + x3 = 0; + y3 = 0; + } + else + { + const MotionVector * const mv = &(pMBs[xin3 + yin3 * x_dim].mvs[vec3]); + x3 = mv->x; + y3 = mv->y; + } + + // median + + *pred_x = MIN(MAX(x1, x2), MIN(MAX(x2, x3), MAX(x1, x3))); + *pred_y = MIN(MAX(y1, y2), MIN(MAX(y2, y3), MAX(y1, y3))); + } + + + /* + perform dc/ac prediction on a single block + + returns how much is saved by performing ac prediction + + [ diag ] [ top ] + [ left ] [ current ] + + */ + static int32_t calc_acdc_prediction(Macroblock *pMBs, uint16_t x, uint16_t y, + uint16_t x_dim, uint8_t block, int16_t dct_codes[64], + uint8_t iDcScaler, int32_t current_quant) + { + int16_t *left, *top, *diag, *current; + + int32_t left_quant = current_quant; + int32_t top_quant = current_quant; + + const int16_t *pLeft = default_acdc_values; + const int16_t *pTop = default_acdc_values; + const int16_t *pDiag = default_acdc_values; + + int16_t *pCurrent; + int32_t S1 = 0, S2 = 0; + uint8_t i; + uint32_t index = x + y * x_dim; + int16_t dc_pred; + uint8_t *acpred_direction = &pMBs[index].acpred_directions[block]; + + left = top = diag = current = 0; + + /* grab left,top and diag macroblocks */ + + /* left macroblock */ + + if(x && (pMBs[index - 1].mode == MODE_INTRA + || pMBs[index - 1].mode == MODE_INTRA_Q)) { + + left = pMBs[index - 1].pred_values[0]; + left_quant = pMBs[index - 1].aquant; + } + + /* top macroblock */ + + if(y && (pMBs[index - x_dim].mode == MODE_INTRA + || pMBs[index - x_dim].mode == MODE_INTRA_Q)) { + + top = pMBs[index - x_dim].pred_values[0]; + top_quant = pMBs[index - x_dim].aquant; + } + + /* diag macroblock */ + + if(x && y && (pMBs[index - 1 - x_dim].mode == MODE_INTRA + || pMBs[index - 1 - x_dim].mode == MODE_INTRA_Q)) { + + diag = pMBs[index - 1 - x_dim].pred_values[0]; + } + + current = pMBs[index].pred_values[0]; + pCurrent = current + block * MBPRED_SIZE; + + + /* now grab pLeft, pTop, pDiag _blocks_ */ + + switch (block) { + + case 0: + if(left) + pLeft = left + MBPRED_SIZE; + + if(top) + pTop = top + (MBPRED_SIZE << 1); + + if(diag) + pDiag = diag + 3 * MBPRED_SIZE; + + break; + + case 1: + pLeft = current; + left_quant = current_quant; + + if(top) { + pTop = top + 3 * MBPRED_SIZE; + pDiag = top + (MBPRED_SIZE << 1); + } + + break; + + case 2: + if(left) { + pLeft = left + 3 * MBPRED_SIZE; + pDiag = left + MBPRED_SIZE; + } + + pTop = current; + top_quant = current_quant; + + + break; + + case 3: + pLeft = current + (MBPRED_SIZE << 1); + left_quant = current_quant; + + pTop = current + MBPRED_SIZE; + top_quant = current_quant; + + pDiag = current; + + break; + + case 4: + if(left) + pLeft = left + (MBPRED_SIZE << 2); + + if(top) + pTop = top + (MBPRED_SIZE << 2); + + if(diag) + pDiag = diag + (MBPRED_SIZE << 2); + + break; + + case 5: + if(left) + pLeft = left + 5 * MBPRED_SIZE; + if(top) + pTop = top + 5 * MBPRED_SIZE; + if(diag) + pDiag = diag + 5 * MBPRED_SIZE; + break; + } + + + /* determine ac prediction direction & dc predictor */ + + if(abs(pLeft[0] - pDiag[0]) < abs(pDiag[0] - pTop[0])) { + *acpred_direction = 1; // vertical + dc_pred = _div_div(pTop[0], iDcScaler); + } + else { + *acpred_direction = 2; // horizontal + dc_pred = _div_div(pLeft[0], iDcScaler); + } + + + /* store current coeffs to pred_values[] */ + + pCurrent[0] = dct_codes[0] * iDcScaler; + for(i = 1; i < 8; i++) { + pCurrent[i] = dct_codes[i]; + + + + + // assert(pCurrent[i] >= -256); + // assert(pCurrent[i] <= 256); + + + + + pCurrent[i + 7] = dct_codes[i * 8]; + + + + + + + + + // assert(pCurrent[i + 7] >= -256); + // assert(pCurrent[i + 7] <= 256); + + + + + + } + + /* + subtract DC/AC prediction from current values + whilst calculating S1/S2 + + S1/S2 are used to determine if its worth predicting for AC + S1 = sum of all (dct_codes - prediction) + S2 = sum of all dct_codes + */ + + dct_codes[0] -= dc_pred; + + if(*acpred_direction == 1) { + for(i = 1; i < 8; i++) { + int16_t level; + + + + + + + + + // assert(pTop[i] >= -256); + // assert(pTop[i] <= 256); + + + + + + + + + + + level = dct_codes[i]; + S2 += abs(level); + level -= _rescale(top_quant, current_quant, pTop[i]); + S1 += abs(level); + dct_codes[i] = level; + } + } + else { + for(i = 1; i < 8; i++) { + int16_t level; + + + + + + + + + + // assert(pLeft[i + 7] >= -256); + // assert(pLeft[i + 7] <= 256); + + + + + + + + + + level = dct_codes[i*8]; + S2 += abs(level); + level -= _rescale(left_quant, current_quant,pLeft[i + 7]); + S1 += abs(level); + dct_codes[i*8] = level; + } + } + + return S2 - S1; + } + + + void MBPrediction(const MBParam *pParam, uint16_t x_pos, uint16_t y_pos, + uint16_t x_dim, int16_t qcoeff[][64], Macroblock *MB_array) + { + int8_t i, mv_count, iDcScaler, iQuant = pParam->quant; + int32_t pred_x, pred_y, S = 0; + int16_t qcoeff_backup[6][64]; + + Macroblock *pMB = &MB_array[x_pos + y_pos * x_dim]; + + if((pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q)) { + memcpy(qcoeff_backup, qcoeff, sizeof(qcoeff_backup)); + + for(i = 0; i < 6; i++) { + iDcScaler = get_dc_scaler(iQuant, (i < 4) ? 1 : 0); + + S += calc_acdc_prediction(MB_array, x_pos, y_pos, x_dim, i, + qcoeff[i], iDcScaler, iQuant); + } + + /* if its not worth performing ac prediction, restore coeff + values and 'disable' ac prediction. */ + if(S < 0) { + for(i = 0; i < 6; i++) { + pMB->acpred_directions[i] = 0; + memcpy(&qcoeff[i][1], &qcoeff_backup[i][1], 63 * sizeof(int16_t)); + } + } + + pMB->cbp = calc_cbp_intra(qcoeff); + } + else { + mv_count = (pMB->mode == MODE_INTER4V) ? 4 : 1; + + for(i = 0; i < mv_count; i++) { + get_pmv(MB_array, x_pos, y_pos, x_dim, i, &pred_x, &pred_y); + + pMB->pmvs[i].x = pMB->mvs[i].x - pred_x; + pMB->pmvs[i].y = pMB->mvs[i].y - pred_y; + } + } + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/CVS/Entries *** bcast-2000c/quicktime/encore2/src/mbtransquant/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/CVS/Entries Thu Dec 13 18:20:40 2001 *************** *** 0 **** --- 1,13 ---- + /dct.c/1.1/Fri Nov 30 01:09:03 2001// + /enc_dct.h/1.1/Fri Nov 30 01:09:03 2001// + /enc_quantize.h/1.1/Fri Nov 30 01:09:03 2001// + /enc_transfer.h/1.1/Fri Nov 30 01:09:03 2001// + /fast_dct.c/1.1/Fri Nov 30 01:09:03 2001// + /fdct.c/1.1/Fri Nov 30 01:09:03 2001// + /idct.c/1.1/Fri Nov 30 01:09:03 2001// + /transfer.c/1.1/Fri Nov 30 01:09:03 2001// + /transferidct.c/1.1/Fri Nov 30 01:09:03 2001// + /transferidct.h/1.1/Fri Nov 30 01:09:03 2001// + D/intel_mmx//// + /mbtransquant.c/1.2/Mon Dec 3 14:34:31 2001// + /quantize.c/1.3/Mon Dec 10 13:46:09 2001// diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/CVS/Repository *** bcast-2000c/quicktime/encore2/src/mbtransquant/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/mbtransquant diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/CVS/Root *** bcast-2000c/quicktime/encore2/src/mbtransquant/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/dct.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/dct.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/dct.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/dct.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,300 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * text_dct.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions for fDCT/iDCT transformation. */ + + /* Some codes of this project come from SSG MPEG-2 implementation. */ + + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include + #include "enc_portab.h" + + /* The first part of it is for the forward DCT */ + + #ifndef PI + # ifdef M_PI + # define PI M_PI + # else + # define PI 3.14159265358979323846 + # endif + #endif + + /* private data */ + static double c[8][8]; /* + + transform coefficients */ + + void fdct_enc(int16_t *block) + { + int i, j, k; + double s; + double tmp[64]; + + for (i = 0; i < 8; i++) + for (j = 0; j < 8; j++) + { + s = 0.0; + + for (k = 0; k < 8; k++) + s += c[j][k] * block[8 * i + k]; + + tmp[8 * i + j] = s; + } + + for (j = 0; j < 8; j++) + for (i = 0; i < 8; i++) + { + s = 0.0; + + for (k = 0; k < 8; k++) + s += c[i][k] * tmp[8 * k + j]; + + block[8 * i + j] = (int) floor(s + 0.499999); + /* + * reason for adding 0.499999 instead of 0.5: + * s is quite often x.5 (at least for i and/or j = 0 or 4) + * and setting the rounding threshold exactly to 0.5 leads to an + * extremely high arithmetic implementation dependency of the result; + * s being between x.5 and x.500001 (which is now incorrectly rounded + * downwards instead of upwards) is assumed to occur less often + * (if at all) + */ + } + } + + void init_fdct_enc() + { + int i, j; + double s; + + for (i = 0; i < 8; i++) + { + s = (i == 0) ? sqrt(0.125) : 0.5; + + for (j = 0; j < 8; j++) + c[i][j] = s * cos((PI / 8.0) * i * (j + 0.5)); + } + } + + + + + /* the second part of it is for the inverse DCT */ + + #define W1 2841 /* + 2048*sqrt(2)*cos(1*pi/16) */ + #define W2 2676 /* + 2048*sqrt(2)*cos(2*pi/16) */ + #define W3 2408 /* + 2048*sqrt(2)*cos(3*pi/16) */ + #define W5 1609 /* + 2048*sqrt(2)*cos(5*pi/16) */ + #define W6 1108 /* + 2048*sqrt(2)*cos(6*pi/16) */ + #define W7 565 /* + 2048*sqrt(2)*cos(7*pi/16) */ + + /* private data */ + static int16_t iclip[1024]; /* + + clipping table */ + static int16_t *iclp; + + /* private prototypes */ + static void idctrow_enc(int16_t *blk); + static void idctcol_enc(int16_t *blk); + + /* two dimensional inverse discrete cosine transform */ + void idct_enc(int16_t *block) + { + int i; + + for (i = 0; i < 8; i++) + idctrow_enc(block + 8 * i); + + for (i = 0; i < 8; i++) + idctcol_enc(block + i); + } + + void init_idct_enc() + { + int i; + + iclp = iclip + 512; + for (i = -512; i < 512; i++) + iclp[i] = (i < -256) ? -256 : ((i > 255) ? 255 : i); + } + + /* row (horizontal) IDCT + * + * 7 pi 1 + * dst[k] = sum c[l] * src[l] * cos( -- * ( k + - ) * l ) + * l=0 8 2 + * + * where: c[0] = 128 + * c[1..7] = 128*sqrt(2) + */ + + static void idctrow_enc(blk) + int16_t *blk; + { + int x0, x1, x2, x3, x4, x5, x6, x7, x8; + + /* + shortcut */ + if (!((x1 = blk[4] << 11) | (x2 = blk[6]) | (x3 = blk[2]) | + (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) + { + blk[0] = blk[1] = blk[2] = blk[3] = blk[4] = blk[5] = blk[6] = + blk[7] = blk[0] << 3; + return; + } + + x0 = (blk[0] << 11) + 128; /* + for proper rounding in the fourth stage */ + + /* + first stage */ + x8 = W7 * (x4 + x5); + x4 = x8 + (W1 - W7) * x4; + x5 = x8 - (W1 + W7) * x5; + x8 = W3 * (x6 + x7); + x6 = x8 - (W3 - W5) * x6; + x7 = x8 - (W3 + W5) * x7; + + /* + second stage */ + x8 = x0 + x1; + x0 -= x1; + x1 = W6 * (x3 + x2); + x2 = x1 - (W2 + W6) * x2; + x3 = x1 + (W2 - W6) * x3; + x1 = x4 + x6; + x4 -= x6; + x6 = x5 + x7; + x5 -= x7; + + /* + third stage */ + x7 = x8 + x3; + x8 -= x3; + x3 = x0 + x2; + x0 -= x2; + x2 = (181 * (x4 + x5) + 128) >> 8; + x4 = (181 * (x4 - x5) + 128) >> 8; + + /* + fourth stage */ + blk[0] = (x7 + x1) >> 8; + blk[1] = (x3 + x2) >> 8; + blk[2] = (x0 + x4) >> 8; + blk[3] = (x8 + x6) >> 8; + blk[4] = (x8 - x6) >> 8; + blk[5] = (x0 - x4) >> 8; + blk[6] = (x3 - x2) >> 8; + blk[7] = (x7 - x1) >> 8; + } + + /* column (vertical) IDCT + * + * 7 pi 1 + * dst[8*k] = sum c[l] * src[8*l] * cos( -- * ( k + - ) * l ) + * l=0 8 2 + * + * where: c[0] = 1/1024 + * c[1..7] = (1/1024)*sqrt(2) + */ + static void idctcol_enc(blk) + int16_t *blk; + { + int x0, x1, x2, x3, x4, x5, x6, x7, x8; + + /* + shortcut */ + if (!((x1 = (blk[8 * 4] << 8)) | (x2 = blk[8 * 6]) | (x3 = blk[8 * 2]) | + (x4 = blk[8 * 1]) | (x5 = blk[8 * 7]) | (x6 = blk[8 * 5]) | (x7 = + blk[8 * + 3]))) + { + blk[8 * 0] = blk[8 * 1] = blk[8 * 2] = blk[8 * 3] = blk[8 * 4] = + blk[8 * 5] = blk[8 * 6] = blk[8 * 7] = + iclp[(blk[8 * 0] + 32) >> 6]; + return; + } + + x0 = (blk[8 * 0] << 8) + 8192; + + /* + first stage */ + x8 = W7 * (x4 + x5) + 4; + x4 = (x8 + (W1 - W7) * x4) >> 3; + x5 = (x8 - (W1 + W7) * x5) >> 3; + x8 = W3 * (x6 + x7) + 4; + x6 = (x8 - (W3 - W5) * x6) >> 3; + x7 = (x8 - (W3 + W5) * x7) >> 3; + + /* + second stage */ + x8 = x0 + x1; + x0 -= x1; + x1 = W6 * (x3 + x2) + 4; + x2 = (x1 - (W2 + W6) * x2) >> 3; + x3 = (x1 + (W2 - W6) * x3) >> 3; + x1 = x4 + x6; + x4 -= x6; + x6 = x5 + x7; + x5 -= x7; + + /* + third stage */ + x7 = x8 + x3; + x8 -= x3; + x3 = x0 + x2; + x0 -= x2; + x2 = (181 * (x4 + x5) + 128) >> 8; + x4 = (181 * (x4 - x5) + 128) >> 8; + + /* + fourth stage */ + blk[8 * 0] = iclp[(x7 + x1) >> 14]; + blk[8 * 1] = iclp[(x3 + x2) >> 14]; + blk[8 * 2] = iclp[(x0 + x4) >> 14]; + blk[8 * 3] = iclp[(x8 + x6) >> 14]; + blk[8 * 4] = iclp[(x8 - x6) >> 14]; + blk[8 * 5] = iclp[(x0 - x4) >> 14]; + blk[8 * 6] = iclp[(x3 - x2) >> 14]; + blk[8 * 7] = iclp[(x7 - x1) >> 14]; + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/enc_dct.h bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/enc_dct.h *** bcast-2000c/quicktime/encore2/src/mbtransquant/enc_dct.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/enc_dct.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,17 ---- + #ifndef _DCT_H_ + #define _DCT_H_ + + #include "enc_portab.h" + + + void enc_fdct_int32(short * const block); + void enc_fdct_mmx (short * const block); + + void enc_idct_int32_init(); + void enc_idct_int32 (short * const block); + + void enc_idct_mmx (short * const src_result); + void enc_idct_sse (short * const src_result); + + #endif /* _DCT_H_ */ + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/enc_quantize.h bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/enc_quantize.h *** bcast-2000c/quicktime/encore2/src/mbtransquant/enc_quantize.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/enc_quantize.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,50 ---- + #ifndef _QUANTIZE_H_ + #define _QUANTIZE_H_ + + + #include "../enctypes.h" + + + /* plain c */ + + void dec_quant_intra(int16_t * coeff, + const int16_t * data, + const uint8_t quant, + const uint8_t dcscalar); + + void dec_dequant_intra(int16_t *data, + const int16_t *coeff, + const uint8_t quant, + const uint8_t dcscalar); + + int dec_quant_inter(int16_t *coeff, + const int16_t *data, + const uint8_t quant); + + void dec_dequant_inter(int16_t *data, + const int16_t *coeff, + const uint8_t quant); + + + /* mmx */ + + void dec_quant_intra_mmx(int16_t * coeff, + const int16_t * const data, + const uint32_t quant, + const uint32_t dcscalar); + + void dec_dequant_intra_mmx(int16_t *data, + const int16_t * const coeff, + const uint32_t quant, + const uint32_t dcscalar); + + uint32_t dec_quant_inter_mmx(int16_t * coeff, + const int16_t * const data, + const uint32_t quant); + + void dec_dequant_inter_mmx(int16_t * data, + const int16_t * const coeff, + const uint32_t quant); + + + #endif /* _QUANTIZE_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/enc_transfer.h bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/enc_transfer.h *** bcast-2000c/quicktime/encore2/src/mbtransquant/enc_transfer.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/enc_transfer.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,38 ---- + #ifndef _TRANSFER_H_ + #define _TRANSFER_H_ + + + #include "enc_portab.h" + + + /* plain c */ + + void enc_transfer_8to16copy(int16_t * const dst, + const uint8_t * const src, + uint32_t stride); + + void enc_transfer_16to8copy(uint8_t * const dst, + const int16_t * const src, + uint32_t stride); + + void enc_transfer_16to8add(uint8_t * const dst, + const int16_t * const src, + uint32_t stride); + + + /* mmx */ + + void enc_transfer_8to16copy_mmx(int16_t * const dst, + const uint8_t * const src, + uint32_t stride); + + void enc_transfer_16to8copy_mmx(uint8_t * const dst, + const int16_t * const src, + uint32_t stride); + + void enc_transfer_16to8add_mmx(uint8_t * const dst, + const int16_t * const src, + uint32_t stride); + + + #endif /* _TRANSFER_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/fast_dct.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/fast_dct.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/fast_dct.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/fast_dct.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,148 ---- + + /************************************************************************** + * * + * This code is developed by Eugene Kuznetsov. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * fast_dct.c, C implementation of fast integer forward DCT algorithm + * + * Copyright (C) 2001 Project Mayo + * + * Eugene Kuznetsov + * + * DivX Advance Research Center + * + **************************************************************************/ + #include "dct.h" + + const float m_c0 = 0.7071068f; // 2896 + const float m_c1 = 0.4903926f; // 2009 + const float m_c2 = 0.4619398f; // 1892 + const float m_c3 = 0.4157348f; // 1703 + const float m_c4 = 0.3535534f; // 1448 + const float m_c5 = 0.2777851f; // 1138 + const float m_c6 = 0.1913417f; // 784 + const float m_c7 = 0.0975452f; // 400 + + + void oneDimensionalFwdDCT_fast_up(int16_t *sInput) + { + int32_t sBuffer[8]; + int32_t sBuffer2[4]; + int j, j1; + + for (j = 0; j < 4; j++) + { + j1 = 7 - j; + sBuffer[j] = sInput[j] + sInput[j1]; + sBuffer[j1] = sInput[j] - sInput[j1]; + } + sBuffer2[0] = sBuffer[0] + sBuffer[3]; + sBuffer2[1] = sBuffer[1] + sBuffer[2]; + sBuffer2[2] = sBuffer[1] - sBuffer[2]; + sBuffer2[3] = sBuffer[0] - sBuffer[3]; + sInput[0] = ((sBuffer2[0] + sBuffer2[1]) * (int16_t) (m_c4 * 4096)) >> 8; + sInput[4] = ((sBuffer2[0] - sBuffer2[1]) * (int16_t) (m_c4 * 4096)) >> 8; + sInput[2] = + (sBuffer2[2] * (int16_t) (m_c6 * 4096) + + sBuffer2[3] * (int16_t) (m_c2 * 4096)) >> 8; + sInput[6] = + (sBuffer2[3] * (int16_t) (m_c6 * 4096) - + sBuffer2[2] * (int16_t) (m_c2 * 4096)) >> 8; + sBuffer2[0] = sBuffer[4] << 12; + sBuffer2[1] = (sBuffer[6] - sBuffer[5]) * (int16_t) (m_c0 * 4096); + sBuffer2[2] = (sBuffer[6] + sBuffer[5]) * (int16_t) (m_c0 * 4096); + sBuffer2[3] = sBuffer[7] << 12; + sBuffer[4] = (sBuffer2[0] + sBuffer2[1]) >> 10; + sBuffer[7] = (sBuffer2[3] + sBuffer2[2]) >> 10; + sBuffer[5] = (sBuffer2[0] - sBuffer2[1]) >> 10; + sBuffer[6] = (sBuffer2[3] - sBuffer2[2]) >> 10; + sInput[1] = + (sBuffer[4] * (int16_t) (m_c7 * 4096) + + sBuffer[7] * (int16_t) (m_c1 * 4096)) >> 10; + sInput[5] = + (sBuffer[5] * (int16_t) (m_c3 * 4096) + + sBuffer[6] * (int16_t) (m_c5 * 4096)) >> 10; + sInput[7] = + (sBuffer[7] * (int16_t) (m_c7 * 4096) - + sBuffer[4] * (int16_t) (m_c1 * 4096)) >> 10; + sInput[3] = + (sBuffer[6] * (int16_t) (m_c3 * 4096) - + sBuffer[5] * (int16_t) (m_c5 * 4096)) >> 10; + } + void oneDimensionalFwdDCT_fast_down(int16_t *sInput) + { + int32_t sBuffer[8]; + int32_t sBuffer2[4]; + int j, j1; + + for (j = 0; j < 4; j++) + { + j1 = 7 - j; + sBuffer[j] = sInput[8 * j] + sInput[8 * j1]; + sBuffer[j1] = sInput[8 * j] - sInput[8 * j1]; + } + sBuffer2[0] = sBuffer[0] + sBuffer[3]; + sBuffer2[1] = sBuffer[1] + sBuffer[2]; + sBuffer2[2] = sBuffer[1] - sBuffer[2]; + sBuffer2[3] = sBuffer[0] - sBuffer[3]; + + sInput[8 * 0] = + ((sBuffer2[0] + sBuffer2[1]) * (int16_t) (m_c4 * 4096)) >> 16; + sInput[8 * 4] = + ((sBuffer2[0] - sBuffer2[1]) * (int16_t) (m_c4 * 4096)) >> 16; + sInput[8 * 2] = + (sBuffer2[2] * (int16_t) (m_c6 * 4096) + + sBuffer2[3] * (int16_t) (m_c2 * 4096)) >> 16; + sInput[8 * 6] = + (sBuffer2[3] * (int16_t) (m_c6 * 4096) - + sBuffer2[2] * (int16_t) (m_c2 * 4096)) >> 16; + sBuffer2[0] = sBuffer[4] << 12; + sBuffer2[1] = (sBuffer[6] - sBuffer[5]) * (int16_t) (m_c0 * 4096); + sBuffer2[2] = (sBuffer[6] + sBuffer[5]) * (int16_t) (m_c0 * 4096); + sBuffer2[3] = sBuffer[7] << 12; + sBuffer[4] = (sBuffer2[0] + sBuffer2[1]) >> 10; + sBuffer[7] = (sBuffer2[3] + sBuffer2[2]) >> 10; + sBuffer[5] = (sBuffer2[0] - sBuffer2[1]) >> 10; + sBuffer[6] = (sBuffer2[3] - sBuffer2[2]) >> 10; + sInput[8 * 1] = + (sBuffer[4] * (int16_t) (m_c7 * 4096) + + sBuffer[7] * (int16_t) (m_c1 * 4096)) >> 18; + sInput[8 * 5] = + (sBuffer[5] * (int16_t) (m_c3 * 4096) + + sBuffer[6] * (int16_t) (m_c5 * 4096)) >> 18; + sInput[8 * 7] = + (sBuffer[7] * (int16_t) (m_c7 * 4096) - + sBuffer[4] * (int16_t) (m_c1 * 4096)) >> 18; + sInput[8 * 3] = + (sBuffer[6] * (int16_t) (m_c3 * 4096) - + sBuffer[5] * (int16_t) (m_c5 * 4096)) >> 18; + } + void fdct_enc_fast(int16_t *block) + { + int32_t i; + + for (i = 0; i < 8; i++) + oneDimensionalFwdDCT_fast_up(block + 8 * i); + for (i = 0; i < 8; i++) + oneDimensionalFwdDCT_fast_down(block + i); + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/fdct.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/fdct.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/fdct.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/fdct.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,256 ---- + /* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */ + + /* + * Disclaimer of Warranty + * + * These software programs are available to the user without any license fee or + * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims + * any and all warranties, whether express, implied, or statuary, including any + * implied warranties or merchantability or of fitness for a particular + * purpose. In no event shall the copyright-holder be liable for any + * incidental, punitive, or consequential damages of any kind whatsoever + * arising from the use of these programs. + * + * This disclaimer of warranty extends to the user of these programs and user's + * customers, employees, agents, transferees, successors, and assigns. + * + * The MPEG Software Simulation Group does not represent or warrant that the + * programs furnished hereunder are free of infringement of any third-party + * patents. + * + * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware, + * are subject to royalty fees to patent holders. Many of these patents are + * general enough such that they are unavoidable regardless of implementation + * design. + * + */ + + /* This routine is a slow-but-accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). Taken from the IJG software + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + * + * The poop on this scaling stuff is as follows: + * + * Each 1-D DCT step produces outputs which are a factor of sqrt(N) + * larger than the true DCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D DCT, + * because the y0 and y4 outputs need not be divided by sqrt(N). + * In the IJG code, this factor of 8 is removed by the quantization step + * (in jcdctmgr.c), here it is removed. + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require 8 + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (For 12-bit sample data, the intermediate + * array is INT32 anyway.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have 8 + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + * + * We can gain a little more speed, with a further compromise in accuracy, + * by omitting the addition in a descaling shift. This yields an incorrectly + * rounded result half the time... + */ + + + #define USE_ACCURATE_ROUNDING + + #define RIGHT_SHIFT(x, shft) ((x) >> (shft)) + + #ifdef USE_ACCURATE_ROUNDING + #define ONE ((int) 1) + #define DESCALE(x, n) RIGHT_SHIFT((x) + (ONE << ((n) - 1)), n) + #else + #define DESCALE(x, n) RIGHT_SHIFT(x, n) + #endif + + #define CONST_BITS 13 + #define PASS1_BITS 2 + + #define FIX_0_298631336 ((int) 2446) /* FIX(0.298631336) */ + #define FIX_0_390180644 ((int) 3196) /* FIX(0.390180644) */ + #define FIX_0_541196100 ((int) 4433) /* FIX(0.541196100) */ + #define FIX_0_765366865 ((int) 6270) /* FIX(0.765366865) */ + #define FIX_0_899976223 ((int) 7373) /* FIX(0.899976223) */ + #define FIX_1_175875602 ((int) 9633) /* FIX(1.175875602) */ + #define FIX_1_501321110 ((int) 12299) /* FIX(1.501321110) */ + #define FIX_1_847759065 ((int) 15137) /* FIX(1.847759065) */ + #define FIX_1_961570560 ((int) 16069) /* FIX(1.961570560) */ + #define FIX_2_053119869 ((int) 16819) /* FIX(2.053119869) */ + #define FIX_2_562915447 ((int) 20995) /* FIX(2.562915447) */ + #define FIX_3_072711026 ((int) 25172) /* FIX(3.072711026) */ + + /* + * Perform an integer forward DCT on one block of samples. + */ + + void enc_fdct_int32(short * const block) + { + int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + int tmp10, tmp11, tmp12, tmp13; + int z1, z2, z3, z4, z5; + short *blkptr; + int *dataptr; + int data[64]; + int i; + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + blkptr = block; + for (i = 0; i < 8; i++) + { + tmp0 = blkptr[0] + blkptr[7]; + tmp7 = blkptr[0] - blkptr[7]; + tmp1 = blkptr[1] + blkptr[6]; + tmp6 = blkptr[1] - blkptr[6]; + tmp2 = blkptr[2] + blkptr[5]; + tmp5 = blkptr[2] - blkptr[5]; + tmp3 = blkptr[3] + blkptr[4]; + tmp4 = blkptr[3] - blkptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (tmp10 + tmp11) << PASS1_BITS; + dataptr[4] = (tmp10 - tmp11) << PASS1_BITS; + + z1 = (tmp12 + tmp13) * FIX_0_541196100; + dataptr[2] = DESCALE(z1 + tmp13 * FIX_0_765366865, CONST_BITS - PASS1_BITS); + dataptr[6] = DESCALE(z1 + tmp12 * (-FIX_1_847759065), CONST_BITS - PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = (z3 + z4) * FIX_1_175875602; /* sqrt(2) * c3 */ + + tmp4 *= FIX_0_298631336; /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 *= FIX_2_053119869; /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 *= FIX_3_072711026; /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 *= FIX_1_501321110; /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 *= -FIX_0_899976223; /* sqrt(2) * (c7-c3) */ + z2 *= -FIX_2_562915447; /* sqrt(2) * (-c1-c3) */ + z3 *= -FIX_1_961570560; /* sqrt(2) * (-c3-c5) */ + z4 *= -FIX_0_390180644; /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = DESCALE(tmp4 + z1 + z3, CONST_BITS - PASS1_BITS); + dataptr[5] = DESCALE(tmp5 + z2 + z4, CONST_BITS - PASS1_BITS); + dataptr[3] = DESCALE(tmp6 + z2 + z3, CONST_BITS - PASS1_BITS); + dataptr[1] = DESCALE(tmp7 + z1 + z4, CONST_BITS - PASS1_BITS); + + dataptr += 8; /* advance pointer to next row */ + blkptr += 8; + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (i = 0; i < 8; i++) + { + tmp0 = dataptr[0] + dataptr[56]; + tmp7 = dataptr[0] - dataptr[56]; + tmp1 = dataptr[8] + dataptr[48]; + tmp6 = dataptr[8] - dataptr[48]; + tmp2 = dataptr[16] + dataptr[40]; + tmp5 = dataptr[16] - dataptr[40]; + tmp3 = dataptr[24] + dataptr[32]; + tmp4 = dataptr[24] - dataptr[32]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[32] = DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = (tmp12 + tmp13) * FIX_0_541196100; + dataptr[16] = DESCALE(z1 + tmp13 * FIX_0_765366865, CONST_BITS + PASS1_BITS); + dataptr[48] = DESCALE(z1 + tmp12 * (-FIX_1_847759065), CONST_BITS + PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = (z3 + z4) * FIX_1_175875602; /* sqrt(2) * c3 */ + + tmp4 *= FIX_0_298631336; /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 *= FIX_2_053119869; /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 *= FIX_3_072711026; /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 *= FIX_1_501321110; /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 *= -FIX_0_899976223; /* sqrt(2) * (c7-c3) */ + z2 *= -FIX_2_562915447; /* sqrt(2) * (-c1-c3) */ + z3 *= -FIX_1_961570560; /* sqrt(2) * (-c3-c5) */ + z4 *= -FIX_0_390180644; /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[56] = DESCALE(tmp4 + z1 + z3, CONST_BITS + PASS1_BITS); + dataptr[40] = DESCALE(tmp5 + z2 + z4, CONST_BITS + PASS1_BITS); + dataptr[24] = DESCALE(tmp6 + z2 + z3, CONST_BITS + PASS1_BITS); + dataptr[8] = DESCALE(tmp7 + z1 + z4, CONST_BITS + PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } + /* descale */ + for (i = 0; i < 64; i++) + block[i] = (short int) DESCALE(data[i], 3); + } + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/idct.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/idct.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/idct.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/idct.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,345 ---- + /* idct.c, inverse fast discrete cosine transform */ + + /* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */ + + /* + * Disclaimer of Warranty + * + * These software programs are available to the user without any license fee or + * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims + * any and all warranties, whether express, implied, or statuary, including any + * implied warranties or merchantability or of fitness for a particular + * purpose. In no event shall the copyright-holder be liable for any + * incidental, punitive, or consequential damages of any kind whatsoever + * arising from the use of these programs. + * + * This disclaimer of warranty extends to the user of these programs and user's + * customers, employees, agents, transferees, successors, and assigns. + * + * The MPEG Software Simulation Group does not represent or warrant that the + * programs furnished hereunder are free of infringement of any third-party + * patents. + * + * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware, + * are subject to royalty fees to patent holders. Many of these patents are + * general enough such that they are unavoidable regardless of implementation + * design. + * + * MPEG2AVI + * -------- + * v0.16B33 renamed the initialization function to init_idct_int32() + * v0.16B32 removed the unused idct_row() and idct_col() functions + * v0.16B3 changed var declarations to static, to enforce data align + * v0.16B22 idct_FAST() renamed to idct_int32() + * also merged idct_FAST() into a single function, to help VC++ + * optimize it. + * + * v0.14 changed int to long, to avoid confusion when compiling on x86 + * platform ( in VC++ "int" -> 32bits ) + */ + + /**********************************************************/ + /* inverse two dimensional DCT, Chen-Wang algorithm */ + /* (cf. IEEE ASSP-32, pp. 803-816, Aug. 1984) */ + /* 32-bit integer arithmetic (8 bit coefficients) */ + /* 11 mults, 29 adds per DCT */ + /* sE, 18.8.91 */ + /**********************************************************/ + /* coefficients extended to 12 bit for IEEE1180-1990 */ + /* compliance sE, 2.1.94 */ + /**********************************************************/ + + /* this code assumes >> to be a two's-complement arithmetic */ + /* right shift: (-2)>>1 == -1 , (-3)>>1 == -2 */ + + //#include + + #define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */ + #define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */ + #define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */ + #define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */ + #define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */ + #define W7 565 /* 2048*sqrt(2)*cos(7*pi/16) */ + + + /* global declarations */ + //void init_idct_int32 (void); + //void idct_int32 (short *block); + + /* private data */ + static short iclip[1024]; /* clipping table */ + static short *iclp; + + /* private prototypes */ + //static void idctrow _ANSI_ARGS_((short *blk)); + //static void idctcol _ANSI_ARGS_((short *blk)); + + /* row (horizontal) IDCT + * + * 7 pi 1 + * dst[k] = sum c[l] * src[l] * cos( -- * ( k + - ) * l ) + * l=0 8 2 + * + * where: c[0] = 128 + * c[1..7] = 128*sqrt(2) + */ + + /* + static void idctrow(blk) + short *blk; + { + int X0, X1, X2, X3, X4, X5, X6, X7, X8; + + // shortcut + if (!((X1 = blk[4]<<11) | (X2 = blk[6]) | (X3 = blk[2]) | + (X4 = blk[1]) | (X5 = blk[7]) | (X6 = blk[5]) | (X7 = blk[3]))) + { + blk[0]=blk[1]=blk[2]=blk[3]=blk[4]=blk[5]=blk[6]=blk[7]=blk[0]<<3; + return; + } + + X0 = (blk[0]<<11) + 128; // for proper rounding in the fourth stage + + // first stage + X8 = W7*(X4+X5); + X4 = X8 + (W1-W7)*X4; + X5 = X8 - (W1+W7)*X5; + X8 = W3*(X6+X7); + X6 = X8 - (W3-W5)*X6; + X7 = X8 - (W3+W5)*X7; + + // second stage + X8 = X0 + X1; + X0 -= X1; + X1 = W6*(X3+X2); + X2 = X1 - (W2+W6)*X2; + X3 = X1 + (W2-W6)*X3; + X1 = X4 + X6; + X4 -= X6; + X6 = X5 + X7; + X5 -= X7; + + // third stage + X7 = X8 + X3; + X8 -= X3; + X3 = X0 + X2; + X0 -= X2; + X2 = (181*(X4+X5)+128)>>8; + X4 = (181*(X4-X5)+128)>>8; + + // fourth stage + blk[0] = (X7+X1)>>8; + blk[1] = (X3+X2)>>8; + blk[2] = (X0+X4)>>8; + blk[3] = (X8+X6)>>8; + blk[4] = (X8-X6)>>8; + blk[5] = (X0-X4)>>8; + blk[6] = (X3-X2)>>8; + blk[7] = (X7-X1)>>8; + }*/ + + /* column (vertical) IDCT + * + * 7 pi 1 + * dst[8*k] = sum c[l] * src[8*l] * cos( -- * ( k + - ) * l ) + * l=0 8 2 + * + * where: c[0] = 1/1024 + * c[1..7] = (1/1024)*sqrt(2) + */ + /* + static void idctcol(blk) + short *blk; + { + int X0, X1, X2, X3, X4, X5, X6, X7, X8; + + // shortcut + if (!((X1 = (blk[8*4]<<8)) | (X2 = blk[8*6]) | (X3 = blk[8*2]) | + (X4 = blk[8*1]) | (X5 = blk[8*7]) | (X6 = blk[8*5]) | (X7 = blk[8*3]))) + { + blk[8*0]=blk[8*1]=blk[8*2]=blk[8*3]=blk[8*4]=blk[8*5]=blk[8*6]=blk[8*7]= + iclp[(blk[8*0]+32)>>6]; + return; + } + + X0 = (blk[8*0]<<8) + 8192; + + // first stage + X8 = W7*(X4+X5) + 4; + X4 = (X8+(W1-W7)*X4)>>3; + X5 = (X8-(W1+W7)*X5)>>3; + X8 = W3*(X6+X7) + 4; + X6 = (X8-(W3-W5)*X6)>>3; + X7 = (X8-(W3+W5)*X7)>>3; + + // second stage + X8 = X0 + X1; + X0 -= X1; + X1 = W6*(X3+X2) + 4; + X2 = (X1-(W2+W6)*X2)>>3; + X3 = (X1+(W2-W6)*X3)>>3; + X1 = X4 + X6; + X4 -= X6; + X6 = X5 + X7; + X5 -= X7; + + // third stage + X7 = X8 + X3; + X8 -= X3; + X3 = X0 + X2; + X0 -= X2; + X2 = (181*(X4+X5)+128)>>8; + X4 = (181*(X4-X5)+128)>>8; + + // fourth stage + blk[8*0] = iclp[(X7+X1)>>14]; + blk[8*1] = iclp[(X3+X2)>>14]; + blk[8*2] = iclp[(X0+X4)>>14]; + blk[8*3] = iclp[(X8+X6)>>14]; + blk[8*4] = iclp[(X8-X6)>>14]; + blk[8*5] = iclp[(X0-X4)>>14]; + blk[8*6] = iclp[(X3-X2)>>14]; + blk[8*7] = iclp[(X7-X1)>>14]; + }*/ + + /* two dimensional inverse discrete cosine transform */ + //void j_rev_dct(block) + //short *block; + void enc_idct_int32(short * const block) + { + + // idct_int32_init() must be called before the first call to this function! + + + /*int i; + long i; + + for (i=0; i<8; i++) + idctrow(block+8*i); + + for (i=0; i<8; i++) + idctcol(block+i);*/ + static short *blk; + static long i; + static long X0, X1, X2, X3, X4, X5, X6, X7, X8; + + + for (i=0; i<8; i++) // idct rows + { + blk = block+(i<<3); + if (!((X1 = blk[4]<<11) | (X2 = blk[6]) | (X3 = blk[2]) | + (X4 = blk[1]) | (X5 = blk[7]) | (X6 = blk[5]) | (X7 = blk[3]))) + { + blk[0]=blk[1]=blk[2]=blk[3]=blk[4]=blk[5]=blk[6]=blk[7]=blk[0]<<3; + continue; + } + + X0 = (blk[0]<<11) + 128; // for proper rounding in the fourth stage + + // first stage + X8 = W7*(X4+X5); + X4 = X8 + (W1-W7)*X4; + X5 = X8 - (W1+W7)*X5; + X8 = W3*(X6+X7); + X6 = X8 - (W3-W5)*X6; + X7 = X8 - (W3+W5)*X7; + + // second stage + X8 = X0 + X1; + X0 -= X1; + X1 = W6*(X3+X2); + X2 = X1 - (W2+W6)*X2; + X3 = X1 + (W2-W6)*X3; + X1 = X4 + X6; + X4 -= X6; + X6 = X5 + X7; + X5 -= X7; + + // third stage + X7 = X8 + X3; + X8 -= X3; + X3 = X0 + X2; + X0 -= X2; + X2 = (181*(X4+X5)+128)>>8; + X4 = (181*(X4-X5)+128)>>8; + + // fourth stage + + blk[0] = (short)((X7+X1)>>8); + blk[1] = (short)((X3+X2)>>8); + blk[2] = (short)((X0+X4)>>8); + blk[3] = (short)((X8+X6)>>8); + blk[4] = (short)((X8-X6)>>8); + blk[5] = (short)((X0-X4)>>8); + blk[6] = (short)((X3-X2)>>8); + blk[7] = (short)((X7-X1)>>8); + + } // end for ( i = 0; i < 8; ++i ) IDCT-rows + + + + for (i=0; i<8; i++) // idct columns + { + blk = block + i; + // shortcut + if (!((X1 = (blk[8*4]<<8)) | (X2 = blk[8*6]) | (X3 = blk[8*2]) | + (X4 = blk[8*1]) | (X5 = blk[8*7]) | (X6 = blk[8*5]) | (X7 = blk[8*3]))) + { + blk[8*0]=blk[8*1]=blk[8*2]=blk[8*3]=blk[8*4]= + blk[8*5]=blk[8*6]=blk[8*7]=iclp[(blk[8*0]+32)>>6]; + continue; + } + + X0 = (blk[8*0]<<8) + 8192; + + // first stage + X8 = W7*(X4+X5) + 4; + X4 = (X8+(W1-W7)*X4)>>3; + X5 = (X8-(W1+W7)*X5)>>3; + X8 = W3*(X6+X7) + 4; + X6 = (X8-(W3-W5)*X6)>>3; + X7 = (X8-(W3+W5)*X7)>>3; + + // second stage + X8 = X0 + X1; + X0 -= X1; + X1 = W6*(X3+X2) + 4; + X2 = (X1-(W2+W6)*X2)>>3; + X3 = (X1+(W2-W6)*X3)>>3; + X1 = X4 + X6; + X4 -= X6; + X6 = X5 + X7; + X5 -= X7; + + // third stage + X7 = X8 + X3; + X8 -= X3; + X3 = X0 + X2; + X0 -= X2; + X2 = (181*(X4+X5)+128)>>8; + X4 = (181*(X4-X5)+128)>>8; + + // fourth stage + blk[8*0] = iclp[(X7+X1)>>14]; + blk[8*1] = iclp[(X3+X2)>>14]; + blk[8*2] = iclp[(X0+X4)>>14]; + blk[8*3] = iclp[(X8+X6)>>14]; + blk[8*4] = iclp[(X8-X6)>>14]; + blk[8*5] = iclp[(X0-X4)>>14]; + blk[8*6] = iclp[(X3-X2)>>14]; + blk[8*7] = iclp[(X7-X1)>>14]; + } + + } // end function idct_int32(block) + + + //void + //idct_int32_init() + void enc_idct_int32_init() + { + int i; + + iclp = iclip+512; + for (i= -512; i<512; i++) + iclp[i] = (i<-256) ? -256 : ((i>255) ? 255 : i); + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Entries bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Entries *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Entries Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,10 ---- + /fdct_mmx.asm/1.2/Fri Nov 30 09:49:41 2001// + /idct_mmx.asm/1.2/Fri Nov 30 09:49:41 2001// + /idct_sse.asm/1.2/Fri Nov 30 09:49:41 2001// + /quant_mmx.asm/1.2/Fri Nov 30 09:49:41 2001// + /quantize_mmx.c/1.2/Fri Nov 30 09:49:41 2001// + /text_fdct_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /text_idct_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + /transfer_mmx.asm/1.2/Fri Nov 30 09:49:41 2001// + /transferidct_mmx.c/1.1/Fri Nov 30 01:09:03 2001// + D diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Repository bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Repository *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Repository Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore2/src/mbtransquant/intel_mmx diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Root bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Root *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/CVS/Root Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/fdct_mmx.asm bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/fdct_mmx.asm *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/fdct_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/fdct_mmx.asm Fri Nov 30 10:49:41 2001 *************** *** 0 **** --- 1,1200 ---- + ;/****************************************************************************** + ; * * + ; * This file is part of XviD, a free MPEG-4 video encoder/decoder * + ; * * + ; * XviD is an implementation of a part of one or more MPEG-4 Video tools * + ; * as specified in ISO/IEC 14496-2 standard. Those intending to use this * + ; * software module in hardware or software products are advised that its * + ; * use may infringe existing patents or copyrights, and any such use * + ; * would be at such party's own risk. The original developer of this * + ; * software module and his/her company, and subsequent editors and their * + ; * companies, will have no liability for use of this software or * + ; * modifications or derivatives thereof. * + ; * * + ; * XviD is free software; you can redistribute it and/or modify it * + ; * under the terms of the GNU General Public License as published by * + ; * the Free Software Foundation; either version 2 of the License, or * + ; * (at your option) any later version. * + ; * * + ; * XviD 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 General Public License for more details. * + ; * * + ; * You should have received a copy of the GNU General Public License * + ; * along with this program; if not, write to the Free Software * + ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + ; * * + ; ******************************************************************************/ + ; + ;/****************************************************************************** + ; * * + ; * fdct_mmx.asm, MMX optimized forward DCT * + ; * * + ; * Initial, but incomplete version provided by Intel at AppNote AP-922 * + ; * http://developer.intel.com/vtune/cbts/strmsimd/922down.htm * + ; * Copyright (C) 1999 Intel Corporation, * + ; * * + ; * completed and corrected in fdctmm32.c/fdctmm32.doc, * + ; * http://members.tripod.com/~liaor * + ; * Copyright (C) 2000 - Royce Shih-Wea Liao , * + ; * * + ; * ported to NASM and some minor changes * + ; * Copyright (C) 2001 - Michael Militzer * + ; * * + ; * For more information visit the XviD homepage: http://www.xvid.org * + ; * * + ; ******************************************************************************/ + ; + ;/****************************************************************************** + ; * * + ; * Revision history: * + ; * * + ; * 04.11.2001 loop unrolled (Isibaar) * + ; * 02.11.2001 initial version (Isibaar) * + ; * * + ; ******************************************************************************/ + + + BITS 32 + + %macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif + %endmacro + + %define INP eax + %define TABLE ebx + %define TABLEF ebx + %define OUT ecx + %define round_frw_row edx + + %define INP_1 eax + 16 + %define INP_2 eax + 32 + %define INP_3 eax + 48 + %define INP_4 eax + 64 + %define INP_5 eax + 80 + %define INP_6 eax + 96 + %define INP_7 eax + 112 + + %define OUT_1 ecx + 16 + %define OUT_2 ecx + 32 + %define OUT_3 ecx + 48 + %define OUT_4 ecx + 64 + %define OUT_5 ecx + 80 + %define OUT_6 ecx + 96 + %define OUT_7 ecx + 112 + %define OUT_8 ecx + 128 + + %define TABLE_1 ebx + 64 + %define TABLE_2 ebx + 128 + %define TABLE_3 ebx + 192 + %define TABLE_4 ebx + 256 + %define TABLE_5 ebx + 320 + %define TABLE_6 ebx + 384 + %define TABLE_7 ebx + 448 + + %define x0 INP + 0*16 + %define x1 INP + 1*16 + %define x2 INP + 2*16 + %define x3 INP + 3*16 + %define x4 INP + 4*16 + %define x5 INP + 5*16 + %define x6 INP + 6*16 + %define x7 INP + 7*16 + %define y0 OUT + 0*16 + %define y1 OUT + 1*16 + %define y2 OUT + 2*16 + %define y3 OUT + 3*16 + %define y4 OUT + 4*16 + %define y5 OUT + 5*16 + %define y6 OUT + 6*16 + %define y7 OUT + 7*16 + + %define tg_1_16 (TABLEF + 0) + %define tg_2_16 (TABLEF + 8) + %define tg_3_16 (TABLEF + 16) + %define cos_4_16 (TABLEF + 24) + %define ocos_4_16 (TABLEF + 32) + + + SECTION .data + + ALIGN 16 + + BITS_FRW_ACC equ 3 ; 2 or 3 for accuracy + SHIFT_FRW_COL equ BITS_FRW_ACC + SHIFT_FRW_ROW equ (BITS_FRW_ACC + 17) + RND_FRW_ROW equ (1 << (SHIFT_FRW_ROW-1)) + + SHIFT_FRW_ROW_CLIP2 equ (4) + SHIFT_FRW_ROW_CLIP1 equ (SHIFT_FRW_ROW - SHIFT_FRW_ROW_CLIP2) + + one_corr dw 1, 1, 1, 1 + + + r_frw_row dd RND_FRW_ROW, RND_FRW_ROW + + + tg_all_16 dw 13036, 13036, 13036, 13036, ; tg * (2<<16) + 0.5 + dw 27146, 27146, 27146, 27146, ; tg * (2<<16) + 0.5 + dw -21746, -21746, -21746, -21746, ; tg * (2<<16) + 0.5 + dw -19195, -19195, -19195, -19195, ; cos * (2<<16) + 0.5 + dw 23170, 23170, 23170, 23170 ; cos * (2<<15) + 0.5 + + + tab_frw_01234567 + ; row0 + dw 16384, 16384, 21407, -8867, ; w09 w01 w08 w00 + dw 16384, 16384, 8867, -21407, ; w13 w05 w12 w04 + dw 16384, -16384, 8867, 21407, ; w11 w03 w10 w02 + dw -16384, 16384, -21407, -8867, ; w15 w07 w14 w06 + dw 22725, 12873, 19266, -22725, ; w22 w20 w18 w16 + dw 19266, 4520, -4520, -12873, ; w23 w21 w19 w17 + dw 12873, 4520, 4520, 19266, ; w30 w28 w26 w24 + dw -22725, 19266, -12873, -22725, ; w31 w29 w27 w25 + + ; row1 + dw 22725, 22725, 29692, -12299, ; w09 w01 w08 w00 + dw 22725, 22725, 12299, -29692, ; w13 w05 w12 w04 + dw 22725, -22725, 12299, 29692, ; w11 w03 w10 w02 + dw -22725, 22725, -29692, -12299, ; w15 w07 w14 w06 + dw 31521, 17855, 26722, -31521, ; w22 w20 w18 w16 + dw 26722, 6270, -6270, -17855, ; w23 w21 w19 w17 + dw 17855, 6270, 6270, 26722, ; w30 w28 w26 w24 + dw -31521, 26722, -17855, -31521, ; w31 w29 w27 w25 + + ; row2 + dw 21407, 21407, 27969, -11585, ; w09 w01 w08 w00 + dw 21407, 21407, 11585, -27969, ; w13 w05 w12 w04 + dw 21407, -21407, 11585, 27969, ; w11 w03 w10 w02 + dw -21407, 21407, -27969, -11585, ; w15 w07 w14 w06 + dw 29692, 16819, 25172, -29692, ; w22 w20 w18 w16 + dw 25172, 5906, -5906, -16819, ; w23 w21 w19 w17 + dw 16819, 5906, 5906, 25172, ; w30 w28 w26 w24 + dw -29692, 25172, -16819, -29692, ; w31 w29 w27 w25 + + ; row3 + dw 19266, 19266, 25172, -10426, ; w09 w01 w08 w00 + dw 19266, 19266, 10426, -25172, ; w13 w05 w12 w04 + dw 19266, -19266, 10426, 25172, ; w11 w03 w10 w02 + dw -19266, 19266, -25172, -10426, ; w15 w07 w14 w06 + dw 26722, 15137, 22654, -26722, ; w22 w20 w18 w16 + dw 22654, 5315, -5315, -15137, ; w23 w21 w19 w17 + dw 15137, 5315, 5315, 22654, ; w30 w28 w26 w24 + dw -26722, 22654, -15137, -26722, ; w31 w29 w27 w25 + + ; row4 + dw 16384, 16384, 21407, -8867, ; w09 w01 w08 w00 + dw 16384, 16384, 8867, -21407, ; w13 w05 w12 w04 + dw 16384, -16384, 8867, 21407, ; w11 w03 w10 w02 + dw -16384, 16384, -21407, -8867, ; w15 w07 w14 w06 + dw 22725, 12873, 19266, -22725, ; w22 w20 w18 w16 + dw 19266, 4520, -4520, -12873, ; w23 w21 w19 w17 + dw 12873, 4520, 4520, 19266, ; w30 w28 w26 w24 + dw -22725, 19266, -12873, -22725, ; w31 w29 w27 w25 + + ; row5 + dw 19266, 19266, 25172, -10426, ; w09 w01 w08 w00 + dw 19266, 19266, 10426, -25172, ; w13 w05 w12 w04 + dw 19266, -19266, 10426, 25172, ; w11 w03 w10 w02 + dw -19266, 19266, -25172, -10426, ; w15 w07 w14 w06 + dw 26722, 15137, 22654, -26722, ; w22 w20 w18 w16 + dw 22654, 5315, -5315, -15137, ; w23 w21 w19 w17 + dw 15137, 5315, 5315, 22654, ; w30 w28 w26 w24 + dw -26722, 22654, -15137, -26722, ; w31 w29 w27 w25 + + ; row6 + dw 21407, 21407, 27969, -11585, ; w09 w01 w08 w00 + dw 21407, 21407, 11585, -27969, ; w13 w05 w12 w04 + dw 21407, -21407, 11585, 27969, ; w11 w03 w10 w02 + dw -21407, 21407, -27969, -11585, ; w15 w07 w14 w06 + dw 29692, 16819, 25172, -29692, ; w22 w20 w18 w16 + dw 25172, 5906, -5906, -16819, ; w23 w21 w19 w17 + dw 16819, 5906, 5906, 25172, ; w30 w28 w26 w24 + dw -29692, 25172, -16819, -29692, ; w31 w29 w27 w25 + + ; row7 + dw 22725, 22725, 29692, -12299, ; w09 w01 w08 w00 + dw 22725, 22725, 12299, -29692, ; w13 w05 w12 w04 + dw 22725, -22725, 12299, 29692, ; w11 w03 w10 w02 + dw -22725, 22725, -29692, -12299, ; w15 w07 w14 w06 + dw 31521, 17855, 26722, -31521, ; w22 w20 w18 w16 + dw 26722, 6270, -6270, -17855, ; w23 w21 w19 w17 + dw 17855, 6270, 6270, 26722, ; w30 w28 w26 w24 + dw -31521, 26722, -17855, -31521 ; w31 w29 w27 w25 + + + SECTION .text + + ALIGN 16 + + cglobal enc_fdct_mmx + ;;void enc_fdct_mmx(short *block); + enc_fdct_mmx: + + push ebx + + mov INP, dword [esp + 8] ; block + + mov TABLEF, tg_all_16 + mov OUT, INP + + movq mm0, [x1] ; 0 ; x1 + + movq mm1, [x6] ; 1 ; x6 + movq mm2, mm0 ; 2 ; x1 + + movq mm3, [x2] ; 3 ; x2 + paddsw mm0, mm1 ; t1 = x[1] + x[6] + + movq mm4, [x5] ; 4 ; x5 + psllw mm0, SHIFT_FRW_COL ; t1 + + movq mm5, [x0] ; 5 ; x0 + paddsw mm4, mm3 ; t2 = x[2] + x[5] + + paddsw mm5, [x7] ; t0 = x[0] + x[7] + psllw mm4, SHIFT_FRW_COL ; t2 + + movq mm6, mm0 ; 6 ; t1 + psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] + + movq mm1, [tg_2_16] ; 1 ; tg_2_16 + psubsw mm0, mm4 ; tm12 = t1 - t2 + + movq mm7, [x3] ; 7 ; x3 + pmulhw mm1, mm0 ; tm12*tg_2_16 + + paddsw mm7, [x4] ; t3 = x[3] + x[4] + psllw mm5, SHIFT_FRW_COL ; t0 + + paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 + psllw mm7, SHIFT_FRW_COL ; t3 + + movq mm4, mm5 ; 4 ; t0 + psubsw mm5, mm7 ; tm03 = t0 - t3 + + paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 + paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 + + por mm1, qword [one_corr] ; correction y2 +0.5 + psllw mm2, SHIFT_FRW_COL+1 ; t6 + + pmulhw mm5, [tg_2_16] ; tm03*tg_2_16 + movq mm7, mm4 ; 7 ; tp03 + + psubsw mm3, [x5] ; t5 = x[2] - x[5] + psubsw mm4, mm6 ; y4 = tp03 - tp12 + + movq [y2], mm1 ; 1 ; save y2 + paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 + + movq mm1, [x3] ; 1 ; x3 + psllw mm3, SHIFT_FRW_COL+1 ; t5 + + psubsw mm1, [x4] ; t4 = x[3] - x[4] + movq mm6, mm2 ; 6 ; t6 + + movq [y4], mm4 ; 4 ; save y4 + paddsw mm2, mm3 ; t6 + t5 + + pmulhw mm2, [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 + psubsw mm6, mm3 ; 3 ; t6 - t5 + + pmulhw mm6, [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 + psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 + + por mm5, qword [one_corr] ; correction y6 +0.5 + psllw mm1, SHIFT_FRW_COL ; t4 + + por mm2, qword [one_corr] ; correction tp65 +0.5 + movq mm4, mm1 ; 4 ; t4 + + movq mm3, [x0] ; 3 ; x0 + paddsw mm1, mm6 ; tp465 = t4 + tm65 + + psubsw mm3, [x7] ; t7 = x[0] - x[7] + psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 + + movq mm0, [tg_1_16] ; 0 ; tg_1_16 + psllw mm3, SHIFT_FRW_COL ; t7 + + movq mm6, [tg_3_16] ; 6 ; tg_3_16 + pmulhw mm0, mm1 ; tp465*tg_1_16 + + movq [y0], mm7 ; 7 ; save y0 + pmulhw mm6, mm4 ; tm465*tg_3_16 + + movq [y6], mm5 ; 5 ; save y6 + movq mm7, mm3 ; 7 ; t7 + + movq mm5, [tg_3_16] ; 5 ; tg_3_16 + psubsw mm7, mm2 ; tm765 = t7 - tp65 + + paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 + pmulhw mm5, mm7 ; tm765*tg_3_16 + + paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 + paddsw mm6, mm4 ; tm465*tg_3_16 + + pmulhw mm3, [tg_1_16] ; tp765*tg_1_16 + + por mm0, qword [one_corr] ; correction y1 +0.5 + paddsw mm5, mm7 ; tm765*tg_3_16 + + psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 + add INP, 0x08 + + movq [y1], mm0 ; 0 ; save y1 + paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 + + movq [y3], mm7 ; 7 ; save y3 + psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 + + movq [y5], mm5 ; 5 ; save y5 + + movq mm0, [x1] ; 0 ; x1 + + movq [y7], mm3 ; 3 ; save y7 (columns 0-4) + + movq mm1, [x6] ; 1 ; x6 + movq mm2, mm0 ; 2 ; x1 + + movq mm3, [x2] ; 3 ; x2 + paddsw mm0, mm1 ; t1 = x[1] + x[6] + + movq mm4, [x5] ; 4 ; x5 + psllw mm0, SHIFT_FRW_COL ; t1 + + movq mm5, [x0] ; 5 ; x0 + paddsw mm4, mm3 ; t2 = x[2] + x[5] + + paddsw mm5, [x7] ; t0 = x[0] + x[7] + psllw mm4, SHIFT_FRW_COL ; t2 + + movq mm6, mm0 ; 6 ; t1 + psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] + + movq mm1, [tg_2_16] ; 1 ; tg_2_16 + psubsw mm0, mm4 ; tm12 = t1 - t2 + + movq mm7, [x3] ; 7 ; x3 + pmulhw mm1, mm0 ; tm12*tg_2_16 + + paddsw mm7, [x4] ; t3 = x[3] + x[4] + psllw mm5, SHIFT_FRW_COL ; t0 + + paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 + psllw mm7, SHIFT_FRW_COL ; t3 + + movq mm4, mm5 ; 4 ; t0 + psubsw mm5, mm7 ; tm03 = t0 - t3 + + paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 + paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 + + por mm1, qword [one_corr] ; correction y2 +0.5 + psllw mm2, SHIFT_FRW_COL+1 ; t6 + + pmulhw mm5, [tg_2_16] ; tm03*tg_2_16 + movq mm7, mm4 ; 7 ; tp03 + + psubsw mm3, [x5] ; t5 = x[2] - x[5] + psubsw mm4, mm6 ; y4 = tp03 - tp12 + + movq [y2+8], mm1 ; 1 ; save y2 + paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 + + movq mm1, [x3] ; 1 ; x3 + psllw mm3, SHIFT_FRW_COL+1 ; t5 + + psubsw mm1, [x4] ; t4 = x[3] - x[4] + movq mm6, mm2 ; 6 ; t6 + + movq [y4+8], mm4 ; 4 ; save y4 + paddsw mm2, mm3 ; t6 + t5 + + pmulhw mm2, [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 + psubsw mm6, mm3 ; 3 ; t6 - t5 + + pmulhw mm6, [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 + psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 + + por mm5, qword [one_corr] ; correction y6 +0.5 + psllw mm1, SHIFT_FRW_COL ; t4 + + por mm2, qword [one_corr] ; correction tp65 +0.5 + movq mm4, mm1 ; 4 ; t4 + + movq mm3, [x0] ; 3 ; x0 + paddsw mm1, mm6 ; tp465 = t4 + tm65 + + psubsw mm3, [x7] ; t7 = x[0] - x[7] + psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 + + movq mm0, [tg_1_16] ; 0 ; tg_1_16 + psllw mm3, SHIFT_FRW_COL ; t7 + + movq mm6, [tg_3_16] ; 6 ; tg_3_16 + pmulhw mm0, mm1 ; tp465*tg_1_16 + + movq [y0+8], mm7 ; 7 ; save y0 + pmulhw mm6, mm4 ; tm465*tg_3_16 + + movq [y6+8], mm5 ; 5 ; save y6 + movq mm7, mm3 ; 7 ; t7 + + movq mm5, [tg_3_16] ; 5 ; tg_3_16 + psubsw mm7, mm2 ; tm765 = t7 - tp65 + + paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 + pmulhw mm5, mm7 ; tm765*tg_3_16 + + paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 + paddsw mm6, mm4 ; tm465*tg_3_16 + + pmulhw mm3, [tg_1_16] ; tp765*tg_1_16 + + por mm0, qword [one_corr] ; correction y1 +0.5 + paddsw mm5, mm7 ; tm765*tg_3_16 + + psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 + + movq [y1+8], mm0 ; 0 ; save y1 + paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 + + movq [y3+8], mm7 ; 7 ; save y3 + psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 + + movq [y5+8], mm5 ; 5 ; save y5 + + movq [y7+8], mm3 ; 3 ; save y7 + + mov INP, [esp + 8] ; row 0 + + mov TABLEF, tab_frw_01234567 ; row 0 + mov OUT, INP + + mov round_frw_row, r_frw_row + + movd mm5, [INP+12] ; mm5 = 7 6 + + punpcklwd mm5, [INP+8] + + movq mm2, mm5 ; mm2 = 5 7 4 6 + psrlq mm5, 32 ; mm5 = _ _ 5 7 + + movq mm0, [INP] ; mm0 = 3 2 1 0 + punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 + + movq mm1, mm0 ; mm1 = 3 2 1 0 + paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] + + punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] + + punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] + movq mm1, mm2 ; mm1 + + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + movq mm4, [TABLE+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + pmaddwd mm0, [TABLE+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + movq mm7, [TABLE+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [round_frw_row] ; +rounder (y2,y0) + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + + pmaddwd mm6, [TABLE+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [round_frw_row] ; +rounder (y6,y4) + psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) + + paddd mm1, [round_frw_row] ; +rounder (y3,y1) + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + + paddd mm5, [round_frw_row] ; +rounder (y7,y5) + psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 + + psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + movq mm6, mm3 ; mm0 = y6 y4 y2 y0 + + punpcklwd mm3, mm1 ; y3 y2 y1 y0 + + punpckhwd mm6, mm1 ; y7 y6 y5 y4 + + psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} + + psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} + + movq [OUT_1-16], mm3 ; 1 ; save y3 y2 y1 y0 + + movq [OUT_1-8], mm6 ; 7 ; save y7 y6 y5 y4 + + movd mm5, [INP_1+12] ; mm5 = 7 6 + + punpcklwd mm5, [INP_1+8] + + movq mm2, mm5 ; mm2 = 5 7 4 6 + psrlq mm5, 32 ; mm5 = _ _ 5 7 + + movq mm0, [INP_1] ; mm0 = 3 2 1 0 + punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 + + movq mm1, mm0 ; mm1 = 3 2 1 0 + paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] + + punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] + + punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] + movq mm1, mm2 ; mm1 + + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_1] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + movq mm4, [TABLE_1+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_1+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + pmaddwd mm0, [TABLE_1+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + movq mm7, [TABLE_1+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [round_frw_row] ; +rounder (y2,y0) + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_1+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_1+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + + pmaddwd mm6, [TABLE_1+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [round_frw_row] ; +rounder (y6,y4) + psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) + + paddd mm1, [round_frw_row] ; +rounder (y3,y1) + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + + paddd mm5, [round_frw_row] ; +rounder (y7,y5) + psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 + + psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + movq mm6, mm3 ; mm0 = y6 y4 y2 y0 + + punpcklwd mm3, mm1 ; y3 y2 y1 y0 + + punpckhwd mm6, mm1 ; y7 y6 y5 y4 + + psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} + + psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} + + movq [OUT_2-16], mm3 ; 1 ; save y3 y2 y1 y0 + + movq [OUT_2-8], mm6 ; 7 ; save y7 y6 y5 y4 + + movd mm5, [INP_2+12] ; mm5 = 7 6 + + punpcklwd mm5, [INP_2+8] + + movq mm2, mm5 ; mm2 = 5 7 4 6 + psrlq mm5, 32 ; mm5 = _ _ 5 7 + + movq mm0, [INP_2] ; mm0 = 3 2 1 0 + punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 + + movq mm1, mm0 ; mm1 = 3 2 1 0 + paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] + + punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] + + punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] + movq mm1, mm2 ; mm1 + + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_2] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + movq mm4, [TABLE_2+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_2+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + pmaddwd mm0, [TABLE_2+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + movq mm7, [TABLE_2+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [round_frw_row] ; +rounder (y2,y0) + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_2+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_2+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + + pmaddwd mm6, [TABLE_2+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [round_frw_row] ; +rounder (y6,y4) + psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) + + paddd mm1, [round_frw_row] ; +rounder (y3,y1) + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + + paddd mm5, [round_frw_row] ; +rounder (y7,y5) + psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 + + psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + movq mm6, mm3 ; mm0 = y6 y4 y2 y0 + + punpcklwd mm3, mm1 ; y3 y2 y1 y0 + + punpckhwd mm6, mm1 ; y7 y6 y5 y4 + + psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} + + psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} + + movq [OUT_3-16], mm3 ; 1 ; save y3 y2 y1 y0 + + movq [OUT_3-8], mm6 ; 7 ; save y7 y6 y5 y4 + + movd mm5, [INP_3+12] ; mm5 = 7 6 + + punpcklwd mm5, [INP_3+8] + + movq mm2, mm5 ; mm2 = 5 7 4 6 + psrlq mm5, 32 ; mm5 = _ _ 5 7 + + movq mm0, [INP_3] ; mm0 = 3 2 1 0 + punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 + + movq mm1, mm0 ; mm1 = 3 2 1 0 + paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] + + punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] + + punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] + movq mm1, mm2 ; mm1 + + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_3] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + movq mm4, [TABLE_3+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_3+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + pmaddwd mm0, [TABLE_3+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + movq mm7, [TABLE_3+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [round_frw_row] ; +rounder (y2,y0) + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_3+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_3+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + + pmaddwd mm6, [TABLE_3+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [round_frw_row] ; +rounder (y6,y4) + psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) + + paddd mm1, [round_frw_row] ; +rounder (y3,y1) + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + + paddd mm5, [round_frw_row] ; +rounder (y7,y5) + psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 + + psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + movq mm6, mm3 ; mm0 = y6 y4 y2 y0 + + punpcklwd mm3, mm1 ; y3 y2 y1 y0 + + punpckhwd mm6, mm1 ; y7 y6 y5 y4 + + psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} + + psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} + + movq [OUT_4-16], mm3 ; 1 ; save y3 y2 y1 y0 + + movq [OUT_4-8], mm6 ; 7 ; save y7 y6 y5 y4 + + movd mm5, [INP_4+12] ; mm5 = 7 6 + + punpcklwd mm5, [INP_4+8] + + movq mm2, mm5 ; mm2 = 5 7 4 6 + psrlq mm5, 32 ; mm5 = _ _ 5 7 + + movq mm0, [INP_4] ; mm0 = 3 2 1 0 + punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 + + movq mm1, mm0 ; mm1 = 3 2 1 0 + paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] + + punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] + + punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] + movq mm1, mm2 ; mm1 + + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_4] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + movq mm4, [TABLE_4+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_4+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + pmaddwd mm0, [TABLE_4+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + movq mm7, [TABLE_4+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [round_frw_row] ; +rounder (y2,y0) + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_4+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_4+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + + pmaddwd mm6, [TABLE_4+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [round_frw_row] ; +rounder (y6,y4) + psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) + + paddd mm1, [round_frw_row] ; +rounder (y3,y1) + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + + paddd mm5, [round_frw_row] ; +rounder (y7,y5) + psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 + + psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + movq mm6, mm3 ; mm0 = y6 y4 y2 y0 + + punpcklwd mm3, mm1 ; y3 y2 y1 y0 + + punpckhwd mm6, mm1 ; y7 y6 y5 y4 + + psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} + + psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} + + movq [OUT_5-16], mm3 ; 1 ; save y3 y2 y1 y0 + + movq [OUT_5-8], mm6 ; 7 ; save y7 y6 y5 y4 + + movd mm5, [INP_5+12] ; mm5 = 7 6 + + punpcklwd mm5, [INP_5+8] + + movq mm2, mm5 ; mm2 = 5 7 4 6 + psrlq mm5, 32 ; mm5 = _ _ 5 7 + + movq mm0, [INP_5] ; mm0 = 3 2 1 0 + punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 + + movq mm1, mm0 ; mm1 = 3 2 1 0 + paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] + + punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] + + punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] + movq mm1, mm2 ; mm1 + + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_5] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + movq mm4, [TABLE_5+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_5+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + pmaddwd mm0, [TABLE_5+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + movq mm7, [TABLE_5+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [round_frw_row] ; +rounder (y2,y0) + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_5+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_5+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + + pmaddwd mm6, [TABLE_5+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [round_frw_row] ; +rounder (y6,y4) + psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) + + paddd mm1, [round_frw_row] ; +rounder (y3,y1) + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + + paddd mm5, [round_frw_row] ; +rounder (y7,y5) + psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 + + psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + movq mm6, mm3 ; mm0 = y6 y4 y2 y0 + + punpcklwd mm3, mm1 ; y3 y2 y1 y0 + + punpckhwd mm6, mm1 ; y7 y6 y5 y4 + + psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} + + psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} + + movq [OUT_6-16], mm3 ; 1 ; save y3 y2 y1 y0 + + movq [OUT_6-8], mm6 ; 7 ; save y7 y6 y5 y4 + + movd mm5, [INP_6+12] ; mm5 = 7 6 + + punpcklwd mm5, [INP_6+8] + + movq mm2, mm5 ; mm2 = 5 7 4 6 + psrlq mm5, 32 ; mm5 = _ _ 5 7 + + movq mm0, [INP_6] ; mm0 = 3 2 1 0 + punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 + + movq mm1, mm0 ; mm1 = 3 2 1 0 + paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] + + punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] + + punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] + movq mm1, mm2 ; mm1 + + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_6] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + movq mm4, [TABLE_6+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_6+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + pmaddwd mm0, [TABLE_6+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + movq mm7, [TABLE_6+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [round_frw_row] ; +rounder (y2,y0) + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_6+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_6+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + + pmaddwd mm6, [TABLE_6+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [round_frw_row] ; +rounder (y6,y4) + psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) + + paddd mm1, [round_frw_row] ; +rounder (y3,y1) + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + + paddd mm5, [round_frw_row] ; +rounder (y7,y5) + psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 + + psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + movq mm6, mm3 ; mm0 = y6 y4 y2 y0 + + punpcklwd mm3, mm1 ; y3 y2 y1 y0 + + punpckhwd mm6, mm1 ; y7 y6 y5 y4 + + psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} + + psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} + + movq [OUT_7-16], mm3 ; 1 ; save y3 y2 y1 y0 + + movq [OUT_7-8], mm6 ; 7 ; save y7 y6 y5 y4 + + movd mm5, [INP_7+12] ; mm5 = 7 6 + + punpcklwd mm5, [INP_7+8] + + movq mm2, mm5 ; mm2 = 5 7 4 6 + psrlq mm5, 32 ; mm5 = _ _ 5 7 + + movq mm0, [INP_7] ; mm0 = 3 2 1 0 + punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 + + movq mm1, mm0 ; mm1 = 3 2 1 0 + paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] + + punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] + + punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] + movq mm1, mm2 ; mm1 + + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_7] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + movq mm4, [TABLE_7+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_7+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + pmaddwd mm0, [TABLE_7+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + movq mm7, [TABLE_7+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [round_frw_row] ; +rounder (y2,y0) + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_7+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_7+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + + pmaddwd mm6, [TABLE_7+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [round_frw_row] ; +rounder (y6,y4) + psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) + + paddd mm1, [round_frw_row] ; +rounder (y3,y1) + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + + paddd mm5, [round_frw_row] ; +rounder (y7,y5) + psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 + + psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + movq mm6, mm3 ; mm0 = y6 y4 y2 y0 + + punpcklwd mm3, mm1 ; y3 y2 y1 y0 + + punpckhwd mm6, mm1 ; y7 y6 y5 y4 + + psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} + + psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} + + movq [OUT_8-16], mm3 ; 1 ; save y3 y2 y1 y0 + + movq [OUT_8-8], mm6 ; 7 ; save y7 y6 y5 y4 + + pop ebx + emms + + ret diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/idct_mmx.asm bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/idct_mmx.asm *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/idct_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/idct_mmx.asm Fri Nov 30 10:49:41 2001 *************** *** 0 **** --- 1,1052 ---- + ;/****************************************************************************** + ; * * + ; * This file is part of XviD, a free MPEG-4 video encoder/decoder * + ; * * + ; * XviD is an implementation of a part of one or more MPEG-4 Video tools * + ; * as specified in ISO/IEC 14496-2 standard. Those intending to use this * + ; * software module in hardware or software products are advised that its * + ; * use may infringe existing patents or copyrights, and any such use * + ; * would be at such party's own risk. The original developer of this * + ; * software module and his/her company, and subsequent editors and their * + ; * companies, will have no liability for use of this software or * + ; * modifications or derivatives thereof. * + ; * * + ; * XviD is free software; you can redistribute it and/or modify it * + ; * under the terms of the GNU General Public License as published by * + ; * the Free Software Foundation; either version 2 of the License, or * + ; * (at your option) any later version. * + ; * * + ; * XviD 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 General Public License for more details. * + ; * * + ; * You should have received a copy of the GNU General Public License * + ; * along with this program; if not, write to the Free Software * + ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + ; * * + ; ******************************************************************************/ + ; + ;/****************************************************************************** + ; * * + ; * idct_mmx.asm, MMX optimized inverse DCT * + ; * * + ; * Initial version provided by Intel at Application Note AP-922 * + ; * http://developer.intel.com/vtune/cbts/strmsimd/922down.htm * + ; * Copyright (C) 1999 Intel Corporation, * + ; * * + ; * corrected and further optimized in idct8x8_xmm.asm * + ; * Copyright (C) 2000-2001 Peter Gubanov * + ; * Rounding trick Copyright (c) 2000 Michel Lespinasse * + ; * * + ; * http://www.elecard.com/peter/idct.html * + ; * http://www.linuxvideo.org/mpeg2dec/ * + ; * * + ; * ported to NASM and some minor changes * + ; * Copyright (C) 2001 - Michael Militzer , * + ; * * + ; * For more information visit the XviD homepage: http://www.xvid.org * + ; * * + ; ******************************************************************************/ + ; + ;/****************************************************************************** + ; * * + ; * Revision history: * + ; * * + ; * 07.11.2001 bugfix, idct now meets IEEE-1180 (Isibaar) * + ; * 02.11.2001 initial version (Isibaar) * + ; * * + ; ******************************************************************************/ + + + BITS 32 + + GLOBAL enc__idct_mmx + GLOBAL enc_idct_mmx + + %define INP_8 eax + 8 + %define OUT_8 eax + 8 + + + %define INP_0 eax + %define INP_1 eax + 16 + %define INP_2 eax + 32 + %define INP_3 eax + 48 + %define INP_4 eax + 64 + %define INP_5 eax + 80 + %define INP_6 eax + 96 + %define INP_7 eax + 112 + + %define OUT_0 eax + %define OUT_1 eax + 16 + %define OUT_2 eax + 32 + %define OUT_3 eax + 48 + %define OUT_4 eax + 64 + %define OUT_5 eax + 80 + %define OUT_6 eax + 96 + %define OUT_7 eax + 112 + + %define TABLE_0 ecx + %define TABLE_1 ecx + 64 + %define TABLE_2 ecx + 128 + %define TABLE_3 ecx + 192 + %define TABLE_4 ecx + 256 + %define TABLE_5 ecx + 320 + %define TABLE_6 ecx + 384 + %define TABLE_7 ecx + 448 + + %define ROUNDER_0 ebx + %define ROUNDER_1 ebx + 8 + %define ROUNDER_2 ebx + 16 + %define ROUNDER_3 ebx + 24 + %define ROUNDER_4 ebx + 32 + %define ROUNDER_5 ebx + 40 + %define ROUNDER_6 ebx + 48 + %define ROUNDER_7 ebx + 56 + + SECTION .data + + ALIGN 16 + + BITS_INV_ACC equ 5 + SHIFT_INV_ROW equ 16 - BITS_INV_ACC + SHIFT_INV_COL equ 1 + BITS_INV_ACC + + + rounder dd 65536, 65536, ; rounder_0 + dd 3597, 3597, ; rounder_1 + dd 2260, 2260, ; rounder_2 + dd 1203, 1203, ; rounder_3 + dd 0, 0, ; rounder_4 + dd 120, 120, ; rounder_5 + dd 512, 512, ; rounder_6 + dd 512, 512 ; rounder_7 + + tg_1_16 dw 13036, 13036, 13036, 13036 + tg_2_16 dw 27146, 27146, 27146, 27146 + tg_3_16 dw -21746, -21746, -21746, -21746 + + ocos_4_16 dw 23170, 23170, 23170, 23170 + + full_tab dw 16384, 16384, 16384, -16384, ; movq-> w06 w04 w02 w00 + dw 21407, 8867, 8867, -21407, ; w07 w05 w03 w01 + dw 16384, -16384, 16384, 16384, ; w14 w12 w10 w08 + dw -8867, 21407, -21407, -8867, ; w15 w13 w11 w09 + dw 22725, 12873, 19266, -22725, ; w22 w20 w18 w16 + dw 19266, 4520, -4520, -12873, ; w23 w21 w19 w17 + dw 12873, 4520, 4520, 19266, ; w30 w28 w26 w24 + dw -22725, 19266, -12873, -22725, ; w31 w29 w27 w25 + + dw 22725, 22725, 22725, -22725, ; movq-> w06 w04 w02 w00 + dw 29692, 12299, 12299, -29692, ; w07 w05 w03 w01 + dw 22725, -22725, 22725, 22725, ; w14 w12 w10 w08 + dw -12299, 29692, -29692, -12299, ; w15 w13 w11 w09 + dw 31521, 17855, 26722, -31521, ; w22 w20 w18 w16 + dw 26722, 6270, -6270, -17855, ; w23 w21 w19 w17 + dw 17855, 6270, 6270, 26722, ; w30 w28 w26 w24 + dw -31521, 26722, -17855, -31521, ; w31 w29 w27 w25 + + dw 21407, 21407, 21407, -21407, ; movq-> w06 w04 w02 w00 + dw 27969, 11585, 11585, -27969, ; w07 w05 w03 w01 + dw 21407, -21407, 21407, 21407, ; w14 w12 w10 w08 + dw -11585, 27969, -27969, -11585, ; w15 w13 w11 w09 + dw 29692, 16819, 25172, -29692, ; w22 w20 w18 w16 + dw 25172, 5906, -5906, -16819, ; w23 w21 w19 w17 + dw 16819, 5906, 5906, 25172, ; w30 w28 w26 w24 + dw -29692, 25172, -16819, -29692, ; w31 w29 w27 w25 + + dw 19266, 19266, 19266, -19266, ; movq-> w06 w04 w02 w00 + dw 25172, 10426, 10426, -25172, ; w07 w05 w03 w01 + dw 19266, -19266, 19266, 19266, ; w14 w12 w10 w08 + dw -10426, 25172, -25172, -10426, ; w15 w13 w11 w09 + dw 26722, 15137, 22654, -26722, ; w22 w20 w18 w16 + dw 22654, 5315, -5315, -15137, ; w23 w21 w19 w17 + dw 15137, 5315, 5315, 22654, ; w30 w28 w26 w24 + dw -26722, 22654, -15137, -26722, ; w31 w29 w27 w25 + + dw 16384, 16384, 16384, -16384, ; movq-> w06 w04 w02 w00 + dw 21407, 8867, 8867, -21407, ; w07 w05 w03 w01 + dw 16384, -16384, 16384, 16384, ; w14 w12 w10 w08 + dw -8867, 21407, -21407, -8867, ; w15 w13 w11 w09 + dw 22725, 12873, 19266, -22725, ; w22 w20 w18 w16 + dw 19266, 4520, -4520, -12873, ; w23 w21 w19 w17 + dw 12873, 4520, 4520, 19266, ; w30 w28 w26 w24 + dw -22725, 19266, -12873, -22725, ; w31 w29 w27 w25 + + dw 19266, 19266, 19266, -19266, ; movq-> w06 w04 w02 w00 + dw 25172, 10426, 10426, -25172, ; w07 w05 w03 w01 + dw 19266, -19266, 19266, 19266, ; w14 w12 w10 w08 + dw -10426, 25172, -25172, -10426, ; w15 w13 w11 w09 + dw 26722, 15137, 22654, -26722, ; w22 w20 w18 w16 + dw 22654, 5315, -5315, -15137, ; w23 w21 w19 w17 + dw 15137, 5315, 5315, 22654, ; w30 w28 w26 w24 + dw -26722, 22654, -15137, -26722, ; w31 w29 w27 w25 + + dw 21407, 21407, 21407, -21407, ; movq-> w06 w04 w02 w00 + dw 27969, 11585, 11585, -27969, ; w07 w05 w03 w01 + dw 21407, -21407, 21407, 21407, ; w14 w12 w10 w08 + dw -11585, 27969, -27969, -11585, ; w15 w13 w11 w09 + dw 29692, 16819, 25172, -29692, ; w22 w20 w18 w16 + dw 25172, 5906, -5906, -16819, ; w23 w21 w19 w17 + dw 16819, 5906, 5906, 25172, ; w30 w28 w26 w24 + dw -29692, 25172, -16819, -29692, ; w31 w29 w27 w25 + + dw 22725, 22725, 22725, -22725, ; movq-> w06 w04 w02 w00 + dw 29692, 12299, 12299, -29692, ; w07 w05 w03 w01 + dw 22725, -22725, 22725, 22725, ; w14 w12 w10 w08 + dw -12299, 29692, -29692, -12299, ; w15 w13 w11 w09 + dw 31521, 17855, 26722, -31521, ; w22 w20 w18 w16 + dw 26722, 6270, -6270, -17855, ; w23 w21 w19 w17 + dw 17855, 6270, 6270, 26722, ; w30 w28 w26 w24 + dw -31521, 26722, -17855, -31521, ; w31 w29 w27 w25 + + + SECTION .text + + ;;void enc_idct_mmx(short *block); + enc__idct_mmx: + enc_idct_mmx: + + push ebx + push edi + + mov INP_0, dword [esp + 12] ; block + mov TABLE_0, full_tab + mov ROUNDER_0, rounder + + movq mm0, [INP_0] ; 0 ; x3 x2 x1 x0 + + movq mm1, [INP_0+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_0] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [TABLE_0+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_0+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [TABLE_0+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [TABLE_0+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [ROUNDER_0] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_0+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_0+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [TABLE_0+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [ROUNDER_0] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [OUT_0], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [OUT_0+8], mm7 ; 7 ; save y7 y6 y5 y4 + + movq mm0, [INP_1] ; 0 ; x3 x2 x1 x0 + + movq mm1, [INP_1+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_1] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [TABLE_1+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_1+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [TABLE_1+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [TABLE_1+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [ROUNDER_1] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_1+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_1+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [TABLE_1+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [ROUNDER_1] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [OUT_1], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [OUT_1+8], mm7 ; 7 ; save y7 y6 y5 y4 + + movq mm0, [INP_2] ; 0 ; x3 x2 x1 x0 + + movq mm1, [INP_2+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_2] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [TABLE_2+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_2+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [TABLE_2+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [TABLE_2+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [ROUNDER_2] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_2+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_2+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [TABLE_2+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [ROUNDER_2] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [OUT_2], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [OUT_2+8], mm7 ; 7 ; save y7 y6 y5 y4 + + movq mm0, [INP_3] ; 0 ; x3 x2 x1 x0 + + movq mm1, [INP_3+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_3] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [TABLE_3+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_3+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [TABLE_3+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [TABLE_3+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [ROUNDER_3] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_3+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_3+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [TABLE_3+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [ROUNDER_3] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [OUT_3], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [OUT_3+8], mm7 ; 7 ; save y7 y6 y5 y4 + + movq mm0, [INP_4] ; 0 ; x3 x2 x1 x0 + + movq mm1, [INP_4+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_4] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [TABLE_4+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_4+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [TABLE_4+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [TABLE_4+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [ROUNDER_4] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_4+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_4+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [TABLE_4+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [ROUNDER_4] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [OUT_4], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [OUT_4+8], mm7 ; 7 ; save y7 y6 y5 y4 + + movq mm0, [INP_5] ; 0 ; x3 x2 x1 x0 + + movq mm1, [INP_5+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_5] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [TABLE_5+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_5+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [TABLE_5+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [TABLE_5+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [ROUNDER_5] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_5+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_5+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [TABLE_5+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [ROUNDER_5] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [OUT_5], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [OUT_5+8], mm7 ; 7 ; save y7 y6 y5 y4 + + movq mm0, [INP_6] ; 0 ; x3 x2 x1 x0 + + movq mm1, [INP_6+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_6] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [TABLE_6+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_6+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [TABLE_6+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [TABLE_6+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [ROUNDER_6] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_6+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_6+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [TABLE_6+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [ROUNDER_6] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [OUT_6], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [OUT_6+8], mm7 ; 7 ; save y7 y6 y5 y4 + + movq mm0, [INP_7] ; 0 ; x3 x2 x1 x0 + + movq mm1, [INP_7+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [TABLE_7] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [TABLE_7+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [TABLE_7+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [TABLE_7+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [TABLE_7+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [ROUNDER_7] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [TABLE_7+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [TABLE_7+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [TABLE_7+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [ROUNDER_7] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [OUT_7], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [OUT_7+8], mm7 ; 7 ; save y7 y6 y5 y4 + + movq mm0, [tg_3_16] + + movq mm3, [INP_0+16*3] + movq mm1, mm0 ; tg_3_16 + + movq mm5, [INP_0+16*5] + pmulhw mm0, mm3 ; x3*(tg_3_16-1) + + movq mm4, [tg_1_16] + pmulhw mm1, mm5 ; x5*(tg_3_16-1) + + movq mm7, [INP_0+16*7] + movq mm2, mm4 ; tg_1_16 + + movq mm6, [INP_0+16*1] + pmulhw mm4, mm7 ; x7*tg_1_16 + + paddsw mm0, mm3 ; x3*tg_3_16 + pmulhw mm2, mm6 ; x1*tg_1_16 + + paddsw mm1, mm3 ; x3+x5*(tg_3_16-1) + psubsw mm0, mm5 ; x3*tg_3_16-x5 = tm35 + + movq mm3, [ocos_4_16] + paddsw mm1, mm5 ; x3+x5*tg_3_16 = tp35 + + paddsw mm4, mm6 ; x1+tg_1_16*x7 = tp17 + psubsw mm2, mm7 ; x1*tg_1_16-x7 = tm17 + + movq mm5, mm4 ; tp17 + movq mm6, mm2 ; tm17 + + paddsw mm5, mm1 ; tp17+tp35 = b0 + psubsw mm6, mm0 ; tm17-tm35 = b3 + + psubsw mm4, mm1 ; tp17-tp35 = t1 + paddsw mm2, mm0 ; tm17+tm35 = t2 + + movq mm7, [tg_2_16] + movq mm1, mm4 ; t1 + + ; movq [SCRATCH+0], mm5 ; save b0 + movq [OUT_0+3*16], mm5 ; save b0 + paddsw mm1, mm2 ; t1+t2 + + ; movq [SCRATCH+8], mm6 ; save b3 + movq [OUT_0+5*16], mm6 ; save b3 + psubsw mm4, mm2 ; t1-t2 + + movq mm5, [INP_0+2*16] + movq mm0, mm7 ; tg_2_16 + + movq mm6, [INP_0+6*16] + pmulhw mm0, mm5 ; x2*tg_2_16 + + pmulhw mm7, mm6 ; x6*tg_2_16 + ; slot + pmulhw mm1, mm3 ; ocos_4_16*(t1+t2) = b1/2 + ; slot + movq mm2, [INP_0+0*16] + pmulhw mm4, mm3 ; ocos_4_16*(t1-t2) = b2/2 + + psubsw mm0, mm6 ; t2*tg_2_16-x6 = tm26 + movq mm3, mm2 ; x0 + + movq mm6, [INP_0+4*16] + paddsw mm7, mm5 ; x2+x6*tg_2_16 = tp26 + + paddsw mm2, mm6 ; x0+x4 = tp04 + psubsw mm3, mm6 ; x0-x4 = tm04 + + movq mm5, mm2 ; tp04 + movq mm6, mm3 ; tm04 + + psubsw mm2, mm7 ; tp04-tp26 = a3 + paddsw mm3, mm0 ; tm04+tm26 = a1 + + paddsw mm1, mm1 ; b1 + paddsw mm4, mm4 ; b2 + + paddsw mm5, mm7 ; tp04+tp26 = a0 + psubsw mm6, mm0 ; tm04-tm26 = a2 + + movq mm7, mm3 ; a1 + movq mm0, mm6 ; a2 + + paddsw mm3, mm1 ; a1+b1 + paddsw mm6, mm4 ; a2+b2 + + psraw mm3, SHIFT_INV_COL ; dst1 + psubsw mm7, mm1 ; a1-b1 + + psraw mm6, SHIFT_INV_COL ; dst2 + psubsw mm0, mm4 ; a2-b2 + + ; movq mm1, [SCRATCH+0] ; load b0 + movq mm1, [OUT_0+3*16] ; load b0 + psraw mm7, SHIFT_INV_COL ; dst6 + + movq mm4, mm5 ; a0 + psraw mm0, SHIFT_INV_COL ; dst5 + + movq [OUT_0+1*16], mm3 + paddsw mm5, mm1 ; a0+b0 + + movq [OUT_0+2*16], mm6 + psubsw mm4, mm1 ; a0-b0 + + ; movq mm3, [SCRATCH+8] ; load b3 + movq mm3, [OUT_0+5*16] ; load b3 + psraw mm5, SHIFT_INV_COL ; dst0 + + movq mm6, mm2 ; a3 + psraw mm4, SHIFT_INV_COL ; dst7 + + movq [OUT_0+5*16], mm0 + paddsw mm2, mm3 ; a3+b3 + + movq [OUT_0+6*16], mm7 + psubsw mm6, mm3 ; a3-b3 + + movq [OUT_0+0*16], mm5 + psraw mm2, SHIFT_INV_COL ; dst3 + + movq [OUT_0+7*16], mm4 + psraw mm6, SHIFT_INV_COL ; dst4 + + movq [OUT_0+3*16], mm2 + + movq [OUT_0+4*16], mm6 + + movq mm0, [tg_3_16] + + movq mm3, [INP_8+16*3] + movq mm1, mm0 ; tg_3_16 + + movq mm5, [INP_8+16*5] + pmulhw mm0, mm3 ; x3*(tg_3_16-1) + + movq mm4, [tg_1_16] + pmulhw mm1, mm5 ; x5*(tg_3_16-1) + + movq mm7, [INP_8+16*7] + movq mm2, mm4 ; tg_1_16 + + movq mm6, [INP_8+16*1] + pmulhw mm4, mm7 ; x7*tg_1_16 + + paddsw mm0, mm3 ; x3*tg_3_16 + pmulhw mm2, mm6 ; x1*tg_1_16 + + paddsw mm1, mm3 ; x3+x5*(tg_3_16-1) + psubsw mm0, mm5 ; x3*tg_3_16-x5 = tm35 + + movq mm3, [ocos_4_16] + paddsw mm1, mm5 ; x3+x5*tg_3_16 = tp35 + + paddsw mm4, mm6 ; x1+tg_1_16*x7 = tp17 + psubsw mm2, mm7 ; x1*tg_1_16-x7 = tm17 + + movq mm5, mm4 ; tp17 + movq mm6, mm2 ; tm17 + + paddsw mm5, mm1 ; tp17+tp35 = b0 + psubsw mm6, mm0 ; tm17-tm35 = b3 + + psubsw mm4, mm1 ; tp17-tp35 = t1 + paddsw mm2, mm0 ; tm17+tm35 = t2 + + movq mm7, [tg_2_16] + movq mm1, mm4 ; t1 + + ; movq [SCRATCH+0], mm5 ; save b0 + movq [OUT_8+3*16], mm5 ; save b0 + paddsw mm1, mm2 ; t1+t2 + + ; movq [SCRATCH+8], mm6 ; save b3 + movq [OUT_8+5*16], mm6 ; save b3 + psubsw mm4, mm2 ; t1-t2 + + movq mm5, [INP_8+2*16] + movq mm0, mm7 ; tg_2_16 + + movq mm6, [INP_8+6*16] + pmulhw mm0, mm5 ; x2*tg_2_16 + + pmulhw mm7, mm6 ; x6*tg_2_16 + ; slot + pmulhw mm1, mm3 ; ocos_4_16*(t1+t2) = b1/2 + ; slot + movq mm2, [INP_8+0*16] + pmulhw mm4, mm3 ; ocos_4_16*(t1-t2) = b2/2 + + psubsw mm0, mm6 ; t2*tg_2_16-x6 = tm26 + movq mm3, mm2 ; x0 + + movq mm6, [INP_8+4*16] + paddsw mm7, mm5 ; x2+x6*tg_2_16 = tp26 + + paddsw mm2, mm6 ; x0+x4 = tp04 + psubsw mm3, mm6 ; x0-x4 = tm04 + + movq mm5, mm2 ; tp04 + movq mm6, mm3 ; tm04 + + psubsw mm2, mm7 ; tp04-tp26 = a3 + paddsw mm3, mm0 ; tm04+tm26 = a1 + + paddsw mm1, mm1 ; b1 + paddsw mm4, mm4 ; b2 + + paddsw mm5, mm7 ; tp04+tp26 = a0 + psubsw mm6, mm0 ; tm04-tm26 = a2 + + movq mm7, mm3 ; a1 + movq mm0, mm6 ; a2 + + paddsw mm3, mm1 ; a1+b1 + paddsw mm6, mm4 ; a2+b2 + + psraw mm3, SHIFT_INV_COL ; dst1 + psubsw mm7, mm1 ; a1-b1 + + psraw mm6, SHIFT_INV_COL ; dst2 + psubsw mm0, mm4 ; a2-b2 + + ; movq mm1, [SCRATCH+0] ; load b0 + movq mm1, [OUT_8+3*16] ; load b0 + psraw mm7, SHIFT_INV_COL ; dst6 + + movq mm4, mm5 ; a0 + psraw mm0, SHIFT_INV_COL ; dst5 + + movq [OUT_8+1*16], mm3 + paddsw mm5, mm1 ; a0+b0 + + movq [OUT_8+2*16], mm6 + psubsw mm4, mm1 ; a0-b0 + + ; movq mm3, [SCRATCH+8] ; load b3 + movq mm3, [OUT_8+5*16] ; load b3 + psraw mm5, SHIFT_INV_COL ; dst0 + + movq mm6, mm2 ; a3 + psraw mm4, SHIFT_INV_COL ; dst7 + + movq [OUT_8+5*16], mm0 + paddsw mm2, mm3 ; a3+b3 + + movq [OUT_8+6*16], mm7 + psubsw mm6, mm3 ; a3-b3 + + movq [OUT_8+0*16], mm5 + psraw mm2, SHIFT_INV_COL ; dst3 + + movq [OUT_8+7*16], mm4 + psraw mm6, SHIFT_INV_COL ; dst4 + + movq [OUT_8+3*16], mm2 + + movq [OUT_8+4*16], mm6 + + pop edi + pop ebx + + emms + + ret diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/idct_sse.asm bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/idct_sse.asm *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/idct_sse.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/idct_sse.asm Fri Nov 30 10:49:41 2001 *************** *** 0 **** --- 1,755 ---- + ; Originally provided by Intel at AP-922 + ; http://developer.intel.com/vtune/cbts/strmsimd/922down.htm + ; (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm) + ; but in a limited edition. + ; New macro implements a column part for precise iDCT + ; The routine precision now satisfies IEEE standard 1180-1990. + ; + ; Copyright (c) 2000-2001 Peter Gubanov + ; Rounding trick Copyright (c) 2000 Michel Lespinasse + ; + ; http://www.elecard.com/peter/idct.html + ; http://www.linuxvideo.org/mpeg2dec/ + ; + ;============================================================================= + ; + ; These examples contain code fragments for first stage iDCT 8x8 + ; (for rows) and first stage DCT 8x8 (for columns) + ; + ;============================================================================= + ; + ; 04.11.2001 nasm conversion; peter ross + ; + + bits 32 + + %macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif + %endmacro + + %define BITS_INV_ACC 5 ; 4 or 5 for IEEE + %define SHIFT_INV_ROW 16 - BITS_INV_ACC + %define SHIFT_INV_COL 1 + BITS_INV_ACC + %define RND_INV_ROW 1024 * (6 - BITS_INV_ACC) ; 1 << (SHIFT_INV_ROW-1) + %define RND_INV_COL 16 * (BITS_INV_ACC - 3) ; 1 << (SHIFT_INV_COL-1) + %define RND_INV_CORR RND_INV_COL - 1 ; correction -1.0 and round + + %define BITS_FRW_ACC 3 ; 2 or 3 for accuracy + %define SHIFT_FRW_COL BITS_FRW_ACC + %define SHIFT_FRW_ROW BITS_FRW_ACC + 17 + %define RND_FRW_ROW 262144 * (BITS_FRW_ACC - 1) ; 1 << (SHIFT_FRW_ROW-1) + + + section .data + + align 16 + + one_corr dw 1, 1, 1, 1 + round_inv_row dd RND_INV_ROW, RND_INV_ROW + round_inv_col dw RND_INV_COL, RND_INV_COL, RND_INV_COL, RND_INV_COL + round_inv_corr dw RND_INV_CORR, RND_INV_CORR, RND_INV_CORR, RND_INV_CORR + round_frw_row dd RND_FRW_ROW, RND_FRW_ROW + tg_1_16 dw 13036, 13036, 13036, 13036 ; tg * (2<<16) + 0.5 + tg_2_16 dw 27146, 27146, 27146, 27146 ; tg * (2<<16) + 0.5 + tg_3_16 dw -21746, -21746, -21746, -21746 ; tg * (2<<16) + 0.5 + cos_4_16 dw -19195, -19195, -19195, -19195 ; cos * (2<<16) + 0.5 + ocos_4_16 dw 23170, 23170, 23170, 23170 ; cos * (2<<15) + 0.5 + + otg_3_16 dw 21895, 21895, 21895, 21895 ; tg * (2<<16) + 0.5 + + %if SHIFT_INV_ROW == 12 ; assume SHIFT_INV_ROW == 12 + rounder_0 dd 65536, 65536 + rounder_4 dd 0, 0 + rounder_1 dd 7195, 7195 + rounder_7 dd 1024, 1024 + rounder_2 dd 4520, 4520 + rounder_6 dd 1024, 1024 + rounder_3 dd 2407, 2407 + rounder_5 dd 240, 240 + + %elif SHIFT_INV_ROW == 11 ; assume SHIFT_INV_ROW == 11 + rounder_0 dd 65536, 65536 + rounder_4 dd 0, 0 + rounder_1 dd 3597, 3597 + rounder_7 dd 512, 512 + rounder_2 dd 2260, 2260 + rounder_6 dd 512, 512 + rounder_3 dd 1203, 1203 + rounder_5 dd 120, 120 + %else + + %error invalid _SHIFT_INV_ROW_ + + %endif + + ;============================================================================= + ; + ; The first stage iDCT 8x8 - inverse DCTs of rows + ; + ;----------------------------------------------------------------------------- + ; The 8-point inverse DCT direct algorithm + ;----------------------------------------------------------------------------- + ; + ; static const short w[32] = { + ; FIX(cos_4_16), FIX(cos_2_16), FIX(cos_4_16), FIX(cos_6_16), + ; FIX(cos_4_16), FIX(cos_6_16), -FIX(cos_4_16), -FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_6_16), -FIX(cos_4_16), FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_2_16), FIX(cos_4_16), -FIX(cos_6_16), + ; FIX(cos_1_16), FIX(cos_3_16), FIX(cos_5_16), FIX(cos_7_16), + ; FIX(cos_3_16), -FIX(cos_7_16), -FIX(cos_1_16), -FIX(cos_5_16), + ; FIX(cos_5_16), -FIX(cos_1_16), FIX(cos_7_16), FIX(cos_3_16), + ; FIX(cos_7_16), -FIX(cos_5_16), FIX(cos_3_16), -FIX(cos_1_16) }; + ; + ; #define DCT_8_INV_ROW(x, y) + ; { + ; int a0, a1, a2, a3, b0, b1, b2, b3; + ; + ; a0 =x[0]*w[0]+x[2]*w[1]+x[4]*w[2]+x[6]*w[3]; + ; a1 =x[0]*w[4]+x[2]*w[5]+x[4]*w[6]+x[6]*w[7]; + ; a2 = x[0] * w[ 8] + x[2] * w[ 9] + x[4] * w[10] + x[6] * w[11]; + ; a3 = x[0] * w[12] + x[2] * w[13] + x[4] * w[14] + x[6] * w[15]; + ; b0 = x[1] * w[16] + x[3] * w[17] + x[5] * w[18] + x[7] * w[19]; + ; b1 = x[1] * w[20] + x[3] * w[21] + x[5] * w[22] + x[7] * w[23]; + ; b2 = x[1] * w[24] + x[3] * w[25] + x[5] * w[26] + x[7] * w[27]; + ; b3 = x[1] * w[28] + x[3] * w[29] + x[5] * w[30] + x[7] * w[31]; + ; + ; y[0] = SHIFT_ROUND ( a0 + b0 ); + ; y[1] = SHIFT_ROUND ( a1 + b1 ); + ; y[2] = SHIFT_ROUND ( a2 + b2 ); + ; y[3] = SHIFT_ROUND ( a3 + b3 ); + ; y[4] = SHIFT_ROUND ( a3 - b3 ); + ; y[5] = SHIFT_ROUND ( a2 - b2 ); + ; y[6] = SHIFT_ROUND ( a1 - b1 ); + ; y[7] = SHIFT_ROUND ( a0 - b0 ); + ; } + ; + ;----------------------------------------------------------------------------- + ; + ; In this implementation the outputs of the iDCT-1D are multiplied + ; for rows 0,4 - by cos_4_16, + ; for rows 1,7 - by cos_1_16, + ; for rows 2,6 - by cos_2_16, + ; for rows 3,5 - by cos_3_16 + ; and are shifted to the left for better accuracy + ; + ; For the constants used, + ; FIX(float_const) = (short) (float_const * (1<<15) + 0.5) + ; + ;============================================================================= + + ;============================================================================= + ; MMX code + ;============================================================================= + + ; Table for rows 0,4 - constants are multiplied by cos_4_16 + + tab_i_04 dw 16384, 16384, 16384, -16384 ; movq-> w06 w04 w02 w00 + dw 21407, 8867, 8867, -21407 ; w07 w05 w03 w01 + dw 16384, -16384, 16384, 16384 ; w14 w12 w10 w08 + dw -8867, 21407, -21407, -8867 ; w15 w13 w11 w09 + dw 22725, 12873, 19266, -22725 ; w22 w20 w18 w16 + dw 19266, 4520, -4520, -12873 ; w23 w21 w19 w17 + dw 12873, 4520, 4520, 19266 ; w30 w28 w26 w24 + dw -22725, 19266, -12873, -22725 ; w31 w29 w27 w25 + + ; Table for rows 1,7 - constants are multiplied by cos_1_16 + + tab_i_17 dw 22725, 22725, 22725, -22725 ; movq-> w06 w04 w02 w00 + dw 29692, 12299, 12299, -29692 ; w07 w05 w03 w01 + dw 22725, -22725, 22725, 22725 ; w14 w12 w10 w08 + dw -12299, 29692, -29692, -12299 ; w15 w13 w11 w09 + dw 31521, 17855, 26722, -31521 ; w22 w20 w18 w16 + dw 26722, 6270, -6270, -17855 ; w23 w21 w19 w17 + dw 17855, 6270, 6270, 26722 ; w30 w28 w26 w24 + dw -31521, 26722, -17855, -31521 ; w31 w29 w27 w25 + + ; Table for rows 2,6 - constants are multiplied by cos_2_16 + + tab_i_26 dw 21407, 21407, 21407, -21407 ; movq-> w06 w04 w02 w00 + dw 27969, 11585, 11585, -27969 ; w07 w05 w03 w01 + dw 21407, -21407, 21407, 21407 ; w14 w12 w10 w08 + dw -11585, 27969, -27969, -11585 ; w15 w13 w11 w09 + dw 29692, 16819, 25172, -29692 ; w22 w20 w18 w16 + dw 25172, 5906, -5906, -16819 ; w23 w21 w19 w17 + dw 16819, 5906, 5906, 25172 ; w30 w28 w26 w24 + dw -29692, 25172, -16819, -29692 ; w31 w29 w27 w25 + + ; Table for rows 3,5 - constants are multiplied by cos_3_16 + + tab_i_35 dw 19266, 19266, 19266, -19266 ; movq-> w06 w04 w02 w00 + dw 25172, 10426, 10426, -25172 ; w07 w05 w03 w01 + dw 19266, -19266, 19266, 19266 ; w14 w12 w10 w08 + dw -10426, 25172, -25172, -10426 ; w15 w13 w11 w09 + dw 26722, 15137, 22654, -26722 ; w22 w20 w18 w16 + dw 22654, 5315, -5315, -15137 ; w23 w21 w19 w17 + dw 15137, 5315, 5315, 22654 ; w30 w28 w26 w24 + dw -26722, 22654, -15137, -26722 ; w31 w29 w27 w25 + + ;----------------------------------------------------------------------------- + + ; + ; DCT_8_INV_ROW_1 INP, OUT, TABLE, ROUNDER + ; + + %macro DCT_8_INV_ROW_1 4 + + movq mm0, [%1] ; 0 ; x3 x2 x1 x0 + + movq mm1, [%1+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [%3] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, [%3+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, [%3+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, [%3+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, [%3+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, [%4] ; +%4 + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, [%3+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, [%3+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, [%3+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, [%4] ; +%4 + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq [%2], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq [%2+8], mm7 ; 7 ; save y7 y6 y5 y4 + %endmacro + + + + + ;============================================================================= + ; code for Pentium III + ;============================================================================= + + ; %3 for rows 0,4 - constants are multiplied by cos_4_16 + + tab_i_04_sse dw 16384, 21407, 16384, 8867 ; movq-> w05 w04 w01 w00 + dw 16384, 8867, -16384, -21407 ; w07 w06 w03 w02 + dw 16384, -8867, 16384, -21407 ; w13 w12 w09 w08 + dw -16384, 21407, 16384, -8867 ; w15 w14 w11 w10 + dw 22725, 19266, 19266, -4520 ; w21 w20 w17 w16 + dw 12873, 4520, -22725, -12873 ; w23 w22 w19 w18 + dw 12873, -22725, 4520, -12873 ; w29 w28 w25 w24 + dw 4520, 19266, 19266, -22725 ; w31 w30 w27 w26 + + ; %3 for rows 1,7 - constants are multiplied by cos_1_16 + + tab_i_17_sse dw 22725, 29692, 22725, 12299 ; movq-> w05 w04 w01 w00 + dw 22725, 12299, -22725, -29692 ; w07 w06 w03 w02 + dw 22725, -12299, 22725, -29692 ; w13 w12 w09 w08 + dw -22725, 29692, 22725, -12299 ; w15 w14 w11 w10 + dw 31521, 26722, 26722, -6270 ; w21 w20 w17 w16 + dw 17855, 6270, -31521, -17855 ; w23 w22 w19 w18 + dw 17855, -31521, 6270, -17855 ; w29 w28 w25 w24 + dw 6270, 26722, 26722, -31521 ; w31 w30 w27 w26 + + ; %3 for rows 2,6 - constants are multiplied by cos_2_16 + + tab_i_26_sse dw 21407, 27969, 21407, 11585 ; movq-> w05 w04 w01 w00 + dw 21407, 11585, -21407, -27969 ; w07 w06 w03 w02 + dw 21407, -11585, 21407, -27969 ; w13 w12 w09 w08 + dw -21407, 27969, 21407, -11585 ; w15 w14 w11 w10 + dw 29692, 25172, 25172, -5906 ; w21 w20 w17 w16 + dw 16819, 5906, -29692, -16819 ; w23 w22 w19 w18 + dw 16819, -29692, 5906, -16819 ; w29 w28 w25 w24 + dw 5906, 25172, 25172, -29692 ; w31 w30 w27 w26 + + ; %3 for rows 3,5 - constants are multiplied by cos_3_16 + + tab_i_35_sse dw 19266, 25172, 19266, 10426 ; movq-> w05 w04 w01 w00 + dw 19266, 10426, -19266, -25172 ; w07 w06 w03 w02 + dw 19266, -10426, 19266, -25172 ; w13 w12 w09 w08 + dw -19266, 25172, 19266, -10426 ; w15 w14 w11 w10 + dw 26722, 22654, 22654, -5315 ; w21 w20 w17 w16 + dw 15137, 5315, -26722, -15137 ; w23 w22 w19 w18 + dw 15137, -26722, 5315, -15137 ; w29 w28 w25 w24 + dw 5315, 22654, 22654, -26722 ; w31 w30 w27 w26 + + ;----------------------------------------------------------------------------- + + ; + ; DCT_8_INV_ROW_1_sse INP, OUT, TABLE, ROUNDER + ; + + %macro DCT_8_INV_ROW_1_sse 4 + + movq mm0, [%1] ; 0 ; x3 x2 x1 x0 + + movq mm1, [%1+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, [%3] ; 3 ; w05 w04 w01 w00 + pshufw mm0, mm0, 10001000b ; x2 x0 x2 x0 + + movq mm4, [%3+8] ; 4 ; w07 w06 w03 w02 + movq mm5, mm1 ; 5 ; x7 x6 x5 x4 + pmaddwd mm3, mm0 ; x2*w05+x0*w04 x2*w01+x0*w00 + + movq mm6, [%3+32] ; 6 ; w21 w20 w17 w16 + pshufw mm1, mm1, 10001000b ; x6 x4 x6 x4 + pmaddwd mm4, mm1 ; x6*w07+x4*w06 x6*w03+x4*w02 + + movq mm7, [%3+40] ; 7 ; w23 w22 w19 w18 + pshufw mm2, mm2, 11011101b ; x3 x1 x3 x1 + pmaddwd mm6, mm2 ; x3*w21+x1*w20 x3*w17+x1*w16 + + pshufw mm5, mm5, 11011101b ; x7 x5 x7 x5 + pmaddwd mm7, mm5 ; x7*w23+x5*w22 x7*w19+x5*w18 + + paddd mm3, [%4] ; +%4 + + pmaddwd mm0, [%3+16] ; x2*w13+x0*w12 x2*w09+x0*w08 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm1, [%3+24] ; x6*w15+x4*w14 x6*w11+x4*w10 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm2, [%3+48] ; x3*w29+x1*w28 x3*w25+x1*w24 + paddd mm6, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + pmaddwd mm5, [%3+56] ; x7*w31+x5*w30 x7*w27+x5*w26 + paddd mm3, mm6 ; a1+b1 a0+b0 + + paddd mm0, [%4] ; +%4 + psrad mm3, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm0, mm1 ; 1 ; a3=sum(even3) a2=sum(even2) + psubd mm4, mm6 ; 6 ; a1-b1 a0-b0 + + movq mm7, mm0 ; 7 ; a3 a2 + paddd mm2, mm5 ; 5 ; b3=sum(odd3) b2=sum(odd2) + + paddd mm0, mm2 ; a3+b3 a2+b2 + psrad mm4, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + + psubd mm7, mm2 ; 2 ; a3-b3 a2-b2 + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + + psrad mm7, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm3, mm0 ; 0 ; y3 y2 y1 y0 + + packssdw mm7, mm4 ; 4 ; y6 y7 y4 y5 + + movq [%2], mm3 ; 3 ; save y3 y2 y1 y0 + pshufw mm7, mm7, 10110001b ; y7 y6 y5 y4 + + movq [%2+8], mm7 ; 7 ; save y7 y6 y5 y4 + + %endmacro + + + ;============================================================================= + ; + ;============================================================================= + + ;============================================================================= + ; + ; The first stage DCT 8x8 - forward DCTs of columns + ; + ; The %2puts are multiplied + ; for rows 0,4 - on cos_4_16, + ; for rows 1,7 - on cos_1_16, + ; for rows 2,6 - on cos_2_16, + ; for rows 3,5 - on cos_3_16 + ; and are shifted to the left for rise of accuracy + ; + ;----------------------------------------------------------------------------- + ; + ; The 8-point scaled forward DCT algorithm (26a8m) + ; + ;----------------------------------------------------------------------------- + ; + ; #define DCT_8_FRW_COL(x, y) + ;{ + ; short t0, t1, t2, t3, t4, t5, t6, t7; + ; short tp03, tm03, tp12, tm12, tp65, tm65; + ; short tp465, tm465, tp765, tm765; + ; + ; t0 = LEFT_SHIFT ( x[0] + x[7] ); + ; t1 = LEFT_SHIFT ( x[1] + x[6] ); + ; t2 = LEFT_SHIFT ( x[2] + x[5] ); + ; t3 = LEFT_SHIFT ( x[3] + x[4] ); + ; t4 = LEFT_SHIFT ( x[3] - x[4] ); + ; t5 = LEFT_SHIFT ( x[2] - x[5] ); + ; t6 = LEFT_SHIFT ( x[1] - x[6] ); + ; t7 = LEFT_SHIFT ( x[0] - x[7] ); + ; + ; tp03 = t0 + t3; + ; tm03 = t0 - t3; + ; tp12 = t1 + t2; + ; tm12 = t1 - t2; + ; + ; y[0] = tp03 + tp12; + ; y[4] = tp03 - tp12; + ; + ; y[2] = tm03 + tm12 * tg_2_16; + ; y[6] = tm03 * tg_2_16 - tm12; + ; + ; tp65 =(t6 +t5 )*cos_4_16; + ; tm65 =(t6 -t5 )*cos_4_16; + ; + ; tp765 = t7 + tp65; + ; tm765 = t7 - tp65; + ; tp465 = t4 + tm65; + ; tm465 = t4 - tm65; + ; + ; y[1] = tp765 + tp465 * tg_1_16; + ; y[7] = tp765 * tg_1_16 - tp465; + ; y[5] = tm765 * tg_3_16 + tm465; + ; y[3] = tm765 - tm465 * tg_3_16; + ;} + ; + ;============================================================================= + + + ; + ; DCT_8_FRW_COL_4 INP, OUT + ; + + %macro DCT_8_FRW_COL_4 2 + + LOCAL x0, x1, x2, x3, x4, x5, x6, x7 + LOCAL y0, y1, y2, y3, y4, y5, y6, y7 + x0 equ [%1 + 0*16] + x1 equ [%1 + 1*16] + x2 equ [%1 + 2*16] + x3 equ [%1 + 3*16] + x4 equ [%1 + 4*16] + x5 equ [%1 + 5*16] + x6 equ [%1 + 6*16] + x7 equ [%1 + 7*16] + y0 equ [%2 + 0*16] + y1 equ [%2 + 1*16] + y2 equ [%2 + 2*16] + y3 equ [%2 + 3*16] + y4 equ [%2 + 4*16] + y5 equ [%2 + 5*16] + y6 equ [%2 + 6*16] + y7 equ [%2 + 7*16] + movq mm0, x1 ; 0 ; x1 + movq mm1, x6 ; 1 ; x6 + movq mm2, mm0 ; 2 ; x1 + movq mm3, x2 ; 3 ; x2 + paddsw mm0, mm1 ; t1 = x[1] + x[6] + movq mm4, x5 ; 4 ; x5 + psllw mm0, SHIFT_FRW_COL ; t1 + movq mm5, x0 ; 5 ; x0 + paddsw mm4, mm3 ; t2 = x[2] + x[5] + paddsw mm5, x7 ; t0 = x[0] + x[7] + psllw mm4, SHIFT_FRW_COL ; t2 + movq mm6, mm0 ; 6 ; t1 + psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] + movq mm1, [tg_2_16] ; 1 ; tg_2_16 + psubsw mm0, mm4 ; tm12 = t1 - t2 + movq mm7, x3 ; 7 ; x3 + pmulhw mm1, mm0 ; tm12*tg_2_16 + paddsw mm7, x4 ; t3 = x[3] + x[4] + psllw mm5, SHIFT_FRW_COL ; t0 + paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 + psllw mm7, SHIFT_FRW_COL ; t3 + movq mm4, mm5 ; 4 ; t0 + psubsw mm5, mm7 ; tm03 = t0 - t3 + paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 + paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 + por mm1, [one_corr] ; correction y2 +0.5 + psllw mm2, SHIFT_FRW_COL+1 ; t6 + pmulhw mm5, [tg_2_16] ; tm03*tg_2_16 + movq mm7, mm4 ; 7 ; tp03 + psubsw mm3, x5 ; t5 = x[2] - x[5] + psubsw mm4, mm6 ; y4 = tp03 - tp12 + movq y2, mm1 ; 1 ; save y2 + paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 + movq mm1, x3 ; 1 ; x3 + psllw mm3, SHIFT_FRW_COL+1 ; t5 + psubsw mm1, x4 ; t4 = x[3] - x[4] + movq mm6, mm2 ; 6 ; t6 + movq y4, mm4 ; 4 ; save y4 + paddsw mm2, mm3 ; t6 + t5 + pmulhw mm2, [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 + psubsw mm6, mm3 ; 3 ; t6 - t5 + pmulhw mm6, [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 + psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 + por mm5, [one_corr] ; correction y6 +0.5 + psllw mm1, SHIFT_FRW_COL ; t4 + por mm2, [one_corr] ; correction tp65 +0.5 + movq mm4, mm1 ; 4 ; t4 + movq mm3, x0 ; 3 ; x0 + paddsw mm1, mm6 ; tp465 = t4 + tm65 + psubsw mm3, x7 ; t7 = x[0] - x[7] + psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 + movq mm0, [tg_1_16] ; 0 ; tg_1_16 + psllw mm3, SHIFT_FRW_COL ; t7 + movq mm6, [tg_3_16] ; 6 ; tg_3_16 + pmulhw mm0, mm1 ; tp465*tg_1_16 + movq y0, mm7 ; 7 ; save y0 + pmulhw mm6, mm4 ; tm465*tg_3_16 + movq y6, mm5 ; 5 ; save y6 + movq mm7, mm3 ; 7 ; t7 + movq mm5, [tg_3_16] ; 5 ; tg_3_16 + psubsw mm7, mm2 ; tm765 = t7 - tp65 + paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 + pmulhw mm5, mm7 ; tm765*tg_3_16 + paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 + paddsw mm6, mm4 ; tm465*tg_3_16 + pmulhw mm3, [tg_1_16] ; tp765*tg_1_16 + por mm0, [one_corr] ; correction y1 +0.5 + paddsw mm5, mm7 ; tm765*tg_3_16 + psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 + movq y1, mm0 ; 0 ; save y1 + paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 + movq y3, mm7 ; 7 ; save y3 + psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 + movq y5, mm5 ; 5 ; save y5 + movq y7, mm3 ; 3 ; save y7 + %endmacro + + + ; + ; DCT_8_INV_COL_4 INP,OUT + ; + + %macro DCT_8_INV_COL_4 2 + movq mm0, [tg_3_16] + + movq mm3, [%1+16*3] + movq mm1, mm0 ; tg_3_16 + + movq mm5, [%1+16*5] + pmulhw mm0, mm3 ; x3*(tg_3_16-1) + + movq mm4, [tg_1_16] + pmulhw mm1, mm5 ; x5*(tg_3_16-1) + + movq mm7, [%1+16*7] + movq mm2, mm4 ; tg_1_16 + + movq mm6, [%1+16*1] + pmulhw mm4, mm7 ; x7*tg_1_16 + + paddsw mm0, mm3 ; x3*tg_3_16 + pmulhw mm2, mm6 ; x1*tg_1_16 + + paddsw mm1, mm3 ; x3+x5*(tg_3_16-1) + psubsw mm0, mm5 ; x3*tg_3_16-x5 = tm35 + + movq mm3, [ocos_4_16] + paddsw mm1, mm5 ; x3+x5*tg_3_16 = tp35 + + paddsw mm4, mm6 ; x1+tg_1_16*x7 = tp17 + psubsw mm2, mm7 ; x1*tg_1_16-x7 = tm17 + + movq mm5, mm4 ; tp17 + movq mm6, mm2 ; tm17 + + paddsw mm5, mm1 ; tp17+tp35 = b0 + psubsw mm6, mm0 ; tm17-tm35 = b3 + + psubsw mm4, mm1 ; tp17-tp35 = t1 + paddsw mm2, mm0 ; tm17+tm35 = t2 + + movq mm7, [tg_2_16] + movq mm1, mm4 ; t1 + + ; movq [SCRATCH+0], mm5 ; save b0 + movq [%2+3*16], mm5 ; save b0 + paddsw mm1, mm2 ; t1+t2 + + ; movq [SCRATCH+8], mm6 ; save b3 + movq [%2+5*16], mm6 ; save b3 + psubsw mm4, mm2 ; t1-t2 + + movq mm5, [%1+2*16] + movq mm0, mm7 ; tg_2_16 + + movq mm6, [%1+6*16] + pmulhw mm0, mm5 ; x2*tg_2_16 + + pmulhw mm7, mm6 ; x6*tg_2_16 + ; slot + pmulhw mm1, mm3 ; ocos_4_16*(t1+t2) = b1/2 + ; slot + movq mm2, [%1+0*16] + pmulhw mm4, mm3 ; ocos_4_16*(t1-t2) = b2/2 + + psubsw mm0, mm6 ; t2*tg_2_16-x6 = tm26 + movq mm3, mm2 ; x0 + + movq mm6, [%1+4*16] + paddsw mm7, mm5 ; x2+x6*tg_2_16 = tp26 + + paddsw mm2, mm6 ; x0+x4 = tp04 + psubsw mm3, mm6 ; x0-x4 = tm04 + + movq mm5, mm2 ; tp04 + movq mm6, mm3 ; tm04 + + psubsw mm2, mm7 ; tp04-tp26 = a3 + paddsw mm3, mm0 ; tm04+tm26 = a1 + + paddsw mm1, mm1 ; b1 + paddsw mm4, mm4 ; b2 + + paddsw mm5, mm7 ; tp04+tp26 = a0 + psubsw mm6, mm0 ; tm04-tm26 = a2 + + movq mm7, mm3 ; a1 + movq mm0, mm6 ; a2 + + paddsw mm3, mm1 ; a1+b1 + paddsw mm6, mm4 ; a2+b2 + + psraw mm3, SHIFT_INV_COL ; dst1 + psubsw mm7, mm1 ; a1-b1 + + psraw mm6, SHIFT_INV_COL ; dst2 + psubsw mm0, mm4 ; a2-b2 + + ; movq mm1, [SCRATCH+0] ; load b0 + movq mm1, [%2+3*16] ; load b0 + psraw mm7, SHIFT_INV_COL ; dst6 + + movq mm4, mm5 ; a0 + psraw mm0, SHIFT_INV_COL ; dst5 + + movq [%2+1*16], mm3 + paddsw mm5, mm1 ; a0+b0 + + movq [%2+2*16], mm6 + psubsw mm4, mm1 ; a0-b0 + + ; movq mm3, [SCRATCH+8] ; load b3 + movq mm3, [%2+5*16] ; load b3 + psraw mm5, SHIFT_INV_COL ; dst0 + + movq mm6, mm2 ; a3 + psraw mm4, SHIFT_INV_COL ; dst7 + + movq [%2+5*16], mm0 + paddsw mm2, mm3 ; a3+b3 + + movq [%2+6*16], mm7 + psubsw mm6, mm3 ; a3-b3 + + movq [%2+0*16], mm5 + psraw mm2, SHIFT_INV_COL ; dst3 + + movq [%2+7*16], mm4 + psraw mm6, SHIFT_INV_COL ; dst4 + + movq [%2+3*16], mm2 + + movq [%2+4*16], mm6 + %endmacro + + + + section .text + + ;============================================================================= + ; + ; void idct_mmx (short * const src_result); + ; + ;============================================================================= + + align 16 + cglobal enc_idct_mmx + enc_idct_mmx + mov eax, dword [esp + 4] + + DCT_8_INV_ROW_1 eax+0, eax+0, tab_i_04, rounder_0 + DCT_8_INV_ROW_1 eax+16, eax+16, tab_i_17, rounder_1 + DCT_8_INV_ROW_1 eax+32, eax+32, tab_i_26, rounder_2 + DCT_8_INV_ROW_1 eax+48, eax+48, tab_i_35, rounder_3 + DCT_8_INV_ROW_1 eax+64, eax+64, tab_i_04, rounder_4 + DCT_8_INV_ROW_1 eax+80, eax+80, tab_i_35, rounder_5 + DCT_8_INV_ROW_1 eax+96, eax+96, tab_i_26, rounder_6 + DCT_8_INV_ROW_1 eax+112, eax+112, tab_i_17, rounder_7 + + DCT_8_INV_COL_4 eax+0,eax+0 + DCT_8_INV_COL_4 eax+8,eax+8 + + ret + + + + ;============================================================================= + ; + ; void idct_sse (short * const src_result); + ; + ;============================================================================= + + align 16 + cglobal idct_sse + idct_sse + mov eax, dword [esp + 4] + + DCT_8_INV_ROW_1_sse eax+0, eax+0, tab_i_04_sse, rounder_0 + DCT_8_INV_ROW_1_sse eax+16, eax+16, tab_i_17_sse, rounder_1 + DCT_8_INV_ROW_1_sse eax+32, eax+32, tab_i_26_sse, rounder_2 + DCT_8_INV_ROW_1_sse eax+48, eax+48, tab_i_35_sse, rounder_3 + DCT_8_INV_ROW_1_sse eax+64, eax+64, tab_i_04_sse, rounder_4 + DCT_8_INV_ROW_1_sse eax+80, eax+80, tab_i_35_sse, rounder_5 + DCT_8_INV_ROW_1_sse eax+96, eax+96, tab_i_26_sse, rounder_6 + DCT_8_INV_ROW_1_sse eax+112, eax+112, tab_i_17_sse, rounder_7 + + DCT_8_INV_COL_4 eax+0, eax+0 + DCT_8_INV_COL_4 eax+8, eax+8 + + ret diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/quant_mmx.asm bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/quant_mmx.asm *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/quant_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/quant_mmx.asm Fri Nov 30 10:49:41 2001 *************** *** 0 **** --- 1,588 ---- + ;/************************************************************************** + ; * + ; * XVID MPEG-4 VIDEO CODEC + ; * mmx quantization/dequantization + ; * + ; * This program is an implementation of a part of one or more MPEG-4 + ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + ; * to use this software module in hardware or software products are + ; * advised that its use may infringe existing patents or copyrights, and + ; * any such use would be at such party's own risk. The original + ; * developer of this software module and his/her company, and subsequent + ; * editors and their companies, will have no liability for use of this + ; * software or modifications or derivatives thereof. + ; * + ; * This program is free software; you can redistribute it and/or modify + ; * it under the terms of the GNU General Public License as published by + ; * the Free Software Foundation; either version 2 of the License, or + ; * (at your option) any later version. + ; * + ; * This program 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 General Public License for more details. + ; * + ; * You should have received a copy of the GNU General Public License + ; * along with this program; if not, write to the Free Software + ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ; * + ; *************************************************************************/ + + ;/************************************************************************** + ; * + ; * History: + ; * + ; * 19.11.2001 quant_inter_mmx now returns sum of abs. coefficient values + ; * 04.11.2001 nasm version; (c)2001 peter ross + ; * + ; *************************************************************************/ + + + bits 32 + + section .data + + + align 16 + + %macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif + %endmacro + + plus_one times 4 dw 1 + + ;=========================================================================== + ; + ; subtract by Q/2 table + ; + ;=========================================================================== + + %macro MMX_SUB 1 + times 4 dw %1 / 2 + %endmacro + + mmx_sub + MMX_SUB 0 + MMX_SUB 1 + MMX_SUB 2 + MMX_SUB 3 + MMX_SUB 4 + MMX_SUB 5 + MMX_SUB 6 + MMX_SUB 7 + MMX_SUB 8 + MMX_SUB 9 + MMX_SUB 10 + MMX_SUB 11 + MMX_SUB 12 + MMX_SUB 13 + MMX_SUB 14 + MMX_SUB 15 + MMX_SUB 16 + MMX_SUB 17 + MMX_SUB 18 + MMX_SUB 19 + MMX_SUB 20 + MMX_SUB 21 + MMX_SUB 22 + MMX_SUB 23 + MMX_SUB 24 + MMX_SUB 25 + MMX_SUB 26 + MMX_SUB 27 + MMX_SUB 28 + MMX_SUB 29 + MMX_SUB 30 + MMX_SUB 31 + + + + ;=========================================================================== + ; + ; divide by 2Q table + ; + ; use a shift of 16 to take full advantage of _pmulhw_ + ; for q=1, _pmulhw_ will overflow so it is treated seperately + ; (3dnow2 provides _pmulhuw_ which wont cause overflow) + ; + ;=========================================================================== + + %macro MMX_DIV 1 + times 4 dw (1 << 16) / (%1 * 2) + 1 + %endmacro + + mmx_div + MMX_DIV 1 + MMX_DIV 1 + MMX_DIV 2 + MMX_DIV 3 + MMX_DIV 4 + MMX_DIV 5 + MMX_DIV 6 + MMX_DIV 7 + MMX_DIV 8 + MMX_DIV 9 + MMX_DIV 10 + MMX_DIV 11 + MMX_DIV 12 + MMX_DIV 13 + MMX_DIV 14 + MMX_DIV 15 + MMX_DIV 16 + MMX_DIV 17 + MMX_DIV 18 + MMX_DIV 19 + MMX_DIV 20 + MMX_DIV 21 + MMX_DIV 22 + MMX_DIV 23 + MMX_DIV 24 + MMX_DIV 25 + MMX_DIV 26 + MMX_DIV 27 + MMX_DIV 28 + MMX_DIV 29 + MMX_DIV 30 + MMX_DIV 31 + + + + ;=========================================================================== + ; + ; add by (odd(Q) ? Q : Q - 1) table + ; + ;=========================================================================== + + %macro MMX_ADD 1 + %if %1 % 1 != 0 + times 4 dw %1 + %else + times 4 dw %1 - 1 + %endif + %endmacro + + mmx_add + MMX_ADD 0 + MMX_ADD 1 + MMX_ADD 2 + MMX_ADD 3 + MMX_ADD 4 + MMX_ADD 5 + MMX_ADD 6 + MMX_ADD 7 + MMX_ADD 8 + MMX_ADD 9 + MMX_ADD 10 + MMX_ADD 11 + MMX_ADD 12 + MMX_ADD 13 + MMX_ADD 14 + MMX_ADD 15 + MMX_ADD 16 + MMX_ADD 17 + MMX_ADD 18 + MMX_ADD 19 + MMX_ADD 20 + MMX_ADD 21 + MMX_ADD 22 + MMX_ADD 23 + MMX_ADD 24 + MMX_ADD 25 + MMX_ADD 26 + MMX_ADD 27 + MMX_ADD 28 + MMX_ADD 29 + MMX_ADD 30 + MMX_ADD 31 + + + ;=========================================================================== + ; + ; multiple by 2Q table + ; + ;=========================================================================== + + %macro MMX_MUL 1 + times 4 dw %1 * 2 + %endmacro + + mmx_mul + MMX_MUL 0 + MMX_MUL 1 + MMX_MUL 2 + MMX_MUL 3 + MMX_MUL 4 + MMX_MUL 5 + MMX_MUL 6 + MMX_MUL 7 + MMX_MUL 8 + MMX_MUL 9 + MMX_MUL 10 + MMX_MUL 11 + MMX_MUL 12 + MMX_MUL 13 + MMX_MUL 14 + MMX_MUL 15 + MMX_MUL 16 + MMX_MUL 17 + MMX_MUL 18 + MMX_MUL 19 + MMX_MUL 20 + MMX_MUL 21 + MMX_MUL 22 + MMX_MUL 23 + MMX_MUL 24 + MMX_MUL 25 + MMX_MUL 26 + MMX_MUL 27 + MMX_MUL 28 + MMX_MUL 29 + MMX_MUL 30 + MMX_MUL 31 + + + + section .text + + + ;=========================================================================== + ; + ; void quant_intra_mmx(int16_t * coeff, + ; const int16_t const * data, + ; const uint32_t quant, + ; const uint32_t dcscalar); + ; + ;=========================================================================== + + align 16 + cglobal enc_quant_intra_mmx + enc_quant_intra_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; coeff + mov esi, [esp + 8 + 8] ; data + mov eax, [esp + 8 + 12] ; quant + + cmp al, 1 + mov ecx, 8 + jz .q1loop + + movq mm7, [mmx_div + eax * 8] + + .loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + pmulhw mm0, mm7 ; mm0 = (mm0 / 2Q) >> 16 + pmulhw mm3, mm7 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 ; + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .loop + + .done + mov ecx, [esp + 8 + 16] ; dcscalar + mov eax, ecx + movsx edx, word [esi - 128] ; data[0] + + shr eax, 1 ; eax = data[0] + dcscalar>>1 + add eax, edx ; + + cdq ; expand eax -> edx:eax + idiv ecx ; eax = edx:eax / dcscalar + + mov [edi - 128], ax ; data[0] = ax + + pop edi + pop esi + + ret + + .q1loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + psrlw mm0, 1 ; mm0 >>= 1 (/2) + psrlw mm3, 1 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .q1loop + jmp short .done + + + + ;=========================================================================== + ; + ; uint32_t quant_inter_mmx(int16_t * coeff, + ; const int16_t const * data, + ; const uint32_t quant); + ; + ;=========================================================================== + + align 16 + cglobal enc_quant_inter_mmx + enc_quant_inter_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; coeff + mov esi, [esp + 8 + 8] ; data + mov eax, [esp + 8 + 12] ; quant + + pxor mm5, mm5 ; present + + movq mm6, [mmx_sub + eax * 8] ; sub + + cmp al, 1 + mov ecx, 8 + jz .q1loop + + movq mm7, [mmx_div + eax * 8] ; divider + + .loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + psubusw mm0, mm6 ; mm0 -= sub (unsigned, dont go < 0) + psubusw mm3, mm6 ; + pmulhw mm0, mm7 ; mm0 = (mm0 / 2Q) >> 16 + pmulhw mm3, mm7 ; + movq mm2, mm0 ; mm0 -> mm2 + pxor mm0, mm1 ; mm0 *= sign(mm0) + psubw mm0, mm1 ; undisplace + movq mm1, mm3 ; mm3 -> mm1 + pxor mm3, mm4 + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + paddw mm2, mm1 ; mm1 + mm2 -> mm2 + pmaddwd mm2, [plus_one] ; + movq mm0, mm2 ; + psrlq mm0, 32 ; + paddd mm0, mm2 ; + paddd mm5, mm0 ; sum += abs(coeff0) + abs(coeff1) + ... + abs(coeff7) + + add esi, 16 + add edi, 16 + dec ecx + jnz .loop + + .done + movd eax, mm5 ; return sum + + pop edi + pop esi + + ret + + .q1loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + psubusw mm0, mm6 ; mm0 -= sub (unsigned, dont go < 0) + psubusw mm3, mm6 ; + psrlw mm0, 1 ; mm0 >>= 1 (/2) + psrlw mm3, 1 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + paddw mm0, mm3 ; mm0 + mm3 -> mm0 + pmaddwd mm0, [plus_one] ; + movq mm2, mm0 ; + psrlq mm2, 32 ; + paddd mm0, mm2 ; + paddd mm5, mm0 ; sum += abs(coeff0) + abs(coeff1) + ... + abs(coeff7) + + add esi, 16 + add edi, 16 + dec ecx + jnz .q1loop + + jmp .done + + + + ;=========================================================================== + ; + ; void dequant_intra_mmx(int16_t *data, + ; const int16_t const *coeff, + ; const uint32_t quant, + ; const uint32_t dcscalar); + ; + ;=========================================================================== + + align 16 + cglobal enc_dequant_intra_mmx + enc_dequant_intra_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; data + mov esi, [esp + 8 + 8] ; coeff + mov eax, [esp + 8 + 12] ; quant + + movq mm6, [mmx_add + eax * 8] + mov ecx, 8 + movq mm7, [mmx_mul + eax * 8] + + .loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm2, mm2 ; mm2 = 0 + pxor mm5, mm5 ; + pcmpeqw mm2, mm0 ; mm2 = (0 == mm0) + pcmpeqw mm5, mm3 ; + pandn mm2, mm6 ; mm2 = (iszero ? 0 : add) + pandn mm5, mm6 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + pmullw mm0, mm7 ; mm0 *= 2Q + pmullw mm3, mm7 ; + paddw mm0, mm2 ; mm0 += mm2 (add) + paddw mm3, mm5 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .loop + + mov ax, [esi - 128] ; ax = data[0] + imul ax, [esp + 8 + 16] ; eax = data[0] * dcscalar + mov [edi - 128], ax ; data[0] = ax + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; void dequant_inter_mmx(int16_t * data, + ; const int16_t * const coeff, + ; const uint32_t quant); + ; + ;=========================================================================== + + align 16 + cglobal enc_dequant_inter_mmx + enc_dequant_inter_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; data + mov esi, [esp + 8 + 8] ; coeff + mov eax, [esp + 8 + 12] ; quant + + movq mm6, [mmx_add + eax * 8] + movq mm7, [mmx_mul + eax * 8] + mov ecx, 8 + + .loop + movq mm0, [esi] ; mm0 = [1st] + movq mm3, [esi + 8] ; + pxor mm1, mm1 ; mm1 = 0 + pxor mm4, mm4 ; + pcmpgtw mm1, mm0 ; mm1 = (0 > mm0) + pcmpgtw mm4, mm3 ; + pxor mm2, mm2 ; mm2 = 0 + pxor mm5, mm5 ; + pcmpeqw mm2, mm0 ; mm2 = (0 == mm0) + pcmpeqw mm5, mm3 ; + pandn mm2, mm6 ; mm2 = (iszero ? 0 : add) + pandn mm5, mm6 ; + pxor mm0, mm1 ; mm0 = |mm0| + pxor mm3, mm4 ; + psubw mm0, mm1 ; displace + psubw mm3, mm4 ; + pmullw mm0, mm7 ; mm0 *= 2Q + pmullw mm3, mm7 ; + paddw mm0, mm2 ; mm0 += mm2 (add) + paddw mm3, mm5 ; + pxor mm0, mm1 ; mm0 *= sign(mm0) + pxor mm3, mm4 ; + psubw mm0, mm1 ; undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz .loop + + pop edi + pop esi + + ret diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/quantize_mmx.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/quantize_mmx.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/quantize_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/quantize_mmx.c Fri Nov 30 10:49:41 2001 *************** *** 0 **** --- 1,343 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * mmx quantization/dequantization + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 02.11.2001 created + * + *************************************************************************/ + + + #include "../quantize.h" + + /* subtract by Q/2 table */ + + #define ZSUB(X) ((X) / 2) + #define MSUB(X) ZSUB((X)),ZSUB((X)),ZSUB((X)),ZSUB((X)) + + + + static const int16_t mmx_sub[32*4] = + { + MSUB(0), MSUB(1), MSUB(2), MSUB(3), + MSUB(4), MSUB(5), MSUB(6), MSUB(7), + MSUB(8), MSUB(9), MSUB(10), MSUB(11), + MSUB(12), MSUB(13), MSUB(14), MSUB(15), + MSUB(16), MSUB(17), MSUB(18), MSUB(19), + MSUB(20), MSUB(21), MSUB(22), MSUB(23), + MSUB(24), MSUB(25), MSUB(26), MSUB(27), + MSUB(28), MSUB(29), MSUB(30), MSUB(31) + }; + + + + /* divide by 2Q table + use a shift of 16 to take full advantage of _pmulhw_ + for q=1, _pmulhw_ will overflow so it is treated seperately + (3dnow2 provides _pmulhuw_ which wont cause overflow) + */ + + + + #define ZDIV(X) ((1L << 16) / ((X)*2) + 1) + #define MDIV(X) ZDIV((X)),ZDIV((X)),ZDIV((X)),ZDIV((X)) + #define MDIV_0 0,0,0,0 + + static const uint16_t mmx_div[32*4] = + { + MDIV_0, MDIV(1), MDIV(2), MDIV(3), + MDIV(4), MDIV(5), MDIV(6), MDIV(7), + MDIV(8), MDIV(9), MDIV(10), MDIV(11), + MDIV(12), MDIV(13), MDIV(14), MDIV(15), + MDIV(16), MDIV(17), MDIV(18), MDIV(19), + MDIV(20), MDIV(21), MDIV(22), MDIV(23), + MDIV(24), MDIV(25), MDIV(26), MDIV(27), + MDIV(28), MDIV(29), MDIV(30), MDIV(31) + }; + + + /* add by (odd(Q) ? Q : Q - 1) table */ + + #define ZADD(X) ((X) & 1 ? (X) : (X) - 1) + #define MADD(X) ZADD((X)),ZADD((X)),ZADD((X)),ZADD((X)) + + + static const int16_t mmx_add[32*4] = + { + MADD(0), MADD(1), MADD(2), MADD(3), + MADD(4), MADD(5), MADD(6), MADD(7), + MADD(8), MADD(9), MADD(10), MADD(11), + MADD(12), MADD(13), MADD(14), MADD(15), + MADD(16), MADD(17), MADD(18), MADD(19), + MADD(20), MADD(21), MADD(22), MADD(23), + MADD(24), MADD(25), MADD(26), MADD(27), + MADD(28), MADD(29), MADD(30), MADD(31) + }; + + + /* multiple by 2Q table */ + #define ZMUL(X) ((X)*2) + #define MUL(X) ZMUL((X)),ZMUL((X)),ZMUL((X)),ZMUL((X)) + + + static const int16_t mmx_mul[32*4] = + { + MUL(0), MUL(1), MUL(2), MUL(3), + MUL(4), MUL(5), MUL(6), MUL(7), + MUL(8), MUL(9), MUL(10), MUL(11), + MUL(12), MUL(13), MUL(14), MUL(15), + MUL(16), MUL(17), MUL(18), MUL(19), + MUL(20), MUL(21), MUL(22), MUL(23), + MUL(24), MUL(25), MUL(26), MUL(27), + MUL(28), MUL(29), MUL(30), MUL(31) + }; + + + void enc_quant_intra_mmx(int16_t * coeff, const int16_t * data, const uint32_t quant, const uint32_t dcscalar) + { + _asm { + mov esi, data + mov edi, coeff + + mov eax, quant + cmp eax, 1 + mov ecx, 8 + jz q1loop + + movq mm7, [mmx_div + eax * 8] + + xloop: + movq mm0, [esi] // mm0 = [1st] + movq mm3, [esi + 8] // + pxor mm1, mm1 // mm1 = 0 + pxor mm4, mm4 // + pcmpgtw mm1, mm0 // mm1 = (0 > mm0) + pcmpgtw mm4, mm3 // + pxor mm0, mm1 // mm0 = |mm0| + pxor mm3, mm4 // + psubw mm0, mm1 // displace + psubw mm3, mm4 // + pmulhw mm0, mm7 // mm0 = (mm0 / 2Q) >> 16 + pmulhw mm3, mm7 // + pxor mm0, mm1 // mm0 *= sign(mm0) + pxor mm3, mm4 + psubw mm0, mm1 // undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz xloop + + jmp short done + + + q1loop: + movq mm0, [esi] // mm0 = [1st] + movq mm3, [esi + 8] // + pxor mm1, mm1 // mm1 = 0 + pxor mm4, mm4 // + pcmpgtw mm1, mm0 // mm1 = (0 > mm0) + pcmpgtw mm4, mm3 // + pxor mm0, mm1 // mm0 = |mm0| + pxor mm3, mm4 // + psubw mm0, mm1 // displace + psubw mm3, mm4 // + psrlw mm0, 1 // mm0 >>= 1 (/2) + psrlw mm3, 1 // + pxor mm0, mm1 // mm0 *= sign(mm0) + pxor mm3, mm4 + psubw mm0, mm1 // undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz q1loop + + done: + + } + *coeff = (*data + ((int32_t)dcscalar >> 1)) / (int32_t)dcscalar; + } + + + + uint32_t enc_quant_inter_mmx(int16_t * coeff, const int16_t * data, const uint32_t quant) + { + _asm { + mov esi, data + mov edi, coeff + mov eax, quant + + pxor mm5, mm5 // present + movq mm6, [mmx_sub + eax * 8] + + cmp eax, 1 + mov ecx, 8 + jz q1loop + + movq mm7, [mmx_div + eax * 8] // divider + + xloop: + movq mm0, [esi] // mm0 = [1st] + movq mm3, [esi + 8] // + pxor mm1, mm1 // mm1 = 0 + pxor mm4, mm4 // + pcmpgtw mm1, mm0 // mm1 = (0 > mm0) + pcmpgtw mm4, mm3 // + pxor mm0, mm1 // mm0 = |mm0| + pxor mm3, mm4 // + psubw mm0, mm1 // displace + psubw mm3, mm4 // + psubusw mm0, mm6 // mm0 -= sub (unsigned, dont go < 0) + psubusw mm3, mm6 // + pmulhw mm0, mm7 // mm0 = (mm0 / 2Q) >> 16 + pmulhw mm3, mm7 // + pxor mm0, mm1 // mm0 *= sign(mm0) + pxor mm3, mm4 + psubw mm0, mm1 // undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + por mm5, mm0 // set present + por mm5, mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz xloop + + jmp short done + + + q1loop: + movq mm0, [esi] // mm0 = [1st] + movq mm3, [esi + 8] // + pxor mm1, mm1 // mm1 = 0 + pxor mm4, mm4 // + pcmpgtw mm1, mm0 // mm1 = (0 > mm0) + pcmpgtw mm4, mm3 // + pxor mm0, mm1 // mm0 = |mm0| + pxor mm3, mm4 // + psubw mm0, mm1 // displace + psubw mm3, mm4 // + psubusw mm0, mm6 // mm0 -= sub (unsigned, dont go < 0) + psubusw mm3, mm6 // + psrlw mm0, 1 // mm0 >>= 1 (/2) + psrlw mm3, 1 // + pxor mm0, mm1 // mm0 *= sign(mm0) + pxor mm3, mm4 + psubw mm0, mm1 // undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + por mm5, mm0 // set present + por mm5, mm3 + + add esi, 16 + add edi, 16 + dec ecx + jnz q1loop + + done: + movq mm0, mm5 // pack present into dword + psrlq mm5, 32 + por mm0, mm5 + + movd eax, mm0 // return present + + } + } + + + + + void enc_dequant_intra_mmx(int16_t *data, const int16_t *coeff, const uint32_t quant, const uint32_t dcscalar) + { + dequant_inter_mmx(data, coeff, quant); + *data = *coeff * dcscalar; + } + + + + void enc_dequant_inter_mmx(int16_t * data, const int16_t * coeff, const uint32_t quant) + { + _asm { + mov esi, coeff + mov edi, data + mov eax, quant + + movq mm6, [mmx_add + eax * 8] + movq mm7, [mmx_mul + eax * 8] + + mov ecx, 8 + xloop: + movq mm0, [esi] // mm0 = [1st] + movq mm3, [esi + 8] // + pxor mm1, mm1 // mm1 = 0 + pxor mm4, mm4 // + pcmpgtw mm1, mm0 // mm1 = (0 > mm0) + pcmpgtw mm4, mm3 // + pxor mm2, mm2 // mm2 = 0 + pxor mm5, mm5 // + pcmpeqw mm2, mm0 // mm2 = (0 == mm0) + pcmpeqw mm5, mm3 // + pandn mm2, mm6 // mm2 = (iszero ? 0 : add) + pandn mm5, mm6 + pxor mm0, mm1 // mm0 = |mm0| + pxor mm3, mm4 // + psubw mm0, mm1 // displace + psubw mm3, mm4 // + pmullw mm0, mm7 // mm0 *= 2Q + pmullw mm3, mm7 // + paddw mm0, mm2 // mm0 += mm2 (add) + paddw mm3, mm5 + pxor mm0, mm1 // mm0 *= sign(mm0) + pxor mm3, mm4 + psubw mm0, mm1 // undisplace + psubw mm3, mm4 + movq [edi], mm0 + movq [edi + 8], mm3 + + add esi, 16 + add edi, 16 + dec ecx + + jnz xloop + + } + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/text_fdct_mmx.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/text_fdct_mmx.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/text_fdct_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/text_fdct_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,1792 ---- + + + ////////////////////////////////////////////////////////////////////////////// + + // + + // fdctmm32.c - AP922 MMX fDCT + + // ---------- + + // Intel Application Note AP-922 - fast, precise implementation of DCT + + // http://developer.intel.com/vtune/cbts/appnotes.htm + + // ---------- + + // + + // This code will run on any MMX CPU. The dct_row operation can be + + // further optimized using PentiumIII/Athlon instructions (pshufw.) + + // If the code will be run on a 3D-Now CPU (AMD K6-2/Athlon), a slight + + // accruacy-boost can be obtained. Please see fdctam32.c for details. + + // + + // For a fast, precise MMX implementation of inverse-DCT + + // visit http://www.elecard.com/peter + + // or check out Avery Lee's Virtualdub source-code + + // http://www.concentric.net/~psilon + + // + + // Revision history + + // ---------------- + + // + + // v1.01 08/26/2000 (clipper bugfix) + + // In my haste to get this code out the door, I neglected to consider + + // the numerical range of output. I *believe* an IEEE-1180/1990 fdct + + // is range-limited to {-2048, +2047}. + + // fdctmm32.c now saturates the output DCT coefficients to this range. + + // A few comment typos were corrected. Equivalent-C code for + + // the forward_dct column stage has also been added. The pseudo-C + + // code in Intel's AP-922 omits several important operations that + + // would cause dct8_frw_col() to fail, if it were used directly without + + // modification. + + // There is still room for additional optimization in the + + // frw_dct_row_mmx() function. The data pack/unpack operation could be + + // shortened with pshufw. + + // + + // v1.0 07/20/2000 (initial release) + + // Initial release of AP922 MMX forward_DCT. + + // + + // + + // liaor@iname.com http://members.tripod.com/~liaor + + ////////////////////////////////////////////////////////////////////////////// + + + + #define INP eax // pointer to (short *blk) + + #define OUT ecx // pointer to output (temporary store space qwTemp[]) + + #define TABLE ebx // pointer to tab_frw_01234567[] + + #define TABLEF ebx // pointer to tg_all_16 + + #define round_frw_row edx + + //#define round_frw_col edx + + + + #define x0 INP + 0*16 + + #define x1 INP + 1*16 + + #define x2 INP + 2*16 + + #define x3 INP + 3*16 + + #define x4 INP + 4*16 + + #define x5 INP + 5*16 + + #define x6 INP + 6*16 + + #define x7 INP + 7*16 + + #define y0 OUT + 0*16 + + #define y1 OUT + 1*16 + + #define y2 OUT + 2*16 + + #define y3 OUT + 3*16 + + #define y4 OUT + 4*16 + + #define y5 OUT + 5*16 + + #define y6 OUT + 6*16 + + #define y7 OUT + 7*16 + + + + + + ////////////////////////////////////////////////////////////////////// + + // + + // constants for the forward DCT + + // ----------------------------- + + // + + // Be sure to check that your compiler is aligning all constants to QWORD + + // (8-byte) memory boundaries! Otherwise the unaligned memory access will + + // severely stall MMX execution. + + // + + ////////////////////////////////////////////////////////////////////// + + + + #define BITS_FRW_ACC 3 //; 2 or 3 for accuracy + + #define SHIFT_FRW_COL BITS_FRW_ACC + + #define SHIFT_FRW_ROW (BITS_FRW_ACC + 17) + + + + // v1.01 The original SHIFT_FRW_ROW constant has been replaced by a + + // "two stage" shift operation. The 1st-shift (CLIP1) aligns the + + // intermediate 32-bit integer data to a {-32768, +32768} (16-bit word) + + // range. The MMX instruction "packssdw" simultaneous clips and packs + + // the intermediate-data into 16-bit format. + + // The 2nd-shift (CLIP2) restores the proper final range {-2048,+2047} + + + + #define SHIFT_FRW_ROW_CLIP2 (4) // 4-bit shift -> { 32768 <> 2048 } + + #define SHIFT_FRW_ROW_CLIP1 ( SHIFT_FRW_ROW - SHIFT_FRW_ROW_CLIP2 ) + + + + //#define RND_FRW_ROW (262144 * (BITS_FRW_ACC - 1)) //; 1 << (SHIFT_FRW_ROW-1) + + #define RND_FRW_ROW (1 << (SHIFT_FRW_ROW-1)) + + //#define RND_FRW_COL (2 * (BITS_FRW_ACC - 1)) //; 1 << (SHIFT_FRW_COL-1) + + #define RND_FRW_COL (1 << (SHIFT_FRW_COL-1)) + + + + const static __int64 one_corr = 0x0001000100010001; + + const static long r_frw_row[2] = {RND_FRW_ROW, RND_FRW_ROW }; + + + + //const static short tg_1_16[4] = {13036, 13036, 13036, 13036 }; //tg * (2<<16) + 0.5 + + //const static short tg_2_16[4] = {27146, 27146, 27146, 27146 }; //tg * (2<<16) + 0.5 + + //const static short tg_3_16[4] = {-21746, -21746, -21746, -21746 }; //tg * (2<<16) + 0.5 + + //const static short cos_4_16[4] = {-19195, -19195, -19195, -19195 }; //cos * (2<<16) + 0.5 + + //const static short ocos_4_16[4] = {23170, 23170, 23170, 23170 }; //cos * (2<<15) + 0.5 + + + + //concatenated table, for forward DCT-column transformation + + const static short tg_all_16[] = { + + 13036, 13036, 13036, 13036, // tg * (2<<16) + 0.5 + + 27146, 27146, 27146, 27146, // tg * (2<<16) + 0.5 + + -21746, -21746, -21746, -21746, // tg * (2<<16) + 0.5 + + -19195, -19195, -19195, -19195, //cos * (2<<16) + 0.5 + + 23170, 23170, 23170, 23170 }; //cos * (2<<15) + 0.5 + + + + #define tg_1_16 (TABLEF + 0) + + #define tg_2_16 (TABLEF + 8) + + #define tg_3_16 (TABLEF + 16) + + #define cos_4_16 (TABLEF + 24) + + #define ocos_4_16 (TABLEF + 32) + + + + + + // CONCATENATED IDCT COEFF TABLE, rows 0,1,2,3,4,5,6,7 (in order ) + + // + + /* + + static const short tab_inv_01234567[] = { // inverse_dct coeff table + + //row0, this row is required + + 16384, 16384, 16384, -16384, // ; movq-> w06 w04 w02 w00 + + 21407, 8867, 8867, -21407, // w07 w05 w03 w01 + + 16384, -16384, 16384, 16384, //; w14 w12 w10 w08 + + -8867, 21407, -21407, -8867, //; w15 w13 w11 w09 + + 22725, 12873, 19266, -22725, //; w22 w20 w18 w16 + + 19266, 4520, -4520, -12873, //; w23 w21 w19 w17 + + 12873, 4520, 4520, 19266, //; w30 w28 w26 w24 + + -22725, 19266, -12873, -22725, //w31 w29 w27 w25 + + + + //row1 + + 22725, 22725, 22725, -22725, // ; movq-> w06 w04 w02 w00 + + 29692, 12299, 12299, -29692, // ; w07 w05 w03 w01 + + 22725, -22725, 22725, 22725, //; w14 w12 w10 w08 + + -12299, 29692, -29692, -12299, //; w15 w13 w11 w09 + + 31521, 17855, 26722, -31521, //; w22 w20 w18 w16 + + 26722, 6270, -6270, -17855, //; w23 w21 w19 w17 + + 17855, 6270, 6270, 26722, //; w30 w28 w26 w24 + + -31521, 26722, -17855, -31521, // w31 w29 w27 w25 + + + + //row2 + + 21407, 21407, 21407, -21407, // ; movq-> w06 w04 w02 w00 + + 27969, 11585, 11585, -27969, // ; w07 w05 w03 w01 + + 21407, -21407, 21407, 21407, // ; w14 w12 w10 w08 + + -11585, 27969, -27969, -11585, // ;w15 w13 w11 w09 + + 29692, 16819, 25172, -29692, // ;w22 w20 w18 w16 + + 25172, 5906, -5906, -16819, // ;w23 w21 w19 w17 + + 16819, 5906, 5906, 25172, // ;w30 w28 w26 w24 + + -29692, 25172, -16819, -29692, // ;w31 w29 w27 w25 + + + + //row3 + + 19266, 19266, 19266, -19266, //; movq-> w06 w04 w02 w00 + + 25172, 10426, 10426, -25172, //; w07 w05 w03 w01 + + 19266, -19266, 19266, 19266, //; w14 w12 w10 w08 + + -10426, 25172, -25172, -10426, //; w15 w13 w11 w09 + + 26722, 15137, 22654, -26722, //; w22 w20 w18 w16 + + 22654, 5315, -5315, -15137, //; w23 w21 w19 w17 + + 15137, 5315, 5315, 22654, //; w30 w28 w26 w24 + + -26722, 22654, -15137, -26722, //; w31 w29 w27 w25 + + + + //row4 + + 16384, 16384, 16384, -16384, // ; movq-> w06 w04 w02 w00 + + 21407, 8867, 8867, -21407, // w07 w05 w03 w01 + + 16384, -16384, 16384, 16384, //; w14 w12 w10 w08 + + -8867, 21407, -21407, -8867, //; w15 w13 w11 w09 + + 22725, 12873, 19266, -22725, //; w22 w20 w18 w16 + + 19266, 4520, -4520, -12873, //; w23 w21 w19 w17 + + 12873, 4520, 4520, 19266, //; w30 w28 w26 w24 + + -22725, 19266, -12873, -22725, //w31 w29 w27 w25 + + + + //row5 + + 19266, 19266, 19266, -19266, //; movq-> w06 w04 w02 w00 + + 25172, 10426, 10426, -25172, //; w07 w05 w03 w01 + + 19266, -19266, 19266, 19266, //; w14 w12 w10 w08 + + -10426, 25172, -25172, -10426, //; w15 w13 w11 w09 + + 26722, 15137, 22654, -26722, //; w22 w20 w18 w16 + + 22654, 5315, -5315, -15137, //; w23 w21 w19 w17 + + 15137, 5315, 5315, 22654, //; w30 w28 w26 w24 + + -26722, 22654, -15137, -26722, //; w31 w29 w27 w25 + + + + //row6 + + 21407, 21407, 21407, -21407, // ; movq-> w06 w04 w02 w00 + + 27969, 11585, 11585, -27969, // ; w07 w05 w03 w01 + + 21407, -21407, 21407, 21407, // ; w14 w12 w10 w08 + + -11585, 27969, -27969, -11585, // ;w15 w13 w11 w09 + + 29692, 16819, 25172, -29692, // ;w22 w20 w18 w16 + + 25172, 5906, -5906, -16819, // ;w23 w21 w19 w17 + + 16819, 5906, 5906, 25172, // ;w30 w28 w26 w24 + + -29692, 25172, -16819, -29692, // ;w31 w29 w27 w25 + + + + //row7 + + 22725, 22725, 22725, -22725, // ; movq-> w06 w04 w02 w00 + + 29692, 12299, 12299, -29692, // ; w07 w05 w03 w01 + + 22725, -22725, 22725, 22725, //; w14 w12 w10 w08 + + -12299, 29692, -29692, -12299, //; w15 w13 w11 w09 + + 31521, 17855, 26722, -31521, //; w22 w20 w18 w16 + + 26722, 6270, -6270, -17855, //; w23 w21 w19 w17 + + 17855, 6270, 6270, 26722, //; w30 w28 w26 w24 + + -31521, 26722, -17855, -31521}; // w31 w29 w27 w25 + + */ + + + + static const short tab_frw_01234567[] = { // forward_dct coeff table + + //row0 + + 16384, 16384, 21407, -8867, // w09 w01 w08 w00 + + 16384, 16384, 8867, -21407, // w13 w05 w12 w04 + + 16384, -16384, 8867, 21407, // w11 w03 w10 w02 + + -16384, 16384, -21407, -8867, // w15 w07 w14 w06 + + 22725, 12873, 19266, -22725, // w22 w20 w18 w16 + + 19266, 4520, -4520, -12873, // w23 w21 w19 w17 + + 12873, 4520, 4520, 19266, // w30 w28 w26 w24 + + -22725, 19266, -12873, -22725, // w31 w29 w27 w25 + + + + //row1 + + 22725, 22725, 29692, -12299, // w09 w01 w08 w00 + + 22725, 22725, 12299, -29692, // w13 w05 w12 w04 + + 22725, -22725, 12299, 29692, // w11 w03 w10 w02 + + -22725, 22725, -29692, -12299, // w15 w07 w14 w06 + + 31521, 17855, 26722, -31521, // w22 w20 w18 w16 + + 26722, 6270, -6270, -17855, // w23 w21 w19 w17 + + 17855, 6270, 6270, 26722, // w30 w28 w26 w24 + + -31521, 26722, -17855, -31521, // w31 w29 w27 w25 + + + + //row2 + + 21407, 21407, 27969, -11585, // w09 w01 w08 w00 + + 21407, 21407, 11585, -27969, // w13 w05 w12 w04 + + 21407, -21407, 11585, 27969, // w11 w03 w10 w02 + + -21407, 21407, -27969, -11585, // w15 w07 w14 w06 + + 29692, 16819, 25172, -29692, // w22 w20 w18 w16 + + 25172, 5906, -5906, -16819, // w23 w21 w19 w17 + + 16819, 5906, 5906, 25172, // w30 w28 w26 w24 + + -29692, 25172, -16819, -29692, // w31 w29 w27 w25 + + + + //row3 + + 19266, 19266, 25172, -10426, // w09 w01 w08 w00 + + 19266, 19266, 10426, -25172, // w13 w05 w12 w04 + + 19266, -19266, 10426, 25172, // w11 w03 w10 w02 + + -19266, 19266, -25172, -10426, // w15 w07 w14 w06, + + 26722, 15137, 22654, -26722, // w22 w20 w18 w16 + + 22654, 5315, -5315, -15137, // w23 w21 w19 w17 + + 15137, 5315, 5315, 22654, // w30 w28 w26 w24 + + -26722, 22654, -15137, -26722, // w31 w29 w27 w25, + + + + //row4 + + 16384, 16384, 21407, -8867, // w09 w01 w08 w00 + + 16384, 16384, 8867, -21407, // w13 w05 w12 w04 + + 16384, -16384, 8867, 21407, // w11 w03 w10 w02 + + -16384, 16384, -21407, -8867, // w15 w07 w14 w06 + + 22725, 12873, 19266, -22725, // w22 w20 w18 w16 + + 19266, 4520, -4520, -12873, // w23 w21 w19 w17 + + 12873, 4520, 4520, 19266, // w30 w28 w26 w24 + + -22725, 19266, -12873, -22725, // w31 w29 w27 w25 + + + + //row5 + + 19266, 19266, 25172, -10426, // w09 w01 w08 w00 + + 19266, 19266, 10426, -25172, // w13 w05 w12 w04 + + 19266, -19266, 10426, 25172, // w11 w03 w10 w02 + + -19266, 19266, -25172, -10426, // w15 w07 w14 w06 + + 26722, 15137, 22654, -26722, // w22 w20 w18 w16 + + 22654, 5315, -5315, -15137, // w23 w21 w19 w17 + + 15137, 5315, 5315, 22654, // w30 w28 w26 w24 + + -26722, 22654, -15137, -26722, // w31 w29 w27 w25 + + + + //row6 + + 21407, 21407, 27969, -11585, // w09 w01 w08 w00 + + 21407, 21407, 11585, -27969, // w13 w05 w12 w04 + + 21407, -21407, 11585, 27969, // w11 w03 w10 w02 + + -21407, 21407, -27969, -11585, // w15 w07 w14 w06, + + 29692, 16819, 25172, -29692, // w22 w20 w18 w16 + + 25172, 5906, -5906, -16819, // w23 w21 w19 w17 + + 16819, 5906, 5906, 25172, // w30 w28 w26 w24 + + -29692, 25172, -16819, -29692, // w31 w29 w27 w25, + + + + //row7 + + 22725, 22725, 29692, -12299, // w09 w01 w08 w00 + + 22725, 22725, 12299, -29692, // w13 w05 w12 w04 + + 22725, -22725, 12299, 29692, // w11 w03 w10 w02 + + -22725, 22725, -29692, -12299, // w15 w07 w14 w06, + + 31521, 17855, 26722, -31521, // w22 w20 w18 w16 + + 26722, 6270, -6270, -17855, // w23 w21 w19 w17 + + 17855, 6270, 6270, 26722, // w30 w28 w26 w24 + + -31521, 26722, -17855, -31521 // w31 w29 w27 w25 + + }; + + + + + + + + void + + fdct_mm32( short *blk ) + + { + + static __int64 xt70[2]; // xt7xt6xt5xt4, xt3xt2xt1xt0 + + static int a0, a1, a2, a3, b0, b1, b2, b3; + + static short *sptr, *optr, *tf; // tf = table_ptr + + static short *xt = (short *) &xt70[0]; + + static int j; + + + + const static short _tg_1_16 = 13036; //tg * (2<<16) + 0.5 + + const static short _tg_2_16 = 27146; //tg * (2<<16) + 0.5 + + const static short _tg_3_16 =-21746; //tg * (2<<16) + 0.5 + + const static short _cos_4_16 =-19195; //cos * (2<<16) + 0.5 + + const static short _ocos_4_16 = 23170; //cos * (2<<15) + 0.5 + + const static short _one_corr = 1; //rounding compensation + + + + static short t0, t1, t2, t3, t4, t5, t6, t7; + + static short tp03, tm03, tp12, tm12, tp65, tm65; + + static short tp465, tm465, tp765, tm765; + + + + __asm { + + + + //////////////////////////////////////////////////////////////////////// + + // + + // The high-level pseudocode for the fdct_mm32() routine : + + // + + // fdct_mm32() + + // { + + // forward_dct_col03(); // dct_column transform on cols 0-3 + + // forward_dct_col47(); // dct_column transform on cols 4-7 + + // for ( j = 0; j < 8; j=j+1 ) + + // forward_dct_row1(j); // dct_row transform on row #j + + // } + + + + mov INP, dword ptr [blk]; ;// input data is row 0 of blk[] + + ;// transform the left half of the matrix (4 columns) + + + + lea TABLEF, dword ptr [tg_all_16]; + + mov OUT, INP; + + + + // lea round_frw_col, dword ptr [r_frw_col] + + // for ( i = 0; i < 2; i = i + 1) + + // the for-loop is executed twice. We are better off unrolling the + + // loop to avoid branch misprediction. + + // mmx32_fdct_col03: // begin processing columns 0-3 + + movq mm0, [x1] ; 0 ; x1 + + ;// + + + + movq mm1, [x6] ; 1 ; x6 + + movq mm2, mm0 ; 2 ; x1 + + + + movq mm3, [x2] ; 3 ; x2 + + paddsw mm0, mm1 ; t1 = x[1] + x[6] + + + + movq mm4, [x5] ; 4 ; x5 + + psllw mm0, SHIFT_FRW_COL ; t1 + + + + movq mm5, [x0] ; 5 ; x0 + + paddsw mm4, mm3 ; t2 = x[2] + x[5] + + + + paddsw mm5, [x7] ; t0 = x[0] + x[7] + + psllw mm4, SHIFT_FRW_COL ; t2 + + + + movq mm6, mm0 ; 6 ; t1 + + psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] + + + + movq mm1, qword ptr [tg_2_16] ; 1 ; tg_2_16 + + psubsw mm0, mm4 ; tm12 = t1 - t2 + + + + movq mm7, [x3] ; 7 ; x3 + + pmulhw mm1, mm0 ; tm12*tg_2_16 + + + + paddsw mm7, [x4] ; t3 = x[3] + x[4] + + psllw mm5, SHIFT_FRW_COL ; t0 + + + + paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 + + psllw mm7, SHIFT_FRW_COL ; t3 + + + + movq mm4, mm5 ; 4 ; t0 + + psubsw mm5, mm7 ; tm03 = t0 - t3 + + + + paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 + + paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 + + + + por mm1, qword ptr one_corr ; correction y2 +0.5 + + psllw mm2, SHIFT_FRW_COL+1 ; t6 + + + + pmulhw mm5, qword ptr [tg_2_16] ; tm03*tg_2_16 + + movq mm7, mm4 ; 7 ; tp03 + + + + psubsw mm3, [x5] ; t5 = x[2] - x[5] + + psubsw mm4, mm6 ; y4 = tp03 - tp12 + + + + movq [y2], mm1 ; 1 ; save y2 + + paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 + + + + movq mm1, [x3] ; 1 ; x3 + + psllw mm3, SHIFT_FRW_COL+1 ; t5 + + + + psubsw mm1, [x4] ; t4 = x[3] - x[4] + + movq mm6, mm2 ; 6 ; t6 + + + + movq [y4], mm4 ; 4 ; save y4 + + paddsw mm2, mm3 ; t6 + t5 + + + + pmulhw mm2, qword ptr [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 + + psubsw mm6, mm3 ; 3 ; t6 - t5 + + + + pmulhw mm6, qword ptr [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 + + psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 + + + + por mm5, qword ptr one_corr ; correction y6 +0.5 + + psllw mm1, SHIFT_FRW_COL ; t4 + + + + por mm2, qword ptr one_corr ; correction tp65 +0.5 + + movq mm4, mm1 ; 4 ; t4 + + + + movq mm3, [x0] ; 3 ; x0 + + paddsw mm1, mm6 ; tp465 = t4 + tm65 + + + + psubsw mm3, [x7] ; t7 = x[0] - x[7] + + psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 + + + + movq mm0, qword ptr [tg_1_16] ; 0 ; tg_1_16 + + psllw mm3, SHIFT_FRW_COL ; t7 + + + + movq mm6, qword ptr [tg_3_16] ; 6 ; tg_3_16 + + pmulhw mm0, mm1 ; tp465*tg_1_16 + + + + movq [y0], mm7 ; 7 ; save y0 + + pmulhw mm6, mm4 ; tm465*tg_3_16 + + + + movq [y6], mm5 ; 5 ; save y6 + + movq mm7, mm3 ; 7 ; t7 + + + + movq mm5, qword ptr [tg_3_16] ; 5 ; tg_3_16 + + psubsw mm7, mm2 ; tm765 = t7 - tp65 + + + + paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 + + pmulhw mm5, mm7 ; tm765*tg_3_16 + + + + paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 + + paddsw mm6, mm4 ; tm465*tg_3_16 + + + + pmulhw mm3, qword ptr [tg_1_16] ; tp765*tg_1_16 + + ;// + + + + por mm0, qword ptr one_corr ; correction y1 +0.5 + + paddsw mm5, mm7 ; tm765*tg_3_16 + + + + psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 + + add INP, 0x08 ; // increment pointer + + + + movq [y1], mm0 ; 0 ; save y1 + + paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 + + + + movq [y3], mm7 ; 7 ; save y3 + + psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 + + + + movq [y5], mm5 ; 5 ; save y5 + + + + + + // mmx32_fdct_col47: // begin processing columns 4-7 + + movq mm0, [x1] ; 0 ; x1 + + ;// + + movq [y7], mm3 ; 3 ; save y7 (columns 0-4) + + ;// + + + + movq mm1, [x6] ; 1 ; x6 + + movq mm2, mm0 ; 2 ; x1 + + + + movq mm3, [x2] ; 3 ; x2 + + paddsw mm0, mm1 ; t1 = x[1] + x[6] + + + + movq mm4, [x5] ; 4 ; x5 + + psllw mm0, SHIFT_FRW_COL ; t1 + + + + movq mm5, [x0] ; 5 ; x0 + + paddsw mm4, mm3 ; t2 = x[2] + x[5] + + + + paddsw mm5, [x7] ; t0 = x[0] + x[7] + + psllw mm4, SHIFT_FRW_COL ; t2 + + + + movq mm6, mm0 ; 6 ; t1 + + psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] + + + + movq mm1, qword ptr [tg_2_16] ; 1 ; tg_2_16 + + psubsw mm0, mm4 ; tm12 = t1 - t2 + + + + movq mm7, [x3] ; 7 ; x3 + + pmulhw mm1, mm0 ; tm12*tg_2_16 + + + + paddsw mm7, [x4] ; t3 = x[3] + x[4] + + psllw mm5, SHIFT_FRW_COL ; t0 + + + + paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 + + psllw mm7, SHIFT_FRW_COL ; t3 + + + + movq mm4, mm5 ; 4 ; t0 + + psubsw mm5, mm7 ; tm03 = t0 - t3 + + + + paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 + + paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 + + + + por mm1, qword ptr one_corr ; correction y2 +0.5 + + psllw mm2, SHIFT_FRW_COL+1 ; t6 + + + + pmulhw mm5, qword ptr [tg_2_16] ; tm03*tg_2_16 + + movq mm7, mm4 ; 7 ; tp03 + + + + psubsw mm3, [x5] ; t5 = x[2] - x[5] + + psubsw mm4, mm6 ; y4 = tp03 - tp12 + + + + movq [y2+8], mm1 ; 1 ; save y2 + + paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 + + + + movq mm1, [x3] ; 1 ; x3 + + psllw mm3, SHIFT_FRW_COL+1 ; t5 + + + + psubsw mm1, [x4] ; t4 = x[3] - x[4] + + movq mm6, mm2 ; 6 ; t6 + + + + movq [y4+8], mm4 ; 4 ; save y4 + + paddsw mm2, mm3 ; t6 + t5 + + + + pmulhw mm2, qword ptr [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 + + psubsw mm6, mm3 ; 3 ; t6 - t5 + + + + pmulhw mm6, qword ptr [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 + + psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 + + + + por mm5, qword ptr one_corr ; correction y6 +0.5 + + psllw mm1, SHIFT_FRW_COL ; t4 + + + + por mm2, qword ptr one_corr ; correction tp65 +0.5 + + movq mm4, mm1 ; 4 ; t4 + + + + movq mm3, [x0] ; 3 ; x0 + + paddsw mm1, mm6 ; tp465 = t4 + tm65 + + + + psubsw mm3, [x7] ; t7 = x[0] - x[7] + + psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 + + + + movq mm0, qword ptr [tg_1_16] ; 0 ; tg_1_16 + + psllw mm3, SHIFT_FRW_COL ; t7 + + + + movq mm6, qword ptr [tg_3_16] ; 6 ; tg_3_16 + + pmulhw mm0, mm1 ; tp465*tg_1_16 + + + + movq [y0+8], mm7 ; 7 ; save y0 + + pmulhw mm6, mm4 ; tm465*tg_3_16 + + + + movq [y6+8], mm5 ; 5 ; save y6 + + movq mm7, mm3 ; 7 ; t7 + + + + movq mm5, qword ptr [tg_3_16] ; 5 ; tg_3_16 + + psubsw mm7, mm2 ; tm765 = t7 - tp65 + + + + paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 + + pmulhw mm5, mm7 ; tm765*tg_3_16 + + + + paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 + + paddsw mm6, mm4 ; tm465*tg_3_16 + + + + pmulhw mm3, qword ptr [tg_1_16] ; tp765*tg_1_16 + + ;// + + + + por mm0, qword ptr one_corr ; correction y1 +0.5 + + paddsw mm5, mm7 ; tm765*tg_3_16 + + + + psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 + + ;// + + + + movq [y1+8], mm0 ; 0 ; save y1 + + paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 + + + + movq [y3+8], mm7 ; 7 ; save y3 + + psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 + + + + movq [y5+8], mm5 ; 5 ; save y5 + + + + movq [y7+8], mm3 ; 3 ; save y7 + + + + // emms; + + // } // end of forward_dct_col07() + + // done with dct_col transform + + + + + + //////////////////////////////////////////////////////////////////////// + + // + + // fdct_mmx32_rows() -- + + // the following subroutine performs the row-transform operation, + + // + + // The output is stored into blk[], destroying the original + + // source data. + + + + // v1.01 - output is range-clipped to {-2048, +2047} + + + + mov INP, dword ptr [blk]; ;// row 0 + + mov edi, 0x08; //x = 8 + + + + lea TABLE, dword ptr [tab_frw_01234567]; // row 0 + + mov OUT, INP; + + + + lea round_frw_row, dword ptr [r_frw_row]; + + // for ( x = 8; x > 0; --x ) // transform 1 row per iteration + + + + // ---------- loop begin + + lp_mmx_fdct_row1: + + movd mm5, dword ptr [INP+12]; // mm5 = 7 6 + + + + punpcklwd mm5, dword ptr [INP+8] // mm5 = 5 7 4 6 + + + + movq mm2, mm5; // mm2 = 5 7 4 6 + + psrlq mm5, 32; // mm5 = _ _ 5 7 + + + + movq mm0, qword ptr [INP]; // mm0 = 3 2 1 0 + + punpcklwd mm5, mm2;// mm5 = 4 5 6 7 + + + + movq mm1, mm0; // mm1 = 3 2 1 0 + + paddsw mm0, mm5; // mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) + + + + psubsw mm1, mm5; // mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) + + movq mm2, mm0; // mm2 = [ xt3 xt2 xt1 xt0 ] + + + + //movq [ xt3xt2xt1xt0 ], mm0; // debugging + + //movq [ xt7xt6xt5xt4 ], mm1; // debugging + + + + punpcklwd mm0, mm1;// mm0 = [ xt5 xt1 xt4 xt0 ] + + + + punpckhwd mm2, mm1;// mm2 = [ xt7 xt3 xt6 xt2 ] + + movq mm1, mm2; // mm1 + + + + ;// shuffle bytes around + + + + // movq mm0, qword ptr [INP] ; 0 ; x3 x2 x1 x0 + + + + // movq mm1, qword ptr [INP+8] ; 1 ; x7 x6 x5 x4 + + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + + + movq mm3, qword ptr [TABLE] ; 3 ; w06 w04 w02 w00 + + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + + punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] + + + + movq mm4, qword ptr [TABLE+8] ; 4 ; w07 w05 w03 w01 + + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + + + movq mm1, qword ptr [TABLE+32] ; 1 ; w22 w20 w18 w16 + + punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] + + + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + + punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] + + + + pmaddwd mm0, qword ptr [TABLE+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + + punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] + + + + movq mm7, qword ptr [TABLE+40] ; 7 ; w23 w21 w19 w17 + + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + //mm3 = a1, a0 (y2,y0) + + //mm1 = b1, b0 (y3,y1) + + //mm0 = a3,a2 (y6,y4) + + //mm5 = b3,b2 (y7,y5) + + + + paddd mm3, qword ptr [round_frw_row] ; +rounder (y2,y0) + + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + + + pmaddwd mm2, qword ptr [TABLE+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) // now ( y2, y0) + + + + pmaddwd mm5, qword ptr [TABLE+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + + ;// + + + + pmaddwd mm6, qword ptr [TABLE+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) // now ( y3, y1) + + + + paddd mm0, qword ptr [round_frw_row] ; +rounder (y6,y4) + + psrad mm3, SHIFT_FRW_ROW_CLIP1 ;// (y2, y0) + + + + paddd mm1, qword ptr [round_frw_row] ; +rounder (y3,y1) + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) // now (y6, y4) + + + + paddd mm5, qword ptr [round_frw_row] ; +rounder (y7,y5) + + psrad mm1, SHIFT_FRW_ROW_CLIP1 ;// y1=a1+b1 y0=a0+b0 + + + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) // now ( y7, y5) + + psrad mm0, SHIFT_FRW_ROW_CLIP1 ;//y3=a3+b3 y2=a2+b2 + + + + add OUT, 16; // increment row-output address by 1 row + + psrad mm5, SHIFT_FRW_ROW_CLIP1;// y4=a3-b3 y5=a2-b2 + + + + add INP, 16; // increment row-address by 1 row + + packssdw mm3, mm0 ;// 0 ; y6 y4 y2 y0, saturate {-32768,+32767} + + + + packssdw mm1, mm5 ;// 3 ; y7 y5 y3 y1, saturate {-32768,+32767} + + movq mm6, mm3; // mm0 = y6 y4 y2 y0 + + + + punpcklwd mm3, mm1; // y3 y2 y1 y0 + + sub edi, 0x01; // i = i - 1 + + + + punpckhwd mm6, mm1; // y7 y6 y5 y4 + + add TABLE,64; // increment to next table + + + + psraw mm3, SHIFT_FRW_ROW_CLIP2; // descale [y3 y2 y1 y0] to {-2048,+2047} + + + + psraw mm6, SHIFT_FRW_ROW_CLIP2; // descale [y7 y6 y5 y4] to {-2048,+2047} + + + + movq qword ptr [OUT-16], mm3 ; 1 ; save y3 y2 y1 y0 + + + + movq qword ptr [OUT-8], mm6 ; 7 ; save y7 y6 y5 y4 + + + + cmp edi, 0x00; + + jg lp_mmx_fdct_row1; // begin fdct processing on next row + + emms; + + } + + + + /* + + //////////////////////////////////////////////////////////////////////// + + // + + // DCT_8_FRW_COL(), equivalent c_code + + // + + // This C-code can be substituted for the same __asm block + + // + + // I found several *DISCREPANCIES* between the AP-922 C-listing + + // and actual corrected code (shown below). + + // + + //////////////////////////////////////////////////////////////////////// + + + + sptr = (short *) blk; + + optr = (short *) blk; // output will overwrite source data! + + + + for ( j = 0; j < 8; j=j+1 ) // dct_frw_col1 loop + + { + + // read source-data column #j into xt[0..7] + + xt[7] = sptr[7*8]; + + xt[6] = sptr[6*8]; + + xt[5] = sptr[5*8]; + + xt[4] = sptr[4*8]; + + + + xt[3] = sptr[3*8]; + + xt[2] = sptr[2*8]; + + xt[1] = sptr[1*8]; + + xt[0] = sptr[0*8]; + + + + #define LEFT_SHIFT( x ) ((x) << (SHIFT_FRW_COL) ) // left shift + + #define LEFT_SHIFT1( x ) ((x) << (SHIFT_FRW_COL+1) ) // left shift+1 + + + + t0 = LEFT_SHIFT ( xt[0] + xt[7] ); + + t1 = LEFT_SHIFT ( xt[1] + xt[6] ); + + t2 = LEFT_SHIFT ( xt[2] + xt[5] ); + + t3 = LEFT_SHIFT ( xt[3] + xt[4] ); + + t4 = LEFT_SHIFT ( xt[3] - xt[4] ); + + t5 = LEFT_SHIFT1( xt[2] - xt[5] ); // *** DISCREPANCY + + t6 = LEFT_SHIFT1( xt[1] - xt[6] ); // *** DISCREPANCY + + t7 = LEFT_SHIFT ( xt[0] - xt[7] ); + + + + tp03 = t0 + t3; + + tm03 = t0 - t3; + + tp12 = t1 + t2; + + tm12 = t1 - t2; + + + + // pmulhw/pmulhrw emulation macros + + #define X86_PMULHW( X ) ((short) ( ((int)X)>>16 )) //Intel MMX + + //#define X86_PMULHRW( X ) ((short) ( ( (((int)X)>>15)+1) >>1) ) //3DNow-MMX + + + + optr[0*8] = tp03 + tp12; + + optr[4*8] = tp03 - tp12; + + optr[2*8] = tm03 + X86_PMULHW( tm12 * _tg_2_16 ); + + optr[2*8] = optr[2*8] | _one_corr; // one_correction + + optr[6*8] = X86_PMULHW( tm03 * _tg_2_16 ) - tm12; + + optr[6*8] = optr[6*8] | _one_corr; // one_correction + + + + tp65 = X86_PMULHW( (t6 +t5 )*_ocos_4_16 ); // *** DISCREPANCY + + tp65 = tp65 | _one_corr; // one_correction + + tm65 = X86_PMULHW( (t6 -t5 )*_ocos_4_16 ); // *** DISCREPANCY + + + + tp765 = t7 + tp65; + + tm765 = t7 - tp65; + + tp465 = t4 + tm65; + + tm465 = t4 - tm65; + + + + optr[1*8] = tp765 + X86_PMULHW( tp465 * _tg_1_16 ); + + optr[1*8] = optr[1*8] | _one_corr; // one_correction + + optr[7*8] = X86_PMULHW( tp765 * _tg_1_16 ) - tp465; + + + + // optr[5*8] = X86_PMULHW( tm765 * _tg_3_16 ) + tm465; // *** DISCREPANCY + + // from pg8 of AP-922, ICONST = [ const*(2^16) + 0.5 ] + + // const * x = PMULHW( ICONST,x ) + x + + // The constant "tg_3_16" > 0.5, thus _tg_3_16 is encoded as tg_3_16-1.0 + + // optr[5*8] = X86_PMULHW( tm765 * ( tg_3_16 - 1.0 ) ) + tm465 + + // = [tm765*tg_3_16 - tm765] + tm465 + + // + + // optr[5*8] + tm765 = [ tm765*tg_3_16 ] + tm465 + tm765 + + // = [ tm765*tg_3_16 ] + tm465 <-- what we want + + + + optr[5*8] = X86_PMULHW( tm765 * _tg_3_16 ) + tm465 + tm765; + + + + // optr[3*8] = tm765 - X86_PMULHW( tm465 * _tg_3_16 ); // *** DISCREPANCY + + // The following operations must be performed in the shown order! + + // same trick (as shown for optr[5*8]) applies to optr[3*8] + + + + optr[3*8] = X86_PMULHW( tm465 * _tg_3_16 ) + tm465; + + optr[3*8] = tm765 - optr[3*8]; + + + + ++sptr; // increment source pointer +1 column + + ++optr; // increment output pointer +1 column + + } // end for ( j = 0 ..., end of C_equivalent code for forward_dct_col_1 + + + + //////////////////////////////////////////////////////////////////////// + + // + + // DCT8_FRW_ROW1(), equivalent c_code + + // + + // This C-code can be substituted for the same __asm block + + // For a derivation of this code, please read fdctmm32.doc + + //////////////////////////////////////////////////////////////////////// + + + + sptr = (short *) blk; + + optr = (short *) blk; // output will overwrite source data! + + tf = &tab_frw_01234567[ 0 ]; // fdct_row load table_forward_w + + + + for ( j = 0; j < 8; j=j+1 ) // dct_frw_row1 loop + + { + + // forward_dct_row input arithmetic + shuffle + + xt[3] = sptr[3] + sptr[4]; + + xt[2] = sptr[2] + sptr[5]; + + xt[1] = sptr[1] + sptr[6]; + + xt[0] = sptr[0] + sptr[7]; + + + + xt[7] = sptr[3] - sptr[4]; + + xt[6] = sptr[2] - sptr[5]; + + xt[5] = sptr[1] - sptr[6]; + + xt[4] = sptr[0] - sptr[7]; + + + + + + a3 = ( xt[0]*tf[10]+ xt[2]*tf[11]) + ( xt[1]*tf[14]+ xt[3]*tf[15]); + + a2 = ( xt[0]*tf[8] + xt[2]*tf[9] ) + ( xt[1]*tf[12]+ xt[3]*tf[13]); + + a1 = ( xt[0]*tf[2] + xt[2]*tf[3] ) + ( xt[1]*tf[6] + xt[3]*tf[7] ); + + a0 = ( xt[0]*tf[0] + xt[2]*tf[1] ) + ( xt[1]*tf[4] + xt[3]*tf[5] ); + + tf += 16; // increment table pointer + + + + b3 = ( xt[4]*tf[10]+ xt[6]*tf[11]) + ( xt[5]*tf[14]+ xt[7]*tf[15]); + + b2 = ( xt[4]*tf[8] + xt[6]*tf[9] ) + ( xt[5]*tf[12]+ xt[7]*tf[13]); + + b1 = ( xt[4]*tf[2] + xt[6]*tf[3] ) + ( xt[5]*tf[6] + xt[7]*tf[7] ); + + b0 = ( xt[4]*tf[0] + xt[6]*tf[1] ) + ( xt[5]*tf[4] + xt[7]*tf[5] ); + + tf += 16; // increment table pointer + + + + // apply rounding constants to scaled elements + + // note, in the MMX implementation, the shift&round is done *last.* + + // Here, the C-code applies the shifts 1st, then the clipping. + + #define SHIFT_AND_ROUND_FRW_ROW( x ) ( ((x)+RND_FRW_ROW) >> SHIFT_FRW_ROW ) + + + + a3 = SHIFT_AND_ROUND_FRW_ROW( a3 ); + + a2 = SHIFT_AND_ROUND_FRW_ROW( a2 ); + + a1 = SHIFT_AND_ROUND_FRW_ROW( a1 ); + + a0 = SHIFT_AND_ROUND_FRW_ROW( a0 ); + + + + b3 = SHIFT_AND_ROUND_FRW_ROW( b3 ); + + b2 = SHIFT_AND_ROUND_FRW_ROW( b2 ); + + b1 = SHIFT_AND_ROUND_FRW_ROW( b1 ); + + b0 = SHIFT_AND_ROUND_FRW_ROW( b0 ); + + + + // v1.01, clip output results to range {-2048, +2047} + + + + // In the MMX implementation, the "clipper" is integrated into + + // the shift&round operation (thanks to packssdw) + + a3 = (a3 > 2047) ? 2047 : a3; // ceiling @ +2047 + + a2 = (a2 > 2047) ? 2047 : a2; // ceiling @ +2047 + + a1 = (a1 > 2047) ? 2047 : a1; // ceiling @ +2047 + + a0 = (a0 > 2047) ? 2047 : a0; // ceiling @ +2047 + + b3 = (b3 > 2047) ? 2047 : b3; // ceiling @ +2047 + + b2 = (b2 > 2047) ? 2047 : b2; // ceiling @ +2047 + + b1 = (b1 > 2047) ? 2047 : b1; // ceiling @ +2047 + + b0 = (b0 > 2047) ? 2047 : b0; // ceiling @ +2047 + + + + a3 = (a3 <-2048) ? -2048 : a3; // floor @ -2048 + + a2 = (a2 <-2048) ? -2048 : a2; // floor @ -2048 + + a1 = (a1 <-2048) ? -2048 : a1; // floor @ -2048 + + a0 = (a0 <-2048) ? -2048 : a0; // floor @ -2048 + + b3 = (b3 <-2048) ? -2048 : b3; // floor @ -2048 + + b2 = (b2 <-2048) ? -2048 : b2; // floor @ -2048 + + b1 = (b1 <-2048) ? -2048 : b1; // floor @ -2048 + + b0 = (b0 <-2048) ? -2048 : b0; // floor @ -2048 + + + + + + // forward_dct_row, assign outputs + + optr[ 3 ] = b1; + + optr[ 2 ] = a1; + + optr[ 1 ] = b0; + + optr[ 0 ] = a0; + + + + optr[ 7 ] = b3; + + optr[ 6 ] = a3; + + optr[ 5 ] = b2; + + optr[ 4 ] = a2; + + + + sptr += 8; // increment source pointer +1 row + + optr += 8; // increment output pointer +1 row + + } // end for ( j = 0 ..., end of C_equivalent code for forward_dct_row_1 + + */ + + } // fdct_mm32( short *blk ) + + + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/text_idct_mmx.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/text_idct_mmx.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/text_idct_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/text_idct_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,571 ---- + + /************************************************************************** + * * + * This code is developed by John Funnell. This software is an * + * an implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * text_idct_mmx.c + * + * Copyright (C) 2001 Project Mayo + * + * John Funnell + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains idct functions with MMX optimization. */ + /* Please see acknowledgement below. */ + + /* + ; + ; MMX iDCT + ; + ; Originally provided by Intel at AP-922 + ; http://developer.intel.com/vtune/cbts/strmsimd/922down.htm + ; (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm) + ; but in a limited edition. + ; New macro implements a column part for precise iDCT + ; The routine precision now satisfies IEEE standard 1180-1990. + ; + ; Copyright (c) 2000-2001 Peter Gubanov + ; Rounding trick Copyright (c) 2000 Michel Lespinasse + ; + ; http://www.elecard.com/peter/idct.html + ; http://www.linuxvideo.org/mpeg2dec/ + ; + ; Conversion to MS-style inline C format (c) 2001 Project Mayo Inc. John Funnell + ; + ; Version v1.0.0 10 January 2001 + ; + */ + + + /* + if you are not setting the name of you MMX idct function with compile flag MMX_IDCT_NAME, + then you need to choose a name to insert in here: + */ + #define DEFAULT_FUNCTION_NAME Fast_IDCT + + + + #ifndef MMX_IDCT_NAME + #define MMX_IDCT_NAME DEFAULT_FUNCTION_NAME + #endif + + + + /* some types */ + #define int16_t short + #define int32_t int + #define uint64_t unsigned __int64 + + #define MPTR qword ptr + + + /* some conversions from readable integer constants to qwords */ + #define SHORT4_TO_QWORD(A, B, C, D) ( \ + ( ( ((uint64_t)(A)) & ((uint64_t)(0xffff)) ) << 0 ) | \ + ( ( ((uint64_t)(B)) & ((uint64_t)(0xffff)) ) << 16 ) | \ + ( ( ((uint64_t)(C)) & ((uint64_t)(0xffff)) ) << 32 ) | \ + ( ( ((uint64_t)(D)) & ((uint64_t)(0xffff)) ) << 48 ) ) + + #define INT2_TO_QWORD(A, B) ( \ + ( ( ((uint64_t)(A)) & ((uint64_t)(0xffffffff)) ) << 0 ) | \ + ( ( ((uint64_t)(B)) & ((uint64_t)(0xffffffff)) ) << 32 ) ) + + + + + #define BITS_INV_ACC 5 /* 4 or 5 for IEEE */ + #define SHIFT_INV_ROW (16 - BITS_INV_ACC) + #define SHIFT_INV_COL (1 + BITS_INV_ACC) + #define RND_INV_ROW (1024 * (6 - BITS_INV_ACC)) /* 1 << (SHIFT_INV_ROW-1) */ + #define RND_INV_COL (16 * (BITS_INV_ACC - 3)) /* 1 << (SHIFT_INV_COL-1) */ + #define RND_INV_CORR (RND_INV_COL - 1) /* correction -1.0 and round */ + #define BITS_FRW_ACC 3 /* 2 or 3 for accuracy */ + #define SHIFT_FRW_COL BITS_FRW_ACC + #define SHIFT_FRW_ROW (BITS_FRW_ACC + 17) + #define RND_FRW_ROW (262144 * (BITS_FRW_ACC - 1)) /* 1 << (SHIFT_FRW_ROW-1) */ + + + + + + + static const uint64_t tg_1_16 = SHORT4_TO_QWORD( 13036, 13036, 13036, 13036 ); + static const uint64_t tg_2_16 = SHORT4_TO_QWORD( 27146, 27146, 27146, 27146 ); + static const uint64_t tg_3_16 = SHORT4_TO_QWORD(-21746, -21746, -21746, -21746 ); + static const uint64_t ocos_4_16 = SHORT4_TO_QWORD( 23170, 23170, 23170, 23170 ); + + + + + /* rounding value that is added before the row transform's rounding */ + + + #if SHIFT_INV_ROW == 12 + static const uint64_t rounder[8] = { + INT2_TO_QWORD( 65536, 65536), /* rounder_0 */ + INT2_TO_QWORD( 7195, 7195), /* rounder_1 */ + INT2_TO_QWORD( 4520, 4520), /* rounder_2 */ + INT2_TO_QWORD( 2407, 2407), /* rounder_3 */ + INT2_TO_QWORD( 0, 0), /* rounder_4 */ + INT2_TO_QWORD( 240, 240), /* rounder_5 */ + INT2_TO_QWORD( 1024, 1024), /* rounder_6 */ + INT2_TO_QWORD( 1024, 1024) /* rounder_7 */ + }; + #elif SHIFT_INV_ROW == 11 + static const uint64_t rounder[2*8] = { + INT2_TO_QWORD( 65536, 65536), /* rounder_0 */ + INT2_TO_QWORD( 3597, 3597), /* rounder_1 */ + INT2_TO_QWORD( 2260, 2260), /* rounder_2 */ + INT2_TO_QWORD( 1203, 1203), /* rounder_3 */ + INT2_TO_QWORD( 0, 0), /* rounder_4 */ + INT2_TO_QWORD( 120, 120), /* rounder_5 */ + INT2_TO_QWORD( 512, 512), /* rounder_6 */ + INT2_TO_QWORD( 512, 512) /* rounder_7 */ + }; + #endif + + + + /* + ;============================================================================= + ; + ; The first stage iDCT 8x8 - inverse DCTs of rows + ; + ;----------------------------------------------------------------------------- + ; The 8-point inverse DCT direct algorithm + ;----------------------------------------------------------------------------- + ; + ; static const short w[32] = { + ; FIX(cos_4_16), FIX(cos_2_16), FIX(cos_4_16), FIX(cos_6_16), + ; FIX(cos_4_16), FIX(cos_6_16), -FIX(cos_4_16), -FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_6_16), -FIX(cos_4_16), FIX(cos_2_16), + ; FIX(cos_4_16), -FIX(cos_2_16), FIX(cos_4_16), -FIX(cos_6_16), + ; FIX(cos_1_16), FIX(cos_3_16), FIX(cos_5_16), FIX(cos_7_16), + ; FIX(cos_3_16), -FIX(cos_7_16), -FIX(cos_1_16), -FIX(cos_5_16), + ; FIX(cos_5_16), -FIX(cos_1_16), FIX(cos_7_16), FIX(cos_3_16), + ; FIX(cos_7_16), -FIX(cos_5_16), FIX(cos_3_16), -FIX(cos_1_16) }; + ; + ; #define DCT_8_INV_ROW(x, y) + ;{ + ; int a0, a1, a2, a3, b0, b1, b2, b3; + ; + ; a0 =x[0]*w[0]+x[2]*w[1]+x[4]*w[2]+x[6]*w[3]; + ; a1 =x[0]*w[4]+x[2]*w[5]+x[4]*w[6]+x[6]*w[7]; + ; a2 = x[0] * w[ 8] + x[2] * w[ 9] + x[4] * w[10] + x[6] * w[11]; + ; a3 = x[0] * w[12] + x[2] * w[13] + x[4] * w[14] + x[6] * w[15]; + ; b0 = x[1] * w[16] + x[3] * w[17] + x[5] * w[18] + x[7] * w[19]; + ; b1 = x[1] * w[20] + x[3] * w[21] + x[5] * w[22] + x[7] * w[23]; + ; b2 = x[1] * w[24] + x[3] * w[25] + x[5] * w[26] + x[7] * w[27]; + ; b3 = x[1] * w[28] + x[3] * w[29] + x[5] * w[30] + x[7] * w[31]; + ; + ; y[0] = SHIFT_ROUND ( a0 + b0 ); + ; y[1] = SHIFT_ROUND ( a1 + b1 ); + ; y[2] = SHIFT_ROUND ( a2 + b2 ); + ; y[3] = SHIFT_ROUND ( a3 + b3 ); + ; y[4] = SHIFT_ROUND ( a3 - b3 ); + ; y[5] = SHIFT_ROUND ( a2 - b2 ); + ; y[6] = SHIFT_ROUND ( a1 - b1 ); + ; y[7] = SHIFT_ROUND ( a0 - b0 ); + ;} + ; + ;----------------------------------------------------------------------------- + ; + ; In this implementation the outputs of the iDCT-1D are multiplied + ; for rows 0,4 - by cos_4_16, + ; for rows 1,7 - by cos_1_16, + ; for rows 2,6 - by cos_2_16, + ; for rows 3,5 - by cos_3_16 + ; and are shifted to the left for better accuracy + ; + ; For the constants used, + ; FIX(float_const) = (short) (float_const * (1<<15) + 0.5) + ; + ;============================================================================= + */ + + + /* + ;============================================================================= + ; code for MMX + ;============================================================================= + ; Table for rows 0,4 - constants are multiplied by cos_4_16 + */ + static const uint64_t tab_i_04[8*8] = { + /* Table for rows 0,4 - constants are multiplied by cos_4_16 */ + SHORT4_TO_QWORD( 16384, 16384, 16384, -16384 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 21407, 8867, 8867, -21407 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 16384, -16384, 16384, 16384 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD( -8867, 21407, -21407, -8867 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 22725, 12873, 19266, -22725 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 19266, 4520, -4520, -12873 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 12873, 4520, 4520, 19266 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-22725, 19266, -12873, -22725 ), /* w31 w29 w27 w25 */ + /* Table for rows 1,7 - constants are multiplied by cos_1_16 */ + SHORT4_TO_QWORD( 22725, 22725, 22725, -22725 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 29692, 12299, 12299, -29692 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 22725, -22725, 22725, 22725 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-12299, 29692, -29692, -12299 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 31521, 17855, 26722, -31521 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 26722, 6270, -6270, -17855 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 17855, 6270, 6270, 26722 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-31521, 26722, -17855, -31521 ), /* w31 w29 w27 w25 */ + /* Table for rows 2,6 - constants are multiplied by cos_2_16 */ + SHORT4_TO_QWORD( 21407, 21407, 21407, -21407 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 27969, 11585, 11585, -27969 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 21407, -21407, 21407, 21407 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-11585, 27969, -27969, -11585 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 29692, 16819, 25172, -29692 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 25172, 5906, -5906, -16819 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 16819, 5906, 5906, 25172 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-29692, 25172, -16819, -29692 ), /* w31 w29 w27 w25 */ + /* Table for rows 3,5 - constants are multiplied by cos_3_16 */ + SHORT4_TO_QWORD( 19266, 19266, 19266, -19266 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 25172, 10426, 10426, -25172 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 19266, -19266, 19266, 19266 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-10426, 25172, -25172, -10426 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 26722, 15137, 22654, -26722 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 22654, 5315, -5315, -15137 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 15137, 5315, 5315, 22654 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-26722, 22654, -15137, -26722 ), /* w31 w29 w27 w25 */ + /* Table for rows 0,4 - constants are multiplied by cos_4_16 */ + SHORT4_TO_QWORD( 16384, 16384, 16384, -16384 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 21407, 8867, 8867, -21407 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 16384, -16384, 16384, 16384 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-8867, 21407, -21407, -8867 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 22725, 12873, 19266, -22725 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 19266, 4520, -4520, -12873 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 12873, 4520, 4520, 19266 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-22725, 19266, -12873, -22725 ), /* w31 w29 w27 w25 */ + /* Table for rows 3,5 - constants are multiplied by cos_3_16 */ + SHORT4_TO_QWORD( 19266, 19266, 19266, -19266 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 25172, 10426, 10426, -25172 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 19266, -19266, 19266, 19266 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-10426, 25172, -25172, -10426 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 26722, 15137, 22654, -26722 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 22654, 5315, -5315, -15137 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 15137, 5315, 5315, 22654 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-26722, 22654, -15137, -26722 ), /* w31 w29 w27 w25 */ + /* Table for rows 2,6 - constants are multiplied by cos_2_16 */ + SHORT4_TO_QWORD( 21407, 21407, 21407, -21407 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 27969, 11585, 11585, -27969 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 21407, -21407, 21407, 21407 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-11585, 27969, -27969, -11585 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 29692, 16819, 25172, -29692 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 25172, 5906, -5906, -16819 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 16819, 5906, 5906, 25172 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-29692, 25172, -16819, -29692 ), /* w31 w29 w27 w25 */ + /* Table for rows 1,7 - constants are multiplied by cos_1_16 */ + SHORT4_TO_QWORD( 22725, 22725, 22725, -22725 ), /* movq-> w06 w04 w02 w00 */ + SHORT4_TO_QWORD( 29692, 12299, 12299, -29692 ), /* w07 w05 w03 w01 */ + SHORT4_TO_QWORD( 22725, -22725, 22725, 22725 ), /* w14 w12 w10 w08 */ + SHORT4_TO_QWORD(-12299, 29692, -29692, -12299 ), /* w15 w13 w11 w09 */ + SHORT4_TO_QWORD( 31521, 17855, 26722, -31521 ), /* w22 w20 w18 w16 */ + SHORT4_TO_QWORD( 26722, 6270, -6270, -17855 ), /* w23 w21 w19 w17 */ + SHORT4_TO_QWORD( 17855, 6270, 6270, 26722 ), /* w30 w28 w26 w24 */ + SHORT4_TO_QWORD(-31521, 26722, -17855, -31521 ), /* w31 w29 w27 w25 */ + }; + + + + uint64_t tempMatrix[64/4]; + + + #define INP eax + #define ROUNDER ebx + #define TABLE ecx + #define OUTP edx + + + + + + /* the function itself */ + void MMX_IDCT_NAME + (int16_t *block) { + __asm { + + push eax + push ebx + push ecx + push edx + push edi + + mov INP, block + lea OUTP, [tempMatrix] + lea TABLE, [tab_i_04] + lea ROUNDER, [rounder] + + mov edi, -8; ; i=-8 + + align 16 + + rowloop: + + movq mm0, MPTR [INP] ; 0 ; x3 x2 x1 x0 + + movq mm1, MPTR [INP+8] ; 1 ; x7 x6 x5 x4 + movq mm2, mm0 ; 2 ; x3 x2 x1 x0 + + movq mm3, MPTR [TABLE] ; 3 ; w06 w04 w02 w00 + punpcklwd mm0, mm1 ; x5 x1 x4 x0 + + movq mm5, mm0 ; 5 ; x5 x1 x4 x0 + punpckldq mm0, mm0 ; x4 x0 x4 x0 + + movq mm4, MPTR [TABLE+8] ; 4 ; w07 w05 w03 w01 + punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 + + pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 + movq mm6, mm2 ; 6 ; x7 x3 x6 x2 + + movq mm1, MPTR [TABLE+32] ; 1 ; w22 w20 w18 w16 + punpckldq mm2, mm2 ; x6 x2 x6 x2 + + pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 + punpckhdq mm5, mm5 ; x5 x1 x5 x1 + + pmaddwd mm0, MPTR [TABLE+16] ; x4*w14+x0*w12 x4*w10+x0*w08 + punpckhdq mm6, mm6 ; x7 x3 x7 x3 + + movq mm7, MPTR [TABLE+40] ; 7 ; w23 w21 w19 w17 + pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 + + paddd mm3, MPTR [ROUNDER] ; +rounder + pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 + + pmaddwd mm2, MPTR [TABLE+24] ; x6*w15+x2*w13 x6*w11+x2*w09 + paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) + + pmaddwd mm5, MPTR [TABLE+48] ; x5*w30+x1*w28 x5*w26+x1*w24 + movq mm4, mm3 ; 4 ; a1 a0 + + pmaddwd mm6, MPTR [TABLE+56] ; x7*w31+x3*w29 x7*w27+x3*w25 + paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) + + paddd mm0, MPTR [ROUNDER] ; +rounder + psubd mm3, mm1 ; a1-b1 a0-b0 + + psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 + paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 + + paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) + psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 + + paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) + movq mm4, mm0 ; 4 ; a3 a2 + + paddd mm0, mm5 ; a3+b3 a2+b2 + psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 + + psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 + psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 + + packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 + packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 + + movq mm7, mm4 ; 7 ; y6 y7 y4 y5 + psrld mm4, 16 ; 0 y6 0 y4 + + pslld mm7, 16 ; y7 0 y5 0 + movq MPTR [OUTP], mm1 ; 1 ; save y3 y2 y1 y0 + + por mm7, mm4 ; 4 ; y7 y6 y5 y4 + movq MPTR [OUTP+8], mm7 ; 7 ; save y7 y6 y5 y4 + + + add INP, 16 ; add 1 row to input pointer + add ROUNDER, 8 ; go to next rounding values + add OUTP, 16 ; add 1 row to output pointer + add TABLE,64 ; move to next section of table + + add edi, 1 + jne rowloop; + + + /* column code starts here... */ + + + lea INP, [tempMatrix] + mov OUTP, block + mov edi, -2; ; i=-2 + + align 16 + colloop: + + // movq mm0, MPTR [tg_3_16] + movq mm0, tg_3_16 + + movq mm3, MPTR [INP+16*3] + movq mm1, mm0 ; tg_3_16 + + movq mm5, MPTR [INP+16*5] + pmulhw mm0, mm3 ; x3*(tg_3_16-1) + + // movq mm4, MPTR [tg_1_16] + movq mm4, tg_1_16 + pmulhw mm1, mm5 ; x5*(tg_3_16-1) + + movq mm7, MPTR [INP+16*7] + movq mm2, mm4 ; tg_1_16 + + movq mm6, MPTR [INP+16*1] + pmulhw mm4, mm7 ; x7*tg_1_16 + + paddsw mm0, mm3 ; x3*tg_3_16 + pmulhw mm2, mm6 ; x1*tg_1_16 + + paddsw mm1, mm3 ; x3+x5*(tg_3_16-1) + psubsw mm0, mm5 ; x3*tg_3_16-x5 = tm35 + + // movq mm3, MPTR [ocos_4_16] + movq mm3, ocos_4_16 + paddsw mm1, mm5 ; x3+x5*tg_3_16 = tp35 + + paddsw mm4, mm6 ; x1+tg_1_16*x7 = tp17 + psubsw mm2, mm7 ; x1*tg_1_16-x7 = tm17 + + movq mm5, mm4 ; tp17 + movq mm6, mm2 ; tm17 + + paddsw mm5, mm1 ; tp17+tp35 = b0 + psubsw mm6, mm0 ; tm17-tm35 = b3 + + psubsw mm4, mm1 ; tp17-tp35 = t1 + paddsw mm2, mm0 ; tm17+tm35 = t2 + + // movq mm7, MPTR [tg_2_16] + movq mm7, tg_2_16 + movq mm1, mm4 ; t1 + + ; movq MPTR [SCRATCH+0], mm5 ; save b0 + movq MPTR [OUTP+3*16], mm5 ; save b0 + paddsw mm1, mm2 ; t1+t2 + + ; movq MPTR [SCRATCH+8], mm6 ; save b3 + movq MPTR [OUTP+5*16], mm6 ; save b3 + psubsw mm4, mm2 ; t1-t2 + + movq mm5, MPTR [INP+2*16] + movq mm0, mm7 ; tg_2_16 + + movq mm6, MPTR [INP+6*16] + pmulhw mm0, mm5 ; x2*tg_2_16 + + pmulhw mm7, mm6 ; x6*tg_2_16 + ; slot + pmulhw mm1, mm3 ; ocos_4_16*(t1+t2) = b1/2 + ; slot + movq mm2, MPTR [INP+0*16] + pmulhw mm4, mm3 ; ocos_4_16*(t1-t2) = b2/2 + + psubsw mm0, mm6 ; t2*tg_2_16-x6 = tm26 + movq mm3, mm2 ; x0 + + movq mm6, MPTR [INP+4*16] + paddsw mm7, mm5 ; x2+x6*tg_2_16 = tp26 + + paddsw mm2, mm6 ; x0+x4 = tp04 + psubsw mm3, mm6 ; x0-x4 = tm04 + + movq mm5, mm2 ; tp04 + movq mm6, mm3 ; tm04 + + psubsw mm2, mm7 ; tp04-tp26 = a3 + paddsw mm3, mm0 ; tm04+tm26 = a1 + + paddsw mm1, mm1 ; b1 + paddsw mm4, mm4 ; b2 + + paddsw mm5, mm7 ; tp04+tp26 = a0 + psubsw mm6, mm0 ; tm04-tm26 = a2 + + movq mm7, mm3 ; a1 + movq mm0, mm6 ; a2 + + paddsw mm3, mm1 ; a1+b1 + paddsw mm6, mm4 ; a2+b2 + + psraw mm3, SHIFT_INV_COL ; dst1 + psubsw mm7, mm1 ; a1-b1 + + psraw mm6, SHIFT_INV_COL ; dst2 + psubsw mm0, mm4 ; a2-b2 + + ; movq mm1, MPTR [SCRATCH+0] ; load b0 + movq mm1, MPTR [OUTP+3*16] ; load b0 + psraw mm7, SHIFT_INV_COL ; dst6 + + movq mm4, mm5 ; a0 + psraw mm0, SHIFT_INV_COL ; dst5 + + movq MPTR [OUTP+1*16], mm3 + paddsw mm5, mm1 ; a0+b0 + + movq MPTR [OUTP+2*16], mm6 + psubsw mm4, mm1 ; a0-b0 + + ; movq mm3, MPTR [SCRATCH+8] ; load b3 + movq mm3, MPTR [OUTP+5*16] ; load b3 + psraw mm5, SHIFT_INV_COL ; dst0 + + movq mm6, mm2 ; a3 + psraw mm4, SHIFT_INV_COL ; dst7 + + movq MPTR [OUTP+5*16], mm0 + paddsw mm2, mm3 ; a3+b3 + + movq MPTR [OUTP+6*16], mm7 + psubsw mm6, mm3 ; a3-b3 + + movq MPTR [OUTP+0*16], mm5 + psraw mm2, SHIFT_INV_COL ; dst3 + + movq MPTR [OUTP+7*16], mm4 + psraw mm6, SHIFT_INV_COL ; dst4 + + movq MPTR [OUTP+3*16], mm2 + + movq MPTR [OUTP+4*16], mm6 + + lea INP, [tempMatrix] + mov OUTP, block + add INP, 8 ; add 4 cols to input pointer + add OUTP, 8 ; add 4 cols to output pointer + + add edi, 1 + jne colloop + + pop edi + pop edx + pop ecx + pop ebx + pop eax + + emms + + }; /* __asm */ + + }; diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/transfer_mmx.asm bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/transfer_mmx.asm *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/transfer_mmx.asm Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/transfer_mmx.asm Fri Nov 30 10:49:41 2001 *************** *** 0 **** --- 1,183 ---- + ;/************************************************************************** + ; * + ; * XVID MPEG-4 VIDEO CODEC + ; * mmx 8bit<->16bit transfer + ; * + ; * This program is an implementation of a part of one or more MPEG-4 + ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + ; * to use this software module in hardware or software products are + ; * advised that its use may infringe existing patents or copyrights, and + ; * any such use would be at such party's own risk. The original + ; * developer of this software module and his/her company, and subsequent + ; * editors and their companies, will have no liability for use of this + ; * software or modifications or derivatives thereof. + ; * + ; * This program is free software; you can redistribute it and/or modify + ; * it under the terms of the GNU General Public License as published by + ; * the Free Software Foundation; either version 2 of the License, or + ; * (at your option) any later version. + ; * + ; * This program 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 General Public License for more details. + ; * + ; * You should have received a copy of the GNU General Public License + ; * along with this program; if not, write to the Free Software + ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ; * + ; *************************************************************************/ + + ;/************************************************************************** + ; * + ; * History: + ; * + ; * 07.11.2001 initial version; (c)2001 peter ross + ; * + ; *************************************************************************/ + + + bits 32 + + %macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif + %endmacro + + + section .text + + + ;=========================================================================== + ; + ; void transfer_8to16copy_mmx(int16_t * const dst, + ; const uint8_t * const src, + ; uint32_t stride); + ; + ;=========================================================================== + + align 16 + cglobal enc_transfer_8to16copy_mmx + enc_transfer_8to16copy_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + mov ecx, [esp + 8 + 12] ; stride + + pxor mm7, mm7 ; mm7 = zero + + mov eax, 8 + + .loop + movq mm0, [esi] + movq mm1, mm0 + punpcklbw mm0, mm7 ; mm01 = unpack([src]) + punpckhbw mm1, mm7 + + movq [edi], mm0 ; [dst] = mm01 + movq [edi + 8], mm1 + + add edi, 16 + add esi, ecx + dec eax + jnz .loop + + pop edi + pop esi + + ret + + + + ;=========================================================================== + ; + ; void transfer_16to8copy_mmx(uint8_t * const dst, + ; const int16_t * const src, + ; uint32_t stride); + ; + ;=========================================================================== + + align 16 + cglobal enc_transfer_16to8copy_mmx + enc_transfer_16to8copy_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + mov ecx, [esp + 8 + 12] ; stride + + mov eax, 8 + + .loop + movq mm0, [esi] + packuswb mm0, [esi + 8] ; mm0 = pack([src]) + + movq [edi], mm0 ; [dst] = mm0 + + add esi, 16 + add edi, ecx + dec eax + jnz .loop + + pop edi + pop esi + + ret + + + ;=========================================================================== + ; + ; void transfer_16to8add_mmx(uint8_t * const dst, + ; const int16_t * const src, + ; uint32_t stride); + ; + ;=========================================================================== + + align 16 + cglobal enc_transfer_16to8add_mmx + enc_transfer_16to8add_mmx + + push esi + push edi + + mov edi, [esp + 8 + 4] ; dst + mov esi, [esp + 8 + 8] ; src + mov ecx, [esp + 8 + 12] ; stride + + pxor mm7, mm7 + + mov eax, 8 + + .loop + movq mm0, [edi] + movq mm1, mm0 + punpcklbw mm0, mm7 ; mm23 = unpack([dst]) + punpckhbw mm1, mm7 + + movq mm2, [esi] ; mm01 = [src] + movq mm3, [esi + 8] + + paddsw mm0, mm2 ; mm01 += mm23 + paddsw mm1, mm3 + + packuswb mm0, mm1 ; [dst] = pack(mm01) + movq [edi], mm0 + + add esi, 16 + add edi, ecx + dec eax + jnz .loop + + pop edi + pop esi + + ret diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/transferidct_mmx.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/transferidct_mmx.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/intel_mmx/transferidct_mmx.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/intel_mmx/transferidct_mmx.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,327 ---- + #include "../transferidct.h" + + + + + + void EncTransferIDCT_add(uint8_t* pDest, int16_t* pSrc, int stride) + + + { + + + __asm + + + { + + + mov ecx, pDest + + + mov edx, pSrc + + + mov eax, stride + + + mov edi, 8 + + + pxor mm2, mm2 + + + p1: + + + movq mm0, [edx] + + + movq mm1, [edx+8] + + + movq mm3, [ecx] + + + movq mm4, mm3 + + + punpcklbw mm3, mm2 + + + punpckhbw mm4, mm2 + + + paddsw mm0, mm3 + + + paddsw mm1, mm4 + + + packuswb mm0, mm1 + + + movq [ecx], mm0 + + + add edx, 16 + + + add ecx, eax + + + dec edi + + + jnz p1 + + + emms + + + } + + + } + + + + + + void EncTransferIDCT_copy(uint8_t* pDest, int16_t* pSrc, int stride) + + + { + + + _asm { + + + + + + ; not sure about the state handling here - there must be a better way + + + push eax + + + push ebx + + + push edi + + + + + + mov eax, pSrc ; parameter 1, *sourceS16 + + + mov ebx, pDest ; parameter 2, *destU8 + + + mov edi, stride ; parameter 3, stride + + + + + + ; lines 0 to 7 schedueled into each other... + + + movq mm0, qword ptr [eax] ; move first four words into mm0 + + + + + + packuswb mm0, qword ptr [eax+8] ; pack mm0 and the next four words into mm0 + + + + + + movq mm1, qword ptr [eax+16] ; move first four words into mm1 + + + + + + packuswb mm1, qword ptr [eax+24]; pack mm0 and the next four words into mm1 + + + + + + movq mm2, qword ptr [eax+32] ; move first four words into mm2 + + + + + + packuswb mm2, qword ptr [eax+40]; pack mm0 and the next four words into mm2 + + + + + + movq mm3, qword ptr [eax+48] ; move first four words into mm3 + + + + + + packuswb mm3, qword ptr [eax+56] ; pack mm3 and the next four words into mm3 + + + + + + movq qword ptr [ebx], mm0 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm1 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm2 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm3 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq mm0, qword ptr [eax+64] ; move first four words into mm0 + + + add eax, 64 ; add 64 to source ptr + + + + + + packuswb mm0, qword ptr [eax+8] ; pack mm0 and the next four words into mm0 + + + + + + movq mm1, qword ptr [eax+16] ; move first four words into mm1 + + + + + + packuswb mm1, qword ptr [eax+24]; pack mm0 and the next four words into mm1 + + + + + + movq mm2, qword ptr [eax+32] ; move first four words into mm2 + + + + + + packuswb mm2, qword ptr [eax+40]; pack mm0 and the next four words into mm2 + + + + + + movq mm3, qword ptr [eax+48] ; move first four words into mm3 + + + + + + packuswb mm3, qword ptr [eax+56]; pack mm3 and the next four words into mm3 + + + + + + movq qword ptr [ebx], mm0 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm1 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm2 ; copy output to destination + + + add ebx, edi ; add +stride to dest ptr + + + + + + movq qword ptr [ebx], mm3 ; copy output to destination + + + + + + pop edi + + + pop ebx + + + pop eax + + + + + + emms + + + + + + } + + + } + + + + + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/mbtransquant.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/mbtransquant.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/mbtransquant.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/mbtransquant.c Mon Dec 3 15:34:31 2001 *************** *** 0 **** --- 1,324 ---- + /****************************************************************************** + * * + * This file is part of XviD, a free MPEG-4 video encoder/decoder * + * * + * XviD is an implementation of a part of one or more MPEG-4 Video tools * + * as specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies, will have no liability for use of this software or * + * modifications or derivatives thereof. * + * * + * XviD is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * XviD 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * * + ******************************************************************************/ + + /****************************************************************************** + * * + * mbtransquant.c * + * * + * Copyright (C) 2001 - Peter Ross * + * Copyright (C) 2001 - Michael Militzer * + * * + * For more information visit the XviD homepage: http://www.xvid.org * + * * + ******************************************************************************/ + + /****************************************************************************** + * * + * Revision history: * + * * + * 19.11.2001 introduced coefficient thresholding (Isibaar) * + * 17.11.2001 initial version * + * * + ******************************************************************************/ + + + #include "enc_transfer.h" + #include "enc_dct.h" + #include "enc_quantize.h" + #include "enc_mbfunctions.h" + #include "enc_timer.h" + + #define MIN(X, Y) ((X)<(Y)?(X):(Y)) + #define MAX(X, Y) ((X)>(Y)?(X):(Y)) + + #define TOOSMALL_LIMIT 8 // skip blocks having a coefficient sum below this value + + static __inline uint8_t calc_cbp_intra(int16_t codes[6][64]) + /* + PLEASE NOTE: + This function has been duplicated in MBTransQuant and MBPrediction + to enforce modularity + */ + { + uint8_t i, j; + uint8_t cbp = 0; + uint8_t shl_val[6] = {32, 16, 8, 4, 2, 1}; + + for (i = 0; i < 6; i++) { + for (j = 1; j < 64; j++) { + int16_t value = codes[i][j]; + + if (value != 0) { + cbp |= shl_val[i]; + break; + } + } + } + return cbp; + } + + + static __inline int8_t get_dc_scaler(int8_t quant, bool lum) + /* + PLEASE NOTE: + This function has been duplicated in MBTransQuant and MBPrediction + to enforce modularity + */ + { + int8_t dc_scaler; + + if(quant > 0 && quant < 5) { + dc_scaler = 8; + return dc_scaler; + } + + if(quant < 25 && !lum) { + dc_scaler = (quant + 13) >> 1; + return dc_scaler; + } + + if(quant < 9) { + dc_scaler = quant << 1; + return dc_scaler; + } + + if(quant < 25) { + dc_scaler = quant + 8; + return dc_scaler; + } + + if(lum) + dc_scaler = (quant << 1) - 16; + else + dc_scaler = quant - 6; + + return dc_scaler; + } + + + /* this isnt pretty, but its better than 20 ifdefs */ + + #if defined(_MMX_) + + #define FDCT enc_fdct_mmx + + #if defined(_XMM_) + #define IDCT enc_idct_sse + #else + #define IDCT enc_idct_mmx + #endif + + #define QUANT_INTRA enc_quant_intra_mmx + #define QUANT_INTER enc_quant_inter_mmx + #define DEQUANT_INTRA enc_dequant_intra_mmx + #define DEQUANT_INTER enc_dequant_inter_mmx + + #define TRANSFER_8TO16COPY enc_transfer_8to16copy_mmx + #define TRANSFER_16TO8COPY enc_transfer_16to8copy_mmx + #define TRANSFER_16TO8ADD enc_transfer_16to8add_mmx + + #else + + #define FDCT enc_fdct_int32 + #define IDCT enc_idct_int32 + + #define QUANT_INTRA enc_quant_intra + #define QUANT_INTER enc_quant_inter + #define DEQUANT_INTRA enc_dequant_intra + #define DEQUANT_INTER enc_dequant_inter + + #define TRANSFER_8TO16COPY enc_transfer_8to16copy + #define TRANSFER_16TO8COPY enc_transfer_16to8copy + #define TRANSFER_16TO8ADD enc_transfer_16to8add + + #endif + + + void MBTransQuantIntra(const MBParam *pParam, + const uint16_t x_pos, + const uint16_t y_pos, + int16_t data[][64], + int16_t qcoeff[][64], + Image * const pCurrent) + { + uint8_t i; + uint16_t stride = pCurrent->iEdgedWidth; + uint8_t iQuant = pParam->quant; + uint8_t *pY_Cur, *pU_Cur, *pV_Cur; + + + //printf("MBTransQuantIntra 1\n"); + pY_Cur = pCurrent->pY + (y_pos << 4) * stride + (x_pos << 4); + pU_Cur = pCurrent->pU + (y_pos << 3) * (stride >> 1) + (x_pos << 3); + pV_Cur = pCurrent->pV + (y_pos << 3) * (stride >> 1) + (x_pos << 3); + + //printf("MBTransQuantIntra 1 %d\n", iQuant); + for(i = 0; i < 6; i++) { + uint8_t iDcScaler = get_dc_scaler(iQuant, (i < 4) ? 1 : 0); + + start_timer(); + + switch(i) { + case 0 : + TRANSFER_8TO16COPY(data[0], pY_Cur, stride); + break; + case 1 : + TRANSFER_8TO16COPY(data[1], pY_Cur + 8, stride); + break; + case 2 : + TRANSFER_8TO16COPY(data[2], pY_Cur + 8 * stride, stride); + break; + case 3 : + TRANSFER_8TO16COPY(data[3], pY_Cur + 8 * stride + 8, stride); + break; + case 4 : + TRANSFER_8TO16COPY(data[4], pU_Cur, stride / 2); + break; + case 5 : + TRANSFER_8TO16COPY(data[5], pV_Cur, stride / 2); + break; + } + stop_transfer_timer(); + //printf("MBTransQuantIntra 2\n"); + + start_timer(); + FDCT(data[i]); + stop_dct_timer(); + + //printf("MBTransQuantIntra 3\n"); + start_timer(); + QUANT_INTRA(qcoeff[i], data[i], iQuant, iDcScaler); + stop_quant_timer(); + + //printf("MBTransQuantIntra 4\n"); + start_timer(); + DEQUANT_INTRA(data[i], qcoeff[i], iQuant, iDcScaler); + stop_iquant_timer(); + + //printf("MBTransQuantIntra 5\n"); + start_timer(); + IDCT(data[i]); + stop_idct_timer(); + + //printf("MBTransQuantIntra 6\n"); + start_timer(); + + //printf("MBTransQuantIntra 7\n"); + switch(i) { + case 0: + TRANSFER_16TO8COPY(pY_Cur, data[0], stride); + break; + case 1: + TRANSFER_16TO8COPY(pY_Cur + 8, data[1], stride); + break; + case 2: + TRANSFER_16TO8COPY(pY_Cur + 8 * stride, data[2], stride); + break; + case 3: + TRANSFER_16TO8COPY(pY_Cur + 8 + 8 * stride, data[3], stride); + break; + case 4: + TRANSFER_16TO8COPY(pU_Cur, data[4], stride / 2); + break; + case 5: + TRANSFER_16TO8COPY(pV_Cur, data[5], stride / 2); + break; + } + stop_transfer_timer(); + //printf("MBTransQuantIntra 8\n"); + } + } + + + uint8_t MBTransQuantInter(const MBParam *pParam, const uint16_t x_pos, const uint16_t y_pos, + int16_t data[][64], int16_t qcoeff[][64], Image * const pCurrent) + { + uint8_t i; + uint16_t stride2 = pCurrent->iEdgedWidth; + uint8_t iQuant = pParam->quant; + uint8_t *pY_Cur, *pU_Cur, *pV_Cur; + uint8_t cbp = 0; + uint32_t sum; + + pY_Cur = pCurrent->pY + (y_pos << 4) * stride2 + (x_pos << 4); + pU_Cur = pCurrent->pU + (y_pos << 3) * (stride2 >> 1) + (x_pos << 3); + pV_Cur = pCurrent->pV + (y_pos << 3) * (stride2 >> 1) + (x_pos << 3); + + for(i = 0; i < 6; i++) { + /* + no need to transfer 8->16-bit + (this is performed already in motion compensation) + */ + start_timer(); + FDCT(data[i]); + stop_dct_timer(); + + start_timer(); + sum = QUANT_INTER(qcoeff[i], data[i], iQuant); + stop_quant_timer(); + + if(sum * iQuant >= TOOSMALL_LIMIT) { // skip block ? + + start_timer(); + DEQUANT_INTER(data[i], qcoeff[i], iQuant); + stop_iquant_timer(); + + cbp |= 1 << (5 - i); + + start_timer(); + IDCT(data[i]); + stop_idct_timer(); + + start_timer(); + + switch(i) { + case 0: + TRANSFER_16TO8ADD(pY_Cur, data[0], stride2); + break; + case 1: + TRANSFER_16TO8ADD(pY_Cur + 8, data[1], stride2); + break; + case 2: + TRANSFER_16TO8ADD(pY_Cur + 8 * stride2, data[2], stride2); + break; + case 3: + TRANSFER_16TO8ADD(pY_Cur + 8 + 8 * stride2, data[3], stride2); + break; + case 4: + TRANSFER_16TO8ADD(pU_Cur, data[4], stride2 / 2); + break; + case 5: + TRANSFER_16TO8ADD(pV_Cur, data[5], stride2 / 2); + break; + } + stop_transfer_timer(); + } + } + return cbp; + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/quantize.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/quantize.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/quantize.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/quantize.c Mon Dec 10 14:46:09 2001 *************** *** 0 **** --- 1,239 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * quantization/dequantization + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 19.11.2001 quant_inter now returns sum of abs. coefficient values + * 02.11.2001 added const to function args + * 28.10.2001 total rewrite + * + *************************************************************************/ + + #include + #include "enc_quantize.h" + #include "enctypes.h" + + + /* mutliply+shift division table + you would think 16-bit shift would be faster(?) + (we only need 13bits precision) + */ + + #define SCALEBITS 16 + #define FIX(X) ((1L << SCALEBITS) / (X) + 1) + + static const uint32_t multipliers[32] = + { + 0, FIX(2), FIX(4), FIX(6), + FIX(8), FIX(10), FIX(12), FIX(14), + FIX(16), FIX(18), FIX(20), FIX(22), + FIX(24), FIX(26), FIX(28), FIX(30), + FIX(32), FIX(34), FIX(36), FIX(38), + FIX(40), FIX(42), FIX(44), FIX(46), + FIX(48), FIX(50), FIX(52), FIX(54), + FIX(56), FIX(58), FIX(60), FIX(62) + }; + + + + /* quantize intra-block + + coeff [out] quantized coefficients + data [in] data block + quant quantizer [1,31] + dcscalar dcscalar + + h.263 intra, + level = sign(cof) * (|cof| / (2 x q)) + + NOTE: expects data input range [-2048,2047] + */ + + + void enc_quant_intra(int16_t * coeff, + const int16_t * data, + const uint8_t quant, + const uint8_t dcscalar) + { + const uint32_t mult = multipliers[quant]; + const uint16_t quant_m_2 = quant << 1; + uint32_t i; + + //if(quant != 5) printf("enc_quant_intra 1 %d %d\n", quant, dcscalar); + *coeff++ = (*data++ + (dcscalar / 2)) / dcscalar; + + for (i = 63; i; i--) { + int16_t acLevel = *data++; + //printf("enc_quant_intra 2\n"); + + if (acLevel < 0) { + //printf("enc_quant_intra 3\n"); + acLevel = -acLevel; + if (acLevel < quant_m_2) { + *coeff++ = 0; + continue; + } + acLevel = (acLevel * mult) >> SCALEBITS; + *coeff++ = -acLevel; + //printf("enc_quant_intra 4\n"); + } else { + //printf("enc_quant_intra 5\n"); + if (acLevel < quant_m_2) { + *coeff++ = 0; + continue; + } + *coeff++ = (acLevel * mult) >> SCALEBITS; + //printf("enc_quant_intra 6\n"); + } + } + } + + + + /* dequantize intra-block + + data [out] dequantized data block + coeff [in] quantized coefficients + quant quantizer [1,31] + dcscalar dcscalar + + NOTE: does not limit output range [-128,127] + + */ + + + void enc_dequant_intra(int16_t *data, const int16_t *coeff, const uint8_t quant, const uint8_t dcscalar) + { + const uint16_t quant_m_2 = quant << 1; + const uint16_t quant_add = (quant & 1 ? quant : quant - 1); + uint32_t i; + + *data++ = *coeff++ * dcscalar; + + for (i = 63; i; i--) { + int16_t acLevel = *coeff++; + if (acLevel < 0) { + *data++ = (acLevel * quant_m_2) - quant_add; + } else if (acLevel > 0) { + *data++ = (acLevel * quant_m_2) + quant_add; + } else { + *data++ = 0; + } + } + } + + + + + /* quantize inter-block + + coeff [out] quantized coefficients + data [in] data block + quant quantizer [1,31] + + returns !0 if any non-zero coefficients found + + h.263 inter, + level = sign(cof) * (|cof| - q/2) / (2 x q) + + NOTE: expects data input range [-2048,2047] + */ + + int enc_quant_inter(int16_t *coeff, const int16_t *data, const uint8_t quant) + { + const uint32_t mult = multipliers[quant]; + const uint16_t quant_m_2 = quant << 1; + const uint16_t quant_d_2 = quant >> 1; + int sum = 0; + uint32_t i; + //if(quant != 5) printf("enc_quant_inter 1 %d\n", quant); + + for (i = 64; i; i--) { + int16_t acLevel = *data++; + + if (acLevel < 0) { + acLevel = (-acLevel) - quant_d_2; + if (acLevel < quant_m_2) { + *coeff++ = 0; + continue; + } + + acLevel = (acLevel * mult) >> SCALEBITS; + sum += acLevel; + *coeff = -acLevel; + *coeff++; + } else { + acLevel -= quant_d_2; + if (acLevel < quant_m_2) { + *coeff++ = 0; + continue; + } + *coeff = (acLevel * mult) >> SCALEBITS; + sum += *coeff; + *coeff++; + } + } + return sum; + } + + + + /* dequantize inter-block + + data [out] dequantized data block + coeff [in] quantized coefficients + quant quantizer [1,31] + dcscalar dcscalar + + NOTE: does not limit output range [-128,127] + + */ + + + void enc_dequant_inter(int16_t *data, const int16_t *coeff, const uint8_t quant) + { + const uint16_t quant_m_2 = quant << 1; + const uint16_t quant_add = (quant & 1 ? quant : quant - 1); + uint32_t i; + + for (i = 64; i; i--) { + int16_t acLevel = *coeff++; + + if (acLevel < 0) { + *data++ = (acLevel * quant_m_2) - quant_add; + } else if (acLevel > 0) { + *data++ = (acLevel * quant_m_2) + quant_add; + } else { + *data++ = 0; + } + } + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/transfer.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/transfer.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/transfer.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/transfer.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,94 ---- + /************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * 8bit<->16bit transfer + * + * This program is an implementation of a part of one or more MPEG-4 + * Video tools as specified in ISO/IEC 14496-2 standard. Those intending + * to use this software module in hardware or software products are + * advised that its use may infringe existing patents or copyrights, and + * any such use would be at such party's own risk. The original + * developer of this software module and his/her company, and subsequent + * editors and their companies, will have no liability for use of this + * software or modifications or derivatives thereof. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *************************************************************************/ + + /************************************************************************** + * + * History: + * + * 07.11.2001 initial version; (c)2001 peter ross + * + *************************************************************************/ + + + #include "enc_transfer.h" + + + void enc_transfer_8to16copy(int16_t * const dst, + const uint8_t * const src, + uint32_t stride) + { + uint32_t i, j; + + for (j = 0; j < 8; j++) { + for (i = 0; i < 8; i++) { + dst[j * 8 + i] = (int16_t)src[j * stride + i]; + } + } + } + + + void enc_transfer_16to8copy(uint8_t * const dst, + const int16_t * const src, + uint32_t stride) + { + uint32_t i, j; + + for (j = 0; j < 8; j++) { + for (i = 0; i < 8; i++) { + int16_t pixel = src[j * 8 + i]; + if (pixel < 0) { + pixel = 0; + } else if (pixel > 255) { + pixel = 255; + } + dst[j * stride + i] = (uint8_t)pixel; + } + } + } + + + void enc_transfer_16to8add(uint8_t * const dst, + const int16_t * const src, + uint32_t stride) + { + uint32_t i, j; + + for (j = 0; j < 8; j++) { + for (i = 0; i < 8; i++) { + int16_t pixel = (int16_t)dst[j * stride + i] + src[j * 8 + i]; + if (pixel < 0) { + pixel = 0; + } else if (pixel > 255) { + pixel = 255; + } + dst[j * stride + i] = (uint8_t)pixel; + } + } + } diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/transferidct.c bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/transferidct.c *** bcast-2000c/quicktime/encore2/src/mbtransquant/transferidct.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/transferidct.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,73 ---- + #include "transferidct.h" + + + + void EncTransferIDCT_add(uint8_t *pDest, int16_t *pSrc, int stride) + + { + + int x, y; + + + + for (y = 0; y < 8; y++) + + for (x = 0; x < 8; x++) + + { + + int16_t tmp = pDest[x + y * stride] + pSrc[x + y * 8]; + + + + if (tmp < 0) + + tmp = 0; + + if (tmp > 255) + + tmp = 255; + + pDest[x + y * stride] = (uint8_t) tmp; + + } + + } + + + + void EncTransferIDCT_copy(uint8_t *pDest, int16_t *pSrc, int stride) + + { + + int x, y; + + + + for (y = 0; y < 8; y++) + + for (x = 0; x < 8; x++) + + { + + int16_t tmp = pSrc[x + y * 8]; + + + + if (tmp < 0) + + tmp = 0; + + if (tmp > 255) + + tmp = 255; + + pDest[x + y * stride] = (uint8_t) tmp; + + } + + } + + + + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/mbtransquant/transferidct.h bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/transferidct.h *** bcast-2000c/quicktime/encore2/src/mbtransquant/transferidct.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/mbtransquant/transferidct.h Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,8 ---- + #ifndef _ENCORE_TRANSFERIDCT_H + #define _ENCORE_TRANSFERIDCT_H + + #include "../portab.h" + void EncTransferIDCT_add(uint8_t *pDest, int16_t *pSrc, int stride); + void EncTransferIDCT_copy(uint8_t *pDest, int16_t *pSrc, int stride); + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/src/ratecontrol.c bcast-2000c-mf3/quicktime/encore2/src/ratecontrol.c *** bcast-2000c/quicktime/encore2/src/ratecontrol.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/ratecontrol.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,283 ---- + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * rate_ctl.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions for rate control of the encoding. */ + + #include + #include "enctypes.h" + #include "ratecontrol.h" + + + extern FILE *ftrace; + + + + void RateCtlInit(RateCtlParam * pCtl, double quant, double target_rate, + + long rc_period, long rc_reaction_period, + + long rc_reaction_ratio) + + { + + #ifdef _RC_ + + fprintf(ftrace, "Initializing Rate Control module:\n"); + + fprintf(ftrace, "Initial quantizer is %f.\n", quant); + + fprintf(ftrace, "Target rate is %f bits per frame.\n", target_rate); + + fprintf(ftrace, "RC averaging period is %d.\n", rc_period); + + fprintf(ftrace, "RC reaction period is %d.\n", rc_reaction_period); + + fprintf(ftrace, "RC reaction ratio is %d.\n", rc_reaction_ratio); + + #endif + + + + pCtl->quant = quant; + + pCtl->rc_period = rc_period; + + pCtl->target_rate = target_rate; + + pCtl->reaction_ratio = rc_reaction_ratio; + + + + pCtl->average_delta = 1. / rc_period; + + pCtl->reaction_delta = 1. / rc_reaction_period; + + pCtl->average_rate = target_rate; + + pCtl->reaction_rate = target_rate; + + + + return; + + } + + + + int RateCtlGetQ(RateCtlParam * pCtl, double MAD) + + { + + double quant; + + + + quant = pCtl->quant; + + + + // if (MAD < 5.) + + // quant = pCtl->min_quant + (quant - pCtl->min_quant) * MAD / 5.; + + + + return (int) (quant + 0.5); + + } + + + + void RateCtlUpdate(RateCtlParam * pCtl, int current_frame) + + { + + double rate, delta, decay; + + double target, current_target; + + double median_quant; + + + + #ifdef _RC_ + + fprintf(ftrace, "Quantizer is currently %f.\n", pCtl->quant); + + fprintf(ftrace, "Current frame is %d bits long.\n", current_frame); + + #endif + + + + rate = pCtl->average_rate; + + delta = pCtl->average_delta; + + decay = 1 - delta; + + rate = rate * decay + current_frame * delta; + + pCtl->average_rate = rate; + + + + target = pCtl->target_rate; + + if (rate > target) + + { + + current_target = target - (rate - target); + + if (current_target < target * 0.75) + + current_target = target * 0.75; + + } + + else + + { + + current_target = target; + + } + + + + #ifdef _RC_ + + fprintf(ftrace, "Target rate is %f.\n", target); + + fprintf(ftrace, "Average rate is %f.\n", rate); + + fprintf(ftrace, "Target rate for current frame is %f.\n", current_target); + + #endif + + + + rate = pCtl->reaction_rate; + + delta = pCtl->reaction_delta; + + decay = 1 - delta; + + rate = rate * decay + current_frame * delta; + + pCtl->reaction_rate = rate; + + + + median_quant = pCtl->min_quant + (pCtl->max_quant - pCtl->min_quant) / 2; + + + + /* + + reduce quantizer when the reaction rate is low */ + + if (rate < current_target) + + pCtl->quant *= + + (1 - + + pCtl->reaction_delta * ((current_target - rate) / + + current_target / 0.20)); + + if (pCtl->quant < pCtl->min_quant) + + pCtl->quant = pCtl->min_quant; + + + + /* + + increase quantizer when the reaction rate is high */ + + if (rate > current_target) + + { + + /* + + slower increasement when the quant is higher than median */ + + if (pCtl->quant > median_quant) + + pCtl->quant *= (1 + pCtl->reaction_delta / pCtl->reaction_ratio); + + /* + + faster increasement when the quant is lower than median */ + + else if (rate > current_target * 1.20) + + pCtl->quant *= (1 + pCtl->reaction_delta); + + else + + pCtl->quant *= + + (1 + + + pCtl->reaction_delta * ((rate - current_target) / + + current_target / 0.20)); + + } + + if (pCtl->quant > pCtl->max_quant) + + pCtl->quant = pCtl->max_quant; + + + + #ifdef _RC_ + + fprintf(ftrace, "Reaction rate is %f.\n", rate); + + fprintf(ftrace, "Quantizer is updated to %f.\n", pCtl->quant); + + #endif + + + + return; + + } + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/ratecontrol.h bcast-2000c-mf3/quicktime/encore2/src/ratecontrol.h *** bcast-2000c/quicktime/encore2/src/ratecontrol.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/ratecontrol.h Sat Dec 1 02:45:44 2001 *************** *** 0 **** --- 1,47 ---- + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * putvlc.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + #ifndef _ENCORE_RATE_CTL_H + #define _ENCORE_RATE_CTL_H + #include "enctypes.h" + + void RateCtlInit(RateCtlParam * pCtl, double quant, double target_rate, + long rc_period, long rc_reaction_period, + + long rc_reaction_ratio); + int RateCtlGetQ(RateCtlParam * pCtl, double MAD); + void RateCtlUpdate(RateCtlParam * pCtl, int current_frame); + + #endif /* + _RATE_CTL_H + */ diff -C2 -r -N bcast-2000c/quicktime/encore2/src/rgb2yuv.c bcast-2000c-mf3/quicktime/encore2/src/rgb2yuv.c *** bcast-2000c/quicktime/encore2/src/rgb2yuv.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/rgb2yuv.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,397 ---- + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + + /************************************************************************** + * + * rgb2yuv.c, 24-bit RGB bitmap to YUV converter + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /************************************************************************** + * + * Modifications: + * + * 14.10.2001 added yuv4:2:2_packed (yuy2) support + * 18.09.2001 only half the line should be copied for u- and v-plane + * in YUV2YUV() - thanks Klaus! + * 26.08.2001 eliminated compiler warning + * 19.08.2001 fixed error in init_rgb2yuv + * now also works correct for flipped images + * 10.08.2001 fixed "too dark problem" - now correct brightness + * + * Michael Militzer + * + **************************************************************************/ + + + /* This file contains RGB to YUV transformation functions. */ + + + #ifdef WIN32 + #include + #endif + #include + #include "rgb2yuv.h" + #include "enc_portab.h" + + static int32_t RGBYUV02570[256], RGBYUV05040[256], RGBYUV00980[256]; + static int32_t RGBYUV01480[256], RGBYUV02910[256], RGBYUV04390[256]; + static int32_t RGBYUV03680[256], RGBYUV00710[256]; + + //void InitLookupTable(); + + + /************************************************************************ + * + * int RGB2YUV (int x_dim, int y_dim, void *bmp, YUV *yuv) + * + * Purpose : It takes a 24-bit RGB bitmap and convert it into + * YUV (4:1:1) format + * + * Input : x_dim the x dimension of the bitmap + * y_dim the y dimension of the bitmap + * bmp pointer to the buffer of the bitmap + * yuv pointer to the YUV structure + * + * Output : 0 OK + * 1 wrong dimension + * 2 memory allocation error + * + * Side Effect : + * None + * + * Date : 09/28/2000 + * + * Contacts: + * + * Adam Li + * + * DivX Advance Research Center + * + ************************************************************************/ + + + int RGB2YUV(int x_dim, int y_dim, uint8_t *bmp, uint8_t *y_out, + uint8_t *u_out, uint8_t *v_out, int x_stride, int flip) + + { + + int i, j, size; + + + uint8_t *b; + + uint8_t *y, *u, *v; + + uint8_t *y_buffer, *sub_u_buf, *sub_v_buf; + + + + + // check to see if x_dim and y_dim are divisible by 2 + + if ((x_dim % 2) || (y_dim % 2)) + return 1; + + size = x_dim * y_dim; + + + y_buffer = (uint8_t *) y_out; + + sub_u_buf = (uint8_t *) u_out; + + sub_v_buf = (uint8_t *) v_out; + + b = (uint8_t *) bmp; + + y = y_buffer; + + u = sub_u_buf; + + v = sub_v_buf; + + + if (flip) + { + + for (j = 0; j < y_dim; j++) + + + { + + y = y_buffer + (y_dim - j - 1) * x_stride; + + u = sub_u_buf + (y_dim / 2 - j / 2 - 1) * x_stride / 2; + + v = sub_v_buf + (y_dim / 2 - j / 2 - 1) * x_stride / 2; + + if (!(j % 2)) + { + for (i = 0; i < x_dim / 2; i++) + { + y[0] = (uint8_t) + ((RGBYUV02570 + [b[2]] + RGBYUV05040[b[1]] + + RGBYUV00980[b[0]] + 0x100000) >> 16); + + y[1] = + (uint8_t) ( + (RGBYUV02570[b[5]] + + RGBYUV05040[b[4]] + + RGBYUV00980[b[3]] + 0x100000) >> 16); + + y += 2; + + *u = + (uint8_t) ( + (RGBYUV01480[b[5]] + + RGBYUV02910[b[4]] + + RGBYUV04390[b[3]] + + 0x800000) >> 16); + + *v = + (uint8_t) ( + (RGBYUV04390[b[5]] + + RGBYUV03680[b[4]] + + RGBYUV00710[b[3]] + 0x800000) >> 16); + u++; + + v++; + + b += 6; + + } + } + else + for (i = 0; i < x_dim; i++) + { + *y = (uint8_t) + ((RGBYUV02570 + [b[2]] + RGBYUV05040[b[1]] + + RGBYUV00980[b[0]] + 0x100000) >> 16); + + y++; + + b += 3; + + } + + } + + } + else + { + + for (j = 0; j < y_dim; j++) + { + + y = y_buffer + j * x_stride; + + u = sub_u_buf + j / 2 * x_stride / 2; + + v = sub_v_buf + j / 2 * x_stride / 2; + + if (!(j % 2)) + { + + for (i = 0; i < x_dim / 2; i++) + { + y[0] = (uint8_t) + ((RGBYUV02570 + [b[2]] + RGBYUV05040[b[1]] + + RGBYUV00980[b[0]] + 0x100000) >> 16); + + y[1] = + (uint8_t) ( + (RGBYUV02570[b[5]] + + RGBYUV05040[b[4]] + + RGBYUV00980[b[3]] + 0x100000) >> 16); + + y += 2; + + *u = + (uint8_t) ( + (RGBYUV01480[b[5]] + + RGBYUV02910[b[4]] + + RGBYUV04390[b[3]] + 0x800000) >> 16); + + *v = + (uint8_t) ( + (RGBYUV04390[b[5]] + + RGBYUV03680[b[4]] + + RGBYUV00710[b[3]] + 0x800000) >> 16); + u++; + + v++; + + b += 6; + + } + } + else + for (i = 0; i < x_dim; i++) + { + *y = (uint8_t) + ((RGBYUV02570 + [b[2]] + RGBYUV05040[b[1]] + + RGBYUV00980[b[0]] + 0x100000) >> 16); + + y++; + + b += 3; + + } + + } + + } + + return 0; + + } + + int YUV2YUV(int x_dim, int y_dim, uint8_t *bmp, uint8_t *y_out, + uint8_t *u_out, uint8_t *v_out, int x_stride, int flip) + + { + int i; + + if (flip) + { + for (i = 0; i < y_dim; i++) + { + memcpy(y_out + (y_dim - i - 1) * x_stride, bmp, x_dim); + bmp += x_dim; + } + for (i = 0; i < y_dim / 2; i++) + { + // memcpy(u_out + (y_dim / 2 - i - 1) * x_stride / 2, bmp, x_dim); + memcpy(u_out + (y_dim / 2 - i - 1) * x_stride / 2, bmp, x_dim / 2); + bmp += x_dim / 2; + } + for (i = 0; i < y_dim / 2; i++) + { + // memcpy(v_out + (y_dim / 2 - i - 1) * x_stride / 2, bmp, x_dim); + memcpy(v_out + (y_dim / 2 - i - 1) * x_stride / 2, bmp, x_dim / 2); + bmp += x_dim / 2; + } + } + else + { + for (i = 0; i < y_dim; i++) + { + memcpy(y_out + i * x_stride, bmp, x_dim); + bmp += x_dim; + } + for (i = 0; i < y_dim / 2; i++) + { + // memcpy(u_out + i * x_stride / 2, bmp, x_dim); + memcpy(u_out + i * x_stride / 2, bmp, x_dim / 2); + bmp += x_dim / 2; + } + for (i = 0; i < y_dim / 2; i++) + { + // memcpy(v_out + i * x_stride / 2, bmp, x_dim); + memcpy(v_out + i * x_stride / 2, bmp, x_dim / 2); + bmp += x_dim / 2; + } + } + return 0; + } + + + void init_rgb2yuv() + { + + int i; + + for (i = 0; i < 256; i++) + RGBYUV02570[i] = (int32_t) (0.2570 * i * 65536); + + for (i = 0; i < 256; i++) + RGBYUV05040[i] = (int32_t) (0.5040 * i * 65536); + + for (i = 0; i < 256; i++) + RGBYUV00980[i] = (int32_t) (0.0980 * i * 65536); + + for (i = 0; i < 256; i++) + RGBYUV01480[i] = -(int32_t) (0.1480 * i * 65536); + + for (i = 0; i < 256; i++) + RGBYUV02910[i] = -(int32_t) (0.2910 * i * 65536); + + for (i = 0; i < 256; i++) + RGBYUV04390[i] = (int32_t) (0.4390 * i * 65536); + + for (i = 0; i < 256; i++) + RGBYUV03680[i] = -(int32_t) (0.3680 * i * 65536); + + for (i = 0; i < 256; i++) + RGBYUV00710[i] = -(int32_t) (0.0710 * i * 65536); + + } + + + /* yuv4:2:2_packed (yuy2) -> yuv4:2:0 planer + + NOTE: does not handle flipping */ + + void yuv422_to_yuv420p(int x_dim, int y_dim, uint8_t *bmp, + uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + int x_stride, int flip) + { + + int dif = x_stride - x_dim; + int x, y; + + for (y = y_dim; y; y -= 2) { + + for (x = x_dim; x; x -= 2) { + *y_out++ = *bmp++; + *u_out++ = *bmp++; + *y_out++ = *bmp++; + *v_out++ = *bmp++; + } + + y_out += dif; + u_out += dif >> 1; + v_out += dif >> 1; + + for (x = x_dim; x; x -= 2) { + *y_out++ = *bmp++; + bmp++; + *y_out++ = *bmp++; + bmp++; + } + + y_out += dif; + } + + } + diff -C2 -r -N bcast-2000c/quicktime/encore2/src/rgb2yuv.h bcast-2000c-mf3/quicktime/encore2/src/rgb2yuv.h *** bcast-2000c/quicktime/encore2/src/rgb2yuv.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/rgb2yuv.h Sat Dec 1 02:45:44 2001 *************** *** 0 **** --- 1,28 ---- + #ifndef __ENCORE_RGB2YUV_H + #define __ENCORE_RGB2YUV_H + + + + + + + #include "enc_portab.h" + + + + + + + + int RGB2YUV(int x_dim, int y_dim, uint8_t *bmp, uint8_t *y_out, + uint8_t *u_out, uint8_t *v_out, int x_stride, int flip); + int YUV2YUV(int x_dim, int y_dim, uint8_t *bmp, uint8_t *y_out, + uint8_t *u_out, uint8_t *v_out, int x_stride, int flip); + void init_rgb2yuv(); + + void yuv422_to_yuv420p(int x_dim, int y_dim, uint8_t *bmp, + uint8_t *y_out, uint8_t *u_out, uint8_t *v_out, + int x_stride, int flip); + + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore2/src/timer.c bcast-2000c-mf3/quicktime/encore2/src/timer.c *** bcast-2000c/quicktime/encore2/src/timer.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore2/src/timer.c Fri Nov 30 02:09:03 2001 *************** *** 0 **** --- 1,219 ---- + /****************************************************************************** + * * + * This file is part of XviD, a free MPEG-4 video encoder/decoder * + * * + * XviD is an implementation of a part of one or more MPEG-4 Video tools * + * as specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies, will have no liability for use of this software or * + * modifications or derivatives thereof. * + * * + * XviD is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * XviD 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * * + ******************************************************************************/ + + /****************************************************************************** + * * + * timer.c, some timing functions * + * * + * Copyright (C) 2001 - Michael Militzer * + * * + * For more information visit the XviD homepage: http://www.xvid.org * + * * + ******************************************************************************/ + + /****************************************************************************** + * * + * Revision history: * + * * + * 17.11.2001 small clean up (Isibaar) * + * 13.11.2001 inlined rdtsc call and moved to portab.h (Isibaar) * + * 02.11.2001 initial version (Isibaar) * + * * + ******************************************************************************/ + + #include + #include + #include "enc_timer.h" + + #if defined(_PROFILING_) + + struct ts { + int64_t current; + int64_t global; + int64_t overall; + int64_t dct; + int64_t idct; + int64_t quant; + int64_t iquant; + int64_t motion; + int64_t inter; + int64_t conv; + int64_t trans; + int64_t prediction; + int64_t coding; + }; + + struct ts tim; + + double frequency = 0.0; + + /* + determine cpu frequency + not very precise but sufficient + */ + double get_freq() { + int64_t x,y; + int32_t i; + + i = time(NULL); + + while(i == time(NULL)); + + x = read_counter(); + i++; + + while(i == time(NULL)); + + y = read_counter(); + + return (double) (y - x) / 1000.; + } + + // set everything to zero // + void init_timer() { + frequency = get_freq(); + + count_frames = 0; + + tim.dct = tim.quant = tim.idct = tim.iquant = + tim.motion = tim.conv = tim.inter = + tim.trans = tim.trans = tim.coding = tim.global = tim.overall = 0; + } + + void start_timer() { + tim.current = read_counter(); + } + + void start_global_timer() { + tim.global = read_counter(); + } + + void stop_dct_timer() { + tim.dct += (read_counter() - tim.current); + } + + void stop_idct_timer() { + tim.idct += (read_counter() - tim.current); + } + + void stop_quant_timer() { + tim.quant += (read_counter() - tim.current); + } + + void stop_iquant_timer() { + tim.iquant += (read_counter() - tim.current); + } + + void stop_motion_timer() { + tim.motion += (read_counter() - tim.current); + } + + void stop_inter_timer() { + tim.inter += (read_counter() - tim.current); + } + + void stop_conv_timer() { + tim.conv += (read_counter() - tim.current); + } + + void stop_transfer_timer() { + tim.trans += (read_counter() - tim.current); + } + + void stop_prediction_timer() { + tim.prediction += (read_counter() - tim.current); + } + + void stop_coding_timer() { + tim.coding += (read_counter() - tim.current); + } + + void stop_global_timer() { + tim.overall += (read_counter() - tim.global); + } + + /* + write log file with some timer information + */ + void write_timer() { + float dct_per, quant_per, idct_per, iquant_per, mot_per; + float inter_per, conv_per, trans_per, pred_per, cod_per, measured; + int64_t sum_ticks = 0; + + count_frames++; + + // only write log file every 50 processed frames // + if(count_frames % 50) { + FILE *fp; + fp = fopen("encoder.log", "w+"); + + dct_per = (float) (((float) ((float) tim.dct / (float) tim.overall)) * 100.0); + quant_per = (float) (((float) ((float) tim.quant / (float) tim.overall)) * 100.0); + idct_per = (float) (((float) ((float) tim.idct / (float) tim.overall)) * 100.0); + iquant_per = (float) (((float) ((float) tim.iquant / (float) tim.overall)) * 100.0); + mot_per = (float) (((float) ((float) tim.motion / (float) tim.overall)) * 100.0); + inter_per = (float) (((float) ((float) tim.inter / (float) tim.overall)) * 100.0); + conv_per = (float) (((float) ((float) tim.conv / (float) tim.overall)) * 100.0); + trans_per = (float) (((float) ((float) tim.trans / (float) tim.overall)) * 100.0); + pred_per = (float) (((float) ((float) tim.prediction / (float) tim.overall)) * 100.0); + cod_per = (float) (((float) ((float) tim.coding / (float) tim.overall)) * 100.0); + + sum_ticks = tim.coding + tim.conv + tim.dct + tim.idct + + tim.inter + tim.iquant + tim.motion + tim.trans + tim.quant + tim.trans; + + measured = (float) (((float) ((float) sum_ticks / (float) tim.overall)) * 100.0); + + fprintf(fp, "DCT:\nTotal time: %f ms (%3f percent of total encoding time)\n\n" + "Quant:\nTotal time: %f ms (%3f percent of total encoding time)\n\n" + "IDCT:\nTotal time: %f ms (%3f percent of total encoding time)\n\n" + "IQuant:\nTotal time: %f ms (%3f percent of total encoding time)\n\n" + "Mot est/comp:\nTotal time: %f ms (%3f percent of total encoding time)\n\n" + "Interpolation:\nTotal time: %f ms (%3f percent of total encoding time)\n\n" + "RGB2YUV:\nTotal time: %f ms (%3f percent of total encoding time)\n\n" + "Transfer:\nTotal time: %f ms (%3f percent of total encoding time)\n\n" + "Prediction:\nTotal time: %f ms (%3f percent of total encoding time)\n\n" + "Coding:\nTotal time: %f ms (%3f percent of total encoding time)\n\n\n" + "Overall encoding time: %f ms, we measured %f ms (%3f percent)\n", + (float) (tim.dct / frequency), dct_per, + (float) (tim.quant / frequency), quant_per, + (float) (tim.idct / frequency), idct_per, + (float) (tim.iquant / frequency), iquant_per, + (float) (tim.motion / frequency), mot_per, + (float) (tim.inter / frequency), inter_per, + (float) (tim.conv / frequency), conv_per, + (float) (tim.trans / frequency), trans_per, + (float) (tim.prediction / frequency), pred_per, + (float) (tim.coding / frequency), cod_per, + (float) (tim.overall / frequency), (float) (sum_ticks / frequency), measured); + + fclose(fp); + } + } + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore50/CVS/Entries bcast-2000c-mf3/quicktime/encore50/CVS/Entries *** bcast-2000c/quicktime/encore50/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/CVS/Entries Thu Dec 13 18:18:30 2001 *************** *** 0 **** --- 1,40 ---- + /bitstream.h/1.2/Mon Dec 3 13:48:33 2001// + /max_level.h/1.2/Mon Dec 3 13:48:33 2001// + /mom_access.c/1.2/Mon Dec 3 13:48:33 2001// + /mom_access.h/1.2/Mon Dec 3 13:48:33 2001// + /mom_structs.h/1.2/Mon Dec 3 13:48:33 2001// + /mom_util.c/1.2/Mon Dec 3 13:48:33 2001// + /mom_util.h/1.2/Mon Dec 3 13:48:33 2001// + /momusys.h/1.2/Mon Dec 3 13:48:33 2001// + /mot_code.c/1.2/Mon Dec 3 13:48:33 2001// + /mot_code.h/1.2/Mon Dec 3 13:48:33 2001// + /mot_est_comp.c/1.2/Mon Dec 3 13:48:33 2001// + /mot_est_comp.h/1.2/Mon Dec 3 13:48:33 2001// + /mot_est_mb.c/1.2/Mon Dec 3 13:48:33 2001// + /mot_est_mb.h/1.2/Mon Dec 3 13:48:33 2001// + /mot_util.c/1.2/Mon Dec 3 13:48:33 2001// + /mot_util.h/1.2/Mon Dec 3 13:48:33 2001// + /non_unix.h/1.2/Mon Dec 3 13:48:33 2001// + /putvlc.c/1.2/Mon Dec 3 13:48:33 2001// + /putvlc.h/1.2/Mon Dec 3 13:48:33 2001// + /rate_ctl.c/1.2/Mon Dec 3 13:48:33 2001// + /rate_ctl.h/1.2/Mon Dec 3 13:48:33 2001// + /text_bits.c/1.2/Mon Dec 3 13:48:33 2001// + /text_bits.h/1.2/Mon Dec 3 13:48:33 2001// + /text_code.c/1.2/Mon Dec 3 13:48:33 2001// + /text_code.h/1.2/Mon Dec 3 13:48:33 2001// + /text_code_mb.h/1.2/Mon Dec 3 13:48:33 2001// + /text_dct.c/1.2/Mon Dec 3 13:48:33 2001// + /text_dct.h/1.2/Mon Dec 3 13:48:33 2001// + /text_defs.h/1.2/Mon Dec 3 13:48:33 2001// + /vlc.h/1.2/Mon Dec 3 13:48:33 2001// + /vm_common_defs.h/1.2/Mon Dec 3 13:48:33 2001// + /vm_enc_defs.h/1.2/Mon Dec 3 13:48:33 2001// + /zigzag.h/1.2/Mon Dec 3 13:48:33 2001// + D/intel_mmx//// + /encore.h/1.3/Sat Dec 8 02:48:14 2001// + /text_code_mb.c/1.3/Sat Dec 8 03:26:50 2001// + /vop_code.c/1.3/Sat Dec 8 02:57:24 2001// + /vop_code.h/1.3/Sat Dec 8 02:58:06 2001// + /bitstream.c/1.3/Wed Dec 12 17:02:47 2001// + /encore.c/1.5/Thu Dec 13 13:39:32 2001// diff -C2 -r -N bcast-2000c/quicktime/encore50/CVS/Repository bcast-2000c-mf3/quicktime/encore50/CVS/Repository *** bcast-2000c/quicktime/encore50/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/CVS/Repository Fri Nov 30 18:08:25 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore50 diff -C2 -r -N bcast-2000c/quicktime/encore50/CVS/Root bcast-2000c-mf3/quicktime/encore50/CVS/Root *** bcast-2000c/quicktime/encore50/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/CVS/Root Fri Nov 30 18:08:25 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore50/bitstream.c bcast-2000c-mf3/quicktime/encore50/bitstream.c *** bcast-2000c/quicktime/encore50/bitstream.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/bitstream.c Wed Dec 12 18:02:47 2001 *************** *** 0 **** --- 1,121 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mom_bitstream.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + #include "bitstream.h" + + /* to mask the n least significant bits of an integer */ + + static unsigned int mask[33] = + { + 0x00000000, 0x00000001, 0x00000003, 0x00000007, + 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, + 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, + 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, + 0x0000ffff, 0x0001ffff, 0x0003ffff, 0x0007ffff, + 0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff, + 0x00ffffff, 0x01ffffff, 0x03ffffff, 0x07ffffff, + 0x0fffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, + 0xffffffff + }; + + + /* static data for pointers and counters */ + + /* byte pointer to the output bitstream */ + static unsigned char *byteptr; + /* counter of how many bytes got written to the bitstream */ + static int bytecnt; + + /* a one byte temporary buffer */ + static unsigned char outbfr; + /* counter of how many unused bits left in the byte buffer */ + static int outcnt; + + void Bitstream_Init(void *buffer) + { + byteptr = (unsigned char *)buffer; + bytecnt = 0; + outbfr = 0; + outcnt = 8; + } + + void Bitstream_PutBits(int n, unsigned int val) + { + int diff; + //printf("Bitstream_PutBits %d %02x\n", n, val); + + while ((diff = n - outcnt) >= 0) { /* input is longer than what is left in the buffer */ + outbfr |= (unsigned char)(val >> diff); + /* note that the first byte of the integer is the least significant byte */ + n = diff; + val &= mask[n]; + + *(byteptr ++) = outbfr; + bytecnt++; + outbfr = 0; + outcnt = 8; + } + + if (n > 0) { /* input is short enough to fit in what is left in the buffer */ + outbfr |= (unsigned char)(val << (-diff)); + outcnt -= n; + } + } + + + int Bitstream_Close() + { + while (outcnt != 8) Bitstream_PutBits(1, 1); + return bytecnt; + } + + + int Bitstream_NextStartCode() + { + int count = outcnt; + + Bitstream_PutBits(1,0); + while (outcnt != 8) Bitstream_PutBits(1, 1); + + return (count); + } + + + int Bitstream_GetLength() + { + return bytecnt; + } + + diff -C2 -r -N bcast-2000c/quicktime/encore50/bitstream.h bcast-2000c-mf3/quicktime/encore50/bitstream.h *** bcast-2000c/quicktime/encore50/bitstream.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/bitstream.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,24 ---- + + #ifndef _MOM_BITSTREAM_I_H_ + #define _MOM_BITSTREAM_I_H_ + + + /* this is a MACRO defined to accommondate the legacy MoMuSys calls. */ + #define BitstreamPutBits(x, y, z) Bitstream_PutBits(z, y) + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + void Bitstream_Init (void *buffer); + void Bitstream_PutBits ( int n, unsigned int val); + int Bitstream_Close (void); + int Bitstream_NextStartCode (void); + int Bitstream_GetLength(void); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _MOM_BITSTREAM_I_H_ */ + diff -C2 -r -N bcast-2000c/quicktime/encore50/encore.c bcast-2000c-mf3/quicktime/encore50/encore.c *** bcast-2000c/quicktime/encore50/encore.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/encore.c Thu Dec 13 14:39:32 2001 *************** *** 0 **** --- 1,434 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * encore.c, MPEG-4 Encoder Core Engine + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains encore(), which is the main entrance function for */ + /* Encoder Core Engine. It also contains the functions to initialize the */ + /* parameters, and redirect the output stream */ + + #include "encore.h" + + #include "vop_code.h" + #include "text_dct.h" + //#include "rc_q2.h" + #include "bitstream.h" + #include "vm_common_defs.h" + + #include "rate_ctl.h" + + typedef struct _REFERENCE + { + unsigned long handle; + float framerate; + long bitrate; + long rc_period; + long rc_reaction_period; + long rc_reaction_ratio; + long max_key_interval; + int x_dim, y_dim; + int prev_rounding; + int search_range; + int max_quantizer; + int min_quantizer; + + long seq; + long curr_run; /* the current run before the last key frame */ + + Vop *current; /* the current frame to be encoded */ + Vop *reference; /* the reference frame - reconstructed previous frame */ + Vop *reconstruct; /* intermediate reconstructed frame - used in inter */ + Vop *error; /* intermediate error frame - used in inter to hold prediction error */ + + struct _REFERENCE *pnext; + } REFERENCE; + + FILE *ftrace = NULL; + int max_quantizer, min_quantizer; + + /* private functions used only in this file */ + void init_vol_config(VolConfig *vol_config); + void init_vop(Vop *vop); + Int get_fcode (Int sr); + int PutVoVolHeader(int vol_width, int vol_height, int time_increment_resolution, float frame_rate); + int YUV2YUV (int x_dim, int y_dim, void *yuv, void *y_out, void *u_out, void *v_out); + + int encore(unsigned long handle, + unsigned long enc_opt, + void *param1, + void *param2) + { + static REFERENCE *ref = NULL; + static VolConfig *vol_config; + // a link list to keep the reference frame for all instances + + REFERENCE *ref_curr, *ref_last = NULL; + int x_dim, y_dim, size, length; + int headerbits = 0; + Vop *curr; + + ref_curr = ref_last = ref; + + //printf("encore 1\n"); + while (ref_curr != NULL) + { + if (ref_curr->handle == handle) break; + ref_last = ref_curr; + ref_curr = ref_last->pnext; + } + // create a reference for the new handle when no match is found + if (ref_curr == NULL) + { + if (enc_opt & ENC_OPT_RELEASE) return ENC_OK; + ref_curr = (REFERENCE *)malloc(sizeof(REFERENCE)); + ref_curr->handle = handle; + ref_curr->seq = 0; + ref_curr->curr_run = 0; + ref_curr->pnext = NULL; + if (ref) ref_last->pnext = ref_curr; + else ref = ref_curr; + } + //printf("encore 1\n"); + // initialize for a handle if requested + if (enc_opt & ENC_OPT_INIT) + { + #ifdef _RC_ + ftrace = fopen("trace.txt", "w"); + fflush(ftrace); + #endif + + init_fdct_enc(); + init_idct_enc(); + + // initializing rate control + ref_curr->framerate = ((ENC_PARAM *)param1)->framerate; + ref_curr->bitrate = ((ENC_PARAM *)param1)->bitrate; + ref_curr->rc_period = ((ENC_PARAM *)param1)->rc_period; + ref_curr->rc_reaction_period = ((ENC_PARAM *)param1)->rc_reaction_period; + ref_curr->rc_reaction_ratio = ((ENC_PARAM *)param1)->rc_reaction_ratio; + ref_curr->x_dim = ((ENC_PARAM *)param1)->x_dim; + ref_curr->y_dim = ((ENC_PARAM *)param1)->y_dim; + ref_curr->max_key_interval = ((ENC_PARAM *)param1)->max_key_interval; + ref_curr->search_range = ((ENC_PARAM *)param1)->search_range; + ref_curr->max_quantizer = ((ENC_PARAM *)param1)->max_quantizer; + ref_curr->min_quantizer = ((ENC_PARAM *)param1)->min_quantizer; + + ref_curr->current = AllocVop(ref_curr->x_dim, ref_curr->y_dim); + ref_curr->reference = AllocVop(ref_curr->x_dim + 2 * 16, + ref_curr->y_dim + 2 * 16); + ref_curr->reconstruct = AllocVop(ref_curr->x_dim, ref_curr->y_dim); + ref_curr->error = AllocVop(ref_curr->x_dim, ref_curr->y_dim); + init_vop(ref_curr->current); + init_vop(ref_curr->reference); + init_vop(ref_curr->reconstruct); + init_vop(ref_curr->error); + ref_curr->reference->hor_spat_ref = -16; + ref_curr->reference->ver_spat_ref = -16; + SetConstantImage(ref_curr->reference->y_chan, 0); + + vol_config = (VolConfig *)malloc(sizeof(VolConfig)); + init_vol_config(vol_config); + vol_config->frame_rate = ref_curr->framerate; + vol_config->bit_rate = ref_curr->bitrate; + + RateCtlInit(8 /* initial quant*/, vol_config->bit_rate / vol_config->frame_rate, + ref_curr->rc_period, ref_curr->rc_reaction_period, ref_curr->rc_reaction_ratio); + + return ENC_OK; + } + //printf("encore 1\n"); + // release the reference associated with the handle if requested + if (enc_opt & ENC_OPT_RELEASE) + { + if (ref_curr == ref) ref = NULL; + else ref_last->pnext = ref_curr->pnext; + + if (ref_curr->current) FreeVop(ref_curr->current); + if (ref_curr->reference) FreeVop(ref_curr->reference); + if (ref_curr->reconstruct) FreeVop(ref_curr->reconstruct); + if (ref_curr->error) FreeVop(ref_curr->error); + + free(ref_curr); + free(vol_config); + if (ftrace) { + fclose(ftrace); + ftrace = NULL; + }; + return ENC_OK; + } + + //printf("encore 1\n"); + // initialize the parameters (need to be cleaned later) + + max_quantizer = ref_curr->max_quantizer; + min_quantizer = ref_curr->min_quantizer; + + x_dim = ref_curr->x_dim; + y_dim = ref_curr->y_dim; + size = x_dim * y_dim; + + curr = ref_curr->current; + curr->width = x_dim; + curr->height = y_dim; + curr->sr_for = ref_curr->search_range; + curr->fcode_for = get_fcode(curr->sr_for); + + // do transformation for the input image + // this is needed because the legacy MoMuSys code uses short int for each data + YUV2YUV(x_dim, y_dim, ((ENC_FRAME *)param1)->image, + curr->y_chan->f, + curr->v_chan->f, + curr->u_chan->f); + + // adjust the rounding_type for the current image + curr->rounding_type = 1 - ref_curr->prev_rounding; + //printf("encore 1\n"); + + Bitstream_Init((void *)(((ENC_FRAME *)param1)->bitstream)); + //printf("encore 1\n"); + + if (ref_curr->seq == 0) + { + headerbits = PutVoVolHeader(x_dim, + y_dim, + curr->time_increment_resolution, + ref_curr->framerate); + } + //printf("encore 1\n"); + + #ifdef _RC_ + fflush(ftrace); + fprintf(ftrace, "\nCoding frame #%d\n", ref_curr->seq); + #endif + //printf("encore 1 %p %p\n", ref_curr, curr); + + if (ref_curr->curr_run % ref_curr->max_key_interval == 0) { + curr->prediction_type = I_VOP; + #ifdef _RC_ + fprintf(ftrace, "This frame is forced to be coded in INTRA.\n"); + fprintf(ftrace, "It has been %d frame since the last INTRA.\n", ref_curr->curr_run); + #endif + } + else curr->prediction_type = P_VOP; + + + + + + + + + + //printf("encore 1\n"); + // Code the image data (YUV) of the current image + VopCode(curr, + ref_curr->reference, + ref_curr->reconstruct, + ref_curr->error, + 1, //enable_8x8_mv, + (float)ref_curr->seq/ref_curr->framerate, // time + vol_config, + ((ENC_FRAME *)param1)->quant); + + + + + + + + length = Bitstream_Close(); + ((ENC_FRAME *)param1)->length = length; + + //printf("encore 2\n"); + // update the rate control parameters + RateCtlUpdate(length * 8); + + ref_curr->prev_rounding = curr->rounding_type; + ref_curr->seq ++; + ref_curr->curr_run ++; + + if (curr->prediction_type == I_VOP) { + ((ENC_RESULT *)param2)->isKeyFrame = 1; + ref_curr->curr_run = 1; + } else + ((ENC_RESULT *)param2)->isKeyFrame = 0; + //printf("encore 3\n"); + + return ENC_OK; + } + + + void init_vol_config(VolConfig *vol_config) + { + /* configure VOL */ + vol_config->M = 1; + vol_config->frame_skip = 1; + vol_config->quantizer = 8; + vol_config->intra_quantizer = 8; + vol_config->modulo_time_base[0] =0; + vol_config->modulo_time_base[1] =0; + vol_config->frame_rate = 30; + vol_config->bit_rate = 800000; + } + + + void init_vop(Vop *vop) + { + /* initialize VOPs */ + vop->quant_precision = 5; + vop->bits_per_pixel = 8; + // vop->time_increment_resolution = 15 ; + vop->time_increment_resolution = 30000; + vop->intra_acdc_pred_disable = 0; + vop->intra_dc_vlc_thr = 0; + + vop->sr_for = 512; + vop->fcode_for = get_fcode(512); + + vop->y_chan->type = SHORT_TYPE; + vop->u_chan->type = SHORT_TYPE; + vop->v_chan->type = SHORT_TYPE; + + vop->hor_spat_ref = 0; + vop->ver_spat_ref = 0; + + } + + Int get_fcode (Int sr) + { + if (sr<=16) return 1; + else if (sr<=32) return 2; + else if (sr<=64) return 3; + else if (sr<=128) return 4; + else if (sr<=256) return 5; + else if (sr<=512) return 6; + else if (sr<=1024) return 7; + else return (-1); + } + + int PutVoVolHeader(int vol_width, + int vol_height, + int time_increment_resolution, + float frame_rate) + { + int written = 0; + int bits, fixed_vop_time_increment; + + Bitstream_PutBits(VO_START_CODE_LENGTH, VO_START_CODE); + Bitstream_PutBits(5, 0); /* vo_id = 0 */ + written += VO_START_CODE_LENGTH + 5; + + Bitstream_PutBits(VOL_START_CODE_LENGTH, VOL_START_CODE); + Bitstream_PutBits(4, 0); /* vol_id = 0 */ + written += VOL_START_CODE_LENGTH + 4; + + Bitstream_PutBits(1, 0); /* random_accessible_vol = 0 */ + Bitstream_PutBits(8, 1); /* video_object_type_indication = 1 video */ + Bitstream_PutBits(1, 1); /* is_object_layer_identifier = 1 */ + Bitstream_PutBits(4, 2); /* visual_object_layer_ver_id = 2 */ + Bitstream_PutBits(3, 1); /* visual_object_layer_priority = 1 */ + written += 1 + 8 + 1 + 4 + 3; + + Bitstream_PutBits(4, 1); /* aspect_ratio_info = 1 */ + + + + + + + + Bitstream_PutBits(1, 0); /* vol_control_parameter = 0 */ + Bitstream_PutBits(2, 0); /* vol_shape = 0 rectangular */ + Bitstream_PutBits(1, 1); /* marker */ + written += 4 + 1 + 2 + 1; + + Bitstream_PutBits(16, time_increment_resolution); + Bitstream_PutBits(1, 1); /* marker */ + Bitstream_PutBits(1, 1); /* fixed_vop_rate = 1 */ + bits = (int)ceil(log((double)time_increment_resolution)/log(2.0)); + if (bits<1) bits=1; + fixed_vop_time_increment = (int)(time_increment_resolution / frame_rate + 0.1); + Bitstream_PutBits(bits, fixed_vop_time_increment); + Bitstream_PutBits(1, 1); /* marker */ + written += 16 + 1 + 1 + bits + 1; + + Bitstream_PutBits(13, vol_width); + Bitstream_PutBits(1, 1); /* marker */ + Bitstream_PutBits(13, vol_height); + Bitstream_PutBits(1, 1); /* marker */ + written += 13 + 1 + 13 + 1; + + Bitstream_PutBits(1, 0); /* interlaced = 0 */ + Bitstream_PutBits(1, 1); /* OBMC_disabled = 1 */ + Bitstream_PutBits(2, 0); /* vol_sprite_usage = 0 */ + Bitstream_PutBits(1, 0); /* not_8_bit = 0 */ + written += 1 + 1 + 2 + 1; + + Bitstream_PutBits(1, 0); /* vol_quant_type = 0 */ + Bitstream_PutBits(1, 0); /* vol_quarter_pixel = 0 */ + Bitstream_PutBits(1, 1); /* complexity_estimation_disabled = 1 */ + Bitstream_PutBits(1, 1); /* resync_marker_disabled = 1 */ + Bitstream_PutBits(1, 0); /* data_partitioning_enabled = 0 */ + Bitstream_PutBits(1, 0); /* scalability = 0 */ + written += 1 + 1 + 1 + 1 + 1 + 1; + + written += Bitstream_NextStartCode(); + + return(written); + } + + int YUV2YUV (int x_dim, int y_dim, void *yuv, void *y_out, void *u_out, void *v_out) + { + // All this conversion does is to turn data from unsigned char to short int, + // since legacy MoMuSys uses short int. + unsigned char *in; + short int *out; + long size; + + in = yuv; + + out = y_out; + size = x_dim * y_dim; + while (size --) *(out ++) = *(in ++); + + out = u_out; + size = x_dim * y_dim / 4; + while (size --) *(out ++) = *(in ++); + + out = v_out; + size = x_dim * y_dim / 4; + while (size --) *(out ++) = *(in ++); + + return 0; + } + diff -C2 -r -N bcast-2000c/quicktime/encore50/encore.h bcast-2000c-mf3/quicktime/encore50/encore.h *** bcast-2000c/quicktime/encore50/encore.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/encore.h Sat Dec 8 03:48:14 2001 *************** *** 0 **** --- 1,59 ---- + + // This is the header file describing + // the entrance function of the encoder core + // or the encore ... + + #ifdef __cplusplus + extern "C" { + #endif + + typedef struct _ENC_PARAM_ { + int x_dim; // the x dimension of the frames to be encoded + int y_dim; // the y dimension of the frames to be encoded + float framerate;// the frame rate of the sequence to be encoded + long bitrate; // the bitrate of the target encoded stream + long rc_period; // the intended rate control averaging period + long rc_reaction_period; // the reation period for rate control + long rc_reaction_ratio; // the ratio for down/up rate control + long max_key_interval; // the maximum interval between key frames + int max_quantizer; // the upper limit of the quantizer + int min_quantizer; // the lower limit of the quantizer + int search_range; // the forward search range for motion estimation + } ENC_PARAM; + + typedef struct _ENC_FRAME_ { + void *image; // the image frame to be encoded + void *bitstream;// the buffer for encoded bitstream + long length; // the length of the encoded bitstream + int quant; + } ENC_FRAME; + + typedef struct _ENC_RESULT_ { + int isKeyFrame; // the current frame is encoded as a key frame + } ENC_RESULT; + + // the prototype of the encore() - main encode engine entrance + int encore( + unsigned long handle, // handle - the handle of the calling entity, must be unique + unsigned long enc_opt, // enc_opt - the option for encoding, see below + void *param1, // param1 - the parameter 1 (its actually meaning depends on enc_opt + void *param2); // param2 - the parameter 2 (its actually meaning depends on enc_opt + + // encore options (the enc_opt parameter of encore()) + #define ENC_OPT_WRITE 1024 // write the reconstruct image to files (for debuging) + #define ENC_OPT_INIT 32768 // initialize the encoder for an handle + #define ENC_OPT_RELEASE 65536 // release all the resource associated with the handle + + // return code of encore() + #define ENC_OK 0 + #define ENC_MEMORY 1 + #define ENC_BAD_FORMAT 2 + + #ifdef __cplusplus + } + #endif + + + + + diff -C2 -r -N bcast-2000c/quicktime/encore50/intel_mmx/CVS/Entries bcast-2000c-mf3/quicktime/encore50/intel_mmx/CVS/Entries *** bcast-2000c/quicktime/encore50/intel_mmx/CVS/Entries Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/intel_mmx/CVS/Entries Fri Dec 7 14:28:24 2001 *************** *** 0 **** --- 1 ---- + D diff -C2 -r -N bcast-2000c/quicktime/encore50/intel_mmx/CVS/Repository bcast-2000c-mf3/quicktime/encore50/intel_mmx/CVS/Repository *** bcast-2000c/quicktime/encore50/intel_mmx/CVS/Repository Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/intel_mmx/CVS/Repository Fri Dec 7 14:28:24 2001 *************** *** 0 **** --- 1 ---- + quicktime/encore50/intel_mmx diff -C2 -r -N bcast-2000c/quicktime/encore50/intel_mmx/CVS/Root bcast-2000c-mf3/quicktime/encore50/intel_mmx/CVS/Root *** bcast-2000c/quicktime/encore50/intel_mmx/CVS/Root Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/intel_mmx/CVS/Root Fri Dec 7 14:28:24 2001 *************** *** 0 **** --- 1 ---- + :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/encore50/max_level.h bcast-2000c-mf3/quicktime/encore50/max_level.h *** bcast-2000c/quicktime/encore50/max_level.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/max_level.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,85 ---- + + static Int intra_max_level[2][64] = + { + { + 27, 10, 5, 4, 3, 3, 3, 3, + 2, 2, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }, + + { + 8, 3, 2, 2, 2, 2, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + } + }; + + + static Int inter_max_level[2][64] = + { + { + 12, 6, 4, 3, 3, 3, 3, 2, + 2, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }, + + { + 3, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + } + }; + + + static Int intra_max_run0[28] = + { + 999, 14, 9, 7, 3, 2, 1, + 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 + }; + + + static Int intra_max_run1[9] = + { + 999, 20, 6, + 1, 0, 0, + 0, 0, 0 + }; + + + static Int inter_max_run0[13] = + { + 999, + 26, 10, 6, 2, 1, 1, + 0, 0, 0, 0, 0, 0 + }; + + + static Int inter_max_run1[4] = + { + 999, 40, 1, 0 + }; + + + diff -C2 -r -N bcast-2000c/quicktime/encore50/mom_access.c bcast-2000c-mf3/quicktime/encore50/mom_access.c *** bcast-2000c/quicktime/encore50/mom_access.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mom_access.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,591 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mom_access.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains memory access for the Image, Vop and VolConfig data */ + /* structures. */ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "mom_access.h" + + /***********************************************************CommentBegin****** + * + * -- GetImage{xxx} -- Access components of intermediate formats + * + * Char *GetImageData(Image *image) + * UInt GetImageSize(Image *image) + * UInt GetImageSizeX(Image *image) + * UInt GetImageSizeY(Image *image) + * Int GetImageVersion(Image *image) + * ImageType GetImageType(Image *image) + * + * Purpose : + * These are common functions to access specific components + * of the common data structures which are used for the + * intermediate formats. + * + ***********************************************************CommentEnd********/ + + Char * + GetImageData(Image *image) + { + switch(GetImageType(image)) + { + case SHORT_TYPE: + return((Char *)image->data->s); + break; + case FLOAT_TYPE: + return((Char *)image->data->f); + break; + case UCHAR_TYPE: + return((Char *)image->data->u); + break; + default: + printf("Image type >>%d<< not supported\n",image->type); + return(NULL); + } + } + + + UInt + GetImageSize(Image *image) + { + return(image->x * image->y); + } + + + UInt + GetImageSizeX(Image *image) + { + return(image->x); + } + + + UInt + GetImageSizeY(Image *image) + { + return(image->y); + } + + + Int + GetImageVersion(Image *image) + { + return(image->version); + } + + + ImageType + GetImageType(Image *image) + { + return(image->type); + } + + + + /***********************************************************CommentBegin****** + * + * -- GetVop{xxx} -- Functions to access components of the Vop structure + * + * Purpose : + * These are common functions to access specific components + * of the Vop data structure. + * + ***********************************************************CommentEnd********/ + + + Int GetVopNot8Bit(Vop *vop) + { + return (vop->bits_per_pixel != 8); + } + + + Int GetVopQuantPrecision(Vop *vop) + { + return (vop->quant_precision); + } + + + Int GetVopBitsPerPixel(Vop *vop) + { + return (vop->bits_per_pixel); + } + + + Int GetVopMidGrey(Vop *vop) + { + return (1 << (vop->bits_per_pixel - 1)); + } + + + Int GetVopBrightWhite(Vop *vop) + { + return ((1 << vop->bits_per_pixel) - 1); + } + + + Int GetVopTimeIncrementResolution(Vop *vop) + { + return (vop->time_increment_resolution); + } + + + Int + GetVopModTimeBase(Vop *vop) + { + return(vop->mod_time_base); + } + + + Int + GetVopTimeInc(Vop *vop) + { + return((int)vop->time_inc); + } + + + Int + GetVopPredictionType(Vop *vop) + { + return(vop->prediction_type); + } + + + Int GetVopIntraDCVlcThr(Vop *vop) + { + return (vop->intra_dc_vlc_thr); + } + + + Int + GetVopRoundingType(Vop *vop) + { + return(vop->rounding_type); + } + + + Int + GetVopWidth(Vop *vop) + { + return(vop->width); + } + + + Int + GetVopHeight(Vop *vop) + { + return(vop->height); + } + + + Int + GetVopHorSpatRef(Vop *vop) + { + return(vop->hor_spat_ref); + } + + + Int + GetVopVerSpatRef(Vop *vop) + { + return(vop->ver_spat_ref); + } + + + Int + GetVopQuantizer(Vop *vop) + { + return(vop->quantizer); + } + + + Int + GetVopIntraQuantizer(Vop *vop) + { + return(vop->intra_quantizer); + } + + + Int + GetVopIntraACDCPredDisable(Vop *vop) + { + return(vop->intra_acdc_pred_disable); + } + + + Int + GetVopFCodeFor(Vop *vop) + { + return(vop->fcode_for); + } + + + Int + GetVopSearchRangeFor(Vop *vop) + { + return(vop->sr_for); + } + + + Image * + GetVopY(Vop *vop) + { + return(vop->y_chan); + } + + + Image * + GetVopU(Vop *vop) + { + return(vop->u_chan); + } + + + Image * + GetVopV(Vop *vop) + { + return(vop->v_chan); + } + + + /***********************************************************CommentBegin****** + * + * -- PutVop{xxx} -- Functions to write to components of the Vop structure + * + * These are common functions to write to specific components + * of the Vop structure. + * + ***********************************************************CommentEnd********/ + + + Void PutVopQuantPrecision(Int quant_precision,Vop *vop) + { + vop->quant_precision = quant_precision; + } + + + Void PutVopBitsPerPixel(Int bits_per_pixel,Vop *vop) + { + vop->bits_per_pixel = bits_per_pixel; + } + + + Void PutVopTimeIncrementResolution(Int time_incre_res, Vop *vop) + { + vop->time_increment_resolution=time_incre_res; + } + + + Void + PutVopModTimeBase(Int mod_time_base, Vop *vop) + { + vop->mod_time_base = mod_time_base; + } + + + Void + PutVopTimeInc(Int time_inc, Vop *vop) + { + vop->time_inc = (float)time_inc; + } + + + Void + PutVopPredictionType(Int prediction_type, Vop *vop) + { + vop->prediction_type = prediction_type; + } + + + Void PutVopIntraDCVlcThr(Int intra_dc_vlc_thr,Vop *vop) + { + vop->intra_dc_vlc_thr=intra_dc_vlc_thr; + } + + + Void + PutVopRoundingType(Int rounding_type, Vop *vop) + { + vop->rounding_type = rounding_type; + } + + + Void + PutVopWidth(Int width, Vop *vop) + { + vop->width = width; + } + + + Void + PutVopHeight(Int height, Vop *vop) + { + vop->height = height; + } + + + Void + PutVopHorSpatRef(Int hor_spat_ref, Vop *vop) + { + vop->hor_spat_ref = hor_spat_ref; + } + + + Void + PutVopVerSpatRef(Int ver_spat_ref, Vop *vop) + { + vop->ver_spat_ref = ver_spat_ref; + } + + + Void + PutVopQuantizer(Int quantizer, Vop *vop) + { + vop->quantizer = quantizer; + } + + + Void + PutVopIntraACDCPredDisable(Int intra_acdc_pred_disable, Vop *vop) + { + vop->intra_acdc_pred_disable = intra_acdc_pred_disable; + } + + + Void + PutVopFCodeFor(Int fcode_for, Vop *vop) + { + vop->fcode_for = fcode_for; + } + + + Void + PutVopSearchRangeFor(Int sr_for, Vop *vop) + { + vop->sr_for = sr_for; + } + + + Void + PutVopY(Image *y_chan, Vop *vop) + { + FreeImage(vop->y_chan); + vop->y_chan = y_chan; + } + + + Void + PutVopU(Image *u_chan, Vop *vop) + { + FreeImage(vop->u_chan); + vop->u_chan = u_chan; + } + + + Void + PutVopV(Image *v_chan, Vop *vop) + { + FreeImage(vop->v_chan); + vop->v_chan = v_chan; + } + + + Void + PutVopIntraQuantizer(Int Q,Vop *vop) + { + vop->intra_quantizer = Q; + } + + + /***********************************************************CommentBegin****** + * + * -- PutVolConfigXXXX -- Access functions for VolConfig + * + * Purpose : + * To set particular fields in a VolConfig strcuture + * + ***********************************************************CommentEnd********/ + + + Void + PutVolConfigFrameRate(Float fr, VolConfig *cfg) + { + cfg->frame_rate = fr; + } + + + Void + PutVolConfigM(Int M, VolConfig *cfg) + { + cfg->M = M; + } + + + Void + PutVolConfigStartFrame(Int frame, VolConfig *cfg) + { + cfg->start_frame = frame; + } + + + Void + PutVolConfigEndFrame(Int frame, VolConfig *cfg) + { + cfg->end_frame = frame; + } + + + Void + PutVolConfigBitrate(Int bit_rate,VolConfig *cfg) + { + cfg->bit_rate = bit_rate; + } + + + Void + PutVolConfigIntraPeriod(Int ir,VolConfig *cfg) + { + cfg->intra_period = ir; + } + + + Void + PutVolConfigQuantizer(Int Q,VolConfig *cfg) + { + cfg->quantizer = Q; + } + + + Void + PutVolConfigIntraQuantizer(Int Q,VolConfig *cfg) + { + cfg->intra_quantizer = Q; + } + + + Void + PutVolConfigFrameSkip(Int frame_skip,VolConfig *cfg) + { + cfg->frame_skip = frame_skip; + } + + + Void + PutVolConfigModTimeBase(Int time,VolConfig *cfg) + { + cfg->modulo_time_base[0] = cfg->modulo_time_base[1]; + cfg->modulo_time_base[1] = time; + } + + + /***********************************************************CommentBegin****** + * + * -- GetVolConfigXXXX -- Access functions for VolConfig + * + * Purpose : + * To obtain the value of particular fields in a VolConfig structure + * + ***********************************************************CommentEnd********/ + + + Float + GetVolConfigFrameRate(VolConfig *cfg) + { + return(cfg->frame_rate); + } + + + Int + GetVolConfigM(VolConfig *cfg) + { + return(cfg->M); + } + + + Int + GetVolConfigStartFrame(VolConfig *cfg) + { + return(cfg->start_frame); + } + + + Int + GetVolConfigEndFrame(VolConfig *cfg) + { + return(cfg->end_frame); + } + + + Int + GetVolConfigBitrate(VolConfig *cfg) + { + return(cfg->bit_rate); + } + + + Int + GetVolConfigIntraPeriod(VolConfig *cfg) + { + return(cfg->intra_period); + } + + + Int + GetVolConfigQuantizer(VolConfig *cfg) + { + return(cfg->quantizer); + } + + + Int + GetVolConfigIntraQuantizer(VolConfig *cfg) + { + return(cfg->intra_quantizer); + } + + + Int + GetVolConfigFrameSkip(VolConfig *cfg) + { + return(cfg->frame_skip); + } + + + Int + GetVolConfigModTimeBase(VolConfig *cfg,Int i) + { + return(cfg->modulo_time_base[i]); + } + diff -C2 -r -N bcast-2000c/quicktime/encore50/mom_access.h bcast-2000c-mf3/quicktime/encore50/mom_access.h *** bcast-2000c/quicktime/encore50/mom_access.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mom_access.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,98 ---- + + + #ifndef _MOM_ACCESS_H_ + #define _MOM_ACCESS_H_ + + + #include "momusys.h" + //#include "mom_access.p" + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + Char *GetImageData(Image *image); + UInt GetImageSize(Image *image); + UInt GetImageSizeX(Image *image); + UInt GetImageSizeY(Image *image); + Int GetImageVersion(Image *image); + ImageType GetImageType(Image *image); + + + /* -- GetVop{xxx} -- Functions to access components of the Vop structure */ + Int GetVopNot8Bit(Vop *vop); + Int GetVopQuantPrecision(Vop *vop); + Int GetVopBitsPerPixel(Vop *vop); + Int GetVopMidGrey(Vop *vop); + Int GetVopBrightWhite(Vop *vop); + Int GetVopTimeIncrementResolution(Vop *vop); + Int GetVopModTimeBase(Vop *vop); + Int GetVopTimeInc(Vop *vop); + Int GetVopPredictionType(Vop *vop); + Int GetVopIntraDCVlcThr(Vop *vop); + Int GetVopRoundingType(Vop *vop); + Int GetVopWidth(Vop *vop); + Int GetVopHeight(Vop *vop); + Int GetVopHorSpatRef(Vop *vop); + Int GetVopVerSpatRef(Vop *vop); + Int GetVopQuantizer(Vop *vop); + Int GetVopIntraQuantizer(Vop *vop); + Int GetVopIntraACDCPredDisable(Vop *vop); + Int GetVopFCodeFor(Vop *vop); + Int GetVopSearchRangeFor(Vop *vop); + Image *GetVopY(Vop *vop); + Image *GetVopU(Vop *vop); + Image *GetVopV(Vop *vop); + + /* -- PutVop{xxx} -- Functions to write to components of the Vop structure */ + Void PutVopQuantPrecision(Int quant_precision,Vop *vop); + Void PutVopBitsPerPixel(Int bits_per_pixel,Vop *vop); + Void PutVopTimeIncrementResolution(Int time_incre_res, Vop *vop); + Void PutVopModTimeBase(Int mod_time_base, Vop *vop); + Void PutVopTimeInc(Int time_inc, Vop *vop); + Void PutVopPredictionType(Int prediction_type, Vop *vop); + Void PutVopIntraDCVlcThr(Int intra_dc_vlc_thr,Vop *vop); + Void PutVopRoundingType(Int rounding_type, Vop *vop); + Void PutVopWidth(Int width, Vop *vop); + Void PutVopHeight(Int height, Vop *vop); + Void PutVopHorSpatRef(Int hor_spat_ref, Vop *vop); + Void PutVopVerSpatRef(Int ver_spat_ref, Vop *vop); + Void PutVopQuantizer(Int quantizer, Vop *vop); + Void PutVopIntraACDCPredDisable(Int intra_acdc_pred_disable, Vop *vop); + Void PutVopFCodeFor(Int fcode_for, Vop *vop); + Void PutVopSearchRangeFor(Int sr_for, Vop *vop); + Void PutVopY(Image *y_chan, Vop *vop); + Void PutVopU(Image *u_chan, Vop *vop); + Void PutVopV(Image *v_chan, Vop *vop); + Void PutVopIntraQuantizer(Int Q,Vop *vop); + + /* VolConfig Put functions */ + Void PutVolConfigFrameRate _P_((Float fr, VolConfig *cfg)); + Void PutVolConfigM _P_((Int M, VolConfig *cfg)); + Void PutVolConfigStartFrame _P_((Int frame, VolConfig *cfg)); + Void PutVolConfigEndFrame _P_((Int frame, VolConfig *cfg)); + Void PutVolConfigBitrate _P_((Int bit_rate,VolConfig *cfg)); + Void PutVolConfigIntraPeriod _P_((Int ir,VolConfig *cfg)); + Void PutVolConfigQuantizer _P_((Int Q,VolConfig *cfg)); + Void PutVolConfigIntraQuantizer _P_((Int Q,VolConfig *cfg)); + Void PutVolConfigFrameSkip _P_((Int frame_skip,VolConfig *cfg)); + Void PutVolConfigModTimeBase _P_((Int time,VolConfig *cfg)); + + /* VolConfig Get functions */ + Float GetVolConfigFrameRate _P_((VolConfig *cfg)); + Int GetVolConfigM _P_((VolConfig *cfg)); + Int GetVolConfigStartFrame _P_((VolConfig *cfg)); + Int GetVolConfigEndFrame _P_((VolConfig *cfg)); + Int GetVolConfigBitrate _P_((VolConfig *cfg)); + Int GetVolConfigIntraPeriod _P_((VolConfig *cfg)); + Int GetVolConfigQuantizer _P_((VolConfig *cfg)); + Int GetVolConfigIntraQuantizer _P_((VolConfig *cfg)); + Int GetVolConfigFrameSkip _P_((VolConfig *cfg)); + Int GetVolConfigModTimeBase _P_((VolConfig *cfg,Int i)); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _MOM_ACCESS_H_ */ + diff -C2 -r -N bcast-2000c/quicktime/encore50/mom_structs.h bcast-2000c-mf3/quicktime/encore50/mom_structs.h *** bcast-2000c/quicktime/encore50/mom_structs.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mom_structs.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,108 ---- + + #ifndef _MOM_STRUCTS_H_ + #define _MOM_STRUCTS_H_ + + + #include "momusys.h" + + #define VERSION 1 /* Image Structure Version */ + + /***** + * + * Basic and generic image structure + * + *****/ + enum image_type {SHORT_TYPE,FLOAT_TYPE,UCHAR_TYPE}; + typedef enum image_type ImageType; + + union image_data + { + SInt *s; /* SHORT data */ + Float *f; /* FLOAT data */ + UChar *u; /* UCHAR data */ + }; + typedef union image_data ImageData; + + struct image + { + Int version; /* Version number */ + UInt x,y; /* Image size */ + Char upperodd; /* Flag to tell if the top line is considered + as even or odd (used for hex grids) */ + Char grid; /* Grid type: s = square, h = hexagonal */ + SInt *f; /* Image data with short int values */ + ImageData *data; /* NEW: pointer to image data */ + ImageType type; /* NEW: type of the image */ + }; + typedef struct image Image; + + typedef struct image ImageI; /* For compatibility with old source code */ + typedef struct image ImageF; /* For compatibility with old source code */ + + /***** + * + * Recommended structures for VOPs, VOLs and VOs (now compliant with VM3.0) + * (in the VOP structure *all* entries from the VOL syntax which + * are necessary for decoding the VOP are duplicated. These entries + * are marked as "VOL ...") + * + *****/ + struct vop + { + /* Actual syntax elements for VOP (standard) */ + Int prediction_type; /* VOP prediction type */ + Int mod_time_base; /* VOP modulo time base (absolute) */ + Float time_inc; /* VOP time increment (relative to last mtb) */ + Int rounding_type; + + Int width; /* VOP height (smallest rectangle) */ + Int height; /* VOP width (smallest rectangle) */ + Int hor_spat_ref; /* VOP horizontal ref. (for composition) */ + Int ver_spat_ref; /* VOP vertical ref. (for composition) */ + + Int intra_dc_vlc_thr; + + Int quantizer; /* VOP quantizer for P-VOPs */ + Int intra_quantizer; /* VOP quantizer for I-VOPs */ + + /* Syntax elements copied from VOL (standard) */ + Int time_increment_resolution; + + Int intra_acdc_pred_disable; /* VOL disable INTRA DC prediction */ + Int sr_for; /* VOP search range of motion vectors */ + Int fcode_for; /* VOP dynamic range of motion vectors */ + Int quant_precision; + Int bits_per_pixel; + + /* Pointers to the images (YUVA) and to related VOPs */ + Image *y_chan; /* Y component of the VOP texture */ + Image *u_chan; /* U component of the VOP texture */ + Image *v_chan; /* V component of the VOP texture */ + }; + typedef struct vop Vop; + + struct object_layer_cfg + { + Float frame_rate; /* VOL frame rate */ + Int M; /* M-1 number of B-VOPs between consecutive P-VOPs*/ + Int start_frame; /* Frame at which to start coding */ + Int end_frame; /* Frame at which to end coding */ + Int bit_rate; /* Target bitrate */ + Int frame_skip; /* Number of frames to skip between codings */ + + Int quantizer; /* Initial value for H.263 INTRA quantizer */ + Int intra_quantizer; /* Initial value for H.263 INTER quantizer */ + + Int intra_period; /* Regular rate of INTRA VOP */ + + /* Automatically calculated coding fields */ + Int modulo_time_base[2]; /* Modulo time base must be maintained for VOL */ + }; + typedef struct object_layer_cfg VolConfig; + + + #include "mom_util.h" + #include "mom_access.h" + + + #endif /* _MOM_STRUCTS_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore50/mom_util.c bcast-2000c-mf3/quicktime/encore50/mom_util.c *** bcast-2000c/quicktime/encore50/mom_util.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mom_util.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,617 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mom_util.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some utility functions to manipulate Image data */ + /* structures. */ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "mom_util.h" + + /* private prototypes */ + Char *emalloc(Int n); + Char *ecalloc(Int n, Int s); + Char *erealloc(Char *p, Int n); + Void CopyImageI(ImageI *image_in, ImageI *image_out); + Void CopyImageF(ImageF *image_in, ImageF *image_out); + Void SetConstantImageI(ImageI *image, SInt val); + Void SetConstantImageF(ImageF *image, Float val); + Void SubImageI(ImageI *image_in1, ImageI *image_in2, ImageI *image_out); + Void SubImageF(ImageF *image_in1, ImageF *image_in2, ImageF *image_out); + + + /* The following is the Image maintance functions. */ + + /***********************************************************CommentBegin****** + * + * -- AllocImage -- Allocates memory for an Image structure + * + * Purpose : + * Allocates memory for an Image structure, including memory + * for the actual image pixels. The image pixels can be of type + * UChar, SInt or Float depending on the parameter type. + * + * Return values : + * A pointer to the allocated Image structure. + * + * Description : + * Allocates memory for the Image if possible, otherwise a + * memory allocation error is signalled and the program will + * exit. + * + ***********************************************************CommentEnd********/ + + Image * + AllocImage(UInt size_x, UInt size_y, ImageType type) + { + Image *image; + + image = (Image *) emalloc(sizeof(Image)); + + image->version = VERSION; + image->x = size_x; + image->y = size_y; + image->upperodd = 0; + image->grid = 's'; + image->type = type; + image->data = (ImageData *) emalloc(sizeof(ImageData)); + + switch(type) + { + case SHORT_TYPE: + image->data->s = (SInt *) ecalloc(size_x*size_y,sizeof(SInt)); + break; + + case FLOAT_TYPE: + image->data->f = (Float *) ecalloc(size_x*size_y,sizeof(Float)); + break; + + case UCHAR_TYPE: + image->data->u = (UChar *) ecalloc(size_x*size_y,sizeof(UChar)); + break; + } + + image->f = image->data->s; /* For compatibility with KHOROS */ + + return(image); + } + + + /***********************************************************CommentBegin****** + * + * -- FreeImage -- Frees up all the memory associated with an Image structure + * + * Purpose : + * Frees up all the memory associated with an Image structure + * + ***********************************************************CommentEnd********/ + + Void + FreeImage(Image *image) + { + SInt *ps; + Float *pf; + UChar *pu; + + if (image == NULL) return; + + switch(image->type) + { + case SHORT_TYPE: + ps = (SInt *)GetImageData(image); + if(ps != NULL) free((Char *)ps); + free((Char *) image->data); + free((Char *)image); + break; + + case FLOAT_TYPE: + pf = (Float *)GetImageData(image); + if(pf != NULL) free((Char *)pf); + free((Char *) image->data); + free((Char *)image); + break; + + case UCHAR_TYPE: + pu = (UChar *)GetImageData(image); + if(pu != NULL) free((Char *)pu); + free((Char *) image->data); + free((Char *)image); + break; + } + } + + + /***********************************************************CommentBegin****** + * + * -- CopyImage -- Copies the pixel values of one image to another image + * + * Purpose : + * Copies the pixel values of one image to another image. + * + * Description : + * Currently, the function exits with an error if + * the source and destination images are not of the same allocated + * size and type. + * + * Also, the images of type UChar are not yet supported. + * + ***********************************************************CommentEnd********/ + + Void + CopyImage(Image *image_in, Image *image_out) + { + switch(image_out->type) + { + case SHORT_TYPE: + CopyImageI(image_in,image_out); + break; + + case FLOAT_TYPE: + CopyImageF(image_in,image_out); + break; + + } + } + + + /***********************************************************CommentBegin****** + * + * -- CopyImageI -- + * + ***********************************************************CommentEnd********/ + + Void + CopyImageI(ImageI *image_in, ImageI *image_out) + { + SInt *p_in = image_in->data->s, + *p_out = image_out->data->s, + *p_end; + + UInt sx_in = image_in->x, + sx_out = image_out->x, + sy_in = image_in->y, + sy_out = image_out->y, + sxy_in = sx_in * sy_in; + + p_end = p_in + sxy_in; + + while (p_in != p_end) + { + *p_out = *p_in; + p_in++; + p_out++; + } + + } + + + /***********************************************************CommentBegin****** + * + * -- CopyImageF -- Copies image_in to image_out + * + ***********************************************************CommentEnd********/ + + Void + CopyImageF(ImageF *image_in, ImageF *image_out) + { + Float *p_in = image_in->data->f, + *p_out = image_out->data->f, + *p_end; + + UInt sx_in = image_in->x, + sx_out = image_out->x, + sy_in = image_in->y, + sy_out = image_out->y, + sxy_in = sx_in * sy_in; + + p_end = p_in + sxy_in; + + while (p_in != p_end) + { + *p_out = *p_in; + p_in++; + p_out++; + } + + } + + + /***********************************************************CommentBegin****** + * + * -- SetConstantImage -- Sets each pixel in the Image to val + * + * Purpose : + * Sets each pixel in the Image to val. + * + * Side effects : + * Note val is a Float. If image is not a Float image then + * val is cast to the appropriate type i.e. SInt, unsigned + * Char. + * + * Description : + * Images of type UChar are not yet supported. + * + ***********************************************************CommentEnd********/ + + Void + SetConstantImage(Image *image, Float val) + { + switch(image->type) + { + case SHORT_TYPE: + SetConstantImageI(image,(SInt)val); + break; + + case FLOAT_TYPE: + SetConstantImageF(image,val); + break; + } + } + + + + /***********************************************************CommentBegin****** + * + * -- SetConstantImageI -- + * + ***********************************************************CommentEnd********/ + + Void + SetConstantImageI(ImageI *image, SInt val) + { + SInt *p = image->data->s, + *p_end; + + UInt sxy = image->x * image->y; + + if (val == 0) + memset (p, 0, sxy * 2); + else + { + p_end = p + sxy; + + while (p != p_end) + { + *p = val; + p++; + } + } + + } + + /***********************************************************CommentBegin****** + * + * -- SetConstantImageF -- + * + ***********************************************************CommentEnd********/ + + Void + SetConstantImageF(ImageF *image, Float val) + { + Float *p = image->data->f, + *p_end; + + UInt sxy = image->x * image->y; + + p_end = p + sxy; + + while (p != p_end) + { + *p = val; + p++; + } + + } + + + /***********************************************************CommentBegin****** + * + * -- SubImage -- Subtracts two images + * + * Purpose : + * Subtracts two images and stores the result in the third + * i.e. image_out = image_in1 - image_in2 + * + * Description : + * Currently, the function exits with an error if + * the source and destination images are not of the same allocated + * size and type. + * + * Also, the images of type UChar are not yet supported. + * + ***********************************************************CommentEnd********/ + + Void + SubImage(Image *image_in1, Image *image_in2, Image *image_out) + { + switch(image_in1->type) + { + case SHORT_TYPE: + SubImageI(image_in1,image_in2,image_out); + break; + + case FLOAT_TYPE: + SubImageF(image_in1,image_in2,image_out); + break; + } + } + + /***********************************************************CommentBegin****** + * + * -- SubImageI -- + * + ***********************************************************CommentEnd********/ + + Void + SubImageI(ImageI *image_in1, ImageI *image_in2, ImageI *image_out) + { + SInt *p = image_out->data->s, + *p1 = image_in1->data->s, + *p2 = image_in2->data->s, + *p_end; + + UInt sx_in1 = image_in1->x, + sx_in2 = image_in2->x, + sx_out = image_out->x, + sy_in1 = image_in1->y, + sy_in2 = image_in2->y, + sy_out = image_out->y, + sxy = sx_out * sy_out; + + p_end = p + sxy; + + while (p != p_end) + { + *p = *p1 - *p2; + p++; + p1++; + p2++; + } + + } + + /***********************************************************CommentBegin****** + * + * -- SubImageF -- + * + ***********************************************************CommentEnd********/ + + Void + SubImageF(ImageF *image_in1, ImageF *image_in2, ImageF *image_out) + { + Float *p = image_out->data->f, + *p1 = image_in1->data->f, + *p2 = image_in2->data->f, + *p_end; + + UInt sx_in1 = image_in1->x, + sx_in2 = image_in2->x, + sx_out = image_out->x, + sy_in1 = image_in1->y, + sy_in2 = image_in2->y, + sy_out = image_out->y, + sxy = sx_out * sy_out; + + p_end = p + sxy; + + while (p != p_end) + { + *p = *p1 - *p2; + p++; + p1++; + p2++; + } + + } + + /* The following is Vop maintance functions. */ + + Vop * + SallocVop() + { + Vop *vop; + + vop = (Vop *)ecalloc(1,sizeof(Vop)); + + return(vop); + } + + + Vop * + AllocVop(UInt x, UInt y) + { + Vop *vop; + + Image *y_chan, + *u_chan, + *v_chan; + + /* first allocate memory for the data structure */ + vop = SallocVop(); + + vop->width = x; + vop->height = y; + + /* Allocate image fields */ + y_chan = AllocImage(x,y,SHORT_TYPE); + u_chan = AllocImage(x/2,y/2,SHORT_TYPE); + v_chan = AllocImage(x/2,y/2,SHORT_TYPE); + + /* Include image fields in structure */ + FreeImage(vop->y_chan); + vop->y_chan = y_chan; + + FreeImage(vop->u_chan); + vop->u_chan = u_chan; + + FreeImage(vop->v_chan); + vop->v_chan = v_chan; + + return(vop); + } + + + Void + SfreeVop (Vop *vop) + { + free ((Char*)vop); + /* vop = NULL; */ + return; + } + + + Void + FreeVop(Vop *vop) + { + Image *data=NULL; /*SpSc: added the initialization */ + + if(vop != NULL) { + + /* Deallocate memory for image fields */ + + data = vop->y_chan; + FreeImage(data); + + data = vop->u_chan; + FreeImage(data); + + data = vop->v_chan; + FreeImage(data); + + SfreeVop(vop); + } + + return; + } + + + Void + CopyVopNonImageField(Vop *in,Vop *out) + { + /* out->quant_precision = in->quant_precision; + out->bits_per_pixel = in->bits_per_pixel; + */ + // out->mod_time_base = in->mod_time_base; + // out->time_inc = in->time_inc; + out->prediction_type = in->prediction_type; + /* out->rounding_type = in->rounding_type; + out->width = in->width; + out->height = in->height; + out->hor_spat_ref = in->hor_spat_ref; + out->ver_spat_ref = in->ver_spat_ref; + out->quantizer = in->quantizer; + out->intra_quantizer = in->intra_quantizer; + out->time_increment_resolution = in->time_increment_resolution; + + out->intra_acdc_pred_disable = in->intra_acdc_pred_disable; + out->fcode_for = in->fcode_for; + out->sr_for = in->sr_for; + + out->intra_dc_vlc_thr = in->intra_dc_vlc_thr; + */ + } + + + /* The following is Memory allocation functions. */ + + /***********************************************************CommentBegin****** + * + * -- emalloc -- Memory allocation with error handling + * + * Purpose : + * Memory allocation with error handling. + * + * Description : + * WARNING: There is a problem when you want to allocate more memory + * than size can handle. Malloc gets as argument an unsigned. It poses + * a problem when sizeof(unsigned) < sizeof(Char *)... + * + ***********************************************************CommentEnd********/ + + Char * + emalloc(Int n) + { + Char *p; + + p = (Char *) malloc((UInt)n); + return p; + } + + /***********************************************************CommentBegin****** + * + * -- ecalloc -- Memory allocation with error handling + * + * Purpose : + * Memory allocation with error handling. + * + * Description : + * WARNING: There is a problem when you want to allocate more memory + * than size can handle. Malloc gets as argument an unsigned. It poses + * a problem when sizeof(unsigned) < sizeof(Char *)... + * + ***********************************************************CommentEnd********/ + + Char * + ecalloc(Int n, Int s) + { + Char *p; + + p = (Char *) calloc((UInt)n,(UInt)s); + + return p; + } + + /***********************************************************CommentBegin****** + * + * -- erealloc -- Memory re-allocation with error handling. + * + * Purpose : + * Memory re-allocation with error handling + * + * Description : + * WARNING: There is a problem when you want to allocate more memory + * than size can handle. Malloc gets as argument an unsigned. It poses + * a problem when sizeof(unsigned) < sizeof(Char *)... + * + ***********************************************************CommentEnd********/ + + Char * + erealloc(Char *p, Int n) + { + p = (Char *) realloc(p,(UInt)n); + return p; + } + + diff -C2 -r -N bcast-2000c/quicktime/encore50/mom_util.h bcast-2000c-mf3/quicktime/encore50/mom_util.h *** bcast-2000c/quicktime/encore50/mom_util.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mom_util.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,60 ---- + + #ifndef _MOM_IMAGE_H_ + #define _MOM_IMAGE_H_ + + # ifdef __cplusplus + extern "C" { + # endif /* __cplusplus */ + + #include "momusys.h" + + Image *AllocImage(UInt size_x, UInt size_y, ImageType type); + Void FreeImage(Image *image); + Void CopyImage(Image *image_in, Image *image_out); + Void SetConstantImage(Image *image, Float val); + Void SubImage(Image *image_in1, Image *image_in2, Image *image_out); + + Vop * SallocVop (void); + Vop * AllocVop (UInt x, UInt y); + Void SfreeVop (Vop *vop); + Void FreeVop (Vop *vop); + Void CopyVopNonImageField (Vop *in, Vop *out); + + # ifdef __cplusplus + } + # endif /* __cplusplus */ + + #endif + + + #ifndef _TUH_TOOLBOX_H + #define _TUH_TOOLBOX_H + + # ifdef __cplusplus + extern "C" { + # endif /* __cplusplus */ + + #define MAX_UCHAR_VAL 255 + #define MAX_SHORT_VAL 32767 + #define MAX_FLOAT_VAL 2000000000 + + #ifndef SIGN0 + #define SIGN0(a) ( ((a)<0) ? -1 : (((a)>0) ? 1 : 0) ) + #endif + + #ifndef SIGN + #define SIGN(a) ((a)<0 ? (-1) : (1)) + #endif + + #ifndef ROUND + #define ROUND(x) ( (Int) ((x) + SIGN0(x)*0.5) ) + #endif + + #include "mom_structs.h" + + + # ifdef __cplusplus + } + # endif /* __cplusplus */ + + #endif /* ifndef _TUH_TOOLBOX_H */ diff -C2 -r -N bcast-2000c/quicktime/encore50/momusys.h bcast-2000c-mf3/quicktime/encore50/momusys.h *** bcast-2000c/quicktime/encore50/momusys.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/momusys.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,170 ---- + + /********************************/ + #ifndef _MOMUSYS_H_ /* TO AVOID REENTERING CODE */ + /********************************/ + /********************************/ + # define _MOMUSYS_H_ /* NOW IMPOSSIBLE TO REENTER */ + /********************************/ + # include "non_unix.h" + /********************************/ + # if defined(C_ANSI) || defined(__STDC__) /* IF C ANSI MODE IS SUPPORTED */ + # define C_IS_ANSI /********************************/ + # define _C_ANSI_ + # endif + + /********************************/ + # include /* SURE ALL Def. ARE DEFINED ! */ + # include /* SURE ALL Def. ARE DEFINED ! */ + # include /********************************/ + + + /********************************/ + # if defined (SYSV) || defined (__STDC__) + # include /********************************/ + # define bzero(s1, length) memset(s1, '\0', length) + # define bcopy(s1, s2, length) memcpy(s1, s2 , length) + # define bcmp(s1, s2, length) memcmp(s1, s2, length) + # define memzero(s1, length) memset(s1, '\0', length) + # define index(s1, c) strchr(s1, c) + # define rindex(s1, c) strrchr(s1, c) + # else + # include + # define strchr(s1, c) index(s1, c) + # define strrchr(s1, c) rindex(s1, c) + # define memcpy(s1, s2 , length) bcopy(s1, s2, length) + # define memzero(s1, length) bzero(s1, length) + # define memcmp(s1, s2, length) bcmp(s1, s2, length) + # endif + + + /********************************/ + # if !defined(FALSE) || ((FALSE)!= 0) /* TO AVOID MULTIPLE DEFINE */ + # define FALSE 0 /* AND BE SURE FALSE = 0 */ + # endif /********************************/ + # if !defined(TRUE) || ((TRUE) != 1) /* TO AVOID MULTIPLE DEFINE */ + # define TRUE 1 /* AND BE SURE TRUE = 1 */ + # endif /********************************/ + + # ifndef NULL + # define NULL 0 + # endif + + /**************************************/ + /**** GENERAL TYPES DEFINITIONS *******/ + /**************************************/ + #define Const const + + typedef void Void ; + + typedef char Char ; + typedef const char C_Char ; + + typedef unsigned char Byte ; + typedef Const Byte C_Byte ; + typedef unsigned char UChar ; + typedef Const UChar C_UChar ; + + typedef short int Short ; + typedef short int SInt ; + typedef unsigned short UShort ; + typedef unsigned short USInt ; + typedef Const short C_Short ; + typedef Const short C_SInt ; + typedef Const UShort C_UShort ; + typedef Const UShort C_USInt ; + + typedef int Int ; + typedef long int LInt ; + typedef Const int C_Int ; + typedef unsigned int U_Int ; + + typedef unsigned int UInt ; + typedef unsigned long int ULInt ; + typedef Const UInt C_UInt ; + + typedef float Float ; + typedef Const float C_Float ; + + typedef double Double ; + typedef Const double C_Double ; + + typedef FILE File ; + + /* Alternatibe type redefinition */ + #if 0 + typedef long INT32; + typedef int INT32; + typedef short INT16; + typedef char INT8; + typedef unsigned int UINT32; + typedef unsigned short UINT16; + typedef unsigned char UINT8; + + + # if __STDC__ + typedef signed char INT8; + # else + typedef char INT8; + # endif + + typedef unsigned long BITS32; + typedef unsigned short BITS16; + typedef unsigned char BYTE; + + typedef unsigned char BOOL; + #endif + + + /**************************************/ + /**** GENERAL MACRO DEFINITIONS *******/ + /**************************************/ + # ifndef MAX + # define MAX(a,b) (((a) > (b)) ? (a) : (b)) + # endif + + # ifndef MIN + # define MIN(a,b) (((a) < (b)) ? (a) : (b)) + # endif + + # define CLIP(a,i,s) (((a) > (s)) ? (s) : MAX(a,i)) + # define INT(a) ((Int) (floor((Double) a))) + # define MNINT(a) ((a) < 0 ? (Int)(a - 0.5) : (Int)(a + 0.5)) + # define MAX3(x,y,z) MAX(MAX(x,y),z) + # define MIN3(x,y,z) MIN(MIN(x,y),z) + # define MEDIAN(x,y,z) ((x)+(y)+(z)-MAX3(x,y,z)-MIN3(x,y,z)) + + # define POW2(a) ((a)*(a)) + # define SQUARE(a) ((a)*(a)) + # define POW3(a) ((a)*(a)*(a)) + # define CUBE(a) ((a)*(a)*(a)) + + # define ABS(x) (((x) < 0) ? -(x) : (x)) + # define SIGN(x) (((x) < 0) ? -1 : 1) + # define EVEN(a) ((a) % 2) == 0) + # define ODD(a) ((a) % 2) == 1) + + # define STRLEN(P_string) ((P_string==NULL) ? strlen(P_string) : -1) + # define TYPE_MALLOC(type,nb) ((type *) malloc(sizeof(type)*nb)) + # define NEW(type) ((type *) malloc(sizeof(type) )) + + #define MOMCHECK(a) if ((a) == 0) fprintf(stdout, "MOMCHECK failed in file %s, line %i\n", __FILE__, __LINE__) + + /********************************/ + # ifdef C_IS_ANSI /* IF C ANSI MODE IS SUPPORTED */ + /********************************/ + # define _ANSI_ARGS_(argv) argv /* MACRO FOR PROTOTYPING */ + # define _P_(argv) argv /* <=> _ANSI_ARGS, BUT SHORTER! */ + /********************************/ + # else /* IF C ANSI IS NOT SUPPORTED */ + /********************************/ + # define _ANSI_ARGS_(argv) () /* MACRO FOR PROTOTYPING */ + # define _P_(argv) () /* <=> _ANSI_ARGS, BUT SHORTER! */ + /********************************/ + # endif + + #include "mom_structs.h" + + #endif /* _MOMUSYS_H_ */ /* End _MOMUSYS_H_ */ + /********************************/ + + diff -C2 -r -N bcast-2000c/quicktime/encore50/mot_code.c bcast-2000c-mf3/quicktime/encore50/mot_code.c *** bcast-2000c/quicktime/encore50/mot_code.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mot_code.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,581 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mot_code.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions to code the motion data of the image.*/ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "vm_common_defs.h" + #include "bitstream.h" + + #include "putvlc.h" + + /* ------------------------------------------------------------------------- */ + + /* Specific macros (include references to internal vars. of the functions) */ + + /* 16x16 MV obtainment */ + #define MBV_H(h,v) (ph[2*(v)*2*hdim+2*(h)]) + #define MBV_V(h,v) (pv[2*(v)*2*hdim+2*(h)]) + + /* 8x8 MV obtainment */ + #define BV_H(h,v,h2,v2) (ph[(2*(v)+(v2))*2*hdim+2*(h)+(h2)]) + #define BV_V(h,v,h2,v2) (pv[(2*(v)+(v2))*2*hdim+2*(h)+(h2)]) + + /* MB mode obtainment */ + #define MB_MODE(h,v) ( ((h)<0||(h)>=hdim||(v)<0||(v)>=vdim ? MBM_OUT : (pm[(v)*hdim+(h)])) ) + + /* get 8x8 MV component */ + #define BV(p,xdim,h,v,h2,v2) (p[(2*(v)+(v2))*(xdim)+2*(h)+(h2)]) + + /* ------------------------------------------------------------------------- */ + + + /* declaration for functions in this file */ + Int WriteMVcomponent(Int f_code, Int dmv, Image *bs); + Void ScaleMVD (Int f_code, Int diff_vector, Int *residual, Int *vlc_code_mag); + Void find_pmvs (Image *mot_x, Image *mot_y, Image *MB_decisions, Image *B_decisions, + Int x, Int y, Int block, Int transparent_value, Int quarter_pel, Int *error_flag, + Int *mvx, Int *mvy, Int newgob); + SInt ModeMB (Image *MB_decision, Int i, Int j); + + + /***********************************************************CommentBegin****** + * + * -- Bits_CountMB_Motion -- + * + * Purpose : + * Encodes the MV's Images acording to modes and alpha Images + * (see notes below). The codewords are appended to the bitstream. + * Included in text_code.h . + * + * Return values : + * Int mv_bits Returns the number of bits sent to the bitstream + * + * Description : + * 1) No checking is made for the consistence of image sizes + * 2) It assumes the output image has been previously allocated. + * 3) Transparent MB's are not coded (no codeword is transmited). + * 4) Motion vectors for 8x8 transparent blocks within + * non-totally-transparent MB's are transmitted as MV (0,0) (not MVD + * (0,0)). This is made in the hope that this MV's are neither + * employed for block reconstruction nor for MV prediction. + * + ***********************************************************CommentEnd********/ + + Int + Bits_CountMB_Motion( + Image *mot_h, /* <-- motion vectors (Float) - per block */ + Image *mot_v, /* <-- motion vectors (Float) - per block */ + Image *alpha, /* <-- macroblocks modes (SInt) - per block */ + Image *modes, /* <-- macroblocks modes (SInt) - per MB */ + Int h, /* <-- horizontal coordinate of the MB */ + Int v, /* <-- vertical coordinate of the MB */ + Int f_code, /* <-- MV range in 1/2 or 1/4 pel units 1=32,2=64,...,7=2048 */ + /* <-- flag for quarter pel MC mode */ + Int quarter_pel, /* MW QPEL 07-JUL-1998 */ + Image *bs, /* --> output (SInt) */ + Int error_res_disable, + Int after_marker, + Int **slice_nb, + Int arbitrary_shape + ) + { + Int vdim, hdim; /* Dimensions in macroblocks */ + Float *ph, *pv; /* Motion vectors */ + SInt *pm; /* Modes */ + SInt *pa; /* Alpha */ + Int mode; + Int bits_mot = 0; + + /* From switch statement */ + Int i, error_flag=0,mvx=0,mvy=0; + Float pred_h, pred_v; + Float diff_h, diff_v; + Int bh, bv; + Int local_f_code; /* MW QPEL 07-JUL-1998 */ + Float subdim; /* MW QPEL 07-JUL-1998 */ + + vdim = (Int)modes->y; + hdim = (Int)modes->x; + ph=(Float*)GetImageData(mot_h); + pv=(Float*)GetImageData(mot_v); + pm=(SInt*)GetImageData(modes); + pa=NULL;//(SInt*)GetImageData(alpha); + + + /* MW QPEL 07-JUL-1998 >> */ + /* Set local_f_code and subdim according to quarter_pel */ + if (quarter_pel) + { + local_f_code = f_code+1; + subdim = 4.0; + } + else + { + local_f_code = f_code; + subdim = 2.0; + } + /* << MW QPEL 07-JUL-1998 */ + + switch (mode=MB_MODE(h,v)) + { + case MBM_INTRA: + break; + + case MBM_INTER16: + /* Prediction obtainment */ + find_pmvs(mot_h,mot_v,modes,alpha,h,v,0,MBM_TRANSPARENT, + /* MW QPEL 07-JUL-1998 */ + quarter_pel,&error_flag,&mvx,&mvy,0); + + pred_h=((Float)mvx)/subdim; /* MW QPEL 07-JUL-1998 */ + pred_v=((Float)mvy)/subdim; /* MW QPEL 07-JUL-1998 */ + + /* MW QPEL 07-JUL-1998 */ + bits_mot += WriteMVcomponent(local_f_code, (Int)(subdim*(MBV_H(h,v) - pred_h)), bs); + /* MW QPEL 07-JUL-1998 */ + bits_mot += WriteMVcomponent(local_f_code, (Int)(subdim*(MBV_V(h,v) - pred_v)), bs); + + break; + + case MBM_INTER8: + i=1; + for (bv=0; bv<=1; bv++) + for (bh=0; bh<=1; bh++) + { + find_pmvs(mot_h,mot_v,modes,alpha,h,v,i,MBM_TRANSPARENT, + /* MW QPEL 07-JUL-1998 */ + quarter_pel,&error_flag,&mvx,&mvy,0); + + pred_h=((Float)mvx)/subdim; /* MW QPEL 07-JUL-1998 */ + pred_v=((Float)mvy)/subdim; /* MW QPEL 07-JUL-1998 */ + + i++; + + diff_h=BV_H(h,v,bh,bv)-pred_h; + diff_v=BV_V(h,v,bh,bv)-pred_v; + + /* MW QPEL 07-JUL-1998 */ + bits_mot += WriteMVcomponent(local_f_code, (Int)(subdim*diff_h), bs); + /* MW QPEL 07-JUL-1998 */ + bits_mot += WriteMVcomponent(local_f_code, (Int)(subdim*diff_v), bs); + } + break; + } + + return bits_mot; + } + + + /***********************************************************CommentBegin****** + * + * -- WriteMVcomponent -- Encodes a single motion vector component + * + * Purpose : + * Scales the motion vector difference, VLC the most significant part, + * then outputs the residual (least significant part) as a FLC. + * + * Arguments in : + * Int f_code, Range for MV, (1/2/3) => (32/64/128) 1/2 units + * Float diff_vector, MV Diff. component (in 1/2 units (in field)) + * Image bs Bitstream output + * + * Return values : + * The number of bits for this encoding + * + * Side effects : + * The encoded motion vector is added to the bitstream + * + ***********************************************************CommentEnd********/ + + Int + WriteMVcomponent( + Int f_code, + Int dmv, + Image *bs + ) + { + Int residual, vlc_code_mag, bits, entry; + + ScaleMVD(f_code, dmv, &residual, &vlc_code_mag); + + if (vlc_code_mag < 0) + entry = vlc_code_mag + 65; + else + entry = vlc_code_mag; + + bits = PutMV (entry, bs); + + if ((f_code != 1) && (vlc_code_mag != 0)) + { + BitstreamPutBits(bs, residual, f_code-1); + bits += f_code - 1; + } + return(bits); + } + + + /***********************************************************CommentBegin****** + * + * -- ScaleMVD -- Scales MVD component acording to the MV range + * + * Purpose : + * Scales a Motion Vector Difference (MVD) component (x or y) according + * to the MV range. The maximum range that can be represented is + * determined by the f_code encoded in the VOP header. Two values, + * vlc_code_mag and residual, are generated. + * + * Description : + * 1) The range of the MV's is computed according to the f_code. + * 2) The range of the MVD component is reduced to fall in the + * correct range. + * 3) Two values are generated: + * vlc_code_mag: It will be VLC coded in other function. + * residual : It will be FLC coded in other function. + * + ***********************************************************CommentEnd********/ + + Void + ScaleMVD ( + Int f_code, /* <-- MV range in 1/2 units: 1=32,2=64,...,7=2048 */ + Int diff_vector, /* <-- MV Difference commponent in 1/2 units */ + Int *residual, /* --> value to be FLC coded */ + Int *vlc_code_mag /* --> value to be VLC coded */ + ) + { + Int range; + Int scale_factor; + Int r_size; + Int low; + Int high; + Int aux; + + r_size = f_code-1; + scale_factor = 1< high) + { + diff_vector -= 2*range; + } + + if (diff_vector==0) + { + *vlc_code_mag = 0; + *residual = 0; + } + else if (scale_factor==1) + { + *vlc_code_mag = diff_vector; + *residual = 0; + } + else + { + aux = ABS(diff_vector) + scale_factor - 1; + *vlc_code_mag = aux>>r_size; + + if (diff_vector<0) + *vlc_code_mag = -*vlc_code_mag; + + *residual = aux & (scale_factor-1); + } + } + + + /***********************************************************CommentBegin****** + * + * -- find_pmvs -- + * + * Purpose : + * Makes the motion vectors prediction for block 'block' (0 = whole MB) + * + ***********************************************************CommentEnd********/ + + Void /* MVP/Noel */ + find_pmvs( + Image *mot_x, /* x-motion vector field */ + Image *mot_y, /* y-motion vector field */ + Image *MB_decisions, /* MB modes */ + Image *B_decisions, /* field with number of vectors per MB */ + Int x, /* xpos of the MB in multiples of 16 (hor coord) */ + Int y, /* ypos of the MB in multiples of 16 (ver coord) */ + Int block, /* block number (0 if one vector per MB, 1..4 else) */ + Int transparent_value, /* value of the transparency (0=enc, 2=dec) */ + Int quarter_pel, /* MW QPEL 06-JUL-1998 */ /* flag to indicate quarter pel mc */ + Int *error_flag, /* set if an error occured */ + Int *mvx, /* hor predicted motion vector [ in half-pixels units ] */ + Int *mvy, /* ver predicted motion vector [ in half-pixels units ] */ + Int newgob + ) + { + Float p1x,p2x,p3x; + Float p1y,p2y,p3y; + Int xin1, xin2, xin3; + Int yin1, yin2, yin3; + Int vec1, vec2, vec3; + Int rule1, rule2, rule3; + Int subdim; /* MW QPEL 06-JUL-1998 */ + Float *motxdata = (Float *) GetImageData(mot_x); + Float *motydata = (Float *) GetImageData(mot_y); + Int xM = GetImageSizeX(mot_x); + Int xB = xM; + Int mb_mode, sum; + + /* MW QPEL 06-JUL-1998 >> */ + if (quarter_pel) + { + subdim=4; + } + else + { + subdim=2; + } + /* << MW QPEL 06-JUL-1998 */ + + /* In a previous version, a MB vector (block = 0) was predicted the same way + as block 1, which is the most likely interpretation of the VM. + + Therefore, if we have advanced pred. mode, and if all MBs around have + only one 16x16 vector each, we chose the appropiate block as if these + MBs have 4 vectors. + + This different prediction affects only 16x16 vectors of MBs with + transparent blocks. + + In the current version, we choose for the 16x16 mode the first + non-transparent block in the surrounding MBs + */ + + switch (block) + { + case 0: + vec1 = 1 ; yin1 = y ; xin1 = x-1; + vec2 = 2 ; yin2 = y-1; xin2 = x; + vec3 = 2 ; yin3 = y-1; xin3 = x+1; + break; + case 1: + vec1 = 1 ; yin1 = y ; xin1 = x-1; + vec2 = 2 ; yin2 = y-1; xin2 = x; + vec3 = 2 ; yin3 = y-1; xin3 = x+1; + break; + case 2: + vec1 = 0 ; yin1 = y ; xin1 = x; + vec2 = 3 ; yin2 = y-1; xin2 = x; + vec3 = 2 ; yin3 = y-1; xin3 = x+1; + break; + case 3: + vec1 = 3 ; yin1 = y ; xin1 = x-1; + vec2 = 0 ; yin2 = y ; xin2 = x; + vec3 = 1 ; yin3 = y ; xin3 = x; + break; + case 4: + vec1 = 2 ; yin1 = y ; xin1 = x; + vec2 = 0 ; yin2 = y ; xin2 = x; + vec3 = 1 ; yin3 = y ; xin3 = x; + break; + default: + printf("Illegal block number in find_pmv (mot_decode.c)"); + *error_flag = 1; + *mvx=*mvy=0; + return ; + } + + if (block==0) + { + /* according to the motion encoding, we must choose a first non-transparent + block in the surrounding MBs (16-mode) + */ + + if (x>0 /*&& ValidCandidateMVP(x,y,xin1,yin1,vec1,xB,transparent_value, + MB_decisions,dcsn_data)*/) + rule1 = 0; + else + rule1 = 1; + + if ((y>0 && newgob==0) /*&& ValidCandidateMVP(x,y,xin2,yin2,vec2,xB,transparent_value, + MB_decisions,dcsn_data)*/) + rule2 = 0; + else + rule2 = 1; + + if ((x != xB/2 -1) && + ((y>0 && newgob==0)) /*&& ValidCandidateMVP(x,y,xin3,yin3,vec3,xB,transparent_value, + MB_decisions,dcsn_data)*/) + rule3 = 0; + else + rule3 = 1; + } + + else + { + /* check borders for single blocks (advanced mode) */ + /* rule 1 */ + /* left border */ + if (((block == 1 || block == 3) && (x == 0)) /*|| + /* left block/MB is transparent * + (!ValidCandidateMVP(x,y,xin1,yin1,vec1,xB,transparent_value, + MB_decisions,dcsn_data))*/) + rule1 = 1; + else + rule1 = 0; + + /* rule 2 */ + /* top border */ + if (((block == 1 || block == 2) && (y == 0)) /*|| + /* top block/MB is transparent * + (!ValidCandidateMVP(x,y,xin2,yin2,vec2,xB,transparent_value, + MB_decisions,dcsn_data))*/) + rule2 = 1; + else + rule2 = 0; + + /* rule 3 */ + if (((block == 1 || block == 2) && (x == xB/2 -1 || y == 0)) /*|| + /* right & top border * + /* right block/MB is transparent * + (!ValidCandidateMVP(x,y,xin3,yin3,vec3,xB,transparent_value, + MB_decisions,dcsn_data))*/) + rule3 = 1; + else + rule3 = 0; + + } + + if (rule1 ) + { + p1x = p1y = 0; + } + else if (((mb_mode = ModeMB(MB_decisions,xin1,yin1)) >= MBM_FIELD00) && (mb_mode <= MBM_FIELD11)) + { + /* MW QPEL 06-JUL-1998 */ + sum = subdim*(BV(motxdata, xM, xin1, yin1, 0, 0) + BV(motxdata, xM, xin1, yin1, 1, 0)); + p1x = (Float)((sum & 3) ? ((sum | 2) >> 1) : (sum >> 1))/(Float)subdim; + sum = subdim*(BV(motydata, xM, xin1, yin1, 0, 0) + BV(motydata, xM, xin1, yin1, 1, 0)); + p1y = (Float)((sum & 3) ? ((sum | 2) >> 1) : (sum >> 1))/(Float)subdim; + } + else + { + p1x = BV(motxdata, xM, xin1, yin1, vec1&0x1, vec1>>1 ); + p1y = BV(motydata, xM, xin1, yin1, vec1&0x1, vec1>>1 ); + } + + if (rule2) + { + p2x = p2y = 0 ; + } + else if (((mb_mode = ModeMB(MB_decisions,xin2,yin2)) >= MBM_FIELD00) && (mb_mode <= MBM_FIELD11)) + { + /* MW QPEL 06-JUL-1998 */ + sum = subdim*(BV(motxdata, xM, xin2, yin2, 0, 0) + BV(motxdata, xM, xin2, yin2, 1, 0)); + p2x = (Float)((sum & 3) ? ((sum | 2) >> 1) : (sum >> 1))/(Float)subdim; + sum = subdim*(BV(motydata, xM, xin2, yin2, 0, 0) + BV(motydata, xM, xin2, yin2, 1, 0)); + p2y = (Float)((sum & 3) ? ((sum | 2) >> 1) : (sum >> 1))/(Float)subdim; + } + else + { + p2x = BV(motxdata, xM, xin2, yin2, vec2&0x1, vec2>>1 ); + p2y = BV(motydata, xM, xin2, yin2, vec2&0x1, vec2>>1 ); + } + + if (rule3 ) + { + p3x = p3y =0; + } + else if (((mb_mode = ModeMB(MB_decisions,xin3,yin3)) >= MBM_FIELD00) && (mb_mode <= MBM_FIELD11)) + { + /* MW QPEL 06-JUL-1998 */ + sum = subdim*(BV(motxdata, xM, xin3, yin3, 0, 0) + BV(motxdata, xM, xin3, yin3, 1, 0)); + p3x = (Float)((sum & 3) ? ((sum | 2) >> 1) : (sum >> 1))/(Float)subdim; + sum = subdim*(BV(motydata, xM, xin3, yin3, 0, 0) + BV(motydata, xM, xin3, yin3, 1, 0)); + p3y = (Float)((sum & 3) ? ((sum | 2) >> 1) : (sum >> 1))/(Float)subdim; + } + else + { + p3x = BV(motxdata, xM, xin3, yin3, vec3&0x1, vec3>>1 ); + p3y = BV(motydata, xM, xin3, yin3, vec3&0x1, vec3>>1 ); + } + + if (rule1 && rule2 && rule3 ) + { + /* all MBs are outside the VOP */ + *mvx=*mvy=0; + } + else if (rule1+rule2+rule3 == 2) + { + /* two of three are zero */ + /* MW QPEL 06-JUL-1998 */ + *mvx=(Int) subdim*(p1x+p2x+p3x); /* MW QPEL 06-JUL-1998 */ + *mvy=(Int) subdim*(p1y+p2y+p3y); /* MW QPEL 06-JUL-1998 */ + } + else + { + /* MW QPEL 06-JUL-1998 */ + /* MW QPEL 06-JUL-1998 */ + *mvx=(Int)(subdim*(p1x+p2x+p3x-MAX(p1x,MAX(p2x,p3x))-MIN(p1x,MIN(p2x,p3x)))); + /* MW QPEL 06-JUL-1998 */ + *mvy=(Int)(subdim*(p1y+p2y+p3y-MAX(p1y,MAX(p2y,p3y))-MIN(p1y,MIN(p2y,p3y)))); + } + + #ifdef _DEBUG_PMVS_ + fprintf(stdout,"find_pmvs (%2d,%2d, rule %1d%1d%1d) :\np1 %6.2f / %6.2f\np2 %6.2f / %6.2f\np3 %6.2f / %6.2f\n",x,y,rule1,rule2,rule3,p1x,p1y,p2x,p2y,p3x,p3y); + #endif + + return; + } + + + /***********************************************************CommentBegin****** + * + * -- ModeMB -- Get the MB mode + * + * Purpose : + * Get the MB mode + * + ***********************************************************CommentEnd********/ + + SInt ModeMB (Image *MB_decision, Int i, Int j) + { + Int width = MB_decision->x; + SInt *p = (SInt *)GetImageData(MB_decision); + + return p[width*j+i]; + } + diff -C2 -r -N bcast-2000c/quicktime/encore50/mot_code.h bcast-2000c-mf3/quicktime/encore50/mot_code.h *** bcast-2000c/quicktime/encore50/mot_code.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mot_code.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,34 ---- + + + /* mot_code.h */ + + #ifndef _MOT_CODE_H_ + #define _MOT_CODE_H_ + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + Int Bits_CountMB_Motion _P_(( Image *mot_h, + Image *mot_v, + Image *alpha, + Image *modes, + Int h, + Int v, + Int f_code, + Int quarter_pel, + Image *bs, + Int error_res_disable, + Int after_marker, + Int **slice_nb, + Int arbitrary_shape + )); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _MOT_CODE_H_ */ + + + diff -C2 -r -N bcast-2000c/quicktime/encore50/mot_est_comp.c bcast-2000c-mf3/quicktime/encore50/mot_est_comp.c *** bcast-2000c/quicktime/encore50/mot_est_comp.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mot_est_comp.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,642 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mot_est_comp.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions to do motion estimation and */ + /* for the current image in one pass. */ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "vm_common_defs.h" + #include "mom_util.h" + #include "mot_util.h" + #include "mot_est_mb.h" + + extern FILE *ftrace; + + /* For correct rounding of chrominance vectors */ + static Int roundtab16[] = {0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,2}; + + Void MotionEstCompPicture ( + SInt *curr, + SInt *prev, + SInt *prev_ipol_y, + SInt *prev_ipol_u, + SInt *prev_ipol_v, + Int prev_x, + Int prev_y, + Int vop_width, + Int vop_height, + Int enable_8x8_mv, + Int edge, + Int sr_for, + Int f_code, + Int rounding_type, + Int br_x, + Int br_y, + Int br_width, + Int br_height, + SInt *curr_comp_y, + SInt *curr_comp_u, + SInt *curr_comp_v, + Float *mad, + Float *mv16_w, + Float *mv16_h, + Float *mv8_w, + Float *mv8_h, + SInt *mode16 + ); + Void GetPred_Chroma ( + Int x_curr, + Int y_curr, + Int dx, + Int dy, + SInt *prev_u, + SInt *prev_v, + SInt *comp_u, + SInt *comp_v, + Int width, + Int width_prev, + Int prev_x_min, + Int prev_y_min, + Int prev_x_max, + Int prev_y_max, + Int rounding_control + ); + + /***********************************************************CommentBegin****** + * + * -- MotionEstimationCompensation -- Estimates the motion vectors and + * do motion compensation + * + * Purpose : + * Estimates the motion vectors in advanced/not_advanced unrestricted + * mode. The output are four images containing x/y components of + * MV's (one per 8x8 block), modes (one value per MB). The motion + * compensation is also performed. + * + * Description : + * 1) memory is allocated for these images. + * 2) mot_x/mot_y have 4 identical vector for a MB coded inter 16 + * 3) mot_x/mot_y have 4 identical zero vectors for a MB coded intra + * 4) if _NO_ESTIMATION_ is used, the output is the following: + * - mot_x : all MV's are 0.0 + * - mot_y : all MV's are 0.0 + * - mode : all modes are MB_INTRA (IGNORING THE SHAPE) + * + * Based on: CodeOneOrTwo (TMN5, coder.c) + * + ***********************************************************CommentEnd********/ + + Void + MotionEstimationCompensation ( + Vop *curr_vop, /* <-- current Vop (for luminance) */ + Vop *prev_rec_vop, /* <-- reference Vop (reconstructed)(1/2 pixel) */ + Int enable_8x8_mv, /* <-- 8x8 MV (=1) or only 16x16 MV (=0) */ + Int edge, /* <-- restricted(==0)/unrestricted(==edge) mode */ + Int f_code, /* <-- MV search range 1/2 pel: 1=32,2=64,...,7=2048*/ + Vop *curr_comp_vop, /* <-> motion compensated current VOP */ + Float *mad, /* <-> mad value of the ME/MC result */ + Image **mot_x, /* --> horizontal MV coordinates */ + Image **mot_y, /* --> vertical MV coordinates */ + Image **mode /* --> modes for each MB */ + ) + { + Image *pr_rec_y; /* Reference image (reconstructed) */ + Image *pi_y; /* Interp.ref.image Y */ + + Image *mode16; + Image *mv16_w; + Image *mv16_h; + Image *mv8_w; + Image *mv8_h; + + SInt *prev_ipol_y, /* Interp.ref.image Y (subimage) */ + *prev_orig_y; /* Ref. original image with edge (subimage) */ + + Int vop_width, vop_height; + + Int br_x; + Int br_y; + Int br_height; + Int br_width; + Int mv_h, mv_w; + + /*GETBBR*/ + br_y=curr_vop->ver_spat_ref; + br_x=curr_vop->hor_spat_ref; + br_height=curr_vop->height; + br_width=curr_vop->width; + mv_h=br_height/MB_SIZE; + mv_w=br_width/MB_SIZE; + + /* + ** WE SUPPOSE prev_rec_vop & prev_vop HAVE EQUAL SIZE AND POSITIONS + */ + + vop_width=prev_rec_vop->width; + vop_height=prev_rec_vop->height; + + /* + ** Get images and interpolate them + */ + + pr_rec_y = prev_rec_vop->y_chan; + prev_orig_y = (SInt*)GetImageData(pr_rec_y); + pi_y = AllocImage (2*vop_width, 2*vop_height, SHORT_TYPE); + InterpolateImage(pr_rec_y, pi_y, GetVopRoundingType(curr_vop)); + prev_ipol_y = (SInt*)GetImageData(pi_y); + + /* + * allocate memory for mv's and modes data + * + */ + + mode16=AllocImage (mv_w,mv_h,SHORT_TYPE); + SetConstantImage (mode16,(Float)MBM_INTRA); + + /* + ** mv16 have 2x2 repeted the mv value to share the functions of + ** mv prediction between CodeVopVotion and MotionEstimation + */ + + mv16_w=AllocImage (mv_w*2,mv_h*2,FLOAT_TYPE); + mv16_h=AllocImage (mv_w*2,mv_h*2,FLOAT_TYPE); + mv8_w =AllocImage (mv_w*2,mv_h*2,FLOAT_TYPE); + mv8_h =AllocImage (mv_w*2,mv_h*2,FLOAT_TYPE); + SetConstantImage (mv16_h,+0.0); + SetConstantImage (mv16_w,+0.0); + SetConstantImage (mv8_h,+0.0); + SetConstantImage (mv8_w,+0.0); + + SetConstantImage (curr_comp_vop->u_chan, 0); + SetConstantImage (curr_comp_vop->v_chan, 0); + + /* Compute motion vectors and modes for each MB + ** (TMN5 functions) + */ + + MotionEstCompPicture( + (SInt *)GetImageData(GetVopY(curr_vop)), //curr_vop, + prev_orig_y, /* Y padd with edge */ + prev_ipol_y, /* Y interpolated (from pi_y) */ + (SInt*)GetImageData(prev_rec_vop->u_chan) + (vop_width/2) * (16/2) + (16/2), + (SInt*)GetImageData(prev_rec_vop->v_chan) + (vop_width/2) * (16/2) + (16/2), + prev_rec_vop->hor_spat_ref, + prev_rec_vop->ver_spat_ref, + vop_width,vop_height, + enable_8x8_mv, + edge, + GetVopSearchRangeFor(curr_vop), + f_code, + GetVopRoundingType(curr_vop), + br_x,br_y, /* pos. of the bounding rectangle */ + br_width,br_height, /* dims. of the bounding rectangle */ + (SInt*)GetImageData(curr_comp_vop->y_chan), + (SInt*)GetImageData(curr_comp_vop->u_chan), + (SInt*)GetImageData(curr_comp_vop->v_chan), + mad, + (Float*)GetImageData(mv16_w), + (Float*)GetImageData(mv16_h), + (Float*)GetImageData(mv8_w), + (Float*)GetImageData(mv8_h), + (SInt*) GetImageData(mode16) + ); + + /* Convert output to MOMUSYS format */ + GetMotionImages(mv16_w, mv16_h, mv8_w, mv8_h, mode16, mot_x, mot_y, mode); + + /* Deallocate dynamic memory */ + FreeImage(mv16_w); FreeImage(mv16_h); + FreeImage(mv8_w); FreeImage(mv8_h); + FreeImage(mode16); + FreeImage(pi_y); + } + + /***********************************************************CommentBegin****** + * + * -- MotionEstCompPicture -- Computes MV's and predictor errors and + * do motion compensation + * + * Purpose : + * Computes MV's (8x8 and 16x16) and predictor errors for the whole + * vop. Perform motion compensation for the whole vop. + * + ***********************************************************CommentEnd********/ + + Void + MotionEstCompPicture( + SInt *curr, /* <-- Current VOP */ + SInt *prev, /* <-- Original Y padd with edge */ + SInt *prev_ipol, /* <-- Y interpolated (from pi_y) */ + SInt *prev_u, /* <-- Original U padd with edge */ + SInt *prev_v, /* <-- Original V padd with edge */ + Int prev_x, /* <-- absolute horiz. position of previous vop */ + Int prev_y, /* <-- absolute verti. position of previous vop */ + Int vop_width, /* <-- horizontal previous vop dimension */ + Int vop_height, /* <-- vertical previous vop dimension */ + Int enable_8x8_mv, /* <-- 8x8 MV (=1) or only 16x16 MV (=0) */ + Int edge, /* <-- edge arround the reference vop */ + Int sr_for, /* <-- forward search range */ + Int f_code, /* MW QPEL 07-JUL-1998 *//* <-- MV search range 1/2 or 1/4 pel: 1=32,2=64,...,7=2048*/ + Int rounding_type, /* <-- The rounding type of the current vop */ + Int br_x, /* <-- absolute horiz. position of the current vop */ + Int br_y, /* <-- absolute verti. position of the current vop */ + Int br_width, /* <-- current bounding rectangule width */ + Int br_height, /* <-- current bounding rectangle height */ + SInt *curr_comp_y, /* <-> motion compensated current Y */ + SInt *curr_comp_u, /* <-> motion compensated current U */ + SInt *curr_comp_v, /* <-> motion compensated current V */ + Float *mad, /* <-> the mad value of current ME/MC result */ + Float *mv16_w, /* --> predicted horizontal 16x16 MV(if approp.) */ + Float *mv16_h, /* --> predicted vertical 16x16 MV (if approp.) */ + Float *mv8_w, /* --> predicted horizontal 8x8 MV (if approp.) */ + Float *mv8_h, /* --> predicted vertical 8x8 MV (if approp.) */ + SInt *mode16 /* --> mode of the preditect motion vector */ + ) + { + Int i, j, k; + SInt curr_mb[MB_SIZE][MB_SIZE]; + SInt curr_comp_mb_16[MB_SIZE][MB_SIZE]; + SInt curr_comp_mb_8[MB_SIZE][MB_SIZE]; + Int sad8 = MV_MAX_ERROR, sad16, sad; + Int imas_w, imas_h, Mode; + Int posmode, pos16, pos8; + Int min_error16, + min_error8_0, min_error8_1, min_error8_2, min_error8_3; + // SInt *curr = (SInt *)GetImageData(GetVopY(curr_vop)); + /*************************************************************************** + array of flags, which contains for the MB and for each one of the 4 Blocks + the following info sequentially: + xm, 1 if the lower search (x axis) is completed (no 1/2 search can be done) + 0, do 1/2 search in the lower bound (x axis) + xM, 1 if the upper search (x axis) is completed (no 1/2 search can be done) + 0, do 1/2 search in the upper bound (x axis) + ym, 1 if the lower search (y axis) is completed (no 1/2 search can be done) + 0, do 1/2 search in the lower bound (y axis) + yM, 1 if the upper search (y axis) is completed (no 1/2 search can be done) + 0, do 1/2 search in the upper bound (y axis) + ***************************************************************************/ + SInt *halfpelflags; + Float hint_mv_w, hint_mv_h; + Int xsum,ysum,dx,dy; + Int prev_x_min,prev_x_max,prev_y_min,prev_y_max; + + prev_x_min = 2 * prev_x + 2 * 16; + prev_y_min = 2 * prev_y + 2 * 16; + prev_x_max = prev_x_min + 2 * vop_width - 4 * 16; + prev_y_max = prev_y_min + 2 * vop_height - 4 * 16; + + imas_w=br_width/MB_SIZE; + imas_h=br_height/MB_SIZE; + + /* Do motion estimation and store result in array */ + + halfpelflags=(SInt*)malloc(5*4*sizeof(SInt)); + /* halfpelflags=(SInt*)malloc(9*4*sizeof(SInt)); */ + sad = 0; + + for ( j=0; j< (br_height/MB_SIZE); j++) + { + hint_mv_w = hint_mv_h = 0.f; + for ( i=0; i< (br_width/MB_SIZE); i++) + { + /* Integer pel search */ + Int min_error; + + posmode = j * imas_w + i; + pos16 = pos8 = 2*j*2*imas_w + 2*i; + + MBMotionEstimation(curr, + prev, br_x, br_y, + br_width, i, j, prev_x, prev_y, + vop_width, vop_height, enable_8x8_mv, edge, + f_code, sr_for, + hint_mv_w, hint_mv_h, // the hint seeds + mv16_w, mv16_h, + mv8_w, mv8_h, &min_error, halfpelflags); + + /* Inter/Intra decision */ + Mode = ChooseMode(curr, + i*MB_SIZE,j*MB_SIZE, min_error, br_width); + + hint_mv_w = mv16_w[pos16]; + hint_mv_h = mv16_h[pos16]; + + LoadArea(curr, i*MB_SIZE, j*MB_SIZE, 16, 16, br_width, (SInt *)curr_mb); + + /* 0==MBM_INTRA,1==MBM_INTER16||MBM_INTER8 */ + if ( Mode != 0) + { + FindSubPel (i*MB_SIZE,j*MB_SIZE, prev_ipol, + &curr_mb[0][0], 16, 16 , 0, + br_x-prev_x,br_y-prev_y,vop_width, vop_height, + edge, halfpelflags, &curr_comp_mb_16[0][0], + &mv16_w[pos16], &mv16_h[pos16], &min_error16); + + /* sad16(0,0) already decreased by Nb/2+1 in FindHalfPel() */ + sad16 = min_error16; + mode16[posmode] = MBM_INTER16; + + if (enable_8x8_mv) + { + xsum = 0; ysum = 0; + + FindSubPel(i*MB_SIZE, j*MB_SIZE, prev_ipol, + &curr_mb[0][0], 8, 8 , 0, + br_x-prev_x,br_y-prev_y, vop_width, vop_height, + edge, halfpelflags, &curr_comp_mb_8[0][0], + &mv8_w[pos8], &mv8_h[pos8], &min_error8_0); + xsum += (Int)(2*(mv8_w[pos8])); + ysum += (Int)(2*(mv8_h[pos8])); + + FindSubPel(i*MB_SIZE, j*MB_SIZE, prev_ipol, + &curr_mb[0][8], 8, 8 , 1, + br_x-prev_x,br_y-prev_y, vop_width,vop_height, + edge, halfpelflags, &curr_comp_mb_8[0][8], + &mv8_w[pos8+1], &mv8_h[pos8+1], &min_error8_1); + xsum += (Int)(2*(mv8_w[pos8+1])); + ysum += (Int)(2*(mv8_h[pos8+1])); + + pos8+=2*imas_w; + + FindSubPel(i*MB_SIZE, j*MB_SIZE, prev_ipol, + &curr_mb[8][0], 8, 8 , 2, + br_x-prev_x,br_y-prev_y, vop_width,vop_height, + edge, halfpelflags, &curr_comp_mb_8[8][0], + &mv8_w[pos8], &mv8_h[pos8], &min_error8_2); + xsum += (Int)(2*(mv8_w[pos8])); + ysum += (Int)(2*(mv8_h[pos8])); + + FindSubPel(i*MB_SIZE, j*MB_SIZE, prev_ipol, + &curr_mb[8][8], 8, 8 , 3, + br_x-prev_x,br_y-prev_y, vop_width,vop_height, + edge, halfpelflags, &curr_comp_mb_8[8][8], + &mv8_w[pos8+1], &mv8_h[pos8+1], &min_error8_3); + xsum += (Int)(2*(mv8_w[pos8+1])); + ysum += (Int)(2*(mv8_h[pos8+1])); + + sad8 = min_error8_0+min_error8_1+min_error8_2+min_error8_3; + + /* Choose 8x8 or 16x16 vectors */ + if (sad8 < (sad16 -(128+1))) + mode16[posmode] = MBM_INTER8; + } /* end of enable_8x8_mv mode */ + + /* When choose 16x16 vectors */ + /* sad16(0,0) was decreased by MB_Nb, now add it back */ + if ((mv16_w[pos16]==0.0) && (mv16_h[pos16]==0.0) && (mode16[posmode]==MBM_INTER16)) + sad16 += 128+1; + + /* calculate motion vectors for chroma compensation */ + if(mode16[posmode] == MBM_INTER8) + { + dx = SIGN (xsum) * (roundtab16[ABS (xsum) % 16] + (ABS (xsum) / 16) * 2); + dy = SIGN (ysum) * (roundtab16[ABS (ysum) % 16] + (ABS (ysum) / 16) * 2); + sad += sad8; + } + else /* mode == MBM_INTER16 */ + { + dx = (Int)(2 * mv16_w[pos16]); + dy = (Int)(2 * mv16_h[pos16]); + dx = ( dx % 4 == 0 ? dx >> 1 : (dx>>1)|1 ); + dy = ( dy % 4 == 0 ? dy >> 1 : (dy>>1)|1 ); + sad += sad16; + } + + GetPred_Chroma (i*MB_SIZE, j*MB_SIZE, dx, dy, + prev_u, prev_v, curr_comp_u, curr_comp_v, + br_width, vop_width, + prev_x_min/4,prev_y_min/4,prev_x_max/4,prev_y_max/4, rounding_type); + + } /* end of mode non zero */ + else /* mode = 0 INTRA */ + { + mode16[posmode] = MBM_INTRA; + for (k = 0; k < MB_SIZE*MB_SIZE; k++) + { + // for INTRA MB, set compensated 0 to generate correct error image + curr_comp_mb_16[k/MB_SIZE][k%MB_SIZE] = 0; + // for INTRA_MB, SAD is recalculated from image instead of using min_error + sad += curr_mb[k/MB_SIZE][k%MB_SIZE]; + } + } + + if (mode16[posmode] == MBM_INTER8) + SetArea((SInt*)curr_comp_mb_8, i*MB_SIZE, j*MB_SIZE, 16, 16, br_width, curr_comp_y); + else + SetArea((SInt*)curr_comp_mb_16, i*MB_SIZE, j*MB_SIZE, 16, 16, br_width, curr_comp_y); + } /* end of i loop */ + } /* end of j loop */ + + *mad = (float)sad/(br_width*br_height); + + free((Char*)halfpelflags); + return; + } + + + /***********************************************************CommentBegin****** + * + * unrestricted_MC_chro + * + * Purpose : + * To make unrestricted MC + * + ***********************************************************CommentEnd********/ + /*Int unrestricted_MC_chro(Int x,Int y, Int npix, + Int prev_x_min,Int prev_y_min, + Int prev_x_max, Int prev_y_max) + { + + if (x < prev_x_min) x = prev_x_min; + else if (x >=prev_x_max) x = prev_x_max-1; + + if (y < prev_y_min) y = prev_y_min; + else if (y >=prev_y_max) y = prev_y_max-1; + return(x+y*npix); + }*/ + + #define unrestricted_MC_chro(x,y,npix,prev_x_min,prev_y_min,prev_x_max,prev_y_max) ((x)+(y)*(npix)) + + + /***********************************************************CommentBegin****** + * + * -- GetPred_Chroma -- Predicts chrominance macroblock + * + * Purpose : + * Does the chrominance prediction for P-frames + * + * Arguments in : + * current position in image, + * motionvectors, + * pointers to compensated and previous Vops, + * width of the compensated Vop + * width of the previous/reference Vop + * + ***********************************************************CommentEnd********/ + + Void GetPred_Chroma ( + Int x_curr, + Int y_curr, + Int dx, + Int dy, + SInt *prev_u, + SInt *prev_v, + SInt *comp_u, + SInt *comp_v, + Int width, + Int width_prev, + Int prev_x_min, + Int prev_y_min, + Int prev_x_max, + Int prev_y_max, + Int rounding_control) + { + Int m,n; + + Int x, y, ofx, ofy, lx; + Int xint, yint; + Int xh, yh; + Int index1,index2,index3,index4; + + lx = width_prev/2; + + x = x_curr>>1; + y = y_curr>>1; + + xint = dx>>1; + xh = dx & 1; + yint = dy>>1; + yh = dy & 1; + + if (!xh && !yh) + { + for (n = 0; n < 8; n++) + { + for (m = 0; m < 8; m++) + { + ofx = x + xint + m; + ofy = y + yint + n; + index1 = unrestricted_MC_chro(ofx,ofy,lx,prev_x_min, + prev_y_min,prev_x_max,prev_y_max); + comp_u[(y+n)*width/2+x+m] + = *(prev_u+index1); + comp_v[(y+n)*width/2+x+m] + = *(prev_v+index1); + } + } + } + else if (!xh && yh) + { + for (n = 0; n < 8; n++) + { + for (m = 0; m < 8; m++) + { + ofx = x + xint + m; + ofy = y + yint + n; + index1 = unrestricted_MC_chro(ofx,ofy,lx,prev_x_min, + prev_y_min,prev_x_max,prev_y_max); + index2 = unrestricted_MC_chro(ofx,ofy+yh,lx,prev_x_min, + prev_y_min,prev_x_max,prev_y_max); + + comp_u[(y+n)*width/2+x+m] + = (*(prev_u+index1) + + *(prev_u+index2) + 1- rounding_control)>>1; + + comp_v[(y+n)*width/2+x+m] + = (*(prev_v+index1) + + *(prev_v+index2) + 1- rounding_control)>>1; + } + } + } + else if (xh && !yh) + { + for (n = 0; n < 8; n++) + { + for (m = 0; m < 8; m++) + { + ofx = x + xint + m; + ofy = y + yint + n; + index1 = unrestricted_MC_chro(ofx,ofy,lx,prev_x_min, + prev_y_min,prev_x_max,prev_y_max); + index2 = unrestricted_MC_chro(ofx+xh,ofy,lx,prev_x_min, + prev_y_min,prev_x_max,prev_y_max); + + comp_u[(y+n)*width/2+x+m] + = (*(prev_u+index1) + + *(prev_u+index2) + 1- rounding_control)>>1; + + comp_v[(y+n)*width/2+x+m] + = (*(prev_v+index1) + + *(prev_v+index2) + 1- rounding_control)>>1; + } + } + } + else + { /* xh && yh */ + for (n = 0; n < 8; n++) + { + for (m = 0; m < 8; m++) + { + ofx = x + xint + m; + ofy = y + yint + n; + index1 = unrestricted_MC_chro(ofx,ofy,lx,prev_x_min, + prev_y_min,prev_x_max,prev_y_max); + index2 = unrestricted_MC_chro(ofx+xh,ofy,lx,prev_x_min, + prev_y_min,prev_x_max,prev_y_max); + index3 = unrestricted_MC_chro(ofx,ofy+yh,lx,prev_x_min, + prev_y_min,prev_x_max,prev_y_max); + index4 = unrestricted_MC_chro(ofx+xh,ofy+yh,lx,prev_x_min, + prev_y_min,prev_x_max,prev_y_max); + + comp_u[(y+n)*width/2+x+m] + = (*(prev_u+index1)+ + *(prev_u+index2)+ + *(prev_u+index3)+ + *(prev_u+index4)+ + 2- rounding_control)>>2; + + comp_v[(y+n)*width/2+x+m] + = (*(prev_v+index1)+ + *(prev_v+index2)+ + *(prev_v+index3)+ + *(prev_v+index4)+ + 2- rounding_control)>>2; + } + } + } + return; + } + diff -C2 -r -N bcast-2000c/quicktime/encore50/mot_est_comp.h bcast-2000c-mf3/quicktime/encore50/mot_est_comp.h *** bcast-2000c/quicktime/encore50/mot_est_comp.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mot_est_comp.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,28 ---- + + #ifndef _MOT_EST_H_ + #define _MOT_EST_H_ + + #include "vm_common_defs.h" + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + Void MotionEstimationCompensation _P_(( Vop *curr_vop, + Vop *prev_rec_vop, + Int enable_8x8_mv, + Int edge, + Int f_code, + Vop *curr_comp_vop, + Float *mad, + Image **mot_x, + Image **mot_y, + Image **mode + )); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _MOT_EST_H_ */ + diff -C2 -r -N bcast-2000c/quicktime/encore50/mot_est_mb.c bcast-2000c-mf3/quicktime/encore50/mot_est_mb.c *** bcast-2000c/quicktime/encore50/mot_est_mb.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mot_est_mb.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,845 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mot_est_mb.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions to do motion estimation and */ + /* for one MacroBlock in one pass. */ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "mot_util.h" + + /* Obtaining if two floating point values are equal*/ + #define ABSDOUBLE(x) (((x) > 0.0001) ? (x) : (((x) < -0.0001) ? -(x): 0.0 )) + #define ARE_EQUAL(x,y) ( (ABSDOUBLE((Float)(x)-(y))>0.1)?(0):(1) ) + + /* auxiliar define for indexing in MBMotionEstimation */ + #define INDEX_BIG(x,y) ((x)+(y)*(vop_width)) + #define INDEX_NOR(x,y) ((x)+(y)*(MB_SIZE)) + + /* ------------------------------------------------------------------------- */ + + /***********************************************************CommentBegin****** + * + * -- RangeInSearchArea -- computes the range of the search area + * + * Purpose : + * computes the range of the search area for the predicted MV's + * INSIDE the overlapped zone between reference and current vops + * + ***********************************************************CommentEnd********/ + + static Void + RangeInSearchArea( + Int i, /* <-- horizontal MBcoordinate in pixels */ + Int j, /* <-- vertical MB coordinate in pixels */ + Int block, /* <-- block position (0 16x16; 1-2-3-4 8x8) */ + Int prev_x, /* <-- absolute horizontal position of the previous vop*/ + Int prev_y, /* <-- absolute vertical position of the previous vop */ + Int vop_width, /* <-- horizontal vop dimension */ + Int vop_height, /* <-- vertical vop dimension */ + Int br_x, /* <-- absolute horizontal position of the current vop */ + Int br_y, /* <-- absolute vertical position of the current vop */ + Int edge, /* <-- edge arround the reference vop */ + Int f_code, /* <- MV search range 1/2 (or 1/4) pel: (0=16,) 1=32,2=64,...,7=2048 */ + Float *mv_x_min, /* <-- min horizontal range */ + Float *mv_x_max, /* <-- max horizontal range */ + Float *mv_y_min, /* <-- min vertical range */ + Float *mv_y_max, /* <-- max vertical range */ + Int *out /* --> the search area does not exist (the reference */ /* and current BB does not overlap) */ + ) + { + Int dim_curr_x_max, + dim_curr_y_max, + dim_curr_x_min, + dim_curr_y_min; + Int dim_prev_x_max, + dim_prev_y_max, + dim_prev_x_min, + dim_prev_y_min; + Int mb_b_size, + block_x, + block_y; + + *out=0; + + switch (block) + { + case 0: /* 8x8 or 16x16 block search */ + block_x=0; /*****************************/ + block_y=0; /** 1 2 ******** 0 *********/ + mb_b_size=MB_SIZE; /** 3 4 ******** *********/ + break; /*****************************/ + case 1: + block_x=0; + block_y=0; + mb_b_size=B_SIZE; + break; + case 2: + block_x=B_SIZE; + block_y=0; + mb_b_size=B_SIZE; + break; + case 3: + block_x=0; + block_y=B_SIZE; + mb_b_size=B_SIZE; + break; + case 4: + block_x=B_SIZE; + block_y=B_SIZE; + mb_b_size=B_SIZE; + break; + default: + return; + } + + /* min x/y */ + dim_curr_x_min=(Int)(br_x+i*MB_SIZE+*mv_x_min+block_x); + dim_curr_y_min=(Int)(br_y+j*MB_SIZE+*mv_y_min+block_y); + dim_prev_x_min=prev_x/*-edge*/; + dim_prev_y_min=prev_y/*-edge*/; + + /* max x/y */ + /*the MB right-pixels inside */ + dim_curr_x_max=(Int)(br_x+i*MB_SIZE+*mv_x_max+mb_b_size+block_x); + /*the MB bottom-pixels inside */ + dim_curr_y_max=(Int)(br_y+j*MB_SIZE+*mv_y_max+mb_b_size+block_y); + dim_prev_x_max=prev_x+vop_width /*+edge*/; + dim_prev_y_max=prev_y+vop_height/*+edge*/; + + /* range x/y min */ + + if (dim_curr_x_min > dim_prev_x_max) + { + *out=1; + } + else if(dim_curr_x_min < dim_prev_x_min) + { + *mv_x_min = *mv_x_min + ( dim_prev_x_min - dim_curr_x_min ) ; + } + + if(!(*out)) + { + if (dim_curr_y_min > dim_prev_y_max) + { + *out=1; + } + else if(dim_curr_y_min < dim_prev_y_min) + { + *mv_y_min = *mv_y_min + ( dim_prev_y_min - dim_curr_y_min ) ; + } + } + + /* range x/y max */ + if(!(*out)) + { + if(dim_curr_x_max < dim_prev_x_min) + { + *out=1; + } + if ((!(*out))&&(dim_curr_x_max > dim_prev_x_max)) + { + *mv_x_max = *mv_x_max - ( dim_curr_x_max - dim_prev_x_max) ; + } + } + + if(!(*out)) + { + if(dim_curr_y_max < dim_prev_y_min) + { + *out=1; /* already set */ + } + if ((!(*out))&&(dim_curr_y_max > dim_prev_y_max)) + { + *mv_y_max = *mv_y_max - ( dim_curr_y_max - dim_prev_y_max) ; + } + } + + if(*mv_x_min>*mv_x_max) + { + *out=1; + } + + if ( (!(*out)) && (*mv_y_min>*mv_y_max)) + { + *out=1; + } + + return; + } + + + /***********************************************************CommentBegin****** + * + * -- Obtain_Range -- computes the range of the search area + * + * Purpose : + * computes the range of the search area for the predicted MV's + * (it can be outside the overlapped zone between the reference + * and current vops) + * + * Return values : + * 1 on success, 0 on error + * + ***********************************************************CommentEnd********/ + + static Int + Obtain_Range( + Int f_code, /* <-- MV search range 1/2 (or 1/4 pel): (0=16,) 1=32,2=64,...,7=2048 */ + Int sr, /* <-- Serach range (radius) */ + Int type, /* <-- MBM_INTER16==16x16 search; MBM_INTER8==8x8 search */ + Float pmv_x, /* <-- predicted horizontal motion vector */ + Float pmv_y, /* <-- predicted horizontal motion vector */ + Float *mv_x_min, /* --> min horizontal range */ + Float *mv_x_max, /* --> max horizontal range */ + Float *mv_y_min, /* --> min vertical range */ + Float *mv_y_max, /* --> max vertical range */ + Int quarter_pel /* <-- quarter pel flag (to allow f_code==0 without sprite) */ + ) + { + Int error; + + Float aux_x_min, aux_y_min, + aux_x_max, aux_y_max; + + Float range; + + error=0; + + if ((f_code==0) && (!quarter_pel)) /* for Low Latency Sprite */ + { + *mv_x_min=0; + *mv_x_max=0; + *mv_y_min=0; + *mv_y_max=0; + } + else + { + range = sr; + + *mv_x_min=-range; *mv_x_max= range - 0.5f; + + *mv_y_min=-range; *mv_y_max= range - 0.5f; + } + + if (type==MBM_INTER8) + { + aux_x_min=pmv_x - DEFAULT_8_WIN; + aux_y_min=pmv_y - DEFAULT_8_WIN; + aux_x_max=pmv_x + DEFAULT_8_WIN; + aux_y_max=pmv_y + DEFAULT_8_WIN; + + if(*mv_x_min < aux_x_min) + *mv_x_min = aux_x_min; + if(*mv_y_min < aux_y_min) + *mv_y_min = aux_y_min; + if(*mv_x_max > aux_x_max) + *mv_x_max = aux_x_max; + if(*mv_y_max > aux_y_max) + *mv_y_max = aux_y_max; + } + + if (error==1) + return(0); + else + return(1); + } + + + /***********************************************************CommentBegin****** + * + * -- MBMotionEstimation -- Computes INTEGER PRECISION MV's for a MB + * + * Purpose : + * Computes INTEGER PRECISION MV's for a MB. Also returns + * prediction errors. Requires the whole MVs data images to + * obtain prediction for the current MV, which determines search + * range + * + ***********************************************************CommentEnd********/ + + Void + MBMotionEstimation( + SInt *curr, /* <-- Current vop pointer */ + SInt *prev, /* <-- extended reference picture */ + Int br_x, /* <-- horizontal bounding rectangle coordinate */ + Int br_y, /* <-- vertical bounding rectangle coordinate */ + Int br_width, /* <-- bounding rectangule width */ + Int i, /* <-- horizontal MBcoordinate in pixels */ + Int j, /* <-- vertical MB coordinate in pixels */ + Int prev_x, /* <-- absolute horiz. position of previous vop */ + Int prev_y, /* <-- absolute verti. position of previous vop */ + Int vop_width, /* <-- horizontal vop dimension */ + Int vop_height, /* <-- vertical vop dimension */ + Int enable_8x8_mv, /* <-- 8x8 MV (=1) or only 16x16 MV (=0) */ + Int edge, /* <-- edge */ + Int f_code, /* <-- MV search range 1/2 (or 1/4) pel: (0=16,) 1=32,2=64,...,7=2048*/ + Int sr, /* <-- search range (corresponds to f_code) UB 990215*/ + Float hint_mv_w, /* <-- hint seed for horizontal MV */ + Float hint_mv_h, /* <-- hint seed for vertical MV */ + Float *mv16_w, /* --> predicted horizontal 16x16 MV(if approp.) */ + Float *mv16_h, /* --> predicted vertical 16x16 MV (if approp.) */ + Float *mv8_w, /* --> predicted horizontal 8x8 MV (if approp.) */ + Float *mv8_h, /* --> predicted vertical 8x8 MV (if approp.) */ + Int *min_error, /* --> Minimum prediction error */ + SInt *flags + ) + { + Int x, y; + Int sad, sad_min=MV_MAX_ERROR; + Int mv_x, mv_y; + Int block; + Float pmv_x, pmv_y; + SInt act_block[MB_SIZE*MB_SIZE]; + + Float mv_x_min, mv_x_max, + mv_y_min, mv_y_max; + Int int_mv_x_min=0, int_mv_x_max=0, + int_mv_y_min=0, int_mv_y_max=0; + + Int pos16, pos8; + Int mvm_width = br_width/MB_SIZE; + + Int x_curr = i*MB_SIZE, + y_curr = j*MB_SIZE; + Int hb,vb; + Int out; + + Int rel_ori_x; + Int rel_ori_y; + + Int min_error16, min_error8 = 0; + // SInt *curr = (SInt *)GetImageData(GetVopY(curr_vop)); + #ifndef _FULL_SEARCH_ /* PIH (NTU) Fast ME 08/08/99 */ + typedef struct + { + Int x; + Int y; + SInt start_nmbr; + } DPoint; + + typedef struct + { + DPoint point[8]; + } Diamond; + + SInt d_type=1,stop_flag=0,pt_nmbr=0,check_pts,total_check_pts=8,mot_dirn=0; + Int d_centre_x=0,d_centre_y=0,check_pt_x,check_pt_y; + Diamond diamond[2]= + { + { + { {0,1,0}, {1,0,0}, {0,-1,0}, {-1,0,0} } + } + , + { + { {0,2,6}, {1,1,0}, {2,0,0}, {1,-1,2}, + {0,-2,2}, {-1,-1,4}, {-2,0,4}, {-1,1,6} } + } + }; + #endif + + d_centre_x = (int)hint_mv_w; + d_centre_y = (int)hint_mv_h; + + rel_ori_x=br_x-prev_x; + rel_ori_y=br_y-prev_y; + + /* Load act_block */ + + LoadArea(curr, x_curr,y_curr,MB_SIZE,MB_SIZE,br_width, act_block); + + /* Compute 16x16 integer MVs */ + + /* Obtain range */ + + Obtain_Range (f_code, sr, MBM_INTER16, /* UB 990215 added search range */ + 0.0, 0.0, &mv_x_min, &mv_x_max, + /*UB 990215 added quarter pel support */ + &mv_y_min, &mv_y_max, 0/*GetVopQuarterPel(curr_vop)*/); + + RangeInSearchArea (i,j,0, prev_x, prev_y, vop_width, vop_height, + br_x, br_y, edge,f_code, &mv_x_min, &mv_x_max, + /*UB 990215 added quarter pel support */ + &mv_y_min, &mv_y_max,&out); + + /* Compute */ + + if(!out) + { + int_mv_x_min=(int)ceil((double)mv_x_min); + int_mv_y_min=(int)ceil((double)mv_y_min); + int_mv_x_max=(int)floor((double)mv_x_max); + int_mv_y_max=(int)floor((double)mv_y_max); + flags[0]=ARE_EQUAL(int_mv_x_min,mv_x_min); + flags[1]=ARE_EQUAL(int_mv_x_max,mv_x_max); + flags[2]=ARE_EQUAL(int_mv_y_min,mv_y_min); + flags[3]=ARE_EQUAL(int_mv_y_max,mv_y_max); + + sad_min=MV_MAX_ERROR; + mv_x = mv_y = 2000; /* A very large MV */ + + #ifdef _FULL_SEARCH_ /* PIH (NTU) 08/08/99 */ + for (y=int_mv_y_min; y<=int_mv_y_max; y++) + for (x=int_mv_x_min; x<=int_mv_x_max; x++) + { + if (x==0 && y==0) + sad=SAD_Macroblock(prev+INDEX_BIG(x_curr+rel_ori_x, + y_curr+rel_ori_y), act_block, + (vop_width/*+2*edge*/), MV_MAX_ERROR) + - (128 + 1); + else + sad=SAD_Macroblock(prev+INDEX_BIG(x_curr+x+rel_ori_x, + y_curr+y+rel_ori_y), act_block, + (vop_width/*+2*edge*/), sad_min); + + if (sad int_mv_x_max || check_pt_y < int_mv_y_min || check_pt_y > int_mv_y_max) + { + sad = MV_MAX_ERROR; + } + else + { + sad=SAD_Macroblock(prev+INDEX_BIG(x_curr+check_pt_x+rel_ori_x, + y_curr+check_pt_y+rel_ori_y), act_block, + (vop_width/*+2*edge*/), sad_min); + #ifdef _SAD_EXHAUS_ + fprintf(stdout,"+o+ [%2d,%2d] sad16(%3d,%3d)=%4d\n",i,j,x,y,sad); + #endif + } + if (sad= 8) pt_nmbr-=8; + check_pts-=1; + } + while(check_pts>0); + + if( d_type == 0) + { + stop_flag = 1; + + } + else + { + if( (mv_x == d_centre_x) && (mv_y == d_centre_y) ) + { + d_type=0; + pt_nmbr=0; + total_check_pts = 4; + } + else + { + if((mv_x==d_centre_x) ||(mv_y==d_centre_y)) + total_check_pts=5; + else + total_check_pts=3; + pt_nmbr=diamond[d_type].point[mot_dirn].start_nmbr; + d_centre_x = mv_x; + d_centre_y = mv_y; + + } + } + } + while(stop_flag!=1); + #endif + + flags[0]=flags[0] && (mv_x==int_mv_x_min); + flags[1]=flags[1] && (mv_x==int_mv_x_max); + flags[2]=flags[2] && (mv_y==int_mv_y_min); + flags[3]=flags[3] && (mv_y==int_mv_y_max); + } + else + { + mv_x=mv_y=0; + sad_min=MV_MAX_ERROR; + } + + /* Store result */ + + out |=((mv_x==2000)||(mv_y==2000)); + if(out) + { + mv_x=mv_y=0; + sad_min=MV_MAX_ERROR; + } + + pos16=2*j*2*mvm_width + 2*i; + mv16_w[pos16]= mv_x; mv16_h[pos16]= mv_y; + mv16_w[pos16+1]= mv_x; mv16_h[pos16+1]= mv_y; + pos16+=2*mvm_width; + mv16_w[pos16]= mv_x; mv16_h[pos16]= mv_y; + mv16_w[pos16+1]= mv_x; mv16_h[pos16+1]= mv_y; + min_error16 = sad_min; + + *min_error = min_error16; + + /* Compute 8x8 MVs */ + + if(enable_8x8_mv==1) + { + if(!out) + { + for (block=0;block<4;block++) + { + /* Obtain range */ + if(block==0) + { + hb=vb=0; + } + else if (block==1) + { + hb=1;vb=0; + } + else if (block==2) + { + hb=0;vb=1; + } + else + { + hb=vb=1; + } + + /* VM 2.*: restrict the search range based on the current 16x16 MV + * inside a window around it + */ + + pmv_x=mv16_w[pos16]; pmv_y=mv16_h[pos16]; + + /* UB 990215 added search range */ + Obtain_Range(f_code, sr, MBM_INTER8, + pmv_x, pmv_y, &mv_x_min, + /*UB 990215 added quarter pel support */ + &mv_x_max, &mv_y_min, &mv_y_max, 0 /*GetVopQuarterPel(curr_vop)*/); + + RangeInSearchArea(i,j, block+1, prev_x, prev_y, + vop_width, vop_height, br_x, br_y, edge,f_code, + /*UB 990215 added quarter pel support */ + &mv_x_min, &mv_x_max, &mv_y_min,&mv_y_max,&out); + + if(!out) + { + int_mv_x_min=(int)ceil((double)mv_x_min); + int_mv_y_min=(int)ceil((double)mv_y_min); + int_mv_x_max=(int)floor((double)mv_x_max); + int_mv_y_max=(int)floor((double)mv_y_max); + flags[4+block*4]=ARE_EQUAL(int_mv_x_min,mv_x_min); + flags[4+block*4+1]=ARE_EQUAL(int_mv_x_max,mv_x_max); + flags[4+block*4+2]=ARE_EQUAL(int_mv_y_min,mv_y_min); + flags[4+block*4+3]=ARE_EQUAL(int_mv_y_max,mv_y_max); + + sad_min=MV_MAX_ERROR; + mv_x = mv_y = 2000; /* A very large MV */ + + for (y=int_mv_y_min; y<=int_mv_y_max; y++) + for (x=int_mv_x_min; x<=int_mv_x_max; x++) + { + sad=SAD_Block(prev+ + INDEX_BIG(x_curr + x + 8*(block==1||block==3)+rel_ori_x, + y_curr + y + 8*(block==2||block==3)+rel_ori_y), + act_block+INDEX_NOR(8*(block==1||block==3), + 8*(block==2||block==3)), + (vop_width /*+2*edge*/), sad_min); + + if (sad motion compensated current mb */ + Float *mvx, /* <-> horizontal motion vector */ + Float *mvy, /* <-> vertical motion vector */ + Int *min_error /* --> prediction error */ + ) + { + static PixPoint search[9] = + { + {0, 0}, {-1, -1}, {0, -1}, {1, -1}, + {-1, 0}, {1, 0}, {-1, 1}, {0, 1}, {1, 1} + }; + /* searching map + 1 2 3 + 4 0 5 + 6 7 8 + */ + + Int i, m, n; + Int new_x, new_y, + lx, size_x; /* MW QPEL 07-JUL-1998 */ + Int min_pos; + Int AE, AE_min; + Int flag_pos; + SInt *pRef, *pComp; + + int flag_search[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1}; + + Int SubDimension = 2; + + lx = 2*(pels /*+ 2*edge*/); + + new_x = (Int)((x + *mvx + rel_x)*(SubDimension)); + new_y = (Int)((y + *mvy + rel_y)*(SubDimension)); + new_x += ((comp&1)<<3)*SubDimension; + new_y += ((comp&2)<<2)*SubDimension; + + size_x=16; + + /** in 1-pixel search we check if we are inside the range; so don't check + it again + **/ + + /* avoids trying outside the reference image */ + /* we also check with flags if we are inside */ + /* search range (1==don't make 1/x search by */ + /* this side */ + + if (bs_x==8) + flag_pos=4+comp*4; + else /* ==16*/ + flag_pos=0; + + if (((new_x/SubDimension) <= 0/*-edge*/) || *(flags+flag_pos)) { + flag_search[1] = flag_search[4] = flag_search[6] = 0; + } else if (((new_x/SubDimension) >= (pels - bs_x /*+ edge*/)) || *(flags+flag_pos+1)) { + flag_search[3] = flag_search[5] = flag_search[8] = 0; + }; + + if (((new_y/SubDimension) <= 0/*-edge*/) || *(flags+flag_pos+2)) { + flag_search[1] = flag_search[2] = flag_search[3] = 0; + } else if (((new_y/SubDimension) >= (lines- bs_y /*+ edge*/)) || *(flags+flag_pos+3)) { + flag_search[6] = flag_search[7] = flag_search[8] = 0; + }; + + AE_min = MV_MAX_ERROR; + min_pos = 0; + for (i = 0; i < 9; i++) + { + if (flag_search[i]) + { + AE = 0; + /* estimate on the already interpolated half-pel image */ + pRef = prev + new_x + search[i].x + (new_y + search[i].y) * lx; + pComp = curr; + + n = bs_y; + while (n--) { + m = bs_x; + while (m--) { + AE += abs((Int)*pRef - (Int)*pComp); + pRef += 2; + pComp ++; + } + pRef += 2 * lx - 2 * bs_x; + pComp += size_x - bs_x; + } + + if (i==0 && bs_y==16 && *mvx==0 && *mvy==0) + AE -= (128 + 1); + + if (AE < AE_min) + { + AE_min = AE; + min_pos = i; + } + } + /* else don't look outside the reference */ + } + + /* Store optimal values */ + *min_error = AE_min; + *mvx += ((Float)search[min_pos].x)/(Float)(SubDimension); + *mvy += ((Float)search[min_pos].y)/(Float)(SubDimension); + + // generate comp mb data for the minimum point + pRef = prev + new_x + search[min_pos].x + (new_y + search[min_pos].y) * lx; + pComp = curr_comp_mb; + + n = bs_y; + while (n--) { + m = bs_x; + while (m--) { + *(pComp ++) = *pRef; + pRef += 2; + } + pRef += 2 * lx - 2 * bs_x; + pComp += 16 - bs_x; + } + + return; + } + + diff -C2 -r -N bcast-2000c/quicktime/encore50/mot_est_mb.h bcast-2000c-mf3/quicktime/encore50/mot_est_mb.h *** bcast-2000c/quicktime/encore50/mot_est_mb.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mot_est_mb.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,57 ---- + + #ifndef _MOT_EST_MB_H + #define _MOT_EST_MB_H + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + Void MBMotionEstimation _P_(( + SInt *curr, + SInt *prev, + Int br_x, + Int br_y, + Int br_width, + Int i, + Int j, + Int prev_x, + Int prev_y, + Int vop_width, + Int vop_height, + Int enable_8x8_mv, + Int edge, + Int f_code, + Int sr, + Float hint_mv_w, + Float hint_mv_h, + Float *mv16_w, + Float *mv16_h, + Float *mv8_w, + Float *mv8_h, + Int *min_error, + SInt *flags + )); + Void FindSubPel _P_(( Int x, + Int y, + SInt *prev, + SInt *curr, + Int bs_x, + Int bs_y, + Int comp, + Int rel_x, + Int rel_y, + Int pels, + Int lines, + Int edge, + SInt *flags, + SInt *corr_comp_mb, + Float *mvx, + Float *mvy, + Int *min_error + )); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _MOT_EST_MB_H */ diff -C2 -r -N bcast-2000c/quicktime/encore50/mot_util.c bcast-2000c-mf3/quicktime/encore50/mot_util.c *** bcast-2000c/quicktime/encore50/mot_util.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mot_util.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,481 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * mot_util.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some utility functions to for motion estimation and */ + /* compensation. */ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "mom_structs.h" + #include "vm_common_defs.h" + + #include "mot_util.h" + + /* ------------------------------------------------------------------------- */ + + /* Macro to compute the MB absolute error difference of the inside the shape */ + + //static Int P_diff; + #define DIFF1(v1,v2,idx) (P_diff = (v1[idx]-v2[idx]), ABS(P_diff)) + + /***********************************************************CommentBegin****** + * + * -- InterpolateImage -- Interpolates a complete (SInt)image + * + * Purpose : + * Interpolates a complete (SInt) image for easier half pel prediction + * + ***********************************************************CommentEnd********/ + + Void + InterpolateImage( + Image *input_image, /* <-- image to interpolate (SInt) */ + Image *output_image, /* --> interpolated image (SInt) */ + Int rounding_control + ) + { + SInt *ii, *oo; + UInt i, j; + UInt width, height; + + width = input_image->x; + height = input_image->y; + ii = (SInt*)GetImageData(output_image); + oo = (SInt*)GetImageData(input_image); + + /* main image */ + for (j = 0; j < height-1; j++) + { + for (i = 0; i < width-1; i++) + { + *(ii + (i<<1)) = *(oo + i); + *(ii + (i<<1)+1) = (*(oo + i) + *(oo + i + 1) + 1- rounding_control)>>1; + *(ii + (i<<1)+(width<<1)) = (*(oo + i) + *(oo + i + width) + 1- + rounding_control)>>1; + *(ii + (i<<1)+1+(width<<1)) = (*(oo+i) + *(oo+i+1) + + *(oo+i+width) + *(oo+i+1+width) + 2- + rounding_control)>>2; + } + /* last pels on each line */ + *(ii+ (width<<1) - 2) = *(oo + width - 1); + *(ii+ (width<<1) - 1) = *(oo + width - 1); + *(ii+ (width<<1)+ (width<<1)-2) = (*(oo+width-1)+*(oo+width+width-1)+1- + rounding_control)>>1; + *(ii+ (width<<1)+ (width<<1)-1) = (*(oo+width-1)+*(oo+width+width-1)+1- + rounding_control)>>1; + ii += (width<<2); + oo += width; + } + + /* last lines */ + for (i = 0; i < width-1; i++) + { + *(ii+ (i<<1)) = *(oo + i); + *(ii+ (i<<1)+1) = (*(oo + i) + *(oo + i + 1) + 1- rounding_control)>>1; + *(ii+ (width<<1)+ (i<<1)) = *(oo + i); + *(ii+ (width<<1)+ (i<<1)+1) = (*(oo + i) + *(oo + i + 1) + 1- + rounding_control)>>1; + } + + /* bottom right corner pels */ + *(ii + (width<<1) - 2) = *(oo + width -1); + *(ii + (width<<1) - 1) = *(oo + width -1); + *(ii + (width<<2) - 2) = *(oo + width -1); + *(ii + (width<<2) - 1) = *(oo + width -1); + + return; + } + + + /***********************************************************CommentBegin****** + * + * -- GetMotionImages -- + * + * Purpose : + * Translate the MVs data from the resulting separated four + * (Float) Images (16x16/8x8, X,Y) of the motion estimation process + * into two Images, which contain the 16x16 and 8x8 MVs + * values acording to the modes (MBM_INTRA, MBM_INTER16, + * MBM_INTER8). It also + * makes a copy of imode16 (SInt-Image of modes). + * + * Return values : + * 1 on success, -1 on error + * + ***********************************************************CommentEnd********/ + + Int + GetMotionImages( + Image *imv16_w, /* <-- 16x16 horiz. MV Float-Image (MxN) (cuad.) */ + Image *imv16_h, /* <-- 16x16 verti. MV Float-Image (MxN) (cuad.) */ + Image *imv8_w, /* <-- 8x8 horizontal MV Float-Image (MxN) */ + Image *imv8_h, /* <-- 8x8 vertical MV Float-Image (MxN) */ + Image *imode16, /* <-- SInt-Image of modes (M/2xN/2) */ + Image **mv_x, /* --> horizontal MV Float-Image (MxN) */ + Image **mv_y, /* --> vertical MV Float-Image (MxN) */ + Image **mode /* --> SInt-Image of modes (M/2xN/2) */ + ) + { + + Int i, j; + Int width, height, base; + Float val_x, val_y; + Float *data_x, *data_y, + *mv16_w, *mv16_h, + *mv8_w, *mv8_h; + SInt *mode16, *data_mode; + SInt modo; + + width = imode16->x; height = imode16->y; + + (*mode)=AllocImage(width,height,SHORT_TYPE); + (*mv_x)=AllocImage(width*2,height*2,FLOAT_TYPE); + (*mv_y)=AllocImage(width*2,height*2,FLOAT_TYPE); + data_x = (Float*)GetImageData((*mv_x)); + data_y = (Float*)GetImageData((*mv_y)); + data_mode = (SInt*)GetImageData((*mode)); + mode16=(SInt*)GetImageData(imode16); + mv16_w=(Float*)GetImageData(imv16_w); + mv16_h=(Float*)GetImageData(imv16_h); + mv8_w=(Float*)GetImageData(imv8_w); + mv8_h=(Float*)GetImageData(imv8_h); + + for(j=0;j Min_FRAME) + return MV_MAX_ERROR; + } + + return sad; + */ + int i, j; + int sad = 0; + SInt *p1 = ii, *p2 = act_block; + + i = 16; + while (i--) { + j = 16; + while (j --) + sad += abs((int)*(p1++) - (int)*(p2++)); + if (sad > Min_FRAME) + return MV_MAX_ERROR; + p1 += h_length - 16; + } + + return sad; + } + + + /***********************************************************CommentBegin****** + * + * -- SAD_Block -- obtains the SAD for a Block + * + * Purpose : + * obtains the SAD for a Block + * + * Return values : + * sad of the Block + * + ***********************************************************CommentEnd********/ + + Int + SAD_Block( + SInt *ii, /* <-- First area */ + SInt *act_block, /* <-- Id. second MB (width=16) */ + UInt h_length, /* <-- Width of first area */ + Int min_sofar /* <-- Minimum prediction error so far */ + ) + { + /* Int i; + Int sad = 0; + SInt *kk; + register Int P_diff; + + kk = act_block; + i = 8; + while (i--) + { + sad += (DIFF1(ii,kk,0)+DIFF1(ii,kk,1) + +DIFF1(ii,kk,2)+DIFF1(ii,kk,3) + +DIFF1(ii,kk,4)+DIFF1(ii,kk,5) + +DIFF1(ii,kk,6)+DIFF1(ii,kk,7) + ); + + ii += h_length; + kk += 16; + if (sad > min_sofar) + return INT_MAX; + } + + return sad; + */ + int i, j; + int sad = 0; + SInt *p1 = ii, *p2 = act_block; + + i = 8; + while (i--) { + j = 8; + while (j --) + sad += abs((int)*(p1++) - (int)*(p2++)); + if (sad > min_sofar) + return INT_MAX; + p1 += h_length - 8; + p2 += 16 - 8; + } + + return sad; + } + + + + /***********************************************************CommentBegin****** + * + * -- LoadArea -- fills array with a image-data + * + * Purpose : + * fills array with a image-data + * + * Return values : + * Pointer to the filled array + * + ***********************************************************CommentEnd********/ + + Void + LoadArea( + SInt *im, /* <-- pointer to image */ + Int x, /* <-- horizontal pos */ + Int y, /* <-- vertical pos */ + Int x_size, /* <-- width of array */ + Int y_size, /* <-- height of array */ + Int lx, /* <-- width of the image data */ + SInt *block /* <-> pointer to the array */ + ) + { + SInt *in; + SInt *out; + Int i = x_size; + Int j = y_size; + + in = im + (y*lx) + x; + out = block; + + while (j--) + { + while (i--) + *out++ = *in++; + i = x_size; + in += lx - x_size; + } + + return; + } + + + /***********************************************************CommentBegin****** + * + * -- SetArea -- fills a image-data with an array + * + * Purpose : + * fills a image-data with an array + * + ***********************************************************CommentEnd********/ + + Void + SetArea( + SInt *block, /* <-- pointer to array */ + Int x, /* <-- horizontal pos in image */ + Int y, /* <-- vertical pos in image */ + Int x_size, /* <-- width of array */ + Int y_size, /* <-- height of array */ + Int lx, /* <-- width of the image data */ + SInt *im /* --> pointer to image */ + ) + { + SInt *in; + SInt *out; + Int i = x_size; + Int j = y_size; + + in = block; + out = im + (y*lx) + x; + + while (j--) + { + while (i--) + *out++ = *in++; + i = x_size; + out += lx - x_size; + } + } + + diff -C2 -r -N bcast-2000c/quicktime/encore50/mot_util.h bcast-2000c-mf3/quicktime/encore50/mot_util.h *** bcast-2000c/quicktime/encore50/mot_util.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/mot_util.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,96 ---- + + #ifndef _MOT_UTIL_H_ + #define _MOT_UTIL_H_ + + #include "limits.h" + #include "momusys.h" + + /* search window for the 8x8 block MV; [-DEFAULT_8_WIN;DEFAULT_8_WIN] pixels + arround the 16x16 motion vector */ + //#define DEFAULT_8_WIN 2.0 + #define DEFAULT_8_WIN 1.0f + + #define B_SIZE 8 + + /* big value, returned if the MV is not good enought (2^25) */ + #define MV_MAX_ERROR 0x2000000 + + /* Point structure */ + + typedef struct pixpoint + { + Int x; + Int y; + } PixPoint; + + #define EHUFF struct Modified_Encoder_Huffman + + EHUFF + { + Int n; + Int *Hlen; + Int *Hcode; + }; + + #define MVLEN(x,y) (ABS(x) + ABS(y)) + + #include "mom_structs.h" + #include "vm_common_defs.h" + + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + Void InterpolateImage _P_(( Image *input_image, + Image *output_image, + Int rounding_control + )); + Int GetMotionImages _P_(( Image *imv16_w, + Image *imv16_h, + Image *imv8_w, + Image *imv8_h, + Image *imode16, + Image **mv_x, + Image **mv_y, + Image **mode + )); + Int ChooseMode _P_(( SInt *curr, + Int x_pos, + Int y_pos, + Int min_SAD, + UInt width + )); + Int SAD_Macroblock _P_(( SInt *ii, + SInt *act_block, + UInt h_length, + Int Min_FRAME + )); + Int SAD_Block _P_(( SInt *ii, + SInt *act_block, + UInt h_length, + Int min_sofar + )); + Void LoadArea _P_(( SInt *im, + Int x, + Int y, + Int x_size, + Int y_size, + Int lx, + SInt *block + )); + Void SetArea _P_(( SInt *block, + Int x, + Int y, + Int x_size, + Int y_size, + Int lx, + SInt *im + )); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + + #endif /* _MOT_UTIL_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore50/non_unix.h bcast-2000c-mf3/quicktime/encore50/non_unix.h *** bcast-2000c/quicktime/encore50/non_unix.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/non_unix.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,20 ---- + + /******************************************************************************/ + #ifndef _NON_UNIX_H_ + #define _NON_UNIX_H_ + + #include "momusys.h" + + #if defined(__POWERPC__) + # define _RAWIO_ + # define _OLDINTRADC_ + # define __STDC__ 1 + #endif + + #if defined(WIN32) + # define _RAWIO_ + # define _OLDINTRADC_ + # define __STDC__ 1 + #endif + + #endif /* _NON_UNIX_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore50/putvlc.c bcast-2000c-mf3/quicktime/encore50/putvlc.c *** bcast-2000c/quicktime/encore50/putvlc.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/putvlc.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,881 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * putvlc.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions to code the RVLC code for bitstream. */ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "momusys.h" + #include "vlc.h" + #include "putvlc.h" + #include "bitstream.h" + + /***********************************************************CommentBegin****** + * + * -- Putxxx -- Write bits from huffman tables to file + * + * Int PutCoeff_Inter(Int run, Int level, Int last, Image *bitstream) + * Int PutCoeff_Intra(Int run, Int level, Int last, Image *bitstream) + * Int PutCBPY (Int cbpy, Int *MB_transp_pattren,Image *bitstream) + * Int PutMCBPC_Inter (Int cbpc, Int mode, Image *bitstream) + * Int PutMCBPC_Sprite (Int cbpc, Int mode, Image *bitstream) + * Int PutMCBPC_Intra (Int cbpc, Int mode, Image *bitstream) + * Int PutMV (Int mvint, Image *bitstream) + * Int PutDCsize_chrom (Int size, Image *bitstream) + * Int PutDCsize_lum (Int size, Image *bitstream) + * Int PutDCsize_lum (Int size, Image *bitstream) + * Int PutCoeff_Inter_RVLC (Int run, Int level, Int last, Image *bitstream) + * Int PutCoeff_Intra_RVLC (Int run, Int level, Int last, Image *bitstream) + * Int PutRunCoeff_Inter (Int run, Int level, Int last, Image *bitstream) + * Int PutRunCoeff_Intra (Int run, Int level, Int last, Image *bitstream) + * Int PutLevelCoeff_Inter (Int run, Int level, Int last, Image *bitstream) + * Int PutLevelCoeff_Intra (Int run, Int level, Int last, Image *bitstream) + * + * Purpose : + * Writes bits from huffman tables to bitstream + * + * Arguments in : + * various, see prototypes above + * + * Return values : + * Number of bits written + * + ***********************************************************CommentEnd********/ + + Int + PutDCsize_lum (Int size, Image *bitstream) + { + MOMCHECK(size >= 0 && size < 13); + + BitstreamPutBits (bitstream, DCtab_lum[size].code, DCtab_lum[size].len); + + return DCtab_lum[size].len; + } + + + Int + PutDCsize_chrom (Int size, Image *bitstream) + { + MOMCHECK (size >= 0 && size < 13); + + BitstreamPutBits (bitstream, DCtab_chrom[size].code, DCtab_chrom[size].len); + + return DCtab_chrom[size].len; + } + + + Int + PutMV (Int mvint, Image *bitstream) + { + Int sign = 0; + Int absmv; + + if (mvint > 32) + { + absmv = -mvint + 65; + sign = 1; + } + else + absmv = mvint; + + BitstreamPutBits (bitstream, mvtab[absmv].code, mvtab[absmv].len); + + if (mvint != 0) + { + BitstreamPutBits (bitstream, sign, 1); + return mvtab[absmv].len + 1; + } + else + return mvtab[absmv].len; + } + + + Int + PutMCBPC_Intra (Int cbpc, Int mode, Image *bitstream) + { + Int ind; + + ind = ((mode >> 1) & 3) | ((cbpc & 3) << 2); + + BitstreamPutBits (bitstream, mcbpc_intra_tab[ind].code, mcbpc_intra_tab[ind].len); + + return mcbpc_intra_tab[ind].len; + } + + + Int + PutMCBPC_Inter (Int cbpc, Int mode, Image *bitstream) + { + Int ind; + + ind = (mode & 7) | ((cbpc & 3) << 3); + + BitstreamPutBits (bitstream, mcbpc_inter_tab[ind].code, + mcbpc_inter_tab[ind].len); + + return mcbpc_inter_tab[ind].len; + } + + + Int + PutMCBPC_Sprite (Int cbpc, Int mode, Image *bitstream) + { + Int ind; + + ind = (mode & 7) | ((cbpc & 3) << 3); + + BitstreamPutBits (bitstream, mcbpc_sprite_tab[ind].code, + mcbpc_sprite_tab[ind].len); + + return mcbpc_sprite_tab[ind].len; + } + + + Int + PutCBPY (Int cbpy, Char intra, Int *MB_transp_pattern, Image *bitstream) + { + Int ind;//,i,ptr; + Int index=0; + + /* Changed due to bug report from Yoshinori Suzuki; MW 11-JUN-1998 */ + /* if ((intra==0)&&(index!=3)) cbpy = 15 - cbpy; */ + if (intra == 0) cbpy = 15 - cbpy; + + ind = cbpy; + BitstreamPutBits (bitstream, cbpy_tab[ind].code, cbpy_tab[ind].len); + return cbpy_tab[ind].len; + } + + + Int + PutCoeff_Inter(Int run, Int level, Int last, Image *bitstream) + { + Int length = 0; + + MOMCHECK (last >= 0 && last < 2); + MOMCHECK (run >= 0 && run < 64); + MOMCHECK (level > 0 && level < 128); + + if (last == 0) + { + if (run < 2 && level < 13 ) + { + BitstreamPutBits (bitstream, (LInt)coeff_tab0[run][level-1].code, + (LInt)coeff_tab0[run][level-1].len); + + length = coeff_tab0[run][level-1].len; + } + else if (run > 1 && run < 27 && level < 5) + { + BitstreamPutBits (bitstream, (LInt)coeff_tab1[run-2][level-1].code, + (LInt)coeff_tab1[run-2][level-1].len); + + length = coeff_tab1[run-2][level-1].len; + } + } + else if (last == 1) + { + if (run < 2 && level < 4) + { + BitstreamPutBits (bitstream, (LInt)coeff_tab2[run][level-1].code, + (LInt)coeff_tab2[run][level-1].len); + + length = coeff_tab2[run][level-1].len; + } + else if (run > 1 && run < 42 && level == 1) + { + BitstreamPutBits (bitstream, (LInt)coeff_tab3[run-2].code, + (LInt)coeff_tab3[run-2].len); + + length = coeff_tab3[run-2].len; + } + } + return length; + } + + + Int + PutCoeff_Intra(Int run, Int level, Int last, Image *bitstream) + { + Int length = 0; + + MOMCHECK (last >= 0 && last < 2); + MOMCHECK (run >= 0 && run < 64); + MOMCHECK (level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 28 ) + { + BitstreamPutBits(bitstream, (LInt)coeff_tab4[level-1].code, + (LInt)coeff_tab4[level-1].len); + + length = coeff_tab4[level-1].len; + } + else if (run == 1 && level < 11) + { + BitstreamPutBits(bitstream, (LInt)coeff_tab5[level-1].code, + (LInt)coeff_tab5[level-1].len); + + length = coeff_tab5[level-1].len; + } + else if (run > 1 && run < 10 && level < 6) + { + BitstreamPutBits(bitstream, (LInt)coeff_tab6[run-2][level-1].code, + (LInt)coeff_tab6[run-2][level-1].len); + + length = coeff_tab6[run-2][level-1].len; + } + else if (run > 9 && run < 15 && level == 1) + { + BitstreamPutBits(bitstream, (LInt)coeff_tab7[run-10].code, + (LInt)coeff_tab7[run-10].len); + + length = coeff_tab7[run-10].len; + } + } + else if (last == 1) + { + if (run == 0 && level < 9) + { + BitstreamPutBits(bitstream, (LInt)coeff_tab8[level-1].code, + (LInt)coeff_tab8[level-1].len); + + length = coeff_tab8[level-1].len; + } + else if (run > 0 && run < 7 && level < 4) + { + BitstreamPutBits(bitstream, (LInt)coeff_tab9[run-1][level-1].code, + (LInt)coeff_tab9[run-1][level-1].len); + + length = coeff_tab9[run-1][level-1].len; + } + else if (run > 6 && run < 21 && level == 1) + { + BitstreamPutBits(bitstream, (LInt)coeff_tab10[run-7].code, + (LInt)coeff_tab10[run-7].len); + + length = coeff_tab10[run-7].len; + } + } + return length; + } + + + Int + PutCoeff_Inter_RVLC(Int run, Int level, Int last, Image *bitstream) + { + Int length = 0; + + MOMCHECK (last >= 0 && last < 2); + MOMCHECK (run >= 0 && run < 64); + MOMCHECK (level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 20 ) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab14[level-1].code, + (LInt)coeff_RVLCtab14[level-1].len); + + length = coeff_RVLCtab14[level-1].len; + } + else if (run == 1 && level < 11) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab15[level-1].code, + (LInt)coeff_RVLCtab15[level-1].len); + + length = coeff_RVLCtab15[level-1].len; + } + else if (run > 1 && run < 4 && level < 8) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab16[run-2][level-1].code, + (LInt)coeff_RVLCtab16[run-2][level-1].len); + length = coeff_RVLCtab16[run-2][level-1].len; + } + else if (run == 4 && level < 6) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab17[level-1].code, + (LInt)coeff_RVLCtab17[level-1].len); + + length = coeff_RVLCtab17[level-1].len; + } + else if (run > 4 && run < 8 && level < 5) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab18[run-5][level-1].code, + (LInt)coeff_RVLCtab18[run-5][level-1].len); + + length = coeff_RVLCtab18[run-5][level-1].len; + } + else if (run > 7 && run < 10 && level < 4) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab19[run-8][level-1].code, + (LInt)coeff_RVLCtab19[run-8][level-1].len); + + length = coeff_RVLCtab19[run-8][level-1].len; + } + else if (run > 9 && run < 18 && level < 3) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab20[run-10][level-1].code, + (LInt)coeff_RVLCtab20[run-10][level-1].len); + + length = coeff_RVLCtab20[run-10][level-1].len; + } + else if (run > 17 && run < 39 && level == 1) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab21[run-18].code, + (LInt)coeff_RVLCtab21[run-18].len); + + length = coeff_RVLCtab21[run-18].len; + } + } + else if (last == 1) + { + if (run >= 0 && run < 2 && level < 6) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab22[run][level-1].code, + (LInt)coeff_RVLCtab22[run][level-1].len); + + length = coeff_RVLCtab22[run][level-1].len; + } + else if (run == 2 && level < 4) + { + BitstreamPutBits (bitstream, (LInt)coeff_RVLCtab23[level-1].code, + (LInt)coeff_RVLCtab23[level-1].len); + + length = coeff_RVLCtab23[level-1].len; + } + else if (run > 2 && run < 14 && level < 3) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab24[run-3][level-1].code, + (LInt)coeff_RVLCtab24[run-3][level-1].len); + + length = coeff_RVLCtab24[run-3][level-1].len; + } + else if (run > 13 && run < 46 && level == 1) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab25[run-14].code, + (LInt)coeff_RVLCtab25[run-14].len); + + length = coeff_RVLCtab25[run-14].len; + } + } + return length; + } + + + Int + PutCoeff_Intra_RVLC(Int run, Int level, Int last, Image *bitstream) + { + Int length = 0; + + MOMCHECK (last >= 0 && last < 2); + MOMCHECK (run >= 0 && run < 64); + MOMCHECK (level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 28 ) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab1[level-1].code, + (LInt)coeff_RVLCtab1[level-1].len); + + length = coeff_RVLCtab1[level-1].len; + } + else if (run == 1 && level < 14) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab2[level-1].code, + (LInt)coeff_RVLCtab2[level-1].len); + + length = coeff_RVLCtab2[level-1].len; + } + else if (run == 2 && level < 12) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab3[level-1].code, + (LInt)coeff_RVLCtab3[level-1].len); + + length = coeff_RVLCtab3[level-1].len; + } + else if (run == 3 && level < 10) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab4[level-1].code, + (LInt)coeff_RVLCtab4[level-1].len); + + length = coeff_RVLCtab4[level-1].len; + } + else if (run > 3 && run < 6 && level < 7) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab5[run-4][level-1].code, + (LInt)coeff_RVLCtab5[run-4][level-1].len); + + length = coeff_RVLCtab5[run-4][level-1].len; + } + else if (run > 5 && run < 8 && level < 6) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab6[run-6][level-1].code, + (LInt)coeff_RVLCtab6[run-6][level-1].len); + + length = coeff_RVLCtab6[run-6][level-1].len; + } + else if (run > 7 && run < 10 && level < 5) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab7[run-8][level-1].code, + (LInt)coeff_RVLCtab7[run-8][level-1].len); + + length = coeff_RVLCtab7[run-8][level-1].len; + } + else if (run > 9 && run < 13 && level < 3) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab8[run-10][level-1].code, + (LInt)coeff_RVLCtab8[run-10][level-1].len); + + length = coeff_RVLCtab8[run-10][level-1].len; + } + else if (run > 12 && run < 20 && level == 1) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab9[run-13].code, + (LInt)coeff_RVLCtab9[run-13].len); + + length = coeff_RVLCtab9[run-13].len; + } + } + else if (last == 1) + { + if (run >= 0 && run < 2 && level < 6) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab10[run][level-1].code, + (LInt)coeff_RVLCtab10[run][level-1].len); + + length = coeff_RVLCtab10[run][level-1].len; + } + else if (run == 2 && level < 4) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab11[level-1].code, + (LInt)coeff_RVLCtab11[level-1].len); + + length = coeff_RVLCtab11[level-1].len; + } + else if (run > 2 && run < 14 && level < 3) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab12[run-3][level-1].code, + (LInt)coeff_RVLCtab12[run-3][level-1].len); + + length = coeff_RVLCtab12[run-3][level-1].len; + } + else if (run > 13 && run < 46 && level == 1) + { + BitstreamPutBits(bitstream, (LInt)coeff_RVLCtab13[run-14].code, + (LInt)coeff_RVLCtab13[run-14].len); + + length = coeff_RVLCtab13[run-14].len; + } + } + return length; + } + + + /* The following is for 3-mode VLC */ + + Int + PutRunCoeff_Inter(Int run, Int level, Int last, Image *bitstream) + { + Int length = 0; + + MOMCHECK (last >= 0 && last < 2); + MOMCHECK (run >= 0 && run < 64); + MOMCHECK (level > 0 && level < 128); + + if (last == 0) + { + if (run < 2 && level < 13 ) + { + length = coeff_tab0[run][level-1].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits (bitstream, (LInt)coeff_tab0[run][level-1].code, + (LInt)coeff_tab0[run][level-1].len); + } + } + else if (run > 1 && run < 27 && level < 5) + { + length = coeff_tab1[run-2][level-1].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits (bitstream, (LInt)coeff_tab1[run-2][level-1].code, + (LInt)coeff_tab1[run-2][level-1].len); + } + } + } + else if (last == 1) + { + if (run < 2 && level < 4) + { + length = coeff_tab2[run][level-1].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits (bitstream, (LInt)coeff_tab2[run][level-1].code, + (LInt)coeff_tab2[run][level-1].len); + } + } + else if (run > 1 && run < 42 && level == 1) + { + length = coeff_tab3[run-2].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits (bitstream, (LInt)coeff_tab3[run-2].code, + (LInt)coeff_tab3[run-2].len); + } + } + } + return length; + } + + + Int + PutRunCoeff_Intra(Int run, Int level, Int last, Image *bitstream) + { + Int length = 0; + + MOMCHECK (last >= 0 && last < 2); + MOMCHECK (run >= 0 && run < 64); + MOMCHECK (level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 28 ) + { + length = coeff_tab4[level-1].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab4[level-1].code, + (LInt)coeff_tab4[level-1].len); + } + } + else if (run == 1 && level < 11) + { + length = coeff_tab5[level-1].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab5[level-1].code, + (LInt)coeff_tab5[level-1].len); + } + } + else if (run > 1 && run < 10 && level < 6) + { + length = coeff_tab6[run-2][level-1].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab6[run-2][level-1].code, + (LInt)coeff_tab6[run-2][level-1].len); + } + } + else if (run > 9 && run < 15 && level == 1) + { + length = coeff_tab7[run-10].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab7[run-10].code, + (LInt)coeff_tab7[run-10].len); + } + } + } + else if (last == 1) + { + if (run == 0 && level < 9) + { + length = coeff_tab8[level-1].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab8[level-1].code, + (LInt)coeff_tab8[level-1].len); + } + } + else if (run > 0 && run < 7 && level < 4) + { + length = coeff_tab9[run-1][level-1].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab9[run-1][level-1].code, + (LInt)coeff_tab9[run-1][level-1].len); + } + } + else if (run > 6 && run < 21 && level == 1) + { + length = coeff_tab10[run-7].len; + if (length != 0) + { + /* boon 120697 */ + BitstreamPutBits(bitstream, 3L, 7L); + /* boon 120697 */ + BitstreamPutBits(bitstream, 2L, 2L); + length += 9; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab10[run-7].code, + (LInt)coeff_tab10[run-7].len); + } + } + } + return length; + } + + + Int + PutLevelCoeff_Inter(Int run, Int level, Int last, Image *bitstream) + { + Int length = 0; + + MOMCHECK (last >= 0 && last < 2); + MOMCHECK (run >= 0 && run < 64); + MOMCHECK (level > 0 && level < 128); + + if (last == 0) + { + if (run < 2 && level < 13 ) + { + length = coeff_tab0[run][level-1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits (bitstream, (LInt)coeff_tab0[run][level-1].code, + (LInt)coeff_tab0[run][level-1].len); + } + } + else if (run > 1 && run < 27 && level < 5) + { + length = coeff_tab1[run-2][level-1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits (bitstream, (LInt)coeff_tab1[run-2][level-1].code, + (LInt)coeff_tab1[run-2][level-1].len); + } + } + } + else if (last == 1) + { + if (run < 2 && level < 4) + { + length = coeff_tab2[run][level-1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits (bitstream, (LInt)coeff_tab2[run][level-1].code, + (LInt)coeff_tab2[run][level-1].len); + } + } + else if (run > 1 && run < 42 && level == 1) + { + length = coeff_tab3[run-2].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits (bitstream, (LInt)coeff_tab3[run-2].code, + (LInt)coeff_tab3[run-2].len); + } + } + } + return length; + } + + + Int + PutLevelCoeff_Intra(Int run, Int level, Int last, Image *bitstream) + { + Int length = 0; + + MOMCHECK (last >= 0 && last < 2); + MOMCHECK (run >= 0 && run < 64); + MOMCHECK (level > 0 && level < 128); + + if (last == 0) + { + if (run == 0 && level < 28 ) + { + length = coeff_tab4[level-1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab4[level-1].code, + (LInt)coeff_tab4[level-1].len); + } + } + else if (run == 1 && level < 11) + { + length = coeff_tab5[level-1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab5[level-1].code, + (LInt)coeff_tab5[level-1].len); + } + } + else if (run > 1 && run < 10 && level < 6) + { + length = coeff_tab6[run-2][level-1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab6[run-2][level-1].code, + (LInt)coeff_tab6[run-2][level-1].len); + } + } + else if (run > 9 && run < 15 && level == 1) + { + length = coeff_tab7[run-10].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab7[run-10].code, + (LInt)coeff_tab7[run-10].len); + } + } + } + else if (last == 1) + { + if (run == 0 && level < 9) + { + length = coeff_tab8[level-1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab8[level-1].code, + (LInt)coeff_tab8[level-1].len); + } + } + else if (run > 0 && run < 7 && level < 4) + { + length = coeff_tab9[run-1][level-1].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab9[run-1][level-1].code, + (LInt)coeff_tab9[run-1][level-1].len); + } + } + else if (run > 6 && run < 21 && level == 1) + { + length = coeff_tab10[run-7].len; + if (length != 0) + { + BitstreamPutBits(bitstream, 3L, 7L); + /* boon19970701 */ + BitstreamPutBits(bitstream, 0L, 1L); + length += 8; /* boon */ + BitstreamPutBits(bitstream, (LInt)coeff_tab10[run-7].code, + (LInt)coeff_tab10[run-7].len); + } + } + } + return length; + } diff -C2 -r -N bcast-2000c/quicktime/encore50/putvlc.h bcast-2000c-mf3/quicktime/encore50/putvlc.h *** bcast-2000c/quicktime/encore50/putvlc.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/putvlc.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,94 ---- + /***********************************************************HeaderBegin******* + * + * File: putvlc.h + * + * Description: Header file to include prototypes for vlc functions + * + ***********************************************************HeaderEnd*********/ + + /************************ INCLUDE FILES ********************************/ + + #include "momusys.h" + + #ifndef _PUTVLC_H_ + #define _PUTVLC_H_ + + #define MARKER_BIT 1 + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + Int PutDCsize_lum _P_(( Int size, + Image *bitstream + )); + Int PutDCsize_chrom _P_(( Int size, + Image *bitstream + )); + Int PutMV _P_(( Int mvint, + Image *bitstream + )); + Int PutMCBPC_Intra _P_(( Int cbpc, + Int mode, + Image *bitstream + )); + Int PutMCBPC_Inter _P_(( Int cbpc, + Int mode, + Image *bitstream + )); + Int PutMCBPC_Sprite _P_(( Int cbpc, + Int mode, + Image *bitstream + )); + Int PutCBPY _P_(( Int cbpy, + Char intra, + Int *MB_transp_pattern, + Image *bitstream + )); + Int PutCoeff_Inter _P_(( Int run, + Int level, + Int last, + Image *bitstream + )); + Int PutCoeff_Intra _P_(( Int run, + Int level, + Int last, + Image *bitstream + )); + Int PutCoeff_Inter_RVLC _P_(( Int run, + Int level, + Int last, + Image *bitstream + )); + Int PutCoeff_Intra_RVLC _P_(( Int run, + Int level, + Int last, + Image *bitstream + )); + Int PutRunCoeff_Inter _P_(( Int run, + Int level, + Int last, + Image *bitstream + )); + Int PutRunCoeff_Intra _P_(( Int run, + Int level, + Int last, + Image *bitstream + )); + Int PutLevelCoeff_Inter _P_(( Int run, + Int level, + Int last, + Image *bitstream + )); + Int PutLevelCoeff_Intra _P_(( Int run, + Int level, + Int last, + Image *bitstream + )); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _PUTVLC_H_ */ + diff -C2 -r -N bcast-2000c/quicktime/encore50/rate_ctl.c bcast-2000c-mf3/quicktime/encore50/rate_ctl.c *** bcast-2000c/quicktime/encore50/rate_ctl.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/rate_ctl.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,157 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * rate_ctl.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions for rate control of the encoding. */ + + #include "stdio.h" + + extern FILE *ftrace; + extern int max_quantizer, min_quantizer; + + typedef struct _rc_param_ { + double quant; + int rc_period; + double target_rate; + double average_rate; + double reaction_rate; + double average_delta; + double reaction_delta; + double reaction_ratio; + } RC_Param; + + static RC_Param rc_param; + + void RateCtlInit(double quant, double target_rate, + long rc_period, long rc_reaction_period, long rc_reaction_ratio) + { + #ifdef _RC_ + fprintf(ftrace, "Initializing Rate Control module:\n"); + fprintf(ftrace, "Initial quantizer is %f.\n", quant); + fprintf(ftrace, "Target rate is %f bits per frame.\n", target_rate); + fprintf(ftrace, "RC averaging period is %d.\n", rc_period); + fprintf(ftrace, "RC reaction period is %d.\n", rc_reaction_period); + fprintf(ftrace, "RC reaction ratio is %d.\n", rc_reaction_ratio); + #endif + + rc_param.quant = quant; + rc_param.rc_period = rc_period; + rc_param.target_rate = target_rate; + rc_param.reaction_ratio = rc_reaction_ratio; + + rc_param.average_delta = 1. / rc_period; + rc_param.reaction_delta = 1. / rc_reaction_period; + rc_param.average_rate = target_rate; + rc_param.reaction_rate = target_rate; + + return; + } + + int RateCtlGetQ(double MAD) + { + double quant; + + quant = rc_param.quant; + + // if (MAD < 5.) + // quant = min_quantizer + (quant - min_quantizer) * MAD / 5.; + + return (int)(quant + 0.5); + } + + void RateCtlUpdate(int current_frame) + { + double rate, delta, decay; + double target, current_target; + double median_quant; + + #ifdef _RC_ + fprintf(ftrace, "Quantizer is currently %f.\n", rc_param.quant); + fprintf(ftrace, "Current frame is %d bits long.\n", current_frame); + #endif + + rate = rc_param.average_rate; + delta = rc_param.average_delta; + decay = 1 - delta; + rate = rate * decay + current_frame * delta; + rc_param.average_rate = rate; + + target = rc_param.target_rate; + if (rate > target) { + current_target = target - (rate - target); + if (current_target < target * 0.75) current_target = target * 0.75; + } else { + current_target = target; + } + + #ifdef _RC_ + fprintf(ftrace, "Target rate is %f.\n", target); + fprintf(ftrace, "Average rate is %f.\n", rate); + fprintf(ftrace, "Target rate for current frame is %f.\n", current_target); + #endif + + rate = rc_param.reaction_rate; + delta = rc_param.reaction_delta; + decay = 1 - delta; + rate = rate * decay + current_frame * delta; + rc_param.reaction_rate = rate; + + median_quant = min_quantizer + (max_quantizer - min_quantizer) / 2; + + /* reduce quantizer when the reaction rate is low */ + if (rate < current_target) rc_param.quant *= + (1 - rc_param.reaction_delta * ((current_target - rate) / current_target / 0.20) ); + if (rc_param.quant < min_quantizer) rc_param.quant = min_quantizer; + + /* increase quantizer when the reaction rate is high */ + if (rate > current_target) { + /* slower increasement when the quant is higher than median */ + if (rc_param.quant > median_quant) + rc_param.quant *= (1 + rc_param.reaction_delta / rc_param.reaction_ratio); + /* faster increasement when the quant is lower than median */ + else if (rate > current_target * 1.20) rc_param.quant *= + (1 + rc_param.reaction_delta); + else rc_param.quant *= + (1 + rc_param.reaction_delta * ((rate - current_target) / current_target / 0.20) ); + } + if (rc_param.quant > max_quantizer) rc_param.quant = max_quantizer; + + #ifdef _RC_ + fprintf(ftrace, "Reaction rate is %f.\n", rate); + fprintf(ftrace, "Quantizer is updated to %f.\n", rc_param.quant); + #endif + + return; + } + diff -C2 -r -N bcast-2000c/quicktime/encore50/rate_ctl.h bcast-2000c-mf3/quicktime/encore50/rate_ctl.h *** bcast-2000c/quicktime/encore50/rate_ctl.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/rate_ctl.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,18 ---- + + #ifndef _RATE_CTL_H + #define _RATE_CTL_H + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + void RateCtlInit(double quant, double target_rate, + long rc_period, long rc_reaction_period, long rc_reaction_ratio); + int RateCtlGetQ(double MAD); + void RateCtlUpdate(int current_frame); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _RATE_CTL_H */ diff -C2 -r -N bcast-2000c/quicktime/encore50/text_bits.c bcast-2000c-mf3/quicktime/encore50/text_bits.c *** bcast-2000c/quicktime/encore50/text_bits.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/text_bits.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,891 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * text_bits.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some utility functions to write to bitstreams for */ + /* texture part of the coding. */ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "momusys.h" + #include "text_defs.h" + #include "bitstream.h" + #include "text_bits.h" + #include "putvlc.h" + #include "zigzag.h" /* added, 14-NOV-1996 MW */ + #include "max_level.h" /* 3-mode esc */ + + Int IntraDC_dpcm (Int val, Int lum, Image *bitstream); + Int CodeCoeff (Int j_start, Int Mode, Int qcoeff[], + Int block, Int ncoeffs, Image *bitstream); + Int CodeCoeff_RVLC (Int j_start, Int Mode, Int qcoeff[], + Int block, Int ncoeffs, Image *bitstream); + + /***********************************************************CommentBegin****** + * + * -- MB_CodeCoeff -- Codes coefficients, does DC/AC prediction + * + * Purpose : + * Codes coefficients, does DC/AC prediction + * + * Arguments in : + * Int *qcoeff : quantized dct-coefficients + * Int Mode : encoding mode + * Int CBP : coded block pattern + * Int ncoeffs : number of coefficients per block + * Int x_pos : the horizontal position of the macroblock in the vop + * Int intra_dcpred_disable : disable the intradc prediction + * Int transp_pattern[]: Describes which blocks are transparent + * + * Arguments out : + * Bits *bits : struct to count the number of texture bits + * Image *bitstream : output bitstream + * + * Description : + * The intradc prediction can be switched off by setting the variable + * intradc_pred_disable to '1'. + * + ***********************************************************CommentEnd********/ + Void MB_CodeCoeff(Bits* bits, Int *qcoeff, + Int Mode, Int CBP, Int ncoeffs, + Int intra_dcpred_disable, + Image *DCbitstream, + Image *bitstream, + Int transp_pattern[], Int direction[], + Int error_res_disable, + Int reverse_vlc, + Int switched, + Int alternate_scan) + { + Int i, m, coeff[64]; + Int *zz = alternate_scan ? zigzag_v : zigzag; + + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + if (intra_dcpred_disable == 0) + { + for (i = 0; i < 6; i++) + { + // if (i>3 || transp_pattern[i]!=1) /* Not transparent */ + { + if (!alternate_scan) + { + switch (direction[i]) + { + case 1: zz = zigzag_v; break; + case 2: zz = zigzag_h; break; + case 0: break; + default: fprintf(stderr, "MB_CodeCoeff(): Error in zigzag direction\n"); + exit(-1); + } + } + /* Do the zigzag scanning of coefficients */ + for (m = 0; m < 64; m++) + { + *(coeff + zz[m]) = qcoeff[i*ncoeffs+m]; + } + + if (switched==0) + { + if (error_res_disable) + { + if (i < 4) + bits->Y += IntraDC_dpcm(coeff[0],1,bitstream); + else + bits->C += IntraDC_dpcm(coeff[0],0,bitstream); + } + else + { + if (i < 4) + bits->Y += IntraDC_dpcm(coeff[0],1,DCbitstream); + else + bits->C += IntraDC_dpcm(coeff[0],0,DCbitstream); + } + } + + /* Code AC coeffs. dep. on block pattern MW 15-NOV-1996 */ + if ((i==0 && CBP&32) || + (i==1 && CBP&16) || + (i==2 && CBP&8) || + (i==3 && CBP&4) || + (i==4 && CBP&2) || + (i==5 && CBP&1)) + { + if (error_res_disable || ((!error_res_disable) && (!reverse_vlc))) + { + if (i < 4) + bits->Y += CodeCoeff(1-switched,Mode, coeff,i,ncoeffs,bitstream); + else + bits->C += CodeCoeff(1-switched,Mode, coeff,i,ncoeffs, + bitstream); + } + else + { + if (i < 4) + bits->Y += CodeCoeff_RVLC(1-switched,Mode, coeff, i, + ncoeffs, bitstream); + else + bits->C += CodeCoeff_RVLC(1-switched,Mode, coeff, i, + ncoeffs, bitstream); + } + } + } + } + } + else /* Without ACDC prediction */ + { + for (i = 0; i < 6; i++) + { + // if (i>3 || transp_pattern[i]!=1) /* Not transparent */ + { + /* Do the zigzag scanning of coefficients */ + for (m = 0; m < 64; m++) + *(coeff + zz[m]) = qcoeff[i*ncoeffs+m]; + + if (switched==0) + { + if (error_res_disable) + { + if (coeff[0] != 128) + BitstreamPutBits(bitstream,(long)(coeff[0]),8L); + else + BitstreamPutBits(bitstream, 255L, 8L); + } + else + { + if (coeff[0] != 128) + BitstreamPutBits(DCbitstream,(long)(coeff[0]),8L); + else + BitstreamPutBits(DCbitstream,255L, 8L); + } + + if (i < 4) + bits->Y += 8; + else + bits->C += 8; + } + + if ((i==0 && CBP&32) || (i==1 && CBP&16) || + (i==2 && CBP&8) || (i==3 && CBP&4) || + (i==4 && CBP&2) || (i==5 && CBP&1)) + { + /* send coeff, not qcoeff !!! MW 07-11-96 */ + + if (error_res_disable || ((!error_res_disable) && (!reverse_vlc))) + { + if (i < 4) + bits->Y += CodeCoeff(1-switched,Mode, coeff,i,ncoeffs, + bitstream); + else + bits->C += CodeCoeff(1-switched,Mode, coeff,i,ncoeffs, + bitstream); + } + else + { + if (i < 4) + bits->Y += CodeCoeff_RVLC(1-switched,Mode, coeff, i, + ncoeffs, bitstream); + else + bits->C += CodeCoeff_RVLC(1-switched,Mode, coeff, i, + ncoeffs, bitstream); + } + + } + } + } + } + } + else /* inter block encoding */ + { + for (i = 0; i < 6; i++) + { + /* Do the zigzag scanning of coefficients */ + for (m = 0; m < 64; m++) + *(coeff + zz[m]) = qcoeff[i*ncoeffs+m]; + if ((i==0 && CBP&32) || + (i==1 && CBP&16) || + (i==2 && CBP&8) || + (i==3 && CBP&4) || + (i==4 && CBP&2) || + (i==5 && CBP&1)) + { + if (error_res_disable || ((!error_res_disable) && (!reverse_vlc))) + { + if (i < 4) + bits->Y += CodeCoeff(0,Mode, coeff, i, ncoeffs, bitstream); + else + bits->C += CodeCoeff(0,Mode, coeff, i, ncoeffs, bitstream); + } + else + { + if (i < 4) + bits->Y += CodeCoeff_RVLC(0,Mode, coeff, i, ncoeffs, + bitstream); + else + bits->C += CodeCoeff_RVLC(0,Mode, coeff, i, ncoeffs, + bitstream); + } + + } + } + } + } + + + /***********************************************************CommentBegin****** + * + * -- IntraDC_dpcm -- DPCM Encoding of INTRADC in case of Intra macroblocks + * + * Purpose : + * DPCM Encoding of INTRADC in case of Intra macroblocks + * + * Arguments in : + * Int val : the difference value with respect to the previous + * INTRADC value + * Int lum : indicates whether the block is a luminance block (lum=1) or + * a chrominance block ( lum = 0) + * + * Arguments out : + * Image* bitstream : a pointer to the output bitstream + * + ***********************************************************CommentEnd********/ + + Int + IntraDC_dpcm(Int val, Int lum, Image *bitstream) + { + Int n_bits; + Int absval, size = 0; + + absval = ( val <0)?-val:val; /* abs(val) */ + + /* compute dct_dc_size */ + + size = 0; + while(absval) + { + absval>>=1; + size++; + } + + if (lum) + { /* luminance */ + n_bits = PutDCsize_lum (size, bitstream); + } + else + { /* chrominance */ + n_bits = PutDCsize_chrom (size, bitstream); + } + + if ( size != 0 ) + { + if (val>=0) + { + ; + } + else + { + absval = -val; /* set to "-val" MW 14-NOV-1996 */ + val = (absval ^( (int)pow(2.0,(double)size)-1) ); + } + BitstreamPutBits(bitstream, (long)(val), (long)(size)); + n_bits += size; + + if (size > 8) + BitstreamPutBits(bitstream, (long)1, (long)1); + } + + return n_bits; /* # bits for intra_dc dpcm */ + + } + + + /***********************************************************CommentBegin****** + * + * -- CodeCoeff -- VLC encoding of quantized DCT coefficients + * + * Purpose : + * VLC encoding of quantized DCT coefficients, except for + * INTRADC in case of Intra macroblocks + * Used by Bits_CountCoeff + * + * Arguments in : + * Int Mode : encoding mode + * Int *qcoeff: pointer to quantized dct coefficients + * Int block : number of the block in the macroblock (0-5) + * Int ncoeffs : the number of coefficients per block + * + * Arguments out : + * Image *bitstream : pointer to the output bitstream + * + * Return values : + * Int bits : number of bits added to the bitstream (?) + * + ***********************************************************CommentEnd********/ + + Int CodeCoeff(Int j_start, Int Mode, Int qcoeff[], Int block, Int ncoeffs, Image *bitstream) + { + Int j, bits; + Int prev_run, run, prev_level, level, first; + Int prev_ind, ind, prev_s, s, length; + + run = bits = 0; + first = 1; + prev_run = prev_level = prev_ind = level = s = prev_s = ind = 0; + + for (j = j_start; j< ncoeffs; j++) + { + /* The INTRADC encoding for INTRA Macroblocks is done in + Bits_CountCoeff */ + + { + /* do not enter this part for INTRADC coding for INTRA macro- + blocks */ + + /* encode AC coeff */ + + s = 0; + + /* Increment run if coeff is zero */ + + if ((level = qcoeff[j]) == 0) + { + run++; + } + else + { + /* code run & level and count bits */ + + if (level < 0) + { + s = 1; + level = -level; + } + + ind = level | run<<4; + ind = ind | 0<<12; /* Not last coeff */ + + if (!first) + { + /* Encode the previous ind */ + + if ((prev_run < 64) && + (((prev_level < 13) && (Mode != MODE_INTRA && + Mode != MODE_INTRA_Q)) + || ((prev_level < 28) && (Mode == MODE_INTRA || + Mode == MODE_INTRA_Q)))) + { + /* Separate tables for Intra luminance blocks */ + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + length = PutCoeff_Intra(prev_run, prev_level, + 0, bitstream); + } + else + { + length = PutCoeff_Inter(prev_run, prev_level, + 0, bitstream); + } + } + else + length = 0; + + /* First escape mode. Level offset */ + if (length == 0) + { + + if ( prev_run < 64 ) + { + + /* subtraction of Max level, last = 0 */ + int level_minus_max; + + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + level_minus_max = prev_level - + intra_max_level[0][prev_run]; + else + level_minus_max = prev_level - + inter_max_level[0][prev_run]; + + if ( ( (level_minus_max < 13) && (Mode != MODE_INTRA && Mode != MODE_INTRA_Q) ) || + ( (level_minus_max < 28) && (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) ) ) + { + /* Separate tables for Intra luminance blocks */ + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + length = PutLevelCoeff_Intra(prev_run, level_minus_max, 0, bitstream); + } + else + { + length = PutLevelCoeff_Inter(prev_run, level_minus_max, 0, bitstream); + } + } else + length = 0; + } + else length = 0; + } + + /* Second escape mode. Run offset */ + if (length == 0) + { + if ( ((prev_level < 13) && (Mode != MODE_INTRA && Mode != MODE_INTRA_Q)) || + ((prev_level < 28) && (Mode == MODE_INTRA || Mode == MODE_INTRA_Q)) ) + { + + /* subtraction of Max Run, last = 0 */ + int run_minus_max; + + if (prev_level == 0) + { + fprintf (stdout, "ERROR(CodeCoeff-second esc): level is %d\n", prev_level); + exit(-1); + } + + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + run_minus_max = prev_run - (intra_max_run0[prev_level]+1); + else + run_minus_max = prev_run - (inter_max_run0[prev_level]+1); + + /* boon 120697 */ + if (run_minus_max < 64) + { + /* Separate tables for Intra luminance blocks */ + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + length = PutRunCoeff_Intra(run_minus_max, prev_level, 0, bitstream); + } + else + { + length = PutRunCoeff_Inter(run_minus_max, prev_level, 0, bitstream); + } + } else + length = 0; + } + else length = 0; + } + + /* Third escape mode. FLC */ + if (length == 0) + { /* Escape coding */ + + if (prev_s == 1) + { + /* Modified due to N2171 Cl. 2.2.14 MW 25-MAR-1998 */ + /* prev_level = (prev_level^0xff)+1; */ + prev_level = (prev_level^0xfff)+1; + } + BitstreamPutBits(bitstream, 3L, 7L); + /* boon */ + BitstreamPutBits(bitstream, 3L, 2L); + + /* last */ + BitstreamPutBits(bitstream, 0L, 1L); + /* run */ + BitstreamPutBits(bitstream, (long)(prev_run), 6L); + + /* 11.08.98 Sven Brandau: "insert marker_bit" due to N2339, Clause 2.1.21 */ + BitstreamPutBits(bitstream, MARKER_BIT, 1); + + /* Modified due to N2171 Cl. 2.2.14 MW 25-MAR-1998 */ + /* BitstreamPutBits(bitstream, (long)(prev_level), 8L); */ + /* bits += 24; */ + /* level */ + BitstreamPutBits(bitstream, (long)(prev_level), 12L); + + /* 11.08.98 Sven Brandau: "insert marker_bit" due to N2339, Clause 2.1.21 */ + BitstreamPutBits(bitstream, MARKER_BIT, 1); + + /*bits += 28;*/ + bits += 30; + } + else + { + BitstreamPutBits(bitstream, (long)(prev_s), 1L); + bits += length + 1; + } + } + + prev_run = run; prev_s = s; + prev_level = level; prev_ind = ind; + + run = first = 0; + } + } + } + + /* Encode the last coeff */ + + if (!first) + { + prev_ind = prev_ind | 1<<12; /* last coeff */ + + if ((prev_run < 64) && + (((prev_level < 4) && (Mode != MODE_INTRA && + Mode != MODE_INTRA_Q)) + || ((prev_level < 9) && ((Mode == MODE_INTRA) || + (Mode == MODE_INTRA_Q))))) + { + /* Separate tables for Intra luminance blocks */ + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + length = PutCoeff_Intra(prev_run, prev_level, 1, + bitstream); + } + else + { + length = PutCoeff_Inter(prev_run, prev_level, 1, + bitstream); + } + } + else + length = 0; + + /* First escape mode. Level offset */ + if (length == 0) + { + if ( prev_run < 64 ) + { + + /* subtraction of Max level, last = 0 */ + int level_minus_max; + + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + level_minus_max = prev_level - intra_max_level[1][prev_run]; + else + level_minus_max = prev_level - inter_max_level[1][prev_run]; + + if ( ( (level_minus_max < 4) && (Mode != MODE_INTRA && Mode != MODE_INTRA_Q) ) || + ( (level_minus_max < 9) && (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) ) ) + { + /* Separate tables for Intra luminance blocks */ + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + length = PutLevelCoeff_Intra(prev_run, level_minus_max, 1, bitstream); + } + else + { + length = PutLevelCoeff_Inter(prev_run, level_minus_max, 1, bitstream); + } + } else + length = 0; + } + else length = 0; + } + + /* Second escape mode. Run offset */ + if (length == 0) + { + if (((prev_level < 4) && (Mode != MODE_INTRA && Mode != MODE_INTRA_Q))|| + ((prev_level < 9) && (Mode == MODE_INTRA || Mode == MODE_INTRA_Q)) ) + { + + /* subtraction of Max Run, last = 1 */ + int run_minus_max; + + if (prev_level == 0) + { + fprintf (stdout, "ERROR(CodeCoeff-second esc): level is %d\n", prev_level); + exit(-1); + } + + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + run_minus_max = prev_run - (intra_max_run1[prev_level]+1); + else + run_minus_max = prev_run - (inter_max_run1[prev_level]+1); + + if (run_minus_max < 64) /* boon 120697 */ + { + /* Separate tables for Intra luminance blocks */ + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + length = PutRunCoeff_Intra(run_minus_max, prev_level, 1, bitstream); + } + else + { + length = PutRunCoeff_Inter(run_minus_max, prev_level, 1, bitstream); + } + } else + length = 0; + } + else length = 0; + } + + /* Third escape mode. FLC */ + if (length == 0) + { /* Escape coding */ + + if (prev_s == 1) + { + /* Modified due to N2171 Cl. 2.2.14 MW 25-MAR-1998 */ + /* prev_level = (prev_level^0xff)+1; */ + prev_level = (prev_level^0xfff)+1; + } + BitstreamPutBits(bitstream, 3L, 7L); + BitstreamPutBits(bitstream, 3L, 2L); /* boon */ + + BitstreamPutBits(bitstream, 1L, 1L); /* last */ + BitstreamPutBits(bitstream, (long)(prev_run), 6L); + + /* 11.08.98 Sven Brandau: "insert marker_bit" due to N2339, Clause 2.1.21 */ + BitstreamPutBits(bitstream, MARKER_BIT, 1); + + /* Modified due to N2171 Cl. 2.2.14 MW 25-MAR-1998 */ + /* BitstreamPutBits(bitstream, (long)(prev_level), 8L); */ + /* bits += 24; */ + /* level */ + BitstreamPutBits(bitstream, (long)(prev_level), 12L); + + /* 11.08.98 Sven Brandau: "insert marker_bit" due to N2339, Clause 2.1.21 */ + BitstreamPutBits(bitstream, MARKER_BIT, 1); + + /*bits += 28;*/ + bits += 30; + + } + else + { + BitstreamPutBits(bitstream, (long)(prev_s), 1L); + bits += length + 1; + } + } + + return bits; + } + + + /***********************************************************CommentBegin****** + * + * -- CodeCoeff_RVLC -- RVLC encoding of quantized DCT coefficients + * + * Purpose : + * RVLC encoding of quantized DCT coefficients, except for + * INTRADC in case of Intra macroblocks + * + * Arguments in : + * Int Mode : encoding mode + * Int *qcoeff: pointer to quantized dct coefficients + * Int block : number of the block in the macroblock (0-5) + * Int ncoeffs : the number of coefficients per block + * + * Arguments out : + * Image *bitstream : pointer to the output bitstream + * + * Return values : + * Int bits : number of bits added to the bitstream (?) + * + ***********************************************************CommentEnd********/ + + Int CodeCoeff_RVLC(Int j_start, Int Mode, Int qcoeff[], Int block, Int ncoeffs, Image *bitstream) + { + Int j, bits; + Int prev_run, run, prev_level, level, first; + Int prev_ind, ind, prev_s, s, length; + + run = bits = 0; + first = 1; + prev_run = prev_level = prev_ind = level = s = prev_s = ind = 0; + + for (j = j_start; j< ncoeffs; j++) + { + /* The INTRADC encoding for INTRA Macroblocks is done in + Bits_CountCoeff */ + + { + /* do not enter this part for INTRADC coding for INTRA macro- + blocks */ + + /* encode AC coeff */ + + s = 0; + + /* Increment run if coeff is zero */ + + if ((level = qcoeff[j]) == 0) + { + run++; + } + else + { + /* code run & level and count bits */ + + if (level < 0) + { + s = 1; + level = -level; + } + + ind = level | run<<4; + ind = ind | 0<<12; /* Not last coeff */ + if (!first) + { + /* Encode the previous ind */ + + if (prev_level < 28 && prev_run < 39) + /* Separate tables for Intra luminance blocks */ + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + length = PutCoeff_Intra_RVLC(prev_run, prev_level, 0, + bitstream); + } + else + { + length = PutCoeff_Inter_RVLC(prev_run, prev_level, 0, + bitstream); + } + else + length = 0; + + if (length == 0) + { /* Escape coding */ + + /* ESCAPE */ + BitstreamPutBits(bitstream, 1L, 5L); + + /* LAST */ + BitstreamPutBits(bitstream, 0L, 1L); + + BitstreamPutBits(bitstream, + (long)(prev_run), 6L);/* RUN */ + + /* 11.08.98 Sven Brandau: "changed length for LEVEL (11 bit)" due to N2339, Clause 2.1.21 */ + /* 11.08.98 Sven Brandau: "insert marker_bit befor and after LEVEL" due to N2339, Clause 2.1.21 */ + /* BitstreamPutBits(bitstream, + (long)(prev_level), 7L);*/ + /* LEVEL */ + BitstreamPutBits( bitstream, MARKER_BIT, 1 ); + /* LEVEL */ + BitstreamPutBits( bitstream, (long)(prev_level), 11L); + BitstreamPutBits( bitstream, MARKER_BIT, 1 ); + + /* ESCAPE */ + BitstreamPutBits(bitstream, 0L, 4L); + + /* ESCAPE's */ + BitstreamPutBits(bitstream, + (long)(prev_s),1L); + + bits += 5 + 1 + 6 + 1 + 11 + 1 + 4 + 1; + /* bits += 24; */ + } + else + { + BitstreamPutBits(bitstream, + (long)(prev_s), 1L); + bits += length + 1; + } + } + + prev_run = run; prev_s = s; + prev_level = level; prev_ind = ind; + + run = first = 0; + } + } + } + + /* Encode the last coeff */ + + if (!first) + { + prev_ind = prev_ind | 1<<12; /* last coeff */ + + if (prev_level < 5 && prev_run < 45) + /* Separate tables for Intra luminance blocks */ + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + length = PutCoeff_Intra_RVLC(prev_run, prev_level, 1, + bitstream); + } + else + { + length = PutCoeff_Inter_RVLC(prev_run, prev_level, 1, + bitstream); + } + else + length = 0; + + if (length == 0) + { /* Escape coding */ + + BitstreamPutBits(bitstream, 1L, 5L); /* ESCAPE */ + + BitstreamPutBits(bitstream, 1L, 1L); /* LAST */ + + /* RUN */ + BitstreamPutBits(bitstream, (long)(prev_run), 6L); + + /* 11.08.98 Sven Brandau: "changed length for LEVEL (11 bit)" due to N2339, Clause 2.1.21 */ + /* 11.08.98 Sven Brandau: "insert marker_bit befor and after LEVEL" due to N2339, Clause 2.1.21 */ + /* BitstreamPutBits(bitstream, (long)(prev_level), 7L);*/ + BitstreamPutBits( bitstream, MARKER_BIT, 1 ); + /* LEVEL */ + BitstreamPutBits( bitstream, (long)(prev_level), 11L); + BitstreamPutBits( bitstream, MARKER_BIT, 1 ); + + BitstreamPutBits(bitstream, 0L, 4L); /* ESCAPE */ + + /* ESCAPE's */ + BitstreamPutBits(bitstream, (long)(prev_s), 1L); + + bits += 24; + + } + else + { + BitstreamPutBits(bitstream, (long)(prev_s), 1L); + bits += length + 1; + } + } + + return bits; + } + + + /***********************************************************CommentBegin****** + * + * -- Bits_Reset -- To reset the structure bits + * + * Purpose : + * To reset the structure bits, used for counting the number + * of texture bits + * + * Arguments in : + * Bits* bits : a pointer to the struct Bits + * + ***********************************************************CommentEnd********/ + + void + Bits_Reset (Bits *bits) + { + memset(bits, 0, sizeof(Bits)); + } diff -C2 -r -N bcast-2000c/quicktime/encore50/text_bits.h bcast-2000c-mf3/quicktime/encore50/text_bits.h *** bcast-2000c/quicktime/encore50/text_bits.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/text_bits.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,75 ---- + + #ifndef _TEXT_BITS_H_ + #define _TEXT_BITS_H_ + + + #include "momusys.h" + #include "text_defs.h" + + + + /* struct for counting bits */ + + typedef struct { + Int Y; + Int C; + Int vec; + Int CBPY; + Int CBPC; + Int MCBPC; + Int MODB; + Int CBPB; + Int MBTYPE; + Int COD; + Int MB_Mode; + Int header; + Int DQUANT; + Int total; + Int no_inter; + Int no_inter4v; + Int no_intra; + Int no_GMC; /* NTT for GMC coding */ + Int ACpred_flag; + Int G; /* HYUNDAI : (Grayscale) */ + Int CODA; /* HYUNDAI : (Grayscale) */ + Int CBPA; /* HYUNDAI : (Grayscale) */ + Int g_ACpred_flag; /* HYUNDAI : (Grayscale) */ + Int no_field; + Int no_skipped; + Int no_Pskip; + Int no_noDCT; + Int fieldDCT; + Int interlaced; + Int Btype[7]; + Int Nmvs[3]; + } Bits; + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + Void MB_CodeCoeff _P_(( Bits *bits, + Int *qcoeff, + Int Mode, + Int CBP, + Int ncoeffs, + Int intra_dcpred_disable, + Image *DCbitstream, + Image *bitstream, + Int transp_pattern[], + Int direction[], + Int error_res_disable, + Int reverse_vlc, + Int switched, + Int alternate_scan + )); + + void Bits_Reset _P_(( Bits *bits + )); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + + #endif /* _TEXT_BITS_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore50/text_code.c bcast-2000c-mf3/quicktime/encore50/text_code.c *** bcast-2000c/quicktime/encore50/text_code.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/text_code.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,980 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * text_code.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions for text coding of image. */ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "text_defs.h" + #include "mot_code.h" + #include "bitstream.h" + #include "putvlc.h" + #include "mot_util.h" + #include "text_code_mb.h" + #include "text_code.h" + + #define SKIPP 6 + + extern FILE *ftrace; + + Void Bits_CountMB_combined ( Int DQUANT, + Int Mode, + Int COD, + Int ACpred_flag, + Int CBP, + Int vop_type, + Bits *bits, + Image *mottext_bitstream, + Int *MB_transp_pattern + ); + Int doDCACpred ( Int *qcoeff, + Int *CBP, + Int ncoeffs, + Int x_pos, + Int y_pos, + Int ***DC_store, + Int QP, + Int MB_width, + Int direction[], + Int mid_grey + ); + Void nullfill(Int pred[], Int mid_grey); + Int Idir_c(Int val, Int QP); + Int IntraDCSwitch_Decision _P_(( Int Mode, + Int intra_dc_vlc_thr, + Int Qp + )); + Int FindCBP _P_(( Int *qcoeff, + Int Mode, + Int ncoeffs + )); + + + /***********************************************************CommentBegin****** + * + * -- VopCodeShapeTextIntraCom --Intra texture encoding of one vop, + * Combined shape/(motion)/texture mode + * + * Purpose : + * Intra texture encoding of one vop (combined shape/(mot)/text mode) + * + * Arguments in : + * Vop curr : the current vop to be coded + * Int intra_dcpred_disable : disable intradc prediction + * Image* AB_SizeConversionDecisions: + * Image* AB_first_MMR_values + * VolConfig *vol_config : configuration information + * Int rc_type : rate control type: + * + * Arguments out : + * Vop *rec_curr : the reconstructed current vop + * Image *texture_bitstream : the output bitstream + * Bits : statistics information + * + * Description : + * This function performs Intra texture encoding of one vop. + * + ***********************************************************CommentEnd********/ + + Void VopCodeShapeTextIntraCom(Vop *curr, + Vop *rec_curr, Image *mottext_bitstream) + { + Int QP = GetVopIntraQuantizer(curr); + Int Mode = MODE_INTRA; + Int* qcoeff; + Int i, j; + Int CBP, COD; + Int CBPY, CBPC; + Int num_pixels = GetImageSizeX(GetVopY(curr)); + Int num_lines = GetImageSizeY(GetVopY(curr)); + Int vop_type; + Int ***DC_store; + Int MB_width = num_pixels / MB_SIZE; + Int MB_height = num_lines / MB_SIZE; + Int m; + Int ACpred_flag=-1; + Int direction[6]; + Int switched=0; + Int DQUANT =0; + + Bits nbits, *bits; + bits = &nbits; + + qcoeff = (Int *) malloc (sizeof (Int) * 384); + + #ifdef _RC_DEBUG_ + fprintf(ftrace, "RC - VopCodeShapeTextIntraCom(): ---> CODING WITH: %d \n",QP); + #endif + + for (i = 0; i < 6; i++) + direction[i] = 0; + + /* allocate space for 3D matrix to keep track of prediction values + for DC/AC prediction */ + + DC_store = (Int ***)calloc(MB_width*MB_height, sizeof(Int **)); + for (i = 0; i < MB_width*MB_height; i++) + { + DC_store[i] = (Int **)calloc(6, sizeof(Int *)); + for (j = 0; j < 6; j++) + DC_store[i][j] = (Int *)calloc(15, sizeof(Int)); + } + + Bits_Reset (bits); + vop_type = PCT_INTRA; + + for (j = 0; j < num_lines/MB_SIZE; j++) /* Macro Block loop */ + { + for (i = 0; i < num_pixels/MB_SIZE; i++) + { + DQUANT = 0; + + COD = 0; + bits->no_intra++; + + CodeMB (curr, rec_curr, NULL, i*MB_SIZE, j*MB_SIZE, + num_pixels, QP+DQUANT, MODE_INTRA, qcoeff); + + m =0; + + DC_store[j*MB_width+i][0][m] = qcoeff[m]*cal_dc_scaler(QP+DQUANT,1); + DC_store[j*MB_width+i][1][m] = qcoeff[m+64]*cal_dc_scaler(QP+DQUANT,1); + DC_store[j*MB_width+i][2][m] = qcoeff[m+128]*cal_dc_scaler(QP+DQUANT,1); + DC_store[j*MB_width+i][3][m] = qcoeff[m+192]*cal_dc_scaler(QP+DQUANT,1); + DC_store[j*MB_width+i][4][m] = qcoeff[m+256]*cal_dc_scaler(QP+DQUANT,2); + DC_store[j*MB_width+i][5][m] = qcoeff[m+320]*cal_dc_scaler(QP+DQUANT,2); + + for (m = 1; m < 8; m++) + { + DC_store[j*MB_width+i][0][m] = qcoeff[m]; + DC_store[j*MB_width+i][1][m] = qcoeff[m+64]; + DC_store[j*MB_width+i][2][m] = qcoeff[m+128]; + DC_store[j*MB_width+i][3][m] = qcoeff[m+192]; + DC_store[j*MB_width+i][4][m] = qcoeff[m+256]; + DC_store[j*MB_width+i][5][m] = qcoeff[m+320]; + } + for (m = 0; m < 7; m++) + { + DC_store[j*MB_width+i][0][m+8] = qcoeff[(m+1)*8]; + DC_store[j*MB_width+i][1][m+8] = qcoeff[(m+1)*8+64]; + DC_store[j*MB_width+i][2][m+8] = qcoeff[(m+1)*8+128]; + DC_store[j*MB_width+i][3][m+8] = qcoeff[(m+1)*8+192]; + DC_store[j*MB_width+i][4][m+8] = qcoeff[(m+1)*8+256]; + DC_store[j*MB_width+i][5][m+8] = qcoeff[(m+1)*8+320]; + } + + CBP = FindCBP(qcoeff,Mode,64); + + /* Do the DC/AC prediction, changing the qcoeff values as + appropriate */ + if (GetVopIntraACDCPredDisable(curr) == 0) + { + ACpred_flag = doDCACpred(qcoeff, &CBP, 64, i, j, DC_store, + QP+DQUANT, MB_width, + direction,GetVopMidGrey(curr)); + } + else + ACpred_flag = -1; + + switched = IntraDCSwitch_Decision(Mode, + GetVopIntraDCVlcThr(curr), + QP); + if (switched) + CBP = FindCBP(qcoeff,MODE_INTER,64); + if (DQUANT) Mode=MODE_INTRA_Q;else Mode=MODE_INTRA; + + QP+=DQUANT; + + CBPY = CBP >> 2; + CBPY = CBPY & 15; /* last 4 bits */ + CBPC = CBP & 3; /* last 2 bits */ + + Bits_CountMB_combined (DQUANT, Mode, COD, ACpred_flag, CBP, + vop_type, + bits, mottext_bitstream,/*MB_transp_pattern*/NULL); + + /* added the variable intra_dcpred_diable */ + MB_CodeCoeff(bits, qcoeff, Mode, CBP, 64, + GetVopIntraACDCPredDisable(curr), + NULL, mottext_bitstream, + /*MB_transp_pattern*/NULL, direction, + 1 /*GetVopErrorResDisable(curr)*/, + 0 /*GetVopReverseVlc(curr)*/, + switched, + 0 /*curr->alternate_scan*/); + } + } + + /* Free allocated memory for 3D matrix */ + for (i = 0; i < MB_width*MB_height; i++) + { + for (j = 0; j < 6; j++) + free(DC_store[i][j]); + free(DC_store[i]); + } + free(DC_store); + + free ((Char*)qcoeff); + } + + /***********************************************************CommentBegin****** + * + * -- VopShapeMotText -- Combined Inter encoding of shape motion and texture + * + * Purpose : + * Combined Inter encoding of texture and motion. + * Used by VopCodeMotTextInter + * + * Arguments in : + * Vop *curr : the current vop to be encoded + * Vop *rec_prev: the previous reconstructed vop + * Image *mot_x : the x-coordinates of the motion vectors + * Image *mot_y : the y-coordinates of the motion vectors + * Image *MB_decisions: Contains for each macroblock the encoding mode + * Int f_code_for: MV search range 1/2 pel: 1=32,2=64,...,7=2048 + * Image* AB_SizeConversionDecisions: + * Image* AB_first_MMR_values : + * Int intra_dcpred_disable : disable the intra dc prediction + * VolConfig *vol_config : configuration information + * Int rc_type : rate control type + * + * Arguments out : + * Vop *rec_curr : the reconstructed current vop + * Image *mottext_bitstream : the output texture/motion bitstream + * Bits *bits : Coding statistics + * + ***********************************************************CommentEnd********/ + + Void VopShapeMotText (Vop *curr, Vop *comp, + Image *MB_decisions, Image *mot_x, Image *mot_y, + Int f_code_for, + Int intra_acdc_pred_disable, + Vop *rec_curr, + Image *mottext_bitstream + ) + { + Int Mode=0; + Int QP = GetVopQuantizer(curr); + Int* qcoeff=NULL; + Int i, j; + Int CBP; + Int COD; + Int CBPY, CBPC; + Int MB_in_width, MB_in_height, B_in_width, mbnum, boff; + SInt p; + SInt *ptr=NULL; + Float *motx_ptr=NULL, *moty_ptr=NULL; + Int num_pixels; + Int num_lines; + Int vop_type=PCT_INTER; + Int ***DC_store=NULL; + Int m, n; + Int ACpred_flag=-1; + Int direction[6]; + Int switched=0; + Int DQUANT=0; + + Bits nbits, *bits; + bits = &nbits; + + qcoeff = (Int *) malloc (sizeof (Int) * 384); + + num_pixels = GetImageSizeX(GetVopY(curr)); + num_lines = GetImageSizeY(GetVopY(curr)); + MB_in_width = num_pixels / MB_SIZE; + MB_in_height = num_lines / MB_SIZE; + B_in_width = 2 * MB_in_width; + + for (i = 0; i < 6; i++) direction[i] = 0; + + #ifdef _RC_DEBUG_ + printf("RC - VopShapeMotText(): ---> CODING WITH: %d \n",QP); + #endif + + /* allocate space for 3D matrix to keep track of prediction values + for DC/AC prediction */ + DC_store = (Int ***)calloc(MB_in_width*MB_in_height, + sizeof(Int **)); + for (i = 0; i < MB_in_width*MB_in_height; i++) + { + DC_store[i] = (Int **)calloc(6, sizeof(Int *)); + for (j = 0; j < 6; j++) + DC_store[i][j] = (Int *)calloc(15, sizeof(Int)); + } + + Bits_Reset (bits); + + vop_type = PCT_INTER; + + ptr = (SInt *) GetImageData(MB_decisions); + motx_ptr = (Float *) GetImageData(mot_x); + moty_ptr = (Float *) GetImageData(mot_y); + + for (j = 0; j < num_lines/MB_SIZE; j++) + { + for (i = 0; i < MB_in_width; i++) + { + switched=0; + p = *ptr; + DQUANT = 0; + + /* Fill DC_store with default coeff values */ + for (m = 0; m < 6; m++) + { + DC_store[j*MB_in_width+i][m][0] = GetVopMidGrey(curr)*8; + for (n = 1; n < 15; n++) + DC_store[j*MB_in_width+i][m][n] = 0; + } + + switch (p) + { + + case MBM_INTRA: + Mode = (DQUANT == 0) ? MODE_INTRA : MODE_INTRA_Q; + bits->no_intra++; + break; + + case MBM_INTER16: + Mode = (DQUANT == 0) ? MODE_INTER : MODE_INTER_Q; + bits->no_inter++; + break; + + case MBM_INTER8: + Mode = MODE_INTER4V; + bits->no_inter4v++; + DQUANT = 0; /* Can't change QP for 8x8 mode */ + break; + + default: + printf("invalid MB_decision value :%d\n", p); + exit(0); + } + + CodeMB (curr, rec_curr, comp, i*MB_SIZE, j*MB_SIZE, + num_pixels, QP + DQUANT, Mode, qcoeff); + + mbnum = j*MB_in_width + i; + boff = (2 * (mbnum / MB_in_width) * B_in_width + + 2 * (mbnum % MB_in_width)); + + CBP = FindCBP(qcoeff,Mode,64); + + if ((CBP == 0) && (p == 1) && (*(motx_ptr +boff) == 0.0) + && (*(moty_ptr +boff) == 0.0)) + { + COD = 1; /* skipped macroblock */ + BitstreamPutBits(mottext_bitstream, (long) (COD), 1L); + bits->COD ++; + + *ptr = SKIPP; + Mode = MODE_INTER; + } + else + { + COD = 0; /* coded macroblock */ + + if ((Mode == MODE_INTRA) || (Mode == MODE_INTRA_Q)) + { + + /* Store the qcoeff-values needed later for prediction */ + m =0; + + DC_store[j*MB_in_width+i][0][m] = qcoeff[m]*cal_dc_scaler(QP+DQUANT,1); + DC_store[j*MB_in_width+i][1][m] = qcoeff[m+64]*cal_dc_scaler(QP+DQUANT,1); + DC_store[j*MB_in_width+i][2][m] = qcoeff[m+128]*cal_dc_scaler(QP+DQUANT,1); + DC_store[j*MB_in_width+i][3][m] = qcoeff[m+192]*cal_dc_scaler(QP+DQUANT,1); + DC_store[j*MB_in_width+i][4][m] = qcoeff[m+256]*cal_dc_scaler(QP+DQUANT,2); + DC_store[j*MB_in_width+i][5][m] = qcoeff[m+320]*cal_dc_scaler(QP+DQUANT,2); + + for (m = 1; m < 8; m++) + { + DC_store[j*MB_in_width+i][0][m] = qcoeff[m]; + DC_store[j*MB_in_width+i][1][m] = qcoeff[m+64]; + DC_store[j*MB_in_width+i][2][m] = qcoeff[m+128]; + DC_store[j*MB_in_width+i][3][m] = qcoeff[m+192]; + DC_store[j*MB_in_width+i][4][m] = qcoeff[m+256]; + DC_store[j*MB_in_width+i][5][m] = qcoeff[m+320]; + } + for (m = 0; m < 7; m++) + { + DC_store[j*MB_in_width+i][0][m+8] = qcoeff[(m+1)*8]; + DC_store[j*MB_in_width+i][1][m+8] = qcoeff[(m+1)*8+64]; + DC_store[j*MB_in_width+i][2][m+8] = qcoeff[(m+1)*8+128]; + DC_store[j*MB_in_width+i][3][m+8] = qcoeff[(m+1)*8+192]; + DC_store[j*MB_in_width+i][4][m+8] = qcoeff[(m+1)*8+256]; + DC_store[j*MB_in_width+i][5][m+8] = qcoeff[(m+1)*8+320]; + } + + if (intra_acdc_pred_disable == 0) + ACpred_flag = doDCACpred(qcoeff, &CBP, 64, i, j, + DC_store, + QP+DQUANT, MB_in_width, + direction,GetVopMidGrey(curr)); + else + ACpred_flag = -1; /* Not to go into bitstream */ + } + + switched = IntraDCSwitch_Decision(Mode, + GetVopIntraDCVlcThr(curr), + QP); + if (switched) + CBP = FindCBP(qcoeff,MODE_INTER,64); + + CBPY = CBP >> 2; + CBPY = CBPY & 15; /* last 4 bits */ + CBPC = CBP & 3; /* last 2 bits */ + + Bits_CountMB_combined (DQUANT, Mode, COD, ACpred_flag, CBP, + vop_type, bits, + mottext_bitstream,/*MB_transp_pattern*/NULL); + + Bits_CountMB_Motion( mot_x, mot_y, NULL, + MB_decisions, i, j, f_code_for, 0 /*quarter_pel*/, + mottext_bitstream, + 1 /*GetVopErrorResDisable(curr)*/, 0, + (Int **)NULL, 0 /*GetVopShape(curr)*/); + + MB_CodeCoeff(bits, qcoeff, Mode, CBP, 64, + intra_acdc_pred_disable, + NULL, mottext_bitstream, + /*MB_transp_pattern*/NULL, direction, + 1/*GetVopErrorResDisable(curr)*/, + 0/*GetVopReverseVlc(curr)*/, + switched, + 0 /*curr->alternate_scan*/); + } + + ptr++; + + } /* for i loop */ + } /* for j loop */ + + /* Free allocated memory for 3D matrix */ + for (i = 0; i < MB_in_width*MB_in_height; i++) + { + + for (j = 0; j < 6; j++) + free(DC_store[i][j]); + free(DC_store[i]); + } + free(DC_store); + + free ((Char*)qcoeff); + + } + + /***********************************************************CommentBegin****** + * + * -- Bits_CountMB_combined -- texture encoding for combined texture/motion + * + * Purpose : + * Used for texture encoding in case of combined texture/motion + * encoding. This function encodes the : + * - COD flag + * - MCBPC flag + * - CBPY flag + * - CBPC flag + * - DQUANT information + * + * Arguments in : + * SInt Mode : The macroblock encoding mode + * Int CBP : Coded block pattern information + * Int COD : Indicates whether this macroblock is coded or not + * Int ACpred_flag + * Int vop_type : indicates the picture coding type + * (Intra,Inter) + * + * Arguments out : + * Bits* bits : a structure counting the number of bits + * Image *bitstream : output texture bit stream * + * + ***********************************************************CommentEnd********/ + + Void Bits_CountMB_combined(Int DQUANT, Int Mode, Int COD, Int ACpred_flag, + Int CBP, Int vop_type, + Bits* bits, Image *mottext_bitstream,Int *MB_transp_pattern) + { + Int cbpy ,cbpc, length; + Int MBtype=-1; + + if ( Mode == MODE_INTRA ) MBtype = 3; + if ( Mode == MODE_INTER ) MBtype = 0; + if ( Mode == MODE_INTRA_Q) MBtype = 4; + if ( Mode == MODE_INTER_Q) MBtype = 1; + if ( Mode == MODE_INTER4V) MBtype = 2; + + /* modified by NTT for GMC coding : start + if ( Mode == MODE_DYN_SP) MBtype = 0; + if ( Mode == MODE_DYN_SP_Q) MBtype = 1; + */ + if ( Mode == MODE_GMC) MBtype = 0; + if ( Mode == MODE_GMC_Q) MBtype = 1; + /* modified by NTT for GMC coding : end */ + + #ifdef D_TRACE + fprintf(ftrace, "DQUANT : %d\tMODE : %d\tVop Type : %d\n", DQUANT, Mode, vop_type); + fprintf(ftrace, "COD : %d\tCBP : %d\tAC Pred Flag : %d\n\n", COD, CBP, ACpred_flag); + #endif + + cbpc = CBP & 3; + cbpy = CBP>>2; + + /* COD */ + + if (vop_type != PCT_INTRA ) + { + if (COD) + { + printf("COD = 1 in Bits_CountMB_combined \n"); + printf("This function should not be used if COD is '1' \n"); + exit(1); + } + + /* write COD */ + BitstreamPutBits(mottext_bitstream, (long)(COD), 1L); + bits->COD++; + } + + /* MCBPC */ + + if (vop_type == PCT_INTRA) + length = PutMCBPC_Intra (cbpc, MBtype, mottext_bitstream); + else + length = PutMCBPC_Inter (cbpc, MBtype, mottext_bitstream); + + bits->MCBPC += length; + + /* MCSEL syntax */ + /* modified by NTT for GMC coding : start + if (((Mode == MODE_INTER) || (Mode == MODE_INTER_Q) || (Mode == MODE_DYN_SP) || (Mode == MODE_DYN_SP_Q)) && (vop_type == PCT_SPRITE)) + */ + if (((Mode == MODE_INTER) || (Mode == MODE_INTER_Q) || (Mode == MODE_GMC) || (Mode == MODE_GMC_Q)) && (vop_type == PCT_SPRITE)) + /* modified by NTT for GMC coding : end */ + { + if ((Mode == MODE_INTER) || (Mode == MODE_INTER_Q)) + BitstreamPutBits(mottext_bitstream, (long) 0, 1L); + /* modified by NTT for GMC coding : start + if ((Mode == MODE_DYN_SP) || (Mode == MODE_DYN_SP_Q)) + */ + if ((Mode == MODE_GMC) || (Mode == MODE_GMC_Q)) + /* modified by NTT for GMC coding : end */ + BitstreamPutBits(mottext_bitstream, (long) 1, 1L); + + bits->MCBPC += 1; + } + + /* ACpred_flag */ + /* 17-Jan-97 JDL : correction no ACpred_flag in combined mode when intra_acdc_pred_disable is true */ + if ((Mode == MODE_INTRA || Mode==MODE_INTRA_Q) && ACpred_flag != -1) + { + BitstreamPutBits(mottext_bitstream, (long)ACpred_flag, 1L); + bits->ACpred_flag += 1; + } + + /* CBPY */ + + length = PutCBPY (cbpy, (Char)(Mode==MODE_INTRA||Mode==MODE_INTRA_Q),/*MB_transp_pattern*/NULL,mottext_bitstream); + + bits->CBPY += length; + + /* DQUANT */ + + /* modified by NTT for GMC coding : start + if ((Mode == MODE_INTER_Q) || (Mode == MODE_INTRA_Q)|| (Mode == MODE_DYN_SP_Q)) + */ + if ((Mode == MODE_INTER_Q) || (Mode == MODE_INTRA_Q)|| (Mode == MODE_GMC_Q)) + /* modified by NTT for GMC coding : end */ + { + switch (DQUANT) + { + case -1: + BitstreamPutBits(mottext_bitstream, 0L, 2L); + break; + case -2: + BitstreamPutBits(mottext_bitstream, 1L, 2L); + break; + case 1: + BitstreamPutBits(mottext_bitstream, 2L, 2L); + break; + case 2: + BitstreamPutBits(mottext_bitstream, 3L, 2L); + break; + default: + fprintf(stderr,"Invalid DQUANT\n"); + exit(1); + } + bits->DQUANT += 2; + } + } + + + /***********************************************************CommentBegin****** + * + * -- doDCACpred -- Does DC/AC prediction. Changes qcoeff values as + * appropriate. + * + * Purpose : + * Does DC/AC prediction. Changes qcoeff values as appropriate. + * + * Arguments in : + * Int CBP + * Int ncoeffs + * Int x_pos + * Int y_pos + * Int DC_store[][6][15] Stores coefficient values per MB for + * prediction (for one Vop) + * Int QP QP value for this MB + * Int MB_width + * + * Arguments in/out : + * Int *qcoeff + * + * Return values : + * Int The ACpred_flag, which is to be put into the bitstream + * + * Side effects : + * Modifies qcoeff if needed for the prediction. + * + ***********************************************************CommentEnd********/ + + Int doDCACpred(Int *qcoeff, Int *CBP, Int ncoeffs, Int x_pos, Int y_pos, + Int ***DC_store, Int QP, Int MB_width, + Int direction[], Int mid_grey ) + { + Int i, m; + Int block_A, block_B, block_C; + Int Xpos[6] = {-1, 0, -1, 0, -1, -1}; + Int Ypos[6] = {-1, -1, 0, 0, -1, -1}; + Int Xtab[6] = {1, 0, 3, 2, 4, 5}; + Int Ytab[6] = {2, 3, 0, 1, 4, 5}; + Int Ztab[6] = {3, 2, 1, 0, 4, 5}; + Int grad_hor, grad_ver, DC_pred; + Int pred_A[15], pred_C[15]; + Int S = 0, S1, S2; + Int diff; + Int pcoeff[384]; + Int ACpred_flag=-1; + + /* Copy qcoeff to the prediction array pcoeff */ + for (i = 0; i < (6*ncoeffs); i++) + { + pcoeff[i] = qcoeff[i]; + } + + for (i = 0; i < 6; i++) + { + if ((x_pos == 0) && y_pos == 0) /* top left corner */ + { + block_A = (i == 1 || i == 3) ? DC_store[y_pos*MB_width+(x_pos+Xpos[i])][Xtab[i]][0] : mid_grey*8; + block_B = (i == 3) ? DC_store[(y_pos+Ypos[i])*MB_width+(x_pos+Xpos[i])][Ztab[i]][0] : mid_grey*8; + block_C = (i == 2 || i == 3) ? DC_store[(y_pos+Ypos[i])*MB_width+x_pos][Ytab[i]][0] : mid_grey*8; + } + else if (x_pos == 0) /* left edge */ + { + block_A = (i == 1 || i == 3) ? DC_store[y_pos*MB_width+(x_pos+Xpos[i])][Xtab[i]][0] : mid_grey*8; + block_B = (i == 1 || i == 3) ? DC_store[(y_pos+Ypos[i])*MB_width+(x_pos+Xpos[i])][Ztab[i]][0] : mid_grey*8; + block_C = DC_store[(y_pos+Ypos[i])*MB_width+x_pos][Ytab[i]][0]; + } + else if (y_pos == 0) /* top row */ + { + block_A = DC_store[y_pos*MB_width+(x_pos+Xpos[i])][Xtab[i]][0]; + block_B = (i == 2 || i == 3) ? DC_store[(y_pos+Ypos[i])*MB_width+(x_pos+Xpos[i])][Ztab[i]][0] : mid_grey*8; + block_C = (i == 2 || i == 3) ? DC_store[(y_pos+Ypos[i])*MB_width+x_pos][Ytab[i]][0] : mid_grey*8; + } + else + { + block_A = DC_store[y_pos*MB_width+(x_pos+Xpos[i])][Xtab[i]][0]; + block_B = (DC_store[(y_pos+Ypos[i])*MB_width+(x_pos+Xpos[i])] + [Ztab[i]][0]); + block_C = DC_store[(y_pos+Ypos[i])*MB_width+x_pos][Ytab[i]][0]; + } + grad_hor = block_B - block_C; + grad_ver = block_A - block_B; + + if ((ABS(grad_ver)) < (ABS(grad_hor))) + { + DC_pred = block_C; + direction[i] = 2; + } + else + { + DC_pred = block_A; + direction[i] = 1; + } + + pcoeff[i*ncoeffs] = qcoeff[i*ncoeffs] - (DC_pred+cal_dc_scaler(QP,(i<4)?1:2)/2)/cal_dc_scaler(QP,(i<4)?1:2); + + /* Find AC predictions */ + if ((x_pos == 0) && y_pos == 0) /* top left corner */ + { + if (i == 1 || i == 3) + for (m = 0; m < 15; m++) + pred_A[m] = Idir_c(((DC_store[y_pos*MB_width+(x_pos+Xpos[i])][Xtab[i]][m]) * QP*2) , 2*QP); + else + nullfill(pred_A,mid_grey); + if (i == 2 || i == 3) + for (m = 0; m < 15; m++) + pred_C[m] = Idir_c(((DC_store[(y_pos+Ypos[i])*MB_width+x_pos][Ytab[i]][m]) * QP*2) , 2*QP); + else + nullfill(pred_C,mid_grey); + } + else if (x_pos == 0) /* left edge */ + { + if (i == 1 || i == 3) + for (m = 0; m < 15; m++) + pred_A[m] = Idir_c(((DC_store[y_pos*MB_width+(x_pos+Xpos[i])][Xtab[i]][m]) * QP*2) , 2*QP); + else + nullfill(pred_A,mid_grey); + for (m = 0; m < 15; m++) + pred_C[m] = Idir_c(((DC_store[(y_pos+Ypos[i])*MB_width+x_pos][Ytab[i]][m]) * QP*2) , 2*QP); + } + else if (y_pos == 0) /* top row */ + { + for (m = 0; m < 15; m++) + pred_A[m] = Idir_c(((DC_store[y_pos*MB_width+(x_pos+Xpos[i])][Xtab[i]][m]) * QP*2) , 2*QP); + if (i == 2 || i == 3) + for (m = 0; m < 15; m++) + pred_C[m] = Idir_c(((DC_store[(y_pos+Ypos[i])*MB_width+x_pos][Ytab[i]][m]) * QP*2) , 2*QP); + else + nullfill(pred_C,mid_grey); + } + else + { + for (m = 0; m < 15; m++) + { + pred_A[m] = Idir_c(((DC_store[y_pos*MB_width+(x_pos+Xpos[i])][Xtab[i]][m]) * QP*2) , 2*QP); + pred_C[m] = Idir_c(((DC_store[(y_pos+Ypos[i])*MB_width+x_pos][Ytab[i]][m]) * QP*2) , 2*QP); + } + } + + #if 1 /* I think it should be like this, 14-NOV-1996 MW */ + S1 = 0; + S2 = 0; + /* Now decide on AC prediction */ + if (direction[i] == 1) /* Horizontal, left COLUMN of block A */ + { + for (m = 0; m < 7; m++) + { + S1 += ABS(qcoeff[i*ncoeffs+(m+1)*8]); + diff = pcoeff[i*ncoeffs+(m+1)*8] + = qcoeff[i*ncoeffs+(m+1)*8] - pred_A[m+8]; + S2 += ABS(diff); + } + } + else /* Vertical, top ROW of block C */ + { + for (m = 1; m < 8; m++) + { + S1 += ABS(qcoeff[i*ncoeffs+m]); + diff = pcoeff[i*ncoeffs+m] + = qcoeff[i*ncoeffs+m] - pred_C[m]; + S2 += ABS(diff); + } + } + S += (S1 - S2); + #endif + } + /* Now change qcoeff for DC pred or DC/AC pred */ + if (S >=0) + { + for (i=0;i127)) { */ + if ((i%64)&&(abs(pcoeff[i])>2047)) + { + printf("predicted AC out of range"); + S=-1;break; + } + } + if (S >= 0) /* Both DC and AC prediction */ + { + ACpred_flag = 1; + for (i = 0; i < ncoeffs*6; i++) + { + qcoeff[i] = pcoeff[i]; + } + /* Update CBP for predicted coeffs. */ + *CBP = FindCBP(qcoeff, MODE_INTRA, 64); + } + else /* Only DC prediction */ + { + ACpred_flag = 0; + for (i = 0; i < 6; i++) + { + qcoeff[i*ncoeffs] = pcoeff[i*ncoeffs]; + direction[i] = 0; + } + } + return ACpred_flag; /* To be put into bitstream */ + } + + /** + * Small routine to fill default prediction values into a DC_store entry + */ + + Void nullfill(Int pred[], Int mid_grey) + { + Int i; + + pred[0] = mid_grey*8; + for (i = 1; i < 15; i++) + { + pred[i] = 0; + } + } + + Int Idir_c(Int val, Int QP) + { + if (val<0) return (val-QP/2)/QP; + else return (val+QP/2)/QP; + } + + + /***********************************************************CommentBegin****** + * + * -- IntraDCSwitch_decisions -- + * + * Purpose : + * decide whether to use inter AC table to encode DC + * + * Arguments in : + * Int Mode + * Int intra_dc_vlc_thr + * Int Qp + * + ***********************************************************CommentEnd********/ + + Int IntraDCSwitch_Decision(Int Mode,Int intra_dc_vlc_thr,Int Qp) + { + Int switched =0; + if (Mode == MODE_INTRA || Mode == MODE_INTRA_Q) + { + if (intra_dc_vlc_thr==0) + switched=0; + else if (intra_dc_vlc_thr==7) + switched=1; + else if (Qp>=intra_dc_vlc_thr*2+11) + switched=1; + } + + return switched; + } + + + /***********************************************************CommentBegin****** + * + * -- cal_dc_scaler -- calculation of DC quantization scale according + * to the incoming Q and type; + * + * Arguments in : + * Int Qp + * + ***********************************************************CommentEnd********/ + + Int cal_dc_scaler (Int QP, Int type) + { + + Int dc_scaler; + if (type == 1) + { + if (QP > 0 && QP < 5) dc_scaler = 8; + else if (QP > 4 && QP < 9) dc_scaler = 2 * QP; + else if (QP > 8 && QP < 25) dc_scaler = QP + 8; + else dc_scaler = 2 * QP - 16; + } + else + { + if (QP > 0 && QP < 5) dc_scaler = 8; + else if (QP > 4 && QP < 25) dc_scaler = (QP + 13) / 2; + else dc_scaler = QP - 6; + } + return dc_scaler; + } + + + + /***********************************************************CommentBegin****** + * + * -- FindCBP -- Find the CBP for a macroblock + * + * Purpose : + * Find the CBP for a macroblock + * + * Arguments in : + * Int *qcoeff : pointer to quantized coefficients + * Int Mode : macroblock encoding mode information + * Int ncoeffs : the number of coefficients + * + * Return values : + * Int CBP : The coded block pattern for a macroblock + * + ***********************************************************CommentEnd********/ + + Int + FindCBP (Int* qcoeff, Int Mode, Int ncoeffs) + { + Int i,j; + Int CBP = 0; + Int intra = (Mode == MODE_INTRA || Mode == MODE_INTRA_Q); + + /* Set CBP for this Macroblock */ + + for (i = 0; i < 6; i++) + { + for (j = i*ncoeffs + intra; j < (i+1)*ncoeffs; j++) + { + + if (qcoeff[j]) + { + if (i == 0) {CBP |= 32;} + else if (i == 1) {CBP |= 16;} + else if (i == 2) {CBP |= 8;} + else if (i == 3) {CBP |= 4;} + else if (i == 4) {CBP |= 2;} + else if (i == 5) {CBP |= 1;} + else + { + fprintf (stderr, "Error in CBP assignment\n"); + exit(-1); + } + + break; + } + } + } + + return CBP; + } + diff -C2 -r -N bcast-2000c/quicktime/encore50/text_code.h bcast-2000c-mf3/quicktime/encore50/text_code.h *** bcast-2000c/quicktime/encore50/text_code.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/text_code.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,42 ---- + + #ifndef _TEXT_CODE_H_ + #define _TEXT_CODE_H_ + + + #include "momusys.h" + #include "mom_structs.h" + #include "text_defs.h" + #include "text_bits.h" + //#include "text_util.h" + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + + /* vm_enc/src/text_code.c */ + Void VopCodeShapeTextIntraCom _P_(( Vop *curr, + Vop *rec_curr, + Image *mottext_bitstream + )); + + Void VopShapeMotText _P_(( Vop *curr, + Vop *comp, + Image *MB_decisions, + Image *mot_x, + Image *mot_y, + Int f_code_for, + Int intra_acdc_pred_disable, + Vop *rec_curr, + Image *mottext_bitstream + )); + Int cal_dc_scaler _P_(( Int QP, + Int type + )); + + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _TEXT_CODE_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore50/text_code_mb.c bcast-2000c-mf3/quicktime/encore50/text_code_mb.c *** bcast-2000c/quicktime/encore50/text_code_mb.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/text_code_mb.c Sat Dec 8 04:26:50 2001 *************** *** 0 **** --- 1,488 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * text_code_mb.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * Juice + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions for text coding of MacroBlocks. */ + /* Some codes of this project come from MoMuSys MPEG-4 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include "text_code.h" + #include "text_dct.h" + + #define BLOCK_SIZE 8 + + Void BlockPredict (SInt *curr, /*SInt *rec_curr,*/ + Int x_pos, Int y_pos, UInt width, Int fblock[][8]); + Void BlockRebuild (SInt *rec_curr, SInt *comp, Int pred_type, Int max, + Int x_pos, Int y_pos, UInt width, UInt edge, Int fblock[][8]); + Void BlockQuantH263 (Int *coeff, Int QP, Int mode, Int type, + Int *qcoeff, Int maxDC, Int image_type); + Void BlockDequantH263 (Int *qcoeff, Int QP, Int mode, Int type, + Int *rcoeff, Int image_type, Int short_video_header, Int bits_per_pixel); + + + /***********************************************************CommentBegin****** + * + * -- CodeMB -- Code, decode and reconstruct Macroblock + * combined with substraction and addition operation + * + * Arguments in : + * Int x_pos x_position of Macroblock + * Int y_pos y_position of Macroblock + * UInt width width of Vop bounding box (unpadded size) + * Int QP Quantization parameter + * Int Mode Macroblock coding mode + * + * Arguments in/out : + * Vop *curr current Vop, uncoded + * Vop *rec_curr current Vop, decoded and reconstructed + * Vop *comp current Vop, motion compensated + * Int *qcoeff coefficient block (384 * sizeof(Int)) + * + ***********************************************************CommentEnd********/ + + Void CodeMB(Vop *curr, Vop *rec_curr, Vop *comp, Int x_pos, Int y_pos, UInt width, + Int QP, Int Mode, Int *qcoeff) + { + Int k; + Int fblock[6][8][8]; + Int coeff[384]; + Int *coeff_ind; + Int *qcoeff_ind; + Int* rcoeff_ind; + Int x, y; + SInt *current, *recon, *compensated = NULL; + UInt xwidth; + Int iblock[6][8][8]; + Int rcoeff[6*64]; + Int i, j; + Int type; /* luma = 1, chroma = 2 */ + // Int *qmat; + SInt tmp[64]; + Int s; + + int operation = curr->prediction_type; + /* This variable is for combined operation. + If it is an I_VOP, then MB in curr is reconstruct into rec_curr, + and comp is not used at all (i.e., it can be set to NULL). + If it is a P_VOP, then MB in curr is reconstructed, and the result + added with MB_comp is written into rec_curr. + - adamli 11/19/2000 */ + + Int max = GetVopBrightWhite(curr); + /* This variable is the max value for the clipping of the reconstructed image. */ + + coeff_ind = coeff; + qcoeff_ind = qcoeff; + rcoeff_ind = rcoeff; + + for (k = 0; k < 6; k++) + { + switch (k) + { + case 0: + x = x_pos; + y = y_pos; + xwidth = width; + current = (SInt *) GetImageData (GetVopY (curr)); + break; + case 1: + x = x_pos + 8; + y = y_pos; + xwidth = width; + current = (SInt *) GetImageData (GetVopY (curr)); + break; + case 2: + x = x_pos; + y = y_pos + 8; + xwidth = width; + current = (SInt *) GetImageData (GetVopY (curr)); + break; + case 3: + x = x_pos + 8; + y = y_pos + 8; + xwidth = width; + current = (SInt *) GetImageData (GetVopY (curr)); + break; + case 4: + x = x_pos / 2; + y = y_pos / 2; + xwidth = width / 2; + current = (SInt *) GetImageData (GetVopU (curr)); + break; + case 5: + x = x_pos / 2; + y = y_pos / 2; + xwidth = width / 2; + current = (SInt *) GetImageData (GetVopV (curr)); + break; + default: + break; + } + BlockPredict (current, x, y, xwidth, fblock[k]); + } + + for (k = 0; k < 6; k++) + { + s = 0; + for (i = 0; i < 8; i++) + for (j = 0; j < 8; j++) + tmp[s++] = (SInt) fblock[k][i][j]; + #ifndef _MMX_ + fdct_enc(tmp); + #else + fdct_mm32(tmp); + #endif + for (s = 0; s < 64; s++) + coeff_ind[s] = (Int) tmp[s]; + + if (k < 4) type = 1; + else type = 2; + + /* For this release, only H263 quantization is supported. - adamli */ + BlockQuantH263(coeff_ind,QP,Mode,type,qcoeff_ind, + GetVopBrightWhite(curr),1); + BlockDequantH263(qcoeff_ind,QP,Mode,type,rcoeff_ind,1, 0, GetVopBitsPerPixel(curr)); + + for (s = 0; s < 64; s++) + tmp[s] = (SInt) rcoeff_ind[s]; + #ifndef _MMX_ + idct_enc(tmp); + #else + Fast_IDCT(tmp); + #endif + s = 0; + for (i = 0; i < 8; i++) + for (j = 0; j < 8; j++) + iblock[k][i][j] = (Int)tmp[s++]; + + coeff_ind += 64; + qcoeff_ind += 64; + rcoeff_ind += 64; + + if (Mode == MODE_INTRA||Mode==MODE_INTRA_Q) + for (i = 0; i < 8; i++) + for (j = 0; j < 8; j ++) + iblock[k][i][j] = MIN (GetVopBrightWhite(curr), MAX (0, iblock[k][i][j])); + + switch (k) + { + case 0: + case 1: + case 2: + continue; + + case 3: + recon = (SInt *) GetImageData (GetVopY (rec_curr)); + if (operation == P_VOP) compensated = (SInt *) GetImageData (GetVopY (comp)); + BlockRebuild (recon, compensated, operation, max, x_pos, y_pos, width, 16, iblock[0]); + BlockRebuild (recon, compensated, operation, max, x_pos + 8, y_pos, width, 16, iblock[1]); + BlockRebuild (recon, compensated, operation, max, x_pos, y_pos + 8, width, 16, iblock[2]); + BlockRebuild (recon, compensated, operation, max, x_pos + 8, y_pos + 8, width, 16, iblock[3]); + continue; + + case 4: + recon = (SInt *) GetImageData (GetVopU (rec_curr)); + if (operation == P_VOP) compensated = (SInt *) GetImageData (GetVopU (comp)); + BlockRebuild (recon, compensated, operation, max, + x_pos/2, y_pos/2, width/2, 8, iblock[4]); + continue; + + case 5: + recon = (SInt *) GetImageData (GetVopV (rec_curr)); + if (operation == P_VOP) compensated = (SInt *) GetImageData (GetVopV (comp)); + BlockRebuild (recon, compensated, operation, max, + x_pos/2, y_pos/2, width/2, 8, iblock[5]); + continue; + } + } + + return; + } + + + /***********************************************************CommentBegin****** + * + * -- BlockPredict -- Get prediction for an Intra block + * + * Purpose : + * Get prediction for an Intra block + * + * Arguments in : + * Int x_pos x_position of Macroblock + * Int y_pos y_position of Macroblock + * UInt width width of Vop bounding box + * + * Arguments in/out : + * SInt *curr current uncoded Vop data + * SInt *rec_curr reconstructed Vop data area + * + * Arguments out : + * Int fblock[][8] the prediction block to be coded for bitstream + * + ***********************************************************CommentEnd********/ + Void + BlockPredict (SInt *curr, /*SInt *rec_curr,*/ Int x_pos, Int y_pos, + UInt width, Int fblock[][8]) + { + Int i, j; + + for (i = 0; i < 8; i++) + { + for (j = 0; j < 8; j++) + { + fblock[i][j] = curr[(y_pos+i)*width + x_pos+j]; + } + } + } + + + /***********************************************************CommentBegin****** + * + * -- BlockRebuild -- Reconstructs a block into data area of Vop + * + * Purpose : + * Reconstructs a block into data area of Vop + * + * Arguments in : + * Int x_pos x_position of Macroblock + * Int y_pos y_position of Macroblock + * UInt width width of Vop bounding box + * + * Arguments in/out : + * SInt *rec_curr current Vop data area to be reconstructed + * + * Description : + * Does reconstruction for Intra predicted blocks also + * + ***********************************************************CommentEnd********/ + + Void + BlockRebuild (SInt *rec_curr, SInt *comp, Int pred_type, Int max, + Int x_pos, Int y_pos, UInt width, UInt edge, Int fblock[][8]) + { + /* this function now does rebuild and generating error at the same time */ + Int i, j; + SInt *rec; + Int padded_width; + + padded_width = width + 2 * edge; + rec = rec_curr + edge * padded_width + edge; + + if (pred_type == I_VOP) + { + SInt *p; + p = rec + y_pos * padded_width + x_pos; + + for (i = 0; i < 8; i++) + { + for (j = 0; j < 8; j++) + { + SInt temp = fblock[i][j]; + *(p++) = CLIP(temp, 0, max); + } + + p += padded_width - 8; + } + } + else if (pred_type == P_VOP) + { + SInt *p, *pc; + p = rec + y_pos * padded_width + x_pos; + pc = comp + y_pos * width + x_pos; + + for (i = 0; i < 8; i++) + { + for (j = 0; j < 8; j++) + { + SInt temp = *(pc++) + fblock[i][j]; + *(p++) = CLIP(temp, 0, max); + } + + p += padded_width - 8; + pc += width - 8; + } + } + } + + + + /***********************************************************CommentBegin****** + * + * -- BlockQuantH263 -- 8x8 block level quantization + * + * Purpose : + * 8x8 block level quantization + * + * Arguments in : + * Int *coeff non-quantized coefficients + * Int QP quantization parameter + * Int Mode Macroblock coding mode + * + * Arguments out : + * Int *qcoeff quantized coefficients + * + ***********************************************************CommentEnd********/ + Void + BlockQuantH263 (Int *coeff, + Int QP, + Int mode, + Int type, + Int *qcoeff, + Int maxDC, + Int image_type) + { + Int i; + Int level, result; + Int step, offset; + Int dc_scaler; + + + + + + + + //if(QP != 5) printf("BlockQuantH263 %d\n", QP); + if (!(QP > 0 && (QP < 32*image_type))) return; + if (!(type == 1 || type == 2)) return; + + if (mode == MODE_INTRA || mode == MODE_INTRA_Q) + { /* Intra */ + dc_scaler = cal_dc_scaler(QP,type); + qcoeff[0] = MAX(1,MIN(maxDC-1, (coeff[0] + dc_scaler/2)/dc_scaler)); + + step = 2 * QP; + for (i = 1; i < 64; i++) + { + level = (abs(coeff[i])) / step; + result = (coeff[i] >= 0) ? level : -level; + qcoeff[i] = MIN(2047, MAX(-2048, result)); + } + } + else + { /* non Intra */ + step = 2 * QP; + offset = QP / 2; + for (i = 0; i < 64; i++) + { + level = (abs(coeff[i]) - offset) / step; + result = (coeff[i] >= 0) ? level : -level; + qcoeff[i] = MIN(2047, MAX(-2048, result)); + } + } + + return; + } + + + /***********************************************************CommentBegin****** + * + * -- BlockDequantH263 -- 8x8 block dequantization + * + * Purpose : + * 8x8 block dequantization + * + * Arguments in : + * Int *qcoeff quantized coefficients + * Int QP quantization parameter + * Int mode Macroblock coding mode + * Int short_video_header Flag to signal short video header bitstreams (H.263) + * + * Arguments out : + * Int *rcoeff reconstructed (dequantized) coefficients + * + ***********************************************************CommentEnd********/ + Void + BlockDequantH263 (Int *qcoeff, Int QP, Int mode, Int type, Int *rcoeff, + Int image_type, Int short_video_header, Int bits_per_pixel) + { + Int i; + Int dc_scaler; + Int lim; + + lim = (1 << (bits_per_pixel + 3)); + + if (QP) + { + for (i = 0; i < 64; i++) + { + if (qcoeff[i]) + { + /* 16.11.98 Sven Brandau: "correct saturation" due to N2470, Clause 2.1.6 */ + qcoeff[i] = MIN(2047, MAX(-2048, qcoeff[i] )); + if ((QP % 2) == 1) + rcoeff[i] = QP * (2*ABS(qcoeff[i]) + 1); + else + rcoeff[i] = QP * (2*ABS(qcoeff[i]) + 1) - 1; + rcoeff[i] = SIGN(qcoeff[i]) * rcoeff[i]; + } + else + rcoeff[i] = 0; + } + if (mode == MODE_INTRA || mode == MODE_INTRA_Q) + { /* Intra */ + + MOMCHECK(QP > 0 && (QP < 32*image_type)); + MOMCHECK(type == 1 || type == 2); + + if (short_video_header) + dc_scaler = 8; + else + dc_scaler = cal_dc_scaler(QP,type); + + rcoeff[0] = qcoeff[0] * dc_scaler; + } + } + else + { + /* No quantizing at all */ + for (i = 0; i < 64; i++) + { + rcoeff[i] = qcoeff[i]; + } + + if (mode == MODE_INTRA || mode == MODE_INTRA_Q) + { /* Intra */ + rcoeff[0] = qcoeff[0]*8; + } + } + for (i=0;i<64;i++) + if (rcoeff[i]>(lim-1)) rcoeff[i]=(lim-1); + else if (rcoeff[i]<(-lim)) rcoeff[i]=(-lim); + + return; + } + diff -C2 -r -N bcast-2000c/quicktime/encore50/text_code_mb.h bcast-2000c-mf3/quicktime/encore50/text_code_mb.h *** bcast-2000c/quicktime/encore50/text_code_mb.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/text_code_mb.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,31 ---- + + #ifndef _TEXT_CODE_MB_H_ + #define _TEXT_CODE_MB_H_ + + #include + #include "momusys.h" + #include "text_defs.h" + //#include "text_util.h" + //#include "text_quant.h" + + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + Void CodeMB _P_(( Vop *curr, + Vop *rec_curr, + Vop *comp, + Int x_pos, + Int y_pos, + UInt width, + Int QP, + Int Mode, + Int *qcoeff + )); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _TEXT_CODE_MB_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore50/text_dct.c bcast-2000c-mf3/quicktime/encore50/text_dct.c *** bcast-2000c/quicktime/encore50/text_dct.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/text_dct.c Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,277 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * text_dct.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions for fDCT/iDCT transformation. */ + /* Some codes of this project come from SSG MPEG-2 implementation. */ + /* Please see seperate acknowledgement file for a list of contributors. */ + + #include + + /* The first part of it is for the forward DCT */ + + #ifndef PI + # ifdef M_PI + # define PI M_PI + # else + # define PI 3.14159265358979323846 + # endif + #endif + + /* private data */ + static double c[8][8]; /* transform coefficients */ + + void fdct_enc(block) + short *block; + { + int i, j, k; + double s; + double tmp[64]; + + for (i=0; i<8; i++) + for (j=0; j<8; j++) + { + s = 0.0; + + for (k=0; k<8; k++) + s += c[j][k] * block[8*i+k]; + + tmp[8*i+j] = s; + } + + for (j=0; j<8; j++) + for (i=0; i<8; i++) + { + s = 0.0; + + for (k=0; k<8; k++) + s += c[i][k] * tmp[8*k+j]; + + block[8*i+j] = (int)floor(s+0.499999); + /* + * reason for adding 0.499999 instead of 0.5: + * s is quite often x.5 (at least for i and/or j = 0 or 4) + * and setting the rounding threshold exactly to 0.5 leads to an + * extremely high arithmetic implementation dependency of the result; + * s being between x.5 and x.500001 (which is now incorrectly rounded + * downwards instead of upwards) is assumed to occur less often + * (if at all) + */ + } + } + + void init_fdct_enc() + { + int i, j; + double s; + + for (i=0; i<8; i++) + { + s = (i==0) ? sqrt(0.125) : 0.5; + + for (j=0; j<8; j++) + c[i][j] = s * cos((PI/8.0)*i*(j+0.5)); + } + } + + + + + /* the second part of it is for the inverse DCT */ + + #define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */ + #define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */ + #define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */ + #define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */ + #define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */ + #define W7 565 /* 2048*sqrt(2)*cos(7*pi/16) */ + + /* private data */ + static short iclip[1024]; /* clipping table */ + static short *iclp; + + /* private prototypes */ + static void idctrow_enc (short *blk); + static void idctcol_enc (short *blk); + + /* two dimensional inverse discrete cosine transform */ + void idct_enc(block) + short *block; + { + int i; + + for (i=0; i<8; i++) + idctrow_enc(block+8*i); + + for (i=0; i<8; i++) + idctcol_enc(block+i); + } + + void init_idct_enc() + { + int i; + + iclp = iclip+512; + for (i= -512; i<512; i++) + iclp[i] = (i<-256) ? -256 : ((i>255) ? 255 : i); + } + + /* row (horizontal) IDCT + * + * 7 pi 1 + * dst[k] = sum c[l] * src[l] * cos( -- * ( k + - ) * l ) + * l=0 8 2 + * + * where: c[0] = 128 + * c[1..7] = 128*sqrt(2) + */ + + static void idctrow_enc(blk) + short *blk; + { + int x0, x1, x2, x3, x4, x5, x6, x7, x8; + + /* shortcut */ + if (!((x1 = blk[4]<<11) | (x2 = blk[6]) | (x3 = blk[2]) | + (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) + { + blk[0]=blk[1]=blk[2]=blk[3]=blk[4]=blk[5]=blk[6]=blk[7]=blk[0]<<3; + return; + } + + x0 = (blk[0]<<11) + 128; /* for proper rounding in the fourth stage */ + + /* first stage */ + x8 = W7*(x4+x5); + x4 = x8 + (W1-W7)*x4; + x5 = x8 - (W1+W7)*x5; + x8 = W3*(x6+x7); + x6 = x8 - (W3-W5)*x6; + x7 = x8 - (W3+W5)*x7; + + /* second stage */ + x8 = x0 + x1; + x0 -= x1; + x1 = W6*(x3+x2); + x2 = x1 - (W2+W6)*x2; + x3 = x1 + (W2-W6)*x3; + x1 = x4 + x6; + x4 -= x6; + x6 = x5 + x7; + x5 -= x7; + + /* third stage */ + x7 = x8 + x3; + x8 -= x3; + x3 = x0 + x2; + x0 -= x2; + x2 = (181*(x4+x5)+128)>>8; + x4 = (181*(x4-x5)+128)>>8; + + /* fourth stage */ + blk[0] = (x7+x1)>>8; + blk[1] = (x3+x2)>>8; + blk[2] = (x0+x4)>>8; + blk[3] = (x8+x6)>>8; + blk[4] = (x8-x6)>>8; + blk[5] = (x0-x4)>>8; + blk[6] = (x3-x2)>>8; + blk[7] = (x7-x1)>>8; + } + + /* column (vertical) IDCT + * + * 7 pi 1 + * dst[8*k] = sum c[l] * src[8*l] * cos( -- * ( k + - ) * l ) + * l=0 8 2 + * + * where: c[0] = 1/1024 + * c[1..7] = (1/1024)*sqrt(2) + */ + static void idctcol_enc(blk) + short *blk; + { + int x0, x1, x2, x3, x4, x5, x6, x7, x8; + + /* shortcut */ + if (!((x1 = (blk[8*4]<<8)) | (x2 = blk[8*6]) | (x3 = blk[8*2]) | + (x4 = blk[8*1]) | (x5 = blk[8*7]) | (x6 = blk[8*5]) | (x7 = blk[8*3]))) + { + blk[8*0]=blk[8*1]=blk[8*2]=blk[8*3]=blk[8*4]=blk[8*5]=blk[8*6]=blk[8*7]= + iclp[(blk[8*0]+32)>>6]; + return; + } + + x0 = (blk[8*0]<<8) + 8192; + + /* first stage */ + x8 = W7*(x4+x5) + 4; + x4 = (x8+(W1-W7)*x4)>>3; + x5 = (x8-(W1+W7)*x5)>>3; + x8 = W3*(x6+x7) + 4; + x6 = (x8-(W3-W5)*x6)>>3; + x7 = (x8-(W3+W5)*x7)>>3; + + /* second stage */ + x8 = x0 + x1; + x0 -= x1; + x1 = W6*(x3+x2) + 4; + x2 = (x1-(W2+W6)*x2)>>3; + x3 = (x1+(W2-W6)*x3)>>3; + x1 = x4 + x6; + x4 -= x6; + x6 = x5 + x7; + x5 -= x7; + + /* third stage */ + x7 = x8 + x3; + x8 -= x3; + x3 = x0 + x2; + x0 -= x2; + x2 = (181*(x4+x5)+128)>>8; + x4 = (181*(x4-x5)+128)>>8; + + /* fourth stage */ + blk[8*0] = iclp[(x7+x1)>>14]; + blk[8*1] = iclp[(x3+x2)>>14]; + blk[8*2] = iclp[(x0+x4)>>14]; + blk[8*3] = iclp[(x8+x6)>>14]; + blk[8*4] = iclp[(x8-x6)>>14]; + blk[8*5] = iclp[(x0-x4)>>14]; + blk[8*6] = iclp[(x3-x2)>>14]; + blk[8*7] = iclp[(x7-x1)>>14]; + } + + + diff -C2 -r -N bcast-2000c/quicktime/encore50/text_dct.h bcast-2000c-mf3/quicktime/encore50/text_dct.h *** bcast-2000c/quicktime/encore50/text_dct.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/text_dct.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,11 ---- + + + + void fdct_enc(short *block); + void init_fdct_enc(); + void idct_enc(short *block); + void init_idct_enc(); + + + void fdct_mm32(short *blk); + void Fast_IDCT(short int *x); diff -C2 -r -N bcast-2000c/quicktime/encore50/text_defs.h bcast-2000c-mf3/quicktime/encore50/text_defs.h *** bcast-2000c/quicktime/encore50/text_defs.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/text_defs.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,23 ---- + + #ifndef _TEXT_DEFS_H_ + #define _TEXT_DEFS_H_ + + + #include "mom_structs.h" + + #include + #include + + #include "vm_enc_defs.h" + + #define ESCAPE 7167 + + #define PCT_INTER 1 + #define PCT_INTRA 0 + #define PCT_SPRITE 2 + + #define ON 1 + #define OFF 0 + + + #endif /* _TEXT_DEFS_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore50/vlc.h bcast-2000c-mf3/quicktime/encore50/vlc.h *** bcast-2000c/quicktime/encore50/vlc.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/vlc.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,1025 ---- + + + #ifndef _VLC_H_ + #define _VLC_H_ + + /* type definitions for variable length code table entries */ + + typedef struct + { + U_Int code; /* right justified */ + Int len; + } VLCtable; + + + /* DC prediction sizes */ + + static VLCtable DCtab_lum[13] = + { + {3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, + {1,8}, {1,9}, {1,10}, {1,11} + }; + + static VLCtable DCtab_chrom[13] = + { + {3,2}, {2,2}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, {1,8}, + {1,9}, {1,10}, {1,11}, {1,12} + }; + + + /* Motion vectors */ + + static VLCtable mvtab[33] = + { + {1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7}, + {11,9}, {10,9}, {9,9}, {17,10}, {16,10}, {15,10}, {14,10}, {13,10}, + {12,10}, {11,10}, {10,10}, {9,10}, {8,10}, {7,10}, {6,10}, {5,10}, + {4,10}, {7,11}, {6,11}, {5,11}, {4,11}, {3,11}, {2,11}, {3,12}, + {2,12} + }; + + + /* MCBPC Indexing by cbpc in first two bits, mode in last two. + CBPC as in table 4/H.263, MB type (mode): 3 = 01, 4 = 10. + Example: cbpc = 01 and mode = 4 gives index = 0110 = 6. */ + + static VLCtable mcbpc_intra_tab[15] = + { + {0x01,9}, {0x01,1}, {0x01,4}, {0x00,0}, + {0x00,0}, {0x01,3}, {0x01,6}, {0x00,0}, + {0x00,0}, {0x02,3}, {0x02,6}, {0x00,0}, + {0x00,0}, {0x03,3}, {0x03,6} + }; + + + /* MCBPC inter. + Addressing: 5 bit ccmmm (cc = CBPC, mmm = mode (1-4 binary)) */ + + static VLCtable mcbpc_inter_tab[29] = + { + {1,1}, {3,3}, {2,3}, {3,5}, {4,6}, {1,9}, {0,0}, {0,0}, + {3,4}, {7,7}, {5,7}, {4,8}, {4,9}, {0,0}, {0,0}, {0,0}, + {2,4}, {6,7}, {4,7}, {3,8}, {3,9}, {0,0}, {0,0}, {0,0}, + {5,6}, {5,9}, {5,8}, {3,7}, {2,9} + }; + + static VLCtable mcbpc_sprite_tab[31] = + { + {1,1}, {0,12}, {2,3}, {3,5}, {4,6}, {3,3}, {12,4}, {1,9}, + {3,4}, {1,12}, {5,7}, {4,8}, {4,9}, {7,7}, {12,5}, {0,0}, + {2,4}, {2,12}, {4,7}, {3,8}, {3,9}, {6,7}, {12,6}, {0,0}, + {5,6}, {3,12}, {5,8}, {3,7}, {2,9}, {5,9}, {12,7} + }; + + /* MODB table, MW 18-MAY-1998 */ + + static VLCtable modb_tab[3] = + { + {1,1}, {1,2}, {0,2} + }; + + #if 0 + /* MCBPC for separate mode */ + + static VLCtable mcbpc_sep_tab[9] = + { + {1,1}, {1,3}, {2,3}, {3,3}, {1,4}, {1,6}, {2,6}, {3,6}, {1,9} + }; + #endif + + /* CBPY. Straightforward indexing */ + + static VLCtable cbpy_tab[16] = + { + {3,4}, {5,5}, {4,5}, {9,4}, {3,5}, {7,4}, {2,6}, {11,4}, + {2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2} + }; + + static VLCtable cbpy_tab3[8] = + { + {3,3},{1,6},{1,5},{2,3},{2,5},{3,5},{1,3},{1,1} + }; + static VLCtable cbpy_tab2[4] = + { + {1,4},{1,3},{1,2},{1,1} + }; + + + /* DCT coefficients. Four tables, two for last = 0, two for last = 1. + the sign bit must be added afterwards. */ + + /* first part of coeffs for last = 0. Indexed by [run][level-1] */ + + static VLCtable coeff_tab0[2][12] = + { + /* run = 0 */ + { + {0x02, 2}, {0x0f, 4}, {0x15, 6}, {0x17, 7}, + {0x1f, 8}, {0x25, 9}, {0x24, 9}, {0x21,10}, + {0x20,10}, {0x07,11}, {0x06,11}, {0x20,11} + }, + /* run = 1 */ + { + {0x06, 3}, {0x14, 6}, {0x1e, 8}, {0x0f,10}, + {0x21,11}, {0x50,12}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0} + } + }; + + /* rest of coeffs for last = 0. indexing by [run-2][level-1] */ + + static VLCtable coeff_tab1[25][4] = + { + /* run = 2 */ + { + {0x0e, 4}, {0x1d, 8}, {0x0e,10}, {0x51,12} + }, + /* run = 3 */ + { + {0x0d, 5}, {0x23, 9}, {0x0d,10}, {0x00, 0} + }, + /* run = 4-26 */ + { + {0x0c, 5}, {0x22, 9}, {0x52,12}, {0x00, 0} + }, + { + {0x0b, 5}, {0x0c,10}, {0x53,12}, {0x00, 0} + }, + { + {0x13, 6}, {0x0b,10}, {0x54,12}, {0x00, 0} + }, + { + {0x12, 6}, {0x0a,10}, {0x00, 0}, {0x00, 0} + }, + { + {0x11, 6}, {0x09,10}, {0x00, 0}, {0x00, 0} + }, + { + {0x10, 6}, {0x08,10}, {0x00, 0}, {0x00, 0} + }, + { + {0x16, 7}, {0x55,12}, {0x00, 0}, {0x00, 0} + }, + { + {0x15, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x14, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1c, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1b, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x21, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x20, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1f, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1e, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1d, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1c, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1b, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x1a, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x22,11}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x23,11}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x56,12}, {0x00, 0}, {0x00, 0}, {0x00, 0} + }, + { + {0x57,12}, {0x00, 0}, {0x00, 0}, {0x00, 0} + } + }; + + /* first coeffs of last = 1. indexing by [run][level-1] */ + + static VLCtable coeff_tab2[2][3] = + { + /* run = 0 */ + { + {0x07, 4}, {0x19, 9}, {0x05,11} + }, + /* run = 1 */ + { + {0x0f, 6}, {0x04,11}, {0x00, 0} + } + }; + + /* rest of coeffs for last = 1. indexing by [run-2] */ + + static VLCtable coeff_tab3[40] = + { + {0x0e, 6}, {0x0d, 6}, {0x0c, 6}, + {0x13, 7}, {0x12, 7}, {0x11, 7}, {0x10, 7}, + {0x1a, 8}, {0x19, 8}, {0x18, 8}, {0x17, 8}, + {0x16, 8}, {0x15, 8}, {0x14, 8}, {0x13, 8}, + {0x18, 9}, {0x17, 9}, {0x16, 9}, {0x15, 9}, + {0x14, 9}, {0x13, 9}, {0x12, 9}, {0x11, 9}, + {0x07,10}, {0x06,10}, {0x05,10}, {0x04,10}, + {0x24,11}, {0x25,11}, {0x26,11}, {0x27,11}, + {0x58,12}, {0x59,12}, {0x5a,12}, {0x5b,12}, + {0x5c,12}, {0x5d,12}, {0x5e,12}, {0x5f,12}, + {0x00, 0} + }; + + /* New tables for Intra luminance coefficients. Same codewords, + different meaning */ + + /* Coeffs for last = 0, run = 0. Indexed by [level-1] */ + + static VLCtable coeff_tab4[27] = + { + /* run = 0 */ + {0x02, 2}, {0x06, 3}, {0x0f, 4}, {0x0d, 5}, + {0x0c, 5}, {0x15, 6}, {0x13, 6}, {0x12, 6}, + {0x17, 7}, {0x1f, 8}, {0x1e, 8}, {0x1d, 8}, + {0x25, 9}, {0x24, 9}, {0x23, 9}, {0x21, 9}, + {0x21,10}, {0x20,10}, {0x0f,10}, {0x0e,10}, + {0x07,11}, {0x06,11}, {0x20,11}, {0x21,11}, + {0x50,12}, {0x51,12}, {0x52,12} + }; + + /* Coeffs for last = 0, run = 1. Indexed by [level-1] */ + + static VLCtable coeff_tab5[10] = + { + {0x0e, 4}, {0x14, 6}, {0x16, 7}, {0x1c, 8}, + {0x20, 9}, {0x1f, 9}, {0x0d,10}, {0x22,11}, + {0x53,12}, {0x55,12} + }; + + /* Coeffs for last = 0, run = 2 -> 9. Indexed by [run-2][level-1] */ + + static VLCtable coeff_tab6[8][5] = + { + /* run = 2 */ + { + {0x0b, 5}, {0x15, 7}, {0x1e, 9}, {0x0c,10}, + {0x56,12} + }, + /* run = 3 */ + { + {0x11, 6}, {0x1b, 8}, {0x1d, 9}, {0x0b,10}, + {0x00, 0} + }, + /* run = 4 */ + { + {0x10, 6}, {0x22, 9}, {0x0a,10}, {0x00, 0}, + {0x00, 0} + }, + /* run = 5 */ + { + {0x0d, 6}, {0x1c, 9}, {0x08,10}, {0x00, 0}, + {0x00, 0} + }, + /* run = 6 */ + { + {0x12, 7}, {0x1b, 9}, {0x54,12}, {0x00, 0}, + {0x00, 0} + }, + /* run = 7 */ + { + {0x14, 7}, {0x1a, 9}, {0x57,12}, {0x00, 0}, + {0x00, 0} + }, + /* run = 8 */ + { + {0x19, 8}, {0x09,10}, {0x00, 0}, {0x00, 0}, + {0x00, 0} + }, + /* run = 9 */ + { + {0x18, 8}, {0x23,11}, {0x00, 0}, {0x00, 0}, + {0x00, 0} + } + }; + + /* Coeffs for last = 0, run = 10 -> 14. Indexed by [run-10] */ + + static VLCtable coeff_tab7[5] = + { + {0x17, 8}, {0x19, 9}, {0x18, 9}, {0x07,10}, + {0x58,12} + }; + + /* Coeffs for last = 1, run = 0. Indexed by [level-1] */ + + static VLCtable coeff_tab8[8] = + { + {0x07, 4}, {0x0c, 6}, {0x16, 8}, {0x17, 9}, + {0x06,10}, {0x05,11}, {0x04,11}, {0x59,12} + }; + + /* Coeffs for last = 1, run = 1 -> 6. Indexed by [run-1][level-1] */ + + static VLCtable coeff_tab9[6][3] = + { + /* run = 1 */ + { + {0x0f, 6}, {0x16, 9}, {0x05,10} + }, + /* run = 2 */ + { + {0x0e, 6}, {0x04,10}, {0x00, 0} + }, + /* run = 3 */ + { + {0x11, 7}, {0x24,11}, {0x00, 0} + }, + /* run = 4 */ + { + {0x10, 7}, {0x25,11}, {0x00, 0} + }, + /* run = 5 */ + { + {0x13, 7}, {0x5a,12}, {0x00, 0} + }, + /* run = 6 */ + { + {0x15, 8}, {0x5b,12}, {0x00, 0} + } + }; + + /* Coeffs for last = 1, run = 7 -> 20. Indexed by [run-7] */ + + static VLCtable coeff_tab10[14] = + { + {0x14, 8}, {0x13, 8}, {0x1a, 8}, {0x15, 9}, + {0x14, 9}, {0x13, 9}, {0x12, 9}, {0x11, 9}, + {0x26,11}, {0x27,11}, {0x5c,12}, {0x5d,12}, + {0x5e,12}, {0x5f,12} + }; + + + + /* RVLC tables */ + /* DCT coefficients. Four tables, two for last = 0, two for last = 1. + the sign bit must be added afterwards. */ + + /* DCT coeffs (intra) for last = 0. */ + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab1[27] = + { + /* run = 0 */ + { 0x6, 3}, + { 0x7, 3}, + { 0xa, 4}, + { 0x9, 5}, + { 0x14, 6}, + { 0x15, 6}, + { 0x34, 7}, + { 0x74, 8}, + { 0x75, 8}, + { 0xdd, 9}, + { 0xec, 9}, + { 0x1ec, 10}, + { 0x1ed, 10}, + { 0x1f4, 10}, + { 0x3ec, 11}, + { 0x3ed, 11}, + { 0x3f4, 11}, + { 0x77d, 12}, + { 0x7bc, 12}, + { 0xfbd, 13}, + { 0xfdc, 13}, + { 0x7bd, 12}, + { 0xfdd, 13}, + { 0x1fbd, 14}, + { 0x1fdc, 14}, + { 0x1fdd, 14}, + { 0x1ffc, 15} + }; + + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab2[13] = + { + /* run = 1 */ + { 0x1, 4}, + { 0x8, 5}, + { 0x2d, 7}, + { 0x6c, 8}, + { 0x6d, 8}, + { 0xdc, 9}, + { 0x1dd, 10}, + { 0x3dc, 11}, + { 0x3dd, 11}, + { 0x77c, 12}, + { 0xfbc, 13}, + { 0x1f7d, 14}, + { 0x1fbc, 14} + }; + + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab3[11] = + { + /* run = 2 */ + { 0x4, 5}, + { 0x2c, 7}, + { 0xbc, 9}, + { 0x1dc, 10}, + { 0x3bc, 11}, + { 0x3bd, 11}, + { 0xefd, 13}, + { 0xf7c, 13}, + { 0xf7d, 13}, + { 0x1efd, 14}, + { 0x1f7c, 14} + }; + + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab4[9] = + { + /* run = 3 */ + { 0x5, 5}, + { 0x5c, 8}, + { 0xbd, 9}, + { 0x37d, 11}, + { 0x6fc, 12}, + { 0xefc, 13}, + { 0x1dfd, 14}, + { 0x1efc, 14}, + { 0x1ffd, 15} + }; + + + /* Indexed by [run-4][level-1] */ + + static VLCtable coeff_RVLCtab5[2][6] = + { + /* run = 4 */ + { + { 0xc, 6}, + { 0x5d, 8}, + { 0x1bd, 10}, + { 0x3fd, 12}, + { 0x6fd, 12}, + { 0x1bfd, 14} + }, + /* run = 5 */ + { + { 0xd, 6}, + { 0x7d, 9}, + { 0x2fc, 11}, + { 0x5fc, 12}, + { 0x1bfc, 14}, + { 0x1dfc, 14} + } + }; + + + /* Indexed by [run-6][level-1] */ + + static VLCtable coeff_RVLCtab6[2][5] = + { + /* run = 6 */ + { + { 0x1c, 7}, + { 0x17c, 10}, + { 0x2fd, 11}, + { 0x5fd, 12}, + { 0x2ffc, 15} + }, + /* run = 7 */ + { + { 0x1d, 7}, + { 0x17d, 10}, + { 0x37c, 11}, + { 0xdfd, 13}, + { 0x2ffd, 15} + } + }; + + + /* Indexed by [run-8][level-1] */ + + static VLCtable coeff_RVLCtab7[2][4] = + { + /* run = 8 */ + { + { 0x3c, 8}, + { 0x1bc, 10}, + { 0xbfd, 13}, + { 0x17fd, 14} + }, + /* run = 9 */ + { + { 0x3d, 8}, + { 0x1fd, 11}, + { 0xdfc, 13}, + { 0x37fc, 15}, + } + }; + + + /* Indexed by [run-10][level-1] */ + + static VLCtable coeff_RVLCtab8[3][2] = + { + /* run = 10 */ + { + { 0x7c, 9}, + { 0x3fc, 12} + }, + /* run = 11 */ + { + { 0xfc, 10}, + { 0xbfc, 13} + }, + /* run = 12 */ + { + { 0xfd, 10}, + { 0x37fd, 15} + } + }; + + + /* Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab9[7] = + { + /* run = 13 -> 19 */ + { 0x1fc, 11}, + { 0x7fc, 13}, + { 0x7fd, 13}, + { 0xffc, 14}, + { 0xffd, 14}, + { 0x17fc, 14}, + { 0x3bfc, 15} + }; + + + /* first coeffs of last = 1. indexing by [run][level-1] */ + + static VLCtable coeff_RVLCtab10[2][5] = + { + /* run = 0 */ + { + { 0xb, 4}, + { 0x78, 8}, + { 0x3f5, 11}, + { 0xfec, 13}, + { 0x1fec, 14} + }, + /* run = 1 */ + { + { 0x12, 5}, + { 0xed, 9}, + { 0x7dc, 12}, + { 0x1fed, 14}, + { 0x3bfd, 15} + } + }; + + + static VLCtable coeff_RVLCtab11[3] = + { + /* run = 2 */ + { 0x13, 5}, + { 0x3f8, 11}, + { 0x3dfc, 15} + }; + + + static VLCtable coeff_RVLCtab12[11][2] = + { + /* run = 3 */ + { + { 0x18, 6}, + { 0x7dd, 12} + }, + /* run = 4 */ + { + { 0x19, 6}, + { 0x7ec, 12} + }, + /* run = 5 */ + { + { 0x22, 6}, + { 0xfed, 13} + }, + /* run = 6 */ + { + { 0x23, 6}, + { 0xff4, 13} + }, + /* run = 7 */ + { + { 0x35, 7}, + { 0xff5, 13} + }, + /* run = 8 */ + { + { 0x38, 7}, + { 0xff8, 13} + }, + /* run = 9 */ + { + { 0x39, 7}, + { 0xff9, 13} + }, + /* run = 10 */ + { + { 0x42, 7}, + { 0x1ff4, 14} + }, + /* run = 11 */ + { + { 0x43, 7}, + { 0x1ff5, 14} + }, + /* run = 12 */ + { + { 0x79, 8}, + { 0x1ff8, 14} + }, + /* run = 13 */ + { + { 0x82, 8}, + { 0x3dfd, 15} + } + }; + + + static VLCtable coeff_RVLCtab13[32] = + { + /* run = 14 -> 45 */ + { 0x83, 8}, + { 0xf4, 9}, + { 0xf5, 9}, + { 0xf8, 9}, + { 0xf9, 9}, + { 0x102, 9}, + { 0x103, 9}, + { 0x1f5, 10}, + { 0x1f8, 10}, + { 0x1f9, 10}, + { 0x202, 10}, + { 0x203, 10}, + { 0x3f9, 11}, + { 0x402, 11}, + { 0x403, 11}, + { 0x7ed, 12}, + { 0x7f4, 12}, + { 0x7f5, 12}, + { 0x7f8, 12}, + { 0x7f9, 12}, + { 0x802, 12}, + { 0x803, 12}, + { 0x1002, 13}, + { 0x1003, 13}, + { 0x1ff9, 14}, + { 0x2002, 14}, + { 0x2003, 14}, + { 0x3efc, 15}, + { 0x3efd, 15}, + { 0x3f7c, 15}, + { 0x3f7d, 15} + }; + + + /* Coeffs for last = 0, run = 0. Indexed by [level-1] */ + + static VLCtable coeff_RVLCtab14[19] = + { + /* run = 0 */ + { 0x6, 3}, + { 0x1, 4}, + { 0x4, 5}, + { 0x1c, 7}, + { 0x3c, 8}, + { 0x3d, 8}, + { 0x7c, 9}, + { 0xfc, 10}, + { 0xfd, 10}, + { 0x1fc, 11}, + { 0x1fd, 11}, + { 0x3fc, 12}, + { 0x7fc, 13}, + { 0x7fd, 13}, + { 0xbfc, 13}, + { 0xbfd, 13}, + { 0xffc, 14}, + { 0xffd, 14}, + { 0x1ffc, 15} + }; + + static VLCtable coeff_RVLCtab15[10] = + { + /* run = 1 */ + { 0x7, 3}, + { 0xc, 6}, + { 0x5c, 8}, + { 0x7d, 9}, + { 0x17c, 10}, + { 0x2fc, 11}, + { 0x3fd, 12}, + { 0xdfc, 13}, + { 0x17fc, 14}, + { 0x17fd, 14} + }; + + static VLCtable coeff_RVLCtab16[2][7] = + { + /* run = 2 */ + { + { 0xa, 4}, + { 0x1d, 7}, + { 0xbc, 9}, + { 0x2fd, 11}, + { 0x5fc, 12}, + { 0x1bfc, 14}, + { 0x1bfd, 14} + }, + /* run = 3 */ + { + { 0x5, 5}, + { 0x5d, 8}, + { 0x17d, 10}, + { 0x5fd, 12}, + { 0xdfd, 13}, + { 0x1dfc, 14}, + { 0x1ffd, 15} + } + }; + + static VLCtable coeff_RVLCtab17[5] = + { + /* run = 4 */ + { 0x8, 5}, + { 0x6c, 8}, + { 0x37c, 11}, + { 0xefc, 13}, + { 0x2ffc, 15} + }; + + static VLCtable coeff_RVLCtab18[3][4] = + { + /* run = 5 */ + { + { 0x9, 5}, + { 0xbd, 9}, + { 0x37d, 11}, + { 0xefd, 13} + }, + /* run = 6 */ + { + { 0xd, 6}, + { 0x1bc, 10}, + { 0x6fc, 12}, + { 0x1dfd, 14} + }, + /* run = 7 */ + { + { 0x14, 6}, + { 0x1bd, 10}, + { 0x6fd, 12}, + { 0x2ffd, 15} + } + }; + + static VLCtable coeff_RVLCtab19[2][3] = + { + /* run = 8 */ + { + { 0x15, 6}, + { 0x1dc, 10}, + { 0xf7c, 13} + }, + /* run = 9 */ + { + { 0x2c, 7}, + { 0x1dd, 10}, + { 0x1efc, 14} + } + }; + + static VLCtable coeff_RVLCtab20[8][2] = + { + /* run = 10 */ + { + { 0x2d, 7}, + { 0x3bc, 11} + }, + /* run = 11 */ + { + { 0x34, 7}, + { 0x77c, 12} + }, + /* run = 12 */ + { + { 0x6d, 8}, + { 0xf7d, 13} + }, + /* run = 13 */ + { + { 0x74, 8}, + { 0x1efd, 14} + }, + /* run = 14 */ + { + { 0x75, 8}, + { 0x1f7c, 14} + }, + /* run = 15 */ + { + { 0xdc, 9}, + { 0x1f7d, 14} + }, + /* run = 16 */ + { + { 0xdd, 9}, + { 0x1fbc, 14} + }, + /* run = 17 */ + { + { 0xec, 9}, + { 0x37fc, 15} + } + }; + + static VLCtable coeff_RVLCtab21[21] = + { + /* run = 18 -> 38 */ + { 0x1ec, 10}, + { 0x1ed, 10}, + { 0x1f4, 10}, + { 0x3bd, 11}, + { 0x3dc, 11}, + { 0x3dd, 11}, + { 0x3ec, 11}, + { 0x3ed, 11}, + { 0x3f4, 11}, + { 0x77d, 12}, + { 0x7bc, 12}, + { 0x7bd, 12}, + { 0xfbc, 13}, + { 0xfbd, 13}, + { 0xfdc, 13}, + { 0xfdd, 13}, + { 0x1fbd, 14}, + { 0x1fdc, 14}, + { 0x1fdd, 14}, + { 0x37fd, 15}, + { 0x3bfc, 15} + }; + + + /* first coeffs of last = 1. indexing by [run][level-1] */ + + static VLCtable coeff_RVLCtab22[2][5] = + { + /* run = 0 */ + { + { 0xb, 4}, + { 0x78, 8}, + { 0x3f5, 11}, + { 0xfec, 13}, + { 0x1fec, 14} + }, + /* run = 1 */ + { + { 0x12, 5}, + { 0xed, 9}, + { 0x7dc, 12}, + { 0x1fed, 14}, + { 0x3bfd, 15} + } + }; + + static VLCtable coeff_RVLCtab23[3] = + { + /* run = 2 */ + { 0x13, 5}, + { 0x3f8, 11}, + { 0x3dfc, 15} + }; + + static VLCtable coeff_RVLCtab24[11][2] = + { + /* run = 3 */ + { + { 0x18, 6}, + { 0x7dd, 12} + }, + /* run = 4 */ + { + { 0x19, 6}, + { 0x7ec, 12} + }, + /* run = 5 */ + { + { 0x22, 6}, + { 0xfed, 13} + }, + /* run = 6 */ + { + { 0x23, 6}, + { 0xff4, 13} + }, + /* run = 7 */ + { + { 0x35, 7}, + { 0xff5, 13} + }, + /* run = 8 */ + { + { 0x38, 7}, + { 0xff8, 13} + }, + /* run = 9 */ + { + { 0x39, 7}, + { 0xff9, 13} + }, + /* run = 10 */ + { + { 0x42, 7}, + { 0x1ff4, 14} + }, + /* run = 11 */ + { + { 0x43, 7}, + { 0x1ff5, 14} + }, + /* run = 12 */ + { + { 0x79, 8}, + { 0x1ff8, 14} + }, + /* run = 13 */ + { + { 0x82, 8}, + { 0x3dfd, 15} + } + }; + + + static VLCtable coeff_RVLCtab25[32] = + { + /* run = 14 -> 45 */ + { 0x83, 8}, + { 0xf4, 9}, + { 0xf5, 9}, + { 0xf8, 9}, + { 0xf9, 9}, + { 0x102, 9}, + { 0x103, 9}, + { 0x1f5, 10}, + { 0x1f8, 10}, + { 0x1f9, 10}, + { 0x202, 10}, + { 0x203, 10}, + { 0x3f9, 11}, + { 0x402, 11}, + { 0x403, 11}, + { 0x7ed, 12}, + { 0x7f4, 12}, + { 0x7f5, 12}, + { 0x7f8, 12}, + { 0x7f9, 12}, + { 0x802, 12}, + { 0x803, 12}, + { 0x1002, 13}, + { 0x1003, 13}, + { 0x1ff9, 14}, + { 0x2002, 14}, + { 0x2003, 14}, + { 0x3efc, 15}, + { 0x3efd, 15}, + { 0x3f7c, 15}, + { 0x3f7d, 15} + }; + + #endif /* _VLC_H */ + + + + + diff -C2 -r -N bcast-2000c/quicktime/encore50/vm_common_defs.h bcast-2000c-mf3/quicktime/encore50/vm_common_defs.h *** bcast-2000c/quicktime/encore50/vm_common_defs.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/vm_common_defs.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,166 ---- + + #ifndef _VM_COMMON_DEFS_H_ + #define _VM_COMMON_DEFS_H_ + + # ifdef __cplusplus + extern "C" { + # endif /* __cplusplus */ + + #define VERSION 1 /* image structure version */ + + + # ifdef __cplusplus + } + # endif /* __cplusplus */ + + + + /* maximum allowed number of VOs and VOLs */ + + #define MAX_NUM_VOS 32 + #define MAX_NUM_VOLS 16 + + /* end of bitstream code */ + + #define EOB_CODE 1 + #define EOB_CODE_LENGTH 32 + + + /*** 10/28 TEST */ + /* #define MB_trace_thres 22 */ + #define MB_trace_thres 8193 /* changed */ + /* 10/28 TEST ***/ + + #define EXTENDED_PAR 0xF + + /* session layer and vop layer start codes */ + + #define SESSION_START_CODE 0x01B0 + #define SESSION_END_CODE 0x01B1 + + #define VO_START_CODE 0x8 + #define VO_START_CODE_LENGTH 27 + + #define VO_HEADER_LENGTH 32 /* lengtho of VO header: VO_START_CODE + VO_ID */ + + #define SOL_START_CODE 0x01be + #define SOL_START_CODE_LENGTH 32 + + #define VOL_START_CODE 0x12 /* 25-MAR-97 JDL : according to WD2 */ + #define VOL_START_CODE_LENGTH 28 + + #define VOP_START_CODE 0x1B6 /* 25-MAR-97 JDL : according to WD2 */ + #define VOP_START_CODE_LENGTH 32 + + #define GROUP_START_CODE 0x01B3 /* 05-05-1997 Minhua Zhou */ + #define GROUP_START_CODE_LENGTH 32 /* 10.12.97 Luis Ducla-Soares */ + + #define VOP_ID_CODE_LENGTH 5 + #define VOP_TEMP_REF_CODE_LENGTH 16 + + #define USER_DATA_START_CODE 0x01B2 /* Due to N2171 Cl. 2.1.9, MW 23-MAR-1998 */ + #define USER_DATA_START_CODE_LENGTH 32 /* Due to N2171 Cl. 2.1.9, MW 23-MAR-1998 */ + + #define START_CODE_PREFIX 0x01 /* Due to N2171 Cl. 2.1.9, MW 23-MAR-1998 */ + #define START_CODE_PREFIX_LENGTH 24 /* Due to N2171 Cl. 2.1.9, MW 23-MAR-1998 */ + + #define SHORT_VIDEO_START_MARKER 0x20 + #define SHORT_VIDEO_START_MARKER_LENGTH 22 + #define SHORT_VIDEO_END_MARKER 0x3F + + #define GOB_RESYNC_MARKER 0x01 + #define GOB_RESYNC_MARKER_LENGTH 17 + + /* motion and resync markers used in error resilient mode */ + + #define DC_MARKER 438273 /* 09.10.97 LDS: according to WD4.0 */ + #define DC_MARKER_LENGTH 19 + + #define MOTION_MARKER_COMB 126977 /* 26.04.97 LDS: according to VM7.0 */ + #define MOTION_MARKER_COMB_LENGTH 17 + + #define MOTION_MARKER_SEP 81921 /* 26.04.97 LDS: according to VM6.0 */ + #define MOTION_MARKER_SEP_LENGTH 17 + + #define RESYNC_MARKER 1 /* 26.04.97 LDS: according to VM6.0 */ + #define RESYNC_MARKER_LENGTH 17 + + #define SPRITE_NOT_USED 0 + #define STATIC_SPRITE 1 + #define GMC_SPRITE 2 /* NTT for GMC coding */ + + /* macroblock size */ + #define MB_SIZE 16 + + /* VOL types */ + + #define RECTANGULAR 0 + #define BINARY 1 + #define BINARY_SHAPE_ONLY 2 /* HYUNDAI (Grayscale) */ + #define GREY_SCALE 3 /* HYUNDAI (Grayscale) */ + + /* macroblock modes */ + + #define MODE_INTRA 0 + #define MODE_INTER 1 + #define MODE_INTRA_Q 2 /* not used currently */ + #define MODE_INTER_Q 3 /* not used currently */ + #define MODE_INTER4V 4 + #define MODE_GMC 5 /* NTT for GMC coding */ + #define MODE_GMC_Q 6 + + #define MBM_INTRA 0 + #define MBM_INTER16 1 + #define MBM_SPRITE 3 + #define MBM_INTER8 4 + #define MBM_TRANSPARENT 2 + #define MBM_OUT 5 + #define MBM_SKIPPED 6 + + + /* (from mot_est.h) */ + #define MBM_OPAQUE 7 /* opaque block value (all pixels 1 or 255) */ + #define MBM_BOUNDARY 8 /* block in the boundary of the shape => transparent */ + + #define MBM_FIELD00 9 /* ref(Top)=Top, ref(Bot)=Top */ + #define MBM_FIELD01 10 /* ref(Top)=Top, ref(Bot)=Bot */ + #define MBM_FIELD10 11 /* ref(Top)=Bot, ref(Bot)=Top */ + #define MBM_FIELD11 12 /* ref(Top)=Bot, ref(Bot)=Bot */ + + #define MBM_B_MODE 0x07 /* Mode mask */ + #define MBM_B_FWDFRM 0 /* Forward frame prediction */ + #define MBM_B_BAKFRM 1 /* Backward frame prediction */ + #define MBM_B_AVEFRM 2 /* Average (bidirectional) frame prediction */ + #define MBM_B_DIRECT 3 /* Direct mode */ + /* nothing defined */ /* Transparent */ + #define MBM_B_FWDFLD 5 /* Forward field prediction */ + #define MBM_B_BAKFLD 6 /* Backward field prediction */ + #define MBM_B_AVEFLD 7 /* Average (bidirectional) field prediction */ + #define MBM_B_REFFLDS 0xF0 /* Mask of reference file selectors */ + #define MBM_B_FWDTOP 0x10 /* Fwd Top fld reference is bot if set */ + #define MBM_B_FWDBOT 0x20 /* Fwd Bot fld reference is bot if set */ + #define MBM_B_BAKTOP 0x40 /* Bak Top fld reference is bot if set */ + #define MBM_B_BAKBOT 0x80 /* Bak Bot fld reference is bot if set */ + + + /* typedef enum + { + MBMODE_INTRA=0, + MBMODE_INTER16=1, + MBMODE_INTER8=4, + MBMODE_TRANSPARENT=2, + MBMODE_OUT=5, + MBMODE_SPRITE=3 + } MBMODE; */ + /* (from mot_est.h) */ + + + #define BINARY_ALPHA 255 + #define BINARY_SHAPE 1 + #define ARB_SHAPE 1 + + #define NO_SHAPE_EFFECTS 0 + + #define REVERSE_VLC 1 /* 26.04.97 LDS */ + + #endif diff -C2 -r -N bcast-2000c/quicktime/encore50/vm_enc_defs.h bcast-2000c-mf3/quicktime/encore50/vm_enc_defs.h *** bcast-2000c/quicktime/encore50/vm_enc_defs.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/vm_enc_defs.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,35 ---- + + #ifndef _VM_ENC_DEFS_H_ + #define _VM_ENC_DEFS_H_ + + #include "vm_common_defs.h" + + #define I_VOP 0 /* vop coding modes */ + #define P_VOP 1 + #define B_VOP 2 + #define SPRITE_VOP 3 + + #define VOP_VISIBLE 1 + + #define SEP_MOT_TEXT 1 + + #define UNRESTRICTED_MV_RANGE 16 /* unrestricted MVs can poin + outside VOP by this number of + pixels */ + + #define QUANT_TYPE_SEL 0 /* = 1 for MPEG quantization */ + #define LOAD_INTRA_QUANT_MAT 1 /* Added, 12-JUN-1996, MW */ + #define LOAD_NONINTRA_QUANT_MAT 1 + + #define DEFAULT_COMP_ORDER TRUE /* Vop Layer Defaults */ + #define DEFAULT_VISIBILITY 1 + #define DEFAULT_SCALING 0 + #define DEFAULT_PRED_TYPE P_VOP + #define DEFAULT_DBQUANT 0 /* Not used */ + + #define BUFFER_EMPTY 0 /* Initial state of buffer */ + + + #define NON_ERROR_RESILIENT 1 /* non error resilient mode: 26.04.97 LDS */ + + #endif /* _VM_ENC_DEFS_H_ */ diff -C2 -r -N bcast-2000c/quicktime/encore50/vop_code.c bcast-2000c-mf3/quicktime/encore50/vop_code.c *** bcast-2000c/quicktime/encore50/vop_code.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/vop_code.c Sat Dec 8 03:57:24 2001 *************** *** 0 **** --- 1,414 ---- + + /************************************************************************** + * * + * This code is developed by Adam Li. This software is an * + * implementation of a part of one or more MPEG-4 Video tools as * + * specified in ISO/IEC 14496-2 standard. Those intending to use this * + * software module in hardware or software products are advised that its * + * use may infringe existing patents or copyrights, and any such use * + * would be at such party's own risk. The original developer of this * + * software module and his/her company, and subsequent editors and their * + * companies (including Project Mayo), will have no liability for use of * + * this software or modifications or derivatives thereof. * + * * + * Project Mayo gives users of the Codec a license to this software * + * module or modifications thereof for use in hardware or software * + * products claiming conformance to the MPEG-4 Video Standard as * + * described in the Open DivX license. * + * * + * The complete Open DivX license can be found at * + * http://www.projectmayo.com/opendivx/license.php . * + * * + **************************************************************************/ + + /************************************************************************** + * + * vop_code.c + * + * Copyright (C) 2001 Project Mayo + * + * Adam Li + * + * DivX Advance Research Center + * + **************************************************************************/ + + /* This file contains some functions to do coding of one VOP. */ + + #include "vop_code.h" + #include "mot_est_comp.h" + //#include "rc_q2.h" + #include "bitstream.h" + + #include "rate_ctl.h" + + #define SCENE_CHANGE_THREADHOLD 50 + #define MB_RATIO_THREADHOLD 0.40 + + extern FILE *ftrace; + + UInt BitstreamPutVopHeader ( Vop *vop, + Float time, + VolConfig *vol_config + ); + Void ImageRepetitivePadding(Image *image, Int edge); + Double compute_MAD(Vop *vop); + + + /***********************************************************CommentBegin****** + * + * -- VopCode -- Shape, texture and motion coding of the vop + * + * Purpose : + * This function performs shape, texture and motion coding of the + * vop passed to it. The input vop is assumed to be BOUNDED. + * + * Arguments in : + * Vop *curr - pointer to vop to be coded + * Vop *prev - pointer the last occurence of this vop + * Vop *rec_prev - pointer to last coded occurence of this vop + * Int enable_8x8_mv - 8x8 motion vectors flag (SpSc) + * Int intra_dcpred_disable - disable intradc prediction + * Float time - + * VolConfig *vol_config - + * + * Arguments in/out : + * Vop *rec_curr - coded vop + * Bitcount num_bits - BitCount structures + * + ***********************************************************CommentEnd********/ + + Void VopCode(Vop *curr, + Vop *reference, + Vop *reconstruct, + Vop *error, + Int enable_8x8_mv, + Float time, + VolConfig *vol_config, + int quant) + { + ImageF *mot_x=NULL, *mot_y=NULL; + Image *MB_decisions=NULL; + Int edge,f_code_for=1; + Vop *error_vop=NULL; + Int vop_quantizer; + + Float mad_P = 0., mad_I = 0.; + Float IntraMBRatio = 1.; + Int numberMB, i, IntraMB; + + edge = 0; + f_code_for = curr->fcode_for; + + if (curr->prediction_type == P_VOP) + { + /* Carry out motion estimation and compensation*/ + MotionEstimationCompensation(curr, reference, + enable_8x8_mv, edge ,f_code_for, + reconstruct, &mad_P, &mot_x,&mot_y,&MB_decisions); + + /* Calculate the percentage of the MBs that are Intra */ + IntraMB = 0; + numberMB = MB_decisions->x * MB_decisions->y; + for (i = 0; i < numberMB; i ++) + if (MB_decisions->f[i] == MBM_INTRA) IntraMB ++; + IntraMBRatio = (float)IntraMB / (float)numberMB; + + #ifdef _RC_ + fprintf(ftrace, "ME with MAD : %f\n", mad_P); + fprintf(ftrace, "%4.2f of the MBs are I-MBs.\n", IntraMBRatio); + #endif + } + else + mad_P = SCENE_CHANGE_THREADHOLD * 2; + + if ((mad_P < SCENE_CHANGE_THREADHOLD / 3) || + ((mad_P < SCENE_CHANGE_THREADHOLD) && (IntraMBRatio < MB_RATIO_THREADHOLD))) + { + // mad is fine. continue to code as P_VOP + curr->prediction_type = P_VOP; + error->prediction_type = P_VOP; + + #ifdef _RC_ + fprintf(ftrace, "Coding mode : INTER\n"); + #endif + + vop_quantizer = (quant > 0) ? quant : RateCtlGetQ(mad_P); + + curr->quantizer = vop_quantizer; + error->quantizer = vop_quantizer; + + #ifdef _RC_DEBUG_ + fprintf(stdout, "RC: >>>>> New quantizer= %d\n", vop_quantizer); + #endif + + SubImage(curr->y_chan, reconstruct->y_chan, error->y_chan); + SubImage(curr->u_chan, reconstruct->u_chan, error->u_chan); + SubImage(curr->v_chan, reconstruct->v_chan, error->v_chan); + + BitstreamPutVopHeader(curr,time,vol_config); + + VopShapeMotText(error, reconstruct, MB_decisions, + mot_x, mot_y, f_code_for, + GetVopIntraACDCPredDisable(curr), reference, + NULL/*mottext_bitstream*/); + } else { + // mad is too large. + // the coding mode should be I_VOP + curr->prediction_type = I_VOP; + curr->rounding_type = 1; + + #ifdef _RC_ + fprintf(ftrace, "Coding mode : INTRA\n"); + #endif + + // We need to recalculate MAD here, since the last MAD was calculated by assuming + // INTER coding, though the actual difference might not be significant to coding. + if (mad_I == 0.) mad_I = (Float) compute_MAD(curr); + + vop_quantizer = (quant > 0) ? quant : RateCtlGetQ(mad_I); + + curr->intra_quantizer = vop_quantizer; + curr->rounding_type = 1; + + BitstreamPutVopHeader(curr,time,vol_config); + + /* Code Texture in Intra mode */ + VopCodeShapeTextIntraCom(curr, + reference, + NULL/*texture_bitstream*/ + ); + } + + + if (MB_decisions) FreeImage(MB_decisions); + if (mot_x) FreeImage(mot_x); + if (mot_y) FreeImage(mot_y); + + ImageRepetitivePadding(reference->y_chan, 16); + ImageRepetitivePadding(reference->u_chan, 8); + ImageRepetitivePadding(reference->v_chan, 8); + + Bitstream_NextStartCode(); + + return; + } /* CodeVop() */ + + + /***********************************************************CommentBegin****** + * + * -- BitstreamPutVopHeader -- Writes all fields of the vop header syntax + * + * Purpose : + * This function writes all fields of the vop header syntax to the + * bitstream disk file. + * + * Arguments in : + * Vop *vop - pointer to vop containing header information + * + * Return values : + * UInt num_bits - number of bits written + * + * Description : + * The vop header (start_code, vop_ID, etc.) is first + * written to an intermediate integer level bitstream data structure. + * This intermediate bitstream data structure is then written to disk. + * + ***********************************************************CommentEnd********/ + + UInt + BitstreamPutVopHeader(Vop *vop, + Float time, + VolConfig *vol_config) + { + Image *buffer = NULL; + Int bits; + Int time_modulo; + Float time_inc; + + Int index; + + UInt num_bits_header=0; + + /* + * + * Write all syntax fields in vop header to data structure + * + */ + + BitstreamPutBits(buffer,VOP_START_CODE,VOP_START_CODE_LENGTH); + + BitstreamPutBits(buffer,GetVopPredictionType(vop),2); + + index = GetVolConfigModTimeBase(vol_config, 1); + + time_modulo = (int)time - index*1000; + while(time_modulo >= 1000) + { + BitstreamPutBits(buffer,1,1); + time_modulo = time_modulo - 1000; + index++; + printf("time modulo : 1\n"); + } + BitstreamPutBits(buffer,0,1); + + /* Store this modulo time base */ + PutVolConfigModTimeBase(index,vol_config); + + time_inc = (time - index*1000); + + bits = (int)ceil(log((double)GetVopTimeIncrementResolution(vop))/log(2.0)); + if (bits<1) bits=1; + time_inc=time_inc*GetVopTimeIncrementResolution(vop)/1000.0f; + + /* marker bit */ + BitstreamPutBits(buffer,1,1); + + BitstreamPutBits(buffer,(Int)(time_inc+0.001),bits); + + /* marker bit */ + BitstreamPutBits(buffer,1,1); + + if (GetVopWidth(vop)==0) + { + printf("Empty VOP at %.2f\n",time); /* MW 30-NOV-1998 */ + BitstreamPutBits(buffer,0L,1L); + num_bits_header += Bitstream_NextStartCode(); + return(num_bits_header); + } + else + BitstreamPutBits(buffer,1L,1L); + + if( GetVopPredictionType(vop) == P_VOP ) + BitstreamPutBits(buffer,GetVopRoundingType(vop),1); + + BitstreamPutBits(buffer,GetVopIntraDCVlcThr(vop),3); + + if (GetVopPredictionType(vop) == I_VOP) /* I_VOP */ + BitstreamPutBits(buffer,GetVopIntraQuantizer(vop),GetVopQuantPrecision(vop)); + else /* P_VOP */ + BitstreamPutBits(buffer,GetVopQuantizer(vop),GetVopQuantPrecision(vop)); + + if (GetVopPredictionType(vop)!=I_VOP) + { + BitstreamPutBits(buffer,GetVopFCodeFor(vop),3); + } + + return(num_bits_header); + } + + // do repetitive padding for image + // make sure set edge = 16 for Y and 8 for UV + Void ImageRepetitivePadding(Image *image, Int edge) + { + SInt *p, left, right; + Int width, height, x, y; + + p = image->f; + width = image->x; + height = image->y; + + /* Horizontal Padding */ + for( y=edge; yy_chan)) + { + case SHORT_TYPE: + /* change to AC MAD */ + /* calculate average first */ + curr_in = (SInt*)GetImageData(error_vop->y_chan); + sxy_in = GetImageSize(error_vop->y_chan); + curr_end = curr_in + sxy_in; + cnt = 0; + while (curr_in != curr_end) + { + dc += *curr_in; //abs(*curr_in); + cnt++; + curr_in++; + } + dc /= cnt; + + curr_in = (SInt*)GetImageData(error_vop->y_chan); + sxy_in = GetImageSize(error_vop->y_chan); + curr_end = curr_in + sxy_in; + cnt = 0; + while (curr_in != curr_end) + { + mad += fabs(*curr_in - dc); + cnt++; + curr_in++; + } + mad /= cnt; + break; + case FLOAT_TYPE: + curr_fin = (Float*)GetImageData(error_vop->y_chan); + sxy_in = GetImageSize(error_vop->y_chan); + curr_fend = curr_fin + sxy_in; + cnt = 0; + while (curr_fin != curr_fend) + { + mad += fabs(*curr_fin); + cnt++; + curr_fin++; + } + mad /= cnt; + break; + default: break; + } + + #ifdef _RC_ + fprintf(ftrace, "The MAD of the VOP to be coded is %f.\n", mad); + #endif + + return mad; + } + + diff -C2 -r -N bcast-2000c/quicktime/encore50/vop_code.h bcast-2000c-mf3/quicktime/encore50/vop_code.h *** bcast-2000c/quicktime/encore50/vop_code.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/vop_code.h Sat Dec 8 03:58:06 2001 *************** *** 0 **** --- 1,41 ---- + + + #ifndef _VM_VOP_CODE_H_ + #define _VM_VOP_CODE_H_ + + #include "bitstream.h" + #include "text_code.h" + + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + + struct bit_count { + Char stats_file[100]; + UInt vol; + UInt vop; + UInt syntax; + UInt texture; + UInt motion; + UInt mot_shape_text; + Bits text_bits; + }; + + typedef struct bit_count BitCount; + + Void VopCode _P_(( Vop *curr, + Vop *reference, + Vop *compensated, + Vop *error, + Int enable_8x8_mv, + Float time, + VolConfig *vol_config, + int quant + )); + + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + #endif /* _VM_VOP_CODE_H_ */ + diff -C2 -r -N bcast-2000c/quicktime/encore50/zigzag.h bcast-2000c-mf3/quicktime/encore50/zigzag.h *** bcast-2000c/quicktime/encore50/zigzag.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/encore50/zigzag.h Mon Dec 3 14:48:33 2001 *************** *** 0 **** --- 1,55 ---- + + #ifndef _ZIGZAG_H_ + #define _ZIGZAG_H_ + + + /* Normal zigzag */ + static Int zigzag[64] = { + 0, 1, 5, 6,14,15,27,28, + 2, 4, 7,13,16,26,29,42, + 3, 8,12,17,25,30,41,43, + 9,11,18,24,31,40,44,53, + 10,19,23,32,39,45,52,54, + 20,22,33,38,46,51,55,60, + 21,34,37,47,50,56,59,61, + 35,36,48,49,57,58,62,63 + }; + + /* Horizontal zigzag */ + static Int zigzag_h[64] = { + 0, 1, 2, 3,10,11,12,13, + 4, 5, 8, 9,17,16,15,14, + 6, 7,19,18,26,27,28,29, + 20,21,24,25,30,31,32,33, + 22,23,34,35,42,43,44,45, + 36,37,40,41,46,47,48,49, + 38,39,50,51,56,57,58,59, + 52,53,54,55,60,61,62,63 + }; + + /* Vertical zigzag */ + static Int zigzag_v[64] = { + 0, 4, 6,20,22,36,38,52, + 1, 5, 7,21,23,37,39,53, + 2, 8,19,24,34,40,50,54, + 3, 9,18,25,35,41,51,55, + 10,17,26,30,42,46,56,60, + 11,16,27,31,43,47,57,61, + 12,15,28,32,44,48,58,62, + 13,14,29,33,45,49,59,63 + }; + + /* Inverse normal zigzag */ + static Int zigzag_i[64] = + { + 0, 1, 8,16, 9, 2, 3,10, + 17,24,32,25,18,11, 4, 5, + 12,19,26,33,40,48,41,34, + 27,20,13, 6, 7,14,21,28, + 35,42,49,56,57,50,43,36, + 29,22,15,23,30,37,44,51, + 58,59,52,45,38,31,39,46, + 53,60,61,54,47,55,62,63 + }; + + #endif /* ifndef _ZIGZAG_H_ */ diff -C2 -r -N bcast-2000c/quicktime/funcprotos.h bcast-2000c-mf3/quicktime/funcprotos.h *** bcast-2000c/quicktime/funcprotos.h Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/funcprotos.h Mon Dec 10 15:12:14 2001 *************** *** 3,7 **** #include "graphics.h" ! #include "private.h" /* atom handling routines */ --- 3,7 ---- #include "graphics.h" ! #include "qtprivate.h" /* atom handling routines */ *************** *** 40,50 **** longest quicktime_samples_to_bytes(quicktime_trak_t *track, long samples); - extern void quicktime_init_codec_raw(quicktime_video_map_t *); extern void quicktime_init_codec_jpeg(quicktime_video_map_t *); extern void quicktime_init_codec_png(quicktime_video_map_t *); extern void quicktime_init_codec_yuv2(quicktime_video_map_t *); extern void quicktime_init_codec_yuv4(quicktime_video_map_t *); extern void quicktime_init_codec_yv12(quicktime_video_map_t *); - extern void quicktime_init_codec_dv(quicktime_video_map_t *); extern void quicktime_init_codec_twos(quicktime_audio_map_t *); --- 40,51 ---- longest quicktime_samples_to_bytes(quicktime_trak_t *track, long samples); extern void quicktime_init_codec_jpeg(quicktime_video_map_t *); extern void quicktime_init_codec_png(quicktime_video_map_t *); + extern void quicktime_init_codec_v308(quicktime_video_map_t *); + extern void quicktime_init_codec_v408(quicktime_video_map_t *); + extern void quicktime_init_codec_v410(quicktime_video_map_t *); extern void quicktime_init_codec_yuv2(quicktime_video_map_t *); extern void quicktime_init_codec_yuv4(quicktime_video_map_t *); extern void quicktime_init_codec_yv12(quicktime_video_map_t *); extern void quicktime_init_codec_twos(quicktime_audio_map_t *); *************** *** 53,57 **** extern void quicktime_init_codec_ulaw(quicktime_audio_map_t *); - /* Graphics */ quicktime_scaletable_t* quicktime_new_scaletable(int input_w, int input_h, int output_w, int output_h); --- 54,57 ---- *************** *** 84,108 **** --- 84,126 ---- int quicktime_write_trak(quicktime_t *file, quicktime_trak_t *trak, long moov_time_scale); longest quicktime_track_end(quicktime_trak_t *trak); + + /* the total number of samples in the track depending on the access mode */ long quicktime_track_samples(quicktime_t *file, quicktime_trak_t *trak); + + /* queries for every atom */ /* the starting sample in the given chunk */ long quicktime_sample_of_chunk(quicktime_trak_t *trak, long chunk); + + /* the byte offset from mdat start of the chunk */ longest quicktime_chunk_to_offset(quicktime_trak_t *trak, long chunk); + + /* the chunk of any offset from mdat start */ long quicktime_offset_to_chunk(longest *chunk_offset, quicktime_trak_t *trak, longest offset); + + + /* total bytes between the two samples */ longest quicktime_sample_range_size(quicktime_trak_t *trak, long chunk_sample, long sample); + + int quicktime_chunk_of_sample(longest *chunk_sample, longest *chunk, quicktime_trak_t *trak, long sample); + + + /* converting between mdat offsets to samples */ longest quicktime_sample_to_offset(quicktime_trak_t *trak, long sample); long quicktime_offset_to_sample(quicktime_trak_t *trak, longest offset); quicktime_trak_t* quicktime_add_trak(quicktime_moov_t *moov); + + /* update all the tables after writing a buffer */ /* set sample_size to 0 if no sample size should be set */ diff -C2 -r -N bcast-2000c/quicktime/global_config bcast-2000c-mf3/quicktime/global_config *** bcast-2000c/quicktime/global_config Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/global_config Thu Jan 1 01:00:00 1970 *************** *** 1,14 **** - # DO NOT EDIT. EDIT ./configure INSTEAD AND RERUN IT. - CFLAGS += -DHAVE_FIREWIRE - CFLAGS += -DUSE_MMX - CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 - CFLAGS += -I. -Ijpeg -Ilibdv $(shell glib-config --cflags) - export CFLAGS - CC = gcc - DVMMXOBJS = libdv/idct_block_mmx.o libdv/quant_x86.o - - DVMMX_OBJS2 = idct_block_mmx.o quant_x86.o - FIREWIREOBJS = libraw1394/eventloop.o libraw1394/fcp.o libraw1394/iso.o libraw1394/main.o libraw1394/readwrite.o - - FIREWIREOBJS2 = eventloop.o fcp.o iso.o main.o readwrite.o - --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/ima4.c bcast-2000c-mf3/quicktime/ima4.c *** bcast-2000c/quicktime/ima4.c Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/ima4.c Mon Dec 3 16:50:50 2001 *************** *** 2,6 **** #include "ima4.h" ! static int quicktime_ima4_step[89] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, --- 2,6 ---- #include "ima4.h" ! static int ima4_step[89] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, *************** *** 15,19 **** }; ! static int quicktime_ima4_index[16] = { -1, -1, -1, -1, 2, 4, 6, 8, --- 15,19 ---- }; ! static int ima4_index[16] = { -1, -1, -1, -1, 2, 4, 6, 8, *************** *** 34,38 **** /* Get new index value */ ! *index += quicktime_ima4_index[*nibble]; if(*index < 0) *index = 0; --- 34,38 ---- /* Get new index value */ ! *index += ima4_index[*nibble]; if(*index < 0) *index = 0; *************** *** 61,65 **** /* Update the step value */ ! *step = quicktime_ima4_step[*index]; } --- 61,65 ---- /* Update the step value */ ! *step = ima4_step[*index]; } *************** *** 83,87 **** predictor &= 0xff80; if(predictor & 0x8000) predictor -= 0x10000; ! step = quicktime_ima4_step[index]; /* Read the input buffer sequentially, one nibble at a time */ --- 83,87 ---- predictor &= 0xff80; if(predictor & 0x8000) predictor -= 0x10000; ! step = ima4_step[index]; /* Read the input buffer sequentially, one nibble at a time */ *************** *** 105,109 **** difference = next_sample - *last_sample; *nibble = 0; ! step = quicktime_ima4_step[*last_index]; new_difference = step >> 3; --- 105,109 ---- difference = next_sample - *last_sample; *nibble = 0; ! step = ima4_step[*last_index]; new_difference = step >> 3; *************** *** 137,141 **** if(*last_sample < -32767) *last_sample = -32767; ! *last_index += quicktime_ima4_index[*nibble]; if(*last_index < 0) *last_index = 0; --- 137,141 ---- if(*last_sample < -32767) *last_sample = -32767; ! *last_index += ima4_index[*nibble]; if(*last_index < 0) *last_index = 0; *************** *** 254,258 **** /* =================================== public for ima4 */ ! static int quicktime_delete_codec_ima4(quicktime_audio_map_t *atrack) { quicktime_ima4_codec_t *codec = ((quicktime_codec_t*)atrack->codec)->priv; --- 254,258 ---- /* =================================== public for ima4 */ ! static int delete_codec(quicktime_audio_map_t *atrack) { quicktime_ima4_codec_t *codec = ((quicktime_codec_t*)atrack->codec)->priv; *************** *** 274,278 **** } ! static int quicktime_decode_ima4(quicktime_t *file, int16_t *output_i, float *output_f, --- 274,278 ---- } ! static int decode(quicktime_t *file, int16_t *output_i, float *output_f, *************** *** 339,343 **** } ! static int quicktime_encode_ima4(quicktime_t *file, int16_t **input_i, float **input_f, --- 339,343 ---- } ! static int encode(quicktime_t *file, int16_t **input_i, float **input_f, *************** *** 493,497 **** } ! int quicktime_flush_ima4(quicktime_t *file, int track) { quicktime_audio_map_t *track_map = &(file->atracks[track]); --- 493,497 ---- } ! void flush(quicktime_t *file, int track) { quicktime_audio_map_t *track_map = &(file->atracks[track]); *************** *** 511,517 **** codec->work_overflow = i / track_map->channels + 1; /* Write the work_overflow only. */ ! result = quicktime_encode_ima4(file, 0, 0, track, 0); } - return result; } --- 511,516 ---- codec->work_overflow = i / track_map->channels + 1; /* Write the work_overflow only. */ ! result = encode(file, 0, 0, track, 0); } } *************** *** 522,530 **** /* Init public items */ ((quicktime_codec_t*)atrack->codec)->priv = calloc(1, sizeof(quicktime_ima4_codec_t)); ! ((quicktime_codec_t*)atrack->codec)->delete_acodec = quicktime_delete_codec_ima4; ((quicktime_codec_t*)atrack->codec)->decode_video = 0; ((quicktime_codec_t*)atrack->codec)->encode_video = 0; ! ((quicktime_codec_t*)atrack->codec)->decode_audio = quicktime_decode_ima4; ! ((quicktime_codec_t*)atrack->codec)->encode_audio = quicktime_encode_ima4; /* Init private items */ --- 521,530 ---- /* Init public items */ ((quicktime_codec_t*)atrack->codec)->priv = calloc(1, sizeof(quicktime_ima4_codec_t)); ! ((quicktime_codec_t*)atrack->codec)->delete_acodec = delete_codec; ((quicktime_codec_t*)atrack->codec)->decode_video = 0; ((quicktime_codec_t*)atrack->codec)->encode_video = 0; ! ((quicktime_codec_t*)atrack->codec)->decode_audio = decode; ! ((quicktime_codec_t*)atrack->codec)->encode_audio = encode; ! ((quicktime_codec_t*)atrack->codec)->flush = flush; /* Init private items */ diff -C2 -r -N bcast-2000c/quicktime/jpeg/CVS/Entries bcast-2000c-mf3/quicktime/jpeg/CVS/Entries *** bcast-2000c/quicktime/jpeg/CVS/Entries Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/jpeg/CVS/Entries Tue Nov 6 14:47:04 2001 *************** *** 1,137 **** ! /Makefile/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /README/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /ansi2knr.1/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /ansi2knr.c/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /c_flags/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /cderror.h/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /cdjpeg.c/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /cdjpeg.h/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /change.log/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /cjpeg.1/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /cjpeg.c/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /ckconfig.c/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /coderules.doc/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /djpeg.1/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /djpeg.c/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /example.c/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /filelist.doc/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /install.doc/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /jcapimin.c/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /jcapistd.c/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /jccoefct.c/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /jccolor.c/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /jcdctmgr.c/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /jchuff.c/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /jchuff.h/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /jcinit.c/1.1.1.1/Thu Nov 2 04:28:46 2000// ! /jcmainct.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jcmarker.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jcmaster.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jcomapi.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.bcc/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.cfg/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.dj/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.doc/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.h/1.1.1.1/Thu Nov 2 04:28:45 2000// ! /jconfig.mac/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.manx/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.mc6/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.sas/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.st/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.vc/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.vms/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jconfig.wat/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jcparam.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jcphuff.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jcprepct.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jcsample.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jctrans.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jdapimin.c/1.1.1.1/Thu Nov 2 04:28:47 2000// ! /jdapistd.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdatadst.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdatasrc.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdcoefct.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdcolor.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdct.h/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jddctmgr.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdhuff.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdhuff.h/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdinput.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdmainct.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdmarker.c/1.1.1.1/Thu Nov 2 04:28:48 2000// ! /jdmaster.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jdmerge.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jdphuff.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jdpostct.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jdsample.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jdtrans.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jerror.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jerror.h/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jfdctflt.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jfdctfst.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jfdctfst_mmx.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jfdctint.c/1.1.1.1/Thu Nov 2 04:28:49 2000// ! /jidctflt.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jidctfst.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jidctint.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jidctred.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jinclude.h/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jmemansi.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jmemdos.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jmemdosa.asm/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jmemmac.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jmemmgr.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jmemname.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jmemnobs.c/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jmemsys.h/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jmorecfg.h/1.1.1.1/Thu Nov 2 04:28:50 2000// ! /jpegint.h/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /jpeglib.h/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /jpegtran.1/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /jpegtran.c/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /jquant1.c/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /jquant2.c/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /jutils.c/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /jversion.h/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /makcjpeg.st/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /makdjpeg.st/1.1.1.1/Thu Nov 2 04:28:51 2000// ! /makeapps.ds/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.ansi/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.bcc/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.cfg/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.dj/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.manx/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.mc6/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.mms/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.sas/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.unix/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.vc/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.vms/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makefile.wat/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makelib.ds/1.1.1.1/Thu Nov 2 04:28:52 2000// ! /makeproj.mac/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /makljpeg.st/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /maktjpeg.st/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /makvms.opt/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /rdbmp.c/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /rdcolmap.c/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /rdgif.c/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /rdjpgcom.1/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /rdjpgcom.c/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /rdppm.c/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /rdrle.c/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /rdswitch.c/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /rdtarga.c/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /structure.doc/1.1.1.1/Thu Nov 2 04:28:53 2000// ! /transupp.c/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /transupp.h/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /usage.doc/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /wizard.doc/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /wrbmp.c/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /wrgif.c/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /wrjpgcom.1/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /wrjpgcom.c/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /wrppm.c/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /wrrle.c/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /wrtarga.c/1.1.1.1/Thu Nov 2 04:28:54 2000// D --- 1,137 ---- ! /Makefile/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /README/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /ansi2knr.1/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /ansi2knr.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /c_flags/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /cderror.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /cdjpeg.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /cdjpeg.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /change.log/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /cjpeg.1/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /cjpeg.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /ckconfig.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /coderules.doc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /djpeg.1/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /djpeg.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /example.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /filelist.doc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /install.doc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcapimin.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcapistd.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jccoefct.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jccolor.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcdctmgr.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jchuff.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jchuff.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcinit.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcmainct.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcmarker.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcmaster.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcomapi.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.bcc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.cfg/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.dj/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.doc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.mac/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.manx/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.mc6/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.sas/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.st/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.vc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.vms/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jconfig.wat/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcparam.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcphuff.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcprepct.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jcsample.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jctrans.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdapimin.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdapistd.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdatadst.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdatasrc.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdcoefct.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdcolor.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdct.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jddctmgr.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdhuff.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdhuff.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdinput.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdmainct.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdmarker.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdmaster.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdmerge.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdphuff.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdpostct.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdsample.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jdtrans.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jerror.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jerror.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jfdctflt.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jfdctfst.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jfdctfst_mmx.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jfdctint.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jidctflt.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jidctfst.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jidctint.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jidctred.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jinclude.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jmemansi.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jmemdos.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jmemdosa.asm/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jmemmac.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jmemmgr.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jmemname.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jmemnobs.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jmemsys.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jmorecfg.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jpegint.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jpeglib.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jpegtran.1/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jpegtran.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jquant1.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jquant2.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jutils.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /jversion.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makcjpeg.st/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makdjpeg.st/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makeapps.ds/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.ansi/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.bcc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.cfg/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.dj/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.manx/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.mc6/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.mms/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.sas/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.unix/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.vc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.vms/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makefile.wat/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makelib.ds/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makeproj.mac/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makljpeg.st/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /maktjpeg.st/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /makvms.opt/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rdbmp.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rdcolmap.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rdgif.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rdjpgcom.1/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rdjpgcom.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rdppm.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rdrle.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rdswitch.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rdtarga.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /structure.doc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /transupp.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /transupp.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /usage.doc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wizard.doc/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wrbmp.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wrgif.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wrjpgcom.1/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wrjpgcom.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wrppm.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wrrle.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /wrtarga.c/1.1.1.1/Mon Oct 1 03:16:38 2001// D diff -C2 -r -N bcast-2000c/quicktime/jpeg/CVS/Root bcast-2000c-mf3/quicktime/jpeg/CVS/Root *** bcast-2000c/quicktime/jpeg/CVS/Root Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/jpeg/CVS/Root Tue Nov 6 14:47:04 2001 *************** *** 1 **** ! heroines@cvs.heroines.sourceforge.net:/cvsroot/heroines --- 1 ---- ! :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/jpeg.c bcast-2000c-mf3/quicktime/jpeg.c *** bcast-2000c/quicktime/jpeg.c Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/jpeg.c Mon Dec 3 14:48:32 2001 *************** *** 14,17 **** --- 14,19 ---- if(codec->buffer) free(codec->buffer); + if(codec->temp_video) + free(codec->temp_video); free(codec); return 0; *************** *** 45,52 **** mjpeg_t *mjpeg = codec->mjpeg; long size, field2_offset; ! int result; //printf("decode 1\n"); mjpeg_set_cpus(codec->mjpeg, file->cpus); quicktime_set_video_position(file, vtrack->current_position, track); size = quicktime_frame_size(file, vtrack->current_position, track); --- 47,61 ---- mjpeg_t *mjpeg = codec->mjpeg; long size, field2_offset; ! int track_height = trak->tkhd.track_height; ! int track_width = trak->tkhd.track_width; ! int result = 0; //printf("decode 1\n"); mjpeg_set_cpus(codec->mjpeg, file->cpus); + if(file->row_span) + mjpeg_set_rowspan(codec->mjpeg, file->row_span); + else + mjpeg_set_rowspan(codec->mjpeg, 0); + quicktime_set_video_position(file, vtrack->current_position, track); size = quicktime_frame_size(file, vtrack->current_position, track); *************** *** 79,93 **** * codec->buffer[field2_offset], codec->buffer[field2_offset + 1]); */ ! mjpeg_decompress(codec->mjpeg, ! codec->buffer, ! size, ! field2_offset, ! row_pointers, ! row_pointers[0], ! row_pointers[1], ! row_pointers[2], ! file->color_model, ! file->cpus); //printf("decode 7\n"); } //printf("decode 8\n"); --- 88,165 ---- * codec->buffer[field2_offset], codec->buffer[field2_offset + 1]); */ ! //printf("decode 6 %d %d %d %d %d %d\n", ! // file->in_x, file->in_y, file->in_w, file->in_h, file->out_w, file->out_h); ! ! if(file->in_x == 0 && ! file->in_y == 0 && ! file->in_w == track_width && ! file->in_h == track_height && ! file->out_w == track_width && ! file->out_h == track_height) ! { ! int i; ! //printf("decode 6\n"); ! mjpeg_decompress(codec->mjpeg, ! codec->buffer, ! size, ! field2_offset, ! row_pointers, ! row_pointers[0], ! row_pointers[1], ! row_pointers[2], ! file->color_model, ! file->cpus); //printf("decode 7\n"); + } + else + { + int i; + unsigned char **temp_rows; + int temp_cmodel = BC_YUV888; + int temp_rowsize = cmodel_calculate_pixelsize(temp_cmodel) * track_width; + + //printf("decode 8\n"); + if(!codec->temp_video) + codec->temp_video = malloc(temp_rowsize * track_height); + temp_rows = malloc(sizeof(unsigned char*) * track_height); + for(i = 0; i < track_height; i++) + temp_rows[i] = codec->temp_video + i * temp_rowsize; + + mjpeg_decompress(codec->mjpeg, + codec->buffer, + size, + field2_offset, + temp_rows, + temp_rows[0], + temp_rows[1], + temp_rows[2], + temp_cmodel, + file->cpus); + + cmodel_transfer(row_pointers, + temp_rows, + row_pointers[0], + row_pointers[1], + row_pointers[2], + temp_rows[0], + temp_rows[1], + temp_rows[2], + file->in_x, + file->in_y, + file->in_w, + file->in_h, + 0, + 0, + file->out_w, + file->out_h, + temp_cmodel, + file->color_model, + 0, + track_width, + file->out_w); + + free(temp_rows); + //printf("decode 9\n"); + } } //printf("decode 8\n"); *************** *** 101,105 **** quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; quicktime_trak_t *trak = vtrack->track; ! long offset = quicktime_position(file); int result = 0; long field2_offset; --- 173,177 ---- quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; quicktime_trak_t *trak = vtrack->track; ! longest offset = quicktime_position(file); int result = 0; long field2_offset; *************** *** 144,147 **** --- 216,220 ---- quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; + // Some JPEG_PROGRESSIVE is BC_YUV422P if(codec->jpeg_type == JPEG_PROGRESSIVE) { *************** *** 149,153 **** colormodel == BC_YUV888 || colormodel == BC_YUV420P || ! colormodel == BC_YUV422P); } else --- 222,227 ---- colormodel == BC_YUV888 || colormodel == BC_YUV420P || ! colormodel == BC_YUV422P || ! colormodel == BC_YUV422); } else *************** *** 156,160 **** colormodel == BC_YUV888 || // colormodel == BC_YUV420P || ! colormodel == BC_YUV422P); // The BC_YUV420P option was provided only for mpeg2movie use.because some // interlaced movies were accidentally in YUV4:2:0 --- 230,235 ---- colormodel == BC_YUV888 || // colormodel == BC_YUV420P || ! colormodel == BC_YUV422P || ! colormodel == BC_YUV422); // The BC_YUV420P option was provided only for mpeg2movie use.because some // interlaced movies were accidentally in YUV4:2:0 *************** *** 183,186 **** --- 258,279 ---- } + static int set_parameter(quicktime_t *file, + int track, + char *key, + void *value) + { + quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)file->vtracks[track].codec)->priv; + + if(!strcasecmp(key, "jpeg_quality")) + { + mjpeg_set_quality(codec->mjpeg, *(int*)value); + } + else + if(!strcasecmp(key, "jpeg_usefloat")) + { + mjpeg_set_float(codec->mjpeg, *(int*)value); + } + return 0; + } void quicktime_init_codec_jpeg(quicktime_video_map_t *vtrack) *************** *** 204,207 **** --- 297,301 ---- ((quicktime_codec_t*)vtrack->codec)->reads_colormodel = reads_colormodel; ((quicktime_codec_t*)vtrack->codec)->writes_colormodel = writes_colormodel; + ((quicktime_codec_t*)vtrack->codec)->set_parameter = set_parameter; /* Init private items */ diff -C2 -r -N bcast-2000c/quicktime/jpeg.c.bak bcast-2000c-mf3/quicktime/jpeg.c.bak *** bcast-2000c/quicktime/jpeg.c.bak Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/jpeg.c.bak Thu Jan 1 01:00:00 1970 *************** *** 1,947 **** - #include - #include "jpeg.h" - #include "quicktime.h" - - /* JPEG MARKERS */ - #define M_SOF0 0xc0 - #define M_SOF1 0xc1 - #define M_SOF2 0xc2 - #define M_SOF3 0xc3 - #define M_SOF5 0xc5 - #define M_SOF6 0xc6 - #define M_SOF7 0xc7 - #define M_JPG 0xc8 - #define M_SOF9 0xc9 - #define M_SOF10 0xca - #define M_SOF11 0xcb - #define M_SOF13 0xcd - #define M_SOF14 0xce - #define M_SOF15 0xcf - #define M_DHT 0xc4 - #define M_DAC 0xcc - #define M_RST0 0xd0 - #define M_RST1 0xd1 - #define M_RST2 0xd2 - #define M_RST3 0xd3 - #define M_RST4 0xd4 - #define M_RST5 0xd5 - #define M_RST6 0xd6 - #define M_RST7 0xd7 - #define M_SOI 0xd8 - #define M_EOI 0xd9 - #define M_SOS 0xda - #define M_DQT 0xdb - #define M_DNL 0xdc - #define M_DRI 0xdd - #define M_DHP 0xde - #define M_EXP 0xdf - #define M_APP0 0xe0 - #define M_APP1 0xe1 - #define M_APP2 0xe2 - #define M_APP3 0xe3 - #define M_APP4 0xe4 - #define M_APP5 0xe5 - #define M_APP6 0xe6 - #define M_APP7 0xe7 - #define M_APP8 0xe8 - #define M_APP9 0xe9 - #define M_APP10 0xea - #define M_APP11 0xeb - #define M_APP12 0xec - #define M_APP13 0xed - #define M_APP14 0xee - #define M_APP15 0xef - #define M_JPG0 0xf0 - #define M_JPG13 0xfd - #define M_COM 0xfe - #define M_TEM 0x01 - #define M_ERROR 0x100 - - /* Buffer and error handling from jpeg-6b examples */ - - METHODDEF(void) - my_error_exit (j_common_ptr cinfo) - { - /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ - my_error_ptr myerr = (my_error_ptr) cinfo->err; - - /* Always display the message. */ - /* We could postpone this until after returning, if we chose. */ - (*cinfo->err->output_message) (cinfo); - - /* Return control to the setjmp point */ - longjmp(myerr->setjmp_buffer, 1); - } - - void quicktime_jpeg_delete_compress_engine(mjpa_compress_engine *compressor) - { - jpeg_destroy((j_common_ptr)&(compressor->jpeg_compress)); - if(compressor->output_buffer) - free(compressor->output_buffer); - free(compressor); - } - - - void quicktime_endcompressor_jpeg(mjpa_compress_engine *engine) - { - engine->done = 1; - pthread_mutex_unlock(&(engine->input_lock)); - pthread_join(engine->tid, 0); - pthread_mutex_destroy(&(engine->input_lock)); - pthread_mutex_destroy(&(engine->output_lock)); - } - - static int quicktime_delete_codec_jpeg(quicktime_video_map_t *vtrack) - { - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - int i; - - for(i = 0; i < codec->total_compressors; i++) - { - if(codec->compressors[i]) - { - quicktime_endcompressor_jpeg(codec->compressors[i]); - quicktime_jpeg_delete_compress_engine(codec->compressors[i]); - codec->compressors[i] = 0; - } - - if(codec->decompressors[i]) - { - quicktime_enddecompressor_jpeg(codec->decompressors[i]); - jpeg_destroy_decompress(&(codec->decompressors[i]->jpeg_decompress)); - - free(codec->decompressors[i]); - codec->decompressors[i] = 0; - } - } - if(codec->input_buffer) - free(codec->input_buffer); - free(codec); - return 0; - } - - void quicktime_set_jpeg(quicktime_t *file, int quality, int use_float) - { - int i; - char *compressor; - - for(i = 0; i < file->total_vtracks; i++) - { - if(quicktime_match_32(quicktime_video_compressor(file, i), QUICKTIME_JPEG) || - quicktime_match_32(quicktime_video_compressor(file, i), QUICKTIME_MJPA) || - quicktime_match_32(quicktime_video_compressor(file, i), QUICKTIME_RTJ0)) - { - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)file->vtracks[i].codec)->priv; - codec->quality = quality; - codec->use_float = use_float; - /* file->vtracks[i].codecs.rtjpeg_codec.quality = quality; */ - } - } - } - - static inline int quicktime_read_int32_jpeg(char **data, int *length) - { - if(*length < 4) return 0; - *length -= 4; - *data += 4; - return (int)((((unsigned char)(*data)[-4]) << 24) | - (((unsigned char)(*data)[-3]) << 16) | - (((unsigned char)(*data)[-2]) << 8) | - (((unsigned char)(*data)[-1]))); - } - - static inline int quicktime_write_int32_jpeg(char **data, int *length, int value) - { - if(*length < 4) return 0; - *length -= 4; - - *(*data)++ = (unsigned int)(value & 0xff000000) >> 24; - *(*data)++ = (unsigned int)(value & 0xff0000) >> 16; - *(*data)++ = (unsigned int)(value & 0xff00) >> 8; - *(*data)++ = (unsigned char)(value & 0xff); - return 0; - } - - static inline int quicktime_read_int16_jpeg(char **data, int *length) - { - if(*length < 2) return 0; - *length -= 2; - *data += 2; - return (((QUICKTIME_INT16)((unsigned char)(*data)[-2]) << 8) | - ((unsigned char)(*data)[-1])); - } - - static inline int quicktime_readbyte_jpeg(char **data, int *length) - { - if(*length < 1) return 0; - *length -= 1; - *data += 1; - return (unsigned char)(*data)[-1]; - } - - int quicktime_read_markers_jpeg(quicktime_mjpeg_hdr *mjpeg_hdr, struct jpeg_decompress_struct *jpeg_decompress) - { - int done = 0; - int length; - char *data; - jpeg_saved_marker_ptr marker_ptr; - - if(jpeg_decompress) - marker_ptr = jpeg_decompress->marker_list; - - while((marker_ptr || !jpeg_decompress) && !done) - { - if((marker_ptr && marker_ptr->marker == JPEG_APP0 + 1) || !jpeg_decompress) - { - if(marker_ptr) - { - length = marker_ptr->data_length; - data = marker_ptr->data; - } - else - { - length = QUICKTIME_JPEG_MARKSIZE; - data = mjpeg_hdr->mjpeg_marker; - } - - quicktime_read_int32_jpeg(&data, &length); - quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->field_size = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->padded_field_size = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->next_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->quant_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->huffman_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->image_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->scan_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->data_offset = quicktime_read_int32_jpeg(&data, &length); - /* printf("%x %x %x %x %x %x %x %x\n", mjpeg_hdr->field_size, */ - /* mjpeg_hdr->padded_field_size, */ - /* mjpeg_hdr->next_offset, */ - /* mjpeg_hdr->quant_offset, */ - /* mjpeg_hdr->huffman_offset, */ - /* mjpeg_hdr->image_offset, */ - /* mjpeg_hdr->scan_offset, */ - /* mjpeg_hdr->data_offset); */ - done = 1; - } - if(marker_ptr) marker_ptr = marker_ptr->next; - } - return 0; - } - - static inline void quicktime_skipmarker_jpeg(char **buffer_ptr, int *buffer_size, int *len) - { - if(*len > 0) - { - *buffer_ptr += *len; - *len = 0; - *buffer_size -= *len; - } - } - - int quicktime_getmarker_jpeg(char **buffer_ptr, int *buffer_size, int *len) - { - int c, done = 0; /* 1 - completion 2 - error */ - - while(!done && *buffer_size > 0) - { - c = quicktime_readbyte_jpeg(buffer_ptr, buffer_size); - /* look for FF */ - while(!done && c != 0xFF) - { - if(!*buffer_size) done = 2; - c = quicktime_readbyte_jpeg(buffer_ptr, buffer_size); - } - - /* now we've got 1 0xFF, keep reading until not 0xFF */ - do - { - if(!*buffer_size) done = 2; - c = quicktime_readbyte_jpeg(buffer_ptr, buffer_size); - }while (!done && c == 0xFF); - - /* not a 00 or FF */ - if (c != 0) done = 1; - } - - *len = 0; - if(done == 1) - return c; - else - return 0; - } - - int quicktime_fixmarker_jpeg(quicktime_mjpeg_hdr *mjpeg_hdr, char *buffer, long output_size, int write_next_offset) - { - char *buffer_ptr = buffer; - int buffer_size = output_size; - int done = 0, offset = 0, app1_offset = 0; - int marker = 0; - int len; - - mjpeg_hdr->field_size = 0; - mjpeg_hdr->padded_field_size = 0; - mjpeg_hdr->next_offset = 0; - mjpeg_hdr->quant_offset = 0; - mjpeg_hdr->huffman_offset = 0; - mjpeg_hdr->image_offset = 0; - mjpeg_hdr->scan_offset = 0; - mjpeg_hdr->data_offset = 0; - - while(!done && buffer_size > 0) - { - marker = quicktime_getmarker_jpeg(&buffer_ptr, &buffer_size, &len); - offset = buffer_ptr - buffer - 1; - len = 0; - - switch(marker) - { - case M_SOI: - len = 0; - break; - - case M_DHT: - mjpeg_hdr->huffman_offset = offset - 1; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size); - if(!mjpeg_hdr->mjpg_kludge) - len -= 2; - break; - - case M_DQT: - mjpeg_hdr->quant_offset = offset - 1; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size); - if(!mjpeg_hdr->mjpg_kludge) - len -= 2; - break; - - case M_SOF0: - mjpeg_hdr->image_offset = offset - 1; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size); - if(!mjpeg_hdr->mjpg_kludge) - len -= 2; - break; - - case M_SOS: - mjpeg_hdr->scan_offset = offset - 1; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size); - if(!mjpeg_hdr->mjpg_kludge) - len -= 2; - mjpeg_hdr->data_offset = offset + len + 3; - done = 1; - break; - - case (JPEG_APP0 + 1): - app1_offset = offset + 3; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size) - 2; - break; - - case 0: - case M_EOI: - done = 1; - break; - } - - if(!done) quicktime_skipmarker_jpeg(&buffer_ptr, &buffer_size, &len); - } - - mjpeg_hdr->field_size = mjpeg_hdr->padded_field_size = mjpeg_hdr->next_offset = output_size; - buffer_ptr = buffer + app1_offset; - buffer_size = output_size - app1_offset; - if(!write_next_offset) mjpeg_hdr->next_offset = 0; - - /* printf("%d %x %x %x %x %x %x %x %x \n", row_offset, mjpeg_hdr->field_size, */ - /* mjpeg_hdr->padded_field_size, */ - /* mjpeg_hdr->next_offset, */ - /* mjpeg_hdr->quant_offset, */ - /* mjpeg_hdr->huffman_offset, */ - /* mjpeg_hdr->image_offset, */ - /* mjpeg_hdr->scan_offset, */ - /* mjpeg_hdr->data_offset); */ - - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, 0); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, QUICKTIME_JPEG_TAG); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->field_size); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->padded_field_size); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->next_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->quant_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->huffman_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->image_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->scan_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->data_offset); - return 0; - } - - void quicktime_create_mjpa_objects(mjpa_decompress_engine *engine) - { - engine->jpeg_decompress.err = jpeg_std_error(&(engine->jpeg_error.pub)); - engine->jpeg_error.pub.error_exit = my_error_exit; - /* Ideally the error handler would be set here but it must be called in a thread */ - jpeg_create_decompress(&(engine->jpeg_decompress)); - } - - void quicktime_delete_mjpa_objects(mjpa_decompress_engine *engine) - { - jpeg_destroy_decompress(&(engine->jpeg_decompress)); - } - - - void quicktime_decompressor_jpeg(mjpa_decompress_engine *engine) - { - /* Run continuously */ - unsigned char **interlaced_row; - unsigned char **last_row; - - while(!engine->done) - { - pthread_mutex_lock(&(engine->input_lock)); - - /* Image decompression core */ - if(!engine->done) - { - if(setjmp(engine->jpeg_error.setjmp_buffer)) - { - /* If we get here, the JPEG code has signaled an error. */ - quicktime_delete_mjpa_objects(engine); - quicktime_create_mjpa_objects(engine); - goto finish; - } - - jpeg_buffer_src(&(engine->jpeg_decompress), engine->input_ptr, engine->input_size); - if(engine->markers_only) - jpeg_save_markers(&(engine->jpeg_decompress), JPEG_APP0 + 1, QUICKTIME_JPEG_MARKSIZE); - - jpeg_read_header(&(engine->jpeg_decompress), TRUE); - - /* printf("jpeg %d %d %d %d %d %d\n", */ - /* engine->jpeg_decompress.comp_info[0].h_samp_factor, */ - /* engine->jpeg_decompress.comp_info[0].v_samp_factor, */ - /* engine->jpeg_decompress.comp_info[1].h_samp_factor, */ - /* engine->jpeg_decompress.comp_info[1].v_samp_factor, */ - /* engine->jpeg_decompress.comp_info[2].h_samp_factor, */ - /* engine->jpeg_decompress.comp_info[2].v_samp_factor); */ - - if(engine->markers_only) - { - quicktime_read_markers_jpeg(&(engine->mjpeg_hdr), &(engine->jpeg_decompress)); - engine->field_offset = engine->mjpeg_hdr.next_offset; - pthread_mutex_unlock(&(engine->output_lock)); - pthread_mutex_lock(&(engine->input_lock)); - } - - jpeg_start_decompress(&(engine->jpeg_decompress)); - if(!engine->interlaced) - { - while(engine->jpeg_decompress.output_scanline < engine->jpeg_decompress.output_height) - { - jpeg_read_scanlines(&engine->jpeg_decompress, - (JSAMPROW*)&engine->row_pointers[engine->jpeg_decompress.output_scanline], - engine->jpeg_decompress.output_height - engine->jpeg_decompress.output_scanline); - } - } - else - { - interlaced_row = engine->row_pointers; - last_row = &(engine->row_pointers[engine->height]); - while(engine->jpeg_decompress.output_scanline < engine->jpeg_decompress.output_height && - interlaced_row < last_row) - { - jpeg_read_scanlines(&(engine->jpeg_decompress), - (JSAMPROW*)interlaced_row, - 1); - - interlaced_row += 2; - } - } - jpeg_finish_decompress(&(engine->jpeg_decompress)); - } - - finish: - pthread_mutex_unlock(&(engine->output_lock)); - } - } - - int quicktime_startdecompressor_jpeg(mjpa_decompress_engine *engine) - { - pthread_attr_t attr; - struct sched_param param; - pthread_mutexattr_t mutex_attr; - - pthread_mutexattr_init(&mutex_attr); - pthread_mutex_init(&(engine->input_lock), &mutex_attr); - pthread_mutex_lock(&(engine->input_lock)); - pthread_mutex_init(&(engine->output_lock), &mutex_attr); - pthread_mutex_lock(&(engine->output_lock)); - - pthread_attr_init(&attr); - pthread_create(&(engine->tid), &attr, (void*)quicktime_decompressor_jpeg, engine); - return 0; - } - - int quicktime_enddecompressor_jpeg(mjpa_decompress_engine *engine) - { - engine->done = 1; - pthread_mutex_unlock(&(engine->input_lock)); - pthread_join(engine->tid, 0); - pthread_mutex_destroy(&(engine->input_lock)); - pthread_mutex_destroy(&(engine->output_lock)); - return 0; - } - - int quicktime_decompressfield_jpeg(mjpa_decompress_engine *engine, - char *input_ptr, - long input_size, - unsigned char **row_pointers, - int markers_only, - int resume) - { - engine->markers_only = markers_only; - engine->row_pointers = row_pointers; - engine->input_ptr = input_ptr; - engine->input_size = input_size; - pthread_mutex_unlock(&(engine->input_lock)); - return 0; - } - - int quicktime_decompresswait_jpeg(mjpa_decompress_engine *engine) - { - pthread_mutex_lock(&(engine->output_lock)); - return 0; - } - - - static int quicktime_decode_jpeg(quicktime_t *file, unsigned char **row_pointers, int track) - { - int result = 0; - register int i; - long color_channels, bytes; - quicktime_trak_t *trak = file->vtracks[track].track; - quicktime_video_map_t *vtrack = &(file->vtracks[track]); - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - int is_mjpa = codec->jpeg_type == 1; - int is_mjpb = codec->jpeg_type == 2; - int interlaced = is_mjpa || is_mjpb; - int row_offset, field_offset; - unsigned char **interlaced_row, **last_row; - int field_dominance = trak->mdia.minf.stbl.stsd.table[0].field_dominance; - long size; - long size_remaining; - int height = (int)trak->tkhd.track_height; - int width = (int)trak->tkhd.track_width; - - /* Create decompression engines as needed */ - for(i = 0; i < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1); i++) - { - if(!codec->decompressors[i]) - { - codec->decompressors[i] = malloc(sizeof(mjpa_decompress_engine)); - codec->decompressors[i]->done = 0; - quicktime_create_mjpa_objects(codec->decompressors[i]); - codec->decompressors[i]->is_mjpa = is_mjpa; - codec->decompressors[i]->mjpeg_hdr.mjpg_kludge = 0; - codec->decompressors[i]->interlaced = interlaced; - codec->decompressors[i]->width = width; - codec->decompressors[i]->height = height; - codec->decompressors[i]->codec = codec; - quicktime_startdecompressor_jpeg(codec->decompressors[i]); - codec->total_decompressors++; - } - } - - /* Read the entire chunk from disk. */ - - quicktime_set_video_position(file, vtrack->current_position, track); - size = quicktime_frame_size(file, vtrack->current_position, track); - if(size > codec->buffer_size && codec->input_buffer) - { - free(codec->input_buffer); - codec->input_buffer = 0; - } - if(!codec->input_buffer) - { - codec->input_buffer = malloc(size); - codec->buffer_size = size; - } - result = quicktime_read_data(file, codec->input_buffer, size); - result = !result; - - /* Start the decompressors */ - if(field_dominance >= 2 && interlaced) - row_offset = 1; - else - row_offset = 0; - - field_offset = 0; - for(i = 0; i < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1) && !result; i++) - { - interlaced_row = row_pointers + row_offset; - - if(i > 0) size_remaining = size - field_offset; - else - size_remaining = size; - - quicktime_decompressfield_jpeg(codec->decompressors[i], - codec->input_buffer + field_offset, - size_remaining, - interlaced_row, - (interlaced && i == 0), - 0); - - if(interlaced && i == 0) - { - /* Get field offset from first field */ - quicktime_decompresswait_jpeg(codec->decompressors[i]); - field_offset = codec->decompressors[i]->field_offset; - quicktime_decompressfield_jpeg(codec->decompressors[i], - codec->input_buffer, - field_offset, - interlaced_row, - 0, - 1); - } - - /* Wait for decompressor completion on uniprocessor */ - if(file->cpus < 2) - { - quicktime_decompresswait_jpeg(codec->decompressors[i]); - } - - row_offset ^= 1; - } - - /* Wait for decompressor completion */ - for(i = 0; i < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1) && !result && file->cpus > 1; i++) - { - quicktime_decompresswait_jpeg(codec->decompressors[i]); - } - - return result; - } - - /* Compress a JPEG field */ - unsigned char* quicktime_compress_jpeg(mjpa_compress_engine *engine, - unsigned char **row_pointers, - long *image_size, - int write_next_offset) - { - unsigned char **interlaced_row, **last_row; - - last_row = &row_pointers[engine->height - 1]; - engine->output_size = 0; - jpeg_buffer_dest(&(engine->jpeg_compress), engine); - - /* Initialize interlaced output */ - jpeg_start_compress(&(engine->jpeg_compress), TRUE); - - /* Write a fake MJPA marker */ - if(engine->is_mjpa) - { - jpeg_write_marker(&(engine->jpeg_compress), - JPEG_APP0 + 1, - engine->mjpeg_hdr.mjpeg_marker, - QUICKTIME_JPEG_MARKSIZE); - } - - if(!engine->interlaced) - { - while(engine->jpeg_compress.next_scanline < engine->jpeg_compress.image_height) - { - jpeg_write_scanlines(&engine->jpeg_compress, - &(row_pointers[engine->jpeg_compress.next_scanline]), - engine->jpeg_compress.image_height - engine->jpeg_compress.next_scanline); - } - } - else - { - interlaced_row = row_pointers; - while(engine->jpeg_compress.next_scanline < engine->jpeg_compress.image_height) - { - if(interlaced_row > last_row) interlaced_row = last_row; - jpeg_write_scanlines(&engine->jpeg_compress, - (JSAMPROW*)interlaced_row, - 1); - - interlaced_row += 2; - } - } - jpeg_finish_compress(&engine->jpeg_compress); - - if(engine->is_mjpa) - { - /* Fix markers and write whole thing */ - quicktime_fixmarker_jpeg(&(engine->mjpeg_hdr), - engine->output_buffer, - engine->output_size, - write_next_offset); - } - *image_size = engine->output_size; - return engine->output_buffer; - } - - /* Main loop for JPEG compression */ - void quicktime_compressor_jpeg(mjpa_compress_engine *engine) - { - long fake_size; - - /* Run continuously */ - while(!engine->done) - { - pthread_mutex_lock(&(engine->input_lock)); - - if(!engine->done) - { - /* Image compression core */ - quicktime_compress_jpeg(engine, engine->row_pointers, &fake_size, engine->write_next_offset); - pthread_mutex_unlock(&(engine->output_lock)); - } - } - } - - void quicktime_startcompressor_jpeg(mjpa_compress_engine *engine) - { - pthread_attr_t attr; - struct sched_param param; - pthread_mutexattr_t mutex_attr; - - pthread_mutexattr_init(&mutex_attr); - pthread_mutex_init(&(engine->input_lock), &mutex_attr); - pthread_mutex_lock(&(engine->input_lock)); - pthread_mutex_init(&(engine->output_lock), &mutex_attr); - pthread_mutex_lock(&(engine->output_lock)); - - pthread_attr_init(&attr); - pthread_create(&(engine->tid), &attr, (void*)quicktime_compressor_jpeg, engine); - } - - void quicktime_compressfield_jpeg(mjpa_compress_engine *engine, - unsigned char **row_pointers, int write_next_offset) - { - engine->row_pointers = row_pointers; - engine->write_next_offset = write_next_offset; - pthread_mutex_unlock(&(engine->input_lock)); - } - - void quicktime_compresswait_jpeg(mjpa_compress_engine *engine) - { - pthread_mutex_lock(&(engine->output_lock)); - } - - mjpa_compress_engine* quicktime_jpeg_new_compress_engine(int width, - int height, - int quality, - int use_float, - int interlaced, - int is_mjpa, - int field_number) - { - mjpa_compress_engine *new_compressor; - - new_compressor = malloc(sizeof(mjpa_compress_engine)); - new_compressor->output_buffer = malloc(512); - new_compressor->output_allocated = 512; - new_compressor->output_size = 0; - new_compressor->row_pointers = 0; - new_compressor->write_next_offset = 0; - new_compressor->done = 0; - /* Initialize the jpeglib structures here */ - new_compressor->jpeg_compress.err = jpeg_std_error(&(new_compressor->jpeg_error)); - jpeg_create_compress(&(new_compressor->jpeg_compress)); - new_compressor->jpeg_compress.input_components = 3; - new_compressor->jpeg_compress.in_color_space = JCS_RGB; - jpeg_set_defaults(&(new_compressor->jpeg_compress)); - jpeg_set_quality(&(new_compressor->jpeg_compress), quality, 0); - if(use_float) - new_compressor->jpeg_compress.dct_method = JDCT_FLOAT; - - /* Progression made it twice as slow. */ - /* jpeg_simple_progression(&(codec->compressors[i]->jpeg_compress)); */ - - /* Changing the sampling to all values but default increased compression time. */ - /* 211111 sampling is required for playback on the LML33 */ - if(interlaced) - { - /* Fix sampling for interlaced */ - new_compressor->jpeg_compress.comp_info[0].h_samp_factor = 2; - new_compressor->jpeg_compress.comp_info[0].v_samp_factor = 1; - new_compressor->jpeg_compress.comp_info[1].h_samp_factor = 1; - new_compressor->jpeg_compress.comp_info[1].v_samp_factor = 1; - new_compressor->jpeg_compress.comp_info[2].h_samp_factor = 1; - new_compressor->jpeg_compress.comp_info[2].v_samp_factor = 1; - } - /* Huffman optimization saved %5 */ - /* codec->compressors[i]->jpeg_compress.optimize_coding = TRUE; */ - /* Omitting tables saved the same %5 */ - /* jpeg_suppress_tables(&(codec->compressors[i]->jpeg_compress), TRUE); */ - - new_compressor->jpeg_compress.image_width = width; - new_compressor->jpeg_compress.image_height = !interlaced ? height : (height >> 1); - new_compressor->is_mjpa = is_mjpa; - new_compressor->mjpeg_hdr.mjpg_kludge = 0; - new_compressor->width = width; - new_compressor->height = height; - new_compressor->interlaced = interlaced; - return new_compressor; - } - - static int quicktime_encode_jpeg(quicktime_t *file, unsigned char **row_pointers, int track) - { - long offset = quicktime_position(file); - int result = 0; - register int i; - quicktime_trak_t *trak = file->vtracks[track].track; - quicktime_video_map_t *vtrack = &(file->vtracks[track]); - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - int is_mjpa = codec->jpeg_type == 1; - int is_mjpb = codec->jpeg_type == 2; - int interlaced = is_mjpa || is_mjpb; - int row_offset; - int image_start; - unsigned char **interlaced_row, **last_row; - long bytes; - int height = (int)trak->tkhd.track_height; - int width = (int)trak->tkhd.track_width; - - /* Create compression engines as needed */ - for(i = 0; i < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1); i++) - { - if(!codec->compressors[i]) - { - codec->compressors[i] = quicktime_jpeg_new_compress_engine(width, - height, - codec->quality, - codec->use_float, - interlaced, - is_mjpa, - i); - - /* Start threads waiting */ - quicktime_startcompressor_jpeg(codec->compressors[i]); - - codec->total_compressors++; - } - } - - - /* Start the compressors on the image fields */ - for(row_offset = 0; row_offset < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1) && !result; row_offset++) - { - quicktime_compressfield_jpeg(codec->compressors[row_offset], - row_pointers + row_offset, !row_offset); - - if(file->cpus < 2 && row_offset < TOTAL_MJPA_COMPRESSORS - 1) - { - quicktime_compresswait_jpeg(codec->compressors[row_offset]); - } - } - - /* Wait for the compressors and write to disk */ - for(row_offset = 0; row_offset < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1) && !result; row_offset++) - { - if(file->cpus > 1 || row_offset == TOTAL_MJPA_COMPRESSORS - 1) - { - quicktime_compresswait_jpeg(codec->compressors[row_offset]); - } - - result = quicktime_write_data(file, - codec->compressors[row_offset]->output_buffer, - codec->compressors[row_offset]->output_size); - result = !result; - } - - bytes = quicktime_position(file) - offset; - quicktime_update_tables(file, - vtrack->track, - offset, - vtrack->current_chunk, - vtrack->current_position, - 1, - bytes); - - vtrack->current_chunk++; - return result; - } - - static int reads_colormodel(quicktime_t *file, - int colormodel, - int track) - { - quicktime_video_map_t *vtrack = &(file->vtracks[track]); - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - - if(codec->jpeg_type == 0) - { - return (colormodel == BC_RGB888 || - colormodel == BC_YUV888 || - colormodel == BC_YUV420); - } - else - if(codec->jpeg_type == 1) - { - return (colormodel == BC_RGB888 || - colormodel == BC_YUV888 || - colormodel == BC_YUV422); - } - } - - static int writes_colormodel(quicktime_t *file, - int colormodel, - int track) - { - quicktime_video_map_t *vtrack = &(file->vtracks[track]); - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - - if(codec->jpeg_type == 0) - { - return (colormodel == BC_RGB888 || - colormodel == BC_YUV888 || - colormodel == BC_YUV420); - } - else - if(codec->jpeg_type == 1) - { - return (colormodel == BC_RGB888 || - colormodel == BC_YUV888 || - colormodel == BC_YUV422); - } - } - - - void quicktime_init_codec_jpeg(quicktime_video_map_t *vtrack, int jpeg_type) - { - char *compressor = vtrack->track->mdia.minf.stbl.stsd.table[0].format; - quicktime_jpeg_codec_t *codec; - int i; - - /* Init public items */ - ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_jpeg_codec_t)); - ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = quicktime_delete_codec_jpeg; - ((quicktime_codec_t*)vtrack->codec)->decode_video = quicktime_decode_jpeg; - ((quicktime_codec_t*)vtrack->codec)->encode_video = quicktime_encode_jpeg; - ((quicktime_codec_t*)vtrack->codec)->decode_audio = 0; - ((quicktime_codec_t*)vtrack->codec)->encode_audio = 0; - ((quicktime_codec_t*)vtrack->codec)->reads_colormodel = reads_colormodel; - ((quicktime_codec_t*)vtrack->codec)->writes_colormodel = writes_colormodel - - /* Init private items */ - codec = ((quicktime_codec_t*)vtrack->codec)->priv; - codec->quality = 100; - codec->use_float = 0; - codec->jpeg_type = jpeg_type; - - for(i = 0; i < TOTAL_MJPA_COMPRESSORS; i++) - { - codec->compressors[i] = 0; - codec->decompressors[i] = 0; - } - codec->total_compressors = 0; - codec->total_decompressors = 0; - codec->input_buffer = 0; - - - /* This information must be stored in the initialization routine because of */ - /* direct copy rendering. Quicktime for Windows must have this information. */ - if(quicktime_match_32(compressor, QUICKTIME_MJPA) && !vtrack->track->mdia.minf.stbl.stsd.table[0].fields) - { - vtrack->track->mdia.minf.stbl.stsd.table[0].fields = 2; - vtrack->track->mdia.minf.stbl.stsd.table[0].field_dominance = 1; - } - } --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/jpeg.h bcast-2000c-mf3/quicktime/jpeg.h *** bcast-2000c/quicktime/jpeg.h Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/jpeg.h Mon Oct 1 05:16:38 2001 *************** *** 16,19 **** --- 16,20 ---- mjpeg_t *mjpeg; int jpeg_type; + unsigned char *temp_video; } quicktime_jpeg_codec_t; diff -C2 -r -N bcast-2000c/quicktime/jpeg.h.bak bcast-2000c-mf3/quicktime/jpeg.h.bak *** bcast-2000c/quicktime/jpeg.h.bak Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/jpeg.h.bak Thu Jan 1 01:00:00 1970 *************** *** 1,116 **** - #ifndef QUICKTIME_JPEG_H - #define QUICKTIME_JPEG_H - - #define QUICKTIME_JPEG_MARKSIZE 40 - #define QUICKTIME_JPEG_TAG 0x6d6a7067 - #define TOTAL_MJPA_COMPRESSORS 2 - - - #ifdef __cplusplus - extern "C" { - #endif - - - #include "jpeg/jpeglib.h" - #include /* Need setjmp.h included by png.h */ - #include "pthread.h" - - struct my_error_mgr { - struct jpeg_error_mgr pub; /* "public" fields */ - - jmp_buf setjmp_buffer; /* for return to caller */ - }; - - typedef struct my_error_mgr* my_error_ptr; - - typedef struct - { - int field_size; - int padded_field_size; - int next_offset; - int quant_offset; - int huffman_offset; - int image_offset; - int scan_offset; - int data_offset; - char mjpeg_marker[QUICKTIME_JPEG_MARKSIZE]; - int mjpg_kludge; - } quicktime_mjpeg_hdr; - - typedef struct - { - char *output_buffer; /* Buffer for MJPEG output */ - long output_size; /* Size of image stored in buffer */ - int output_allocated; /* Allocated size of output buffer */ - struct jpeg_compress_struct jpeg_compress; - struct jpeg_error_mgr jpeg_error; - unsigned char **row_pointers; - int row_offset; - int mjpg_kludge; - int is_mjpa; - quicktime_mjpeg_hdr mjpeg_hdr; - int width; /* Total dimensions of the frame */ - int height; - int interlaced; - int write_next_offset; - - pthread_t tid; /* ID of thread */ - pthread_mutex_t input_lock, output_lock; - int done; /* Flag to end */ - } mjpa_compress_engine; - - typedef struct - { - struct jpeg_decompress_struct jpeg_decompress; - struct my_error_mgr jpeg_error; - int is_mjpa; - unsigned char **row_pointers; - char *input_ptr; - long input_size; - void *codec; - long field_offset; /* offset of next field read by the first field */ - int markers_only; /* Get the field offset and wait */ - quicktime_mjpeg_hdr mjpeg_hdr; - int interlaced; - int width; /* Total dimensions of the frame */ - int height; - - pthread_t tid; /* ID of thread */ - pthread_mutex_t input_lock, output_lock; - int done; /* Flag to end */ - } mjpa_decompress_engine; - - typedef struct - { - int quality; - int use_float; - int jpeg_type; /* 0 - QUICKTIME_JPEG, 1 - QUICKTIME_MJPA, 2 - QUICKTIME_MJPB */ - char *input_buffer; /* Buffer for MJPEG output */ - long output_size; /* Size of image stored in buffer */ - int buffer_size; /* Allocated size of input buffer */ - mjpa_compress_engine *compressors[TOTAL_MJPA_COMPRESSORS]; - mjpa_decompress_engine *decompressors[TOTAL_MJPA_COMPRESSORS]; - int total_compressors; /* Number of compressors created */ - int total_decompressors; /* Number of decompressors created */ - } quicktime_jpeg_codec_t; - - /* These functions are called from Broadcast 2000 directly to achieve */ - /* massively parallel compression. */ - - mjpa_compress_engine* quicktime_jpeg_new_compress_engine(int width, - int height, - int quality, - int use_float, - int interlaced, - int is_mjpa, - int field_number); - void quicktime_jpeg_delete_compress_engine(mjpa_compress_engine *compressor); - /* This returns the output buffer. */ - unsigned char* quicktime_compress_jpeg(mjpa_compress_engine *engine, unsigned char **row_pointers, long *image_size, int write_next_offset); - int quicktime_fixmarker_jpeg(quicktime_mjpeg_hdr *mjpeg_hdr, char *buffer, long output_size, int write_next_offset); - - #ifdef __cplusplus - } - #endif - - #endif --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/jpeg_old.c.bak bcast-2000c-mf3/quicktime/jpeg_old.c.bak *** bcast-2000c/quicktime/jpeg_old.c.bak Mon Jan 22 21:55:49 2001 --- bcast-2000c-mf3/quicktime/jpeg_old.c.bak Thu Jan 1 01:00:00 1970 *************** *** 1,947 **** - #include - #include "jpeg_old.h" - #include "quicktime.h" - - /* JPEG MARKERS */ - #define M_SOF0 0xc0 - #define M_SOF1 0xc1 - #define M_SOF2 0xc2 - #define M_SOF3 0xc3 - #define M_SOF5 0xc5 - #define M_SOF6 0xc6 - #define M_SOF7 0xc7 - #define M_JPG 0xc8 - #define M_SOF9 0xc9 - #define M_SOF10 0xca - #define M_SOF11 0xcb - #define M_SOF13 0xcd - #define M_SOF14 0xce - #define M_SOF15 0xcf - #define M_DHT 0xc4 - #define M_DAC 0xcc - #define M_RST0 0xd0 - #define M_RST1 0xd1 - #define M_RST2 0xd2 - #define M_RST3 0xd3 - #define M_RST4 0xd4 - #define M_RST5 0xd5 - #define M_RST6 0xd6 - #define M_RST7 0xd7 - #define M_SOI 0xd8 - #define M_EOI 0xd9 - #define M_SOS 0xda - #define M_DQT 0xdb - #define M_DNL 0xdc - #define M_DRI 0xdd - #define M_DHP 0xde - #define M_EXP 0xdf - #define M_APP0 0xe0 - #define M_APP1 0xe1 - #define M_APP2 0xe2 - #define M_APP3 0xe3 - #define M_APP4 0xe4 - #define M_APP5 0xe5 - #define M_APP6 0xe6 - #define M_APP7 0xe7 - #define M_APP8 0xe8 - #define M_APP9 0xe9 - #define M_APP10 0xea - #define M_APP11 0xeb - #define M_APP12 0xec - #define M_APP13 0xed - #define M_APP14 0xee - #define M_APP15 0xef - #define M_JPG0 0xf0 - #define M_JPG13 0xfd - #define M_COM 0xfe - #define M_TEM 0x01 - #define M_ERROR 0x100 - - /* Buffer and error handling from jpeg-6b examples */ - - METHODDEF(void) - my_error_exit (j_common_ptr cinfo) - { - /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ - my_error_ptr myerr = (my_error_ptr) cinfo->err; - - /* Always display the message. */ - /* We could postpone this until after returning, if we chose. */ - (*cinfo->err->output_message) (cinfo); - - /* Return control to the setjmp point */ - longjmp(myerr->setjmp_buffer, 1); - } - - void quicktime_jpeg_delete_compress_engine(mjpa_compress_engine *compressor) - { - jpeg_destroy((j_common_ptr)&(compressor->jpeg_compress)); - if(compressor->output_buffer) - free(compressor->output_buffer); - free(compressor); - } - - - void quicktime_endcompressor_jpeg(mjpa_compress_engine *engine) - { - engine->done = 1; - pthread_mutex_unlock(&(engine->input_lock)); - pthread_join(engine->tid, 0); - pthread_mutex_destroy(&(engine->input_lock)); - pthread_mutex_destroy(&(engine->output_lock)); - } - - static int quicktime_delete_codec_jpeg(quicktime_video_map_t *vtrack) - { - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - int i; - - for(i = 0; i < codec->total_compressors; i++) - { - if(codec->compressors[i]) - { - quicktime_endcompressor_jpeg(codec->compressors[i]); - quicktime_jpeg_delete_compress_engine(codec->compressors[i]); - codec->compressors[i] = 0; - } - - if(codec->decompressors[i]) - { - quicktime_enddecompressor_jpeg(codec->decompressors[i]); - jpeg_destroy_decompress(&(codec->decompressors[i]->jpeg_decompress)); - - free(codec->decompressors[i]); - codec->decompressors[i] = 0; - } - } - if(codec->input_buffer) - free(codec->input_buffer); - free(codec); - return 0; - } - - void quicktime_set_jpeg(quicktime_t *file, int quality, int use_float) - { - int i; - char *compressor; - - for(i = 0; i < file->total_vtracks; i++) - { - if(quicktime_match_32(quicktime_video_compressor(file, i), QUICKTIME_JPEG) || - quicktime_match_32(quicktime_video_compressor(file, i), QUICKTIME_MJPA) || - quicktime_match_32(quicktime_video_compressor(file, i), QUICKTIME_RTJ0)) - { - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)file->vtracks[i].codec)->priv; - codec->quality = quality; - codec->use_float = use_float; - /* file->vtracks[i].codecs.rtjpeg_codec.quality = quality; */ - } - } - } - - static inline int quicktime_read_int32_jpeg(char **data, int *length) - { - if(*length < 4) return 0; - *length -= 4; - *data += 4; - return (int)((((unsigned char)(*data)[-4]) << 24) | - (((unsigned char)(*data)[-3]) << 16) | - (((unsigned char)(*data)[-2]) << 8) | - (((unsigned char)(*data)[-1]))); - } - - static inline int quicktime_write_int32_jpeg(char **data, int *length, int value) - { - if(*length < 4) return 0; - *length -= 4; - - *(*data)++ = (unsigned int)(value & 0xff000000) >> 24; - *(*data)++ = (unsigned int)(value & 0xff0000) >> 16; - *(*data)++ = (unsigned int)(value & 0xff00) >> 8; - *(*data)++ = (unsigned char)(value & 0xff); - return 0; - } - - static inline int quicktime_read_int16_jpeg(char **data, int *length) - { - if(*length < 2) return 0; - *length -= 2; - *data += 2; - return (((QUICKTIME_INT16)((unsigned char)(*data)[-2]) << 8) | - ((unsigned char)(*data)[-1])); - } - - static inline int quicktime_readbyte_jpeg(char **data, int *length) - { - if(*length < 1) return 0; - *length -= 1; - *data += 1; - return (unsigned char)(*data)[-1]; - } - - int quicktime_read_markers_jpeg(quicktime_mjpeg_hdr *mjpeg_hdr, struct jpeg_decompress_struct *jpeg_decompress) - { - int done = 0; - int length; - char *data; - jpeg_saved_marker_ptr marker_ptr; - - if(jpeg_decompress) - marker_ptr = jpeg_decompress->marker_list; - - while((marker_ptr || !jpeg_decompress) && !done) - { - if((marker_ptr && marker_ptr->marker == JPEG_APP0 + 1) || !jpeg_decompress) - { - if(marker_ptr) - { - length = marker_ptr->data_length; - data = marker_ptr->data; - } - else - { - length = QUICKTIME_JPEG_MARKSIZE; - data = mjpeg_hdr->mjpeg_marker; - } - - quicktime_read_int32_jpeg(&data, &length); - quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->field_size = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->padded_field_size = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->next_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->quant_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->huffman_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->image_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->scan_offset = quicktime_read_int32_jpeg(&data, &length); - mjpeg_hdr->data_offset = quicktime_read_int32_jpeg(&data, &length); - /* printf("%x %x %x %x %x %x %x %x\n", mjpeg_hdr->field_size, */ - /* mjpeg_hdr->padded_field_size, */ - /* mjpeg_hdr->next_offset, */ - /* mjpeg_hdr->quant_offset, */ - /* mjpeg_hdr->huffman_offset, */ - /* mjpeg_hdr->image_offset, */ - /* mjpeg_hdr->scan_offset, */ - /* mjpeg_hdr->data_offset); */ - done = 1; - } - if(marker_ptr) marker_ptr = marker_ptr->next; - } - return 0; - } - - static inline void quicktime_skipmarker_jpeg(char **buffer_ptr, int *buffer_size, int *len) - { - if(*len > 0) - { - *buffer_ptr += *len; - *len = 0; - *buffer_size -= *len; - } - } - - int quicktime_getmarker_jpeg(char **buffer_ptr, int *buffer_size, int *len) - { - int c, done = 0; /* 1 - completion 2 - error */ - - while(!done && *buffer_size > 0) - { - c = quicktime_readbyte_jpeg(buffer_ptr, buffer_size); - /* look for FF */ - while(!done && c != 0xFF) - { - if(!*buffer_size) done = 2; - c = quicktime_readbyte_jpeg(buffer_ptr, buffer_size); - } - - /* now we've got 1 0xFF, keep reading until not 0xFF */ - do - { - if(!*buffer_size) done = 2; - c = quicktime_readbyte_jpeg(buffer_ptr, buffer_size); - }while (!done && c == 0xFF); - - /* not a 00 or FF */ - if (c != 0) done = 1; - } - - *len = 0; - if(done == 1) - return c; - else - return 0; - } - - int quicktime_fixmarker_jpeg(quicktime_mjpeg_hdr *mjpeg_hdr, char *buffer, long output_size, int write_next_offset) - { - char *buffer_ptr = buffer; - int buffer_size = output_size; - int done = 0, offset = 0, app1_offset = 0; - int marker = 0; - int len; - - mjpeg_hdr->field_size = 0; - mjpeg_hdr->padded_field_size = 0; - mjpeg_hdr->next_offset = 0; - mjpeg_hdr->quant_offset = 0; - mjpeg_hdr->huffman_offset = 0; - mjpeg_hdr->image_offset = 0; - mjpeg_hdr->scan_offset = 0; - mjpeg_hdr->data_offset = 0; - - while(!done && buffer_size > 0) - { - marker = quicktime_getmarker_jpeg(&buffer_ptr, &buffer_size, &len); - offset = buffer_ptr - buffer - 1; - len = 0; - - switch(marker) - { - case M_SOI: - len = 0; - break; - - case M_DHT: - mjpeg_hdr->huffman_offset = offset - 1; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size); - if(!mjpeg_hdr->mjpg_kludge) - len -= 2; - break; - - case M_DQT: - mjpeg_hdr->quant_offset = offset - 1; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size); - if(!mjpeg_hdr->mjpg_kludge) - len -= 2; - break; - - case M_SOF0: - mjpeg_hdr->image_offset = offset - 1; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size); - if(!mjpeg_hdr->mjpg_kludge) - len -= 2; - break; - - case M_SOS: - mjpeg_hdr->scan_offset = offset - 1; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size); - if(!mjpeg_hdr->mjpg_kludge) - len -= 2; - mjpeg_hdr->data_offset = offset + len + 3; - done = 1; - break; - - case (JPEG_APP0 + 1): - app1_offset = offset + 3; - len = quicktime_read_int16_jpeg(&buffer_ptr, &buffer_size) - 2; - break; - - case 0: - case M_EOI: - done = 1; - break; - } - - if(!done) quicktime_skipmarker_jpeg(&buffer_ptr, &buffer_size, &len); - } - - mjpeg_hdr->field_size = mjpeg_hdr->padded_field_size = mjpeg_hdr->next_offset = output_size; - buffer_ptr = buffer + app1_offset; - buffer_size = output_size - app1_offset; - if(!write_next_offset) mjpeg_hdr->next_offset = 0; - - /* printf("%d %x %x %x %x %x %x %x %x \n", row_offset, mjpeg_hdr->field_size, */ - /* mjpeg_hdr->padded_field_size, */ - /* mjpeg_hdr->next_offset, */ - /* mjpeg_hdr->quant_offset, */ - /* mjpeg_hdr->huffman_offset, */ - /* mjpeg_hdr->image_offset, */ - /* mjpeg_hdr->scan_offset, */ - /* mjpeg_hdr->data_offset); */ - - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, 0); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, QUICKTIME_JPEG_TAG); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->field_size); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->padded_field_size); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->next_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->quant_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->huffman_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->image_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->scan_offset); - quicktime_write_int32_jpeg(&buffer_ptr, &buffer_size, mjpeg_hdr->data_offset); - return 0; - } - - void quicktime_create_mjpa_objects(mjpa_decompress_engine *engine) - { - engine->jpeg_decompress.err = jpeg_std_error(&(engine->jpeg_error.pub)); - engine->jpeg_error.pub.error_exit = my_error_exit; - /* Ideally the error handler would be set here but it must be called in a thread */ - jpeg_create_decompress(&(engine->jpeg_decompress)); - } - - void quicktime_delete_mjpa_objects(mjpa_decompress_engine *engine) - { - jpeg_destroy_decompress(&(engine->jpeg_decompress)); - } - - - void quicktime_decompressor_jpeg(mjpa_decompress_engine *engine) - { - /* Run continuously */ - unsigned char **interlaced_row; - unsigned char **last_row; - - while(!engine->done) - { - pthread_mutex_lock(&(engine->input_lock)); - - /* Image decompression core */ - if(!engine->done) - { - if(setjmp(engine->jpeg_error.setjmp_buffer)) - { - /* If we get here, the JPEG code has signaled an error. */ - quicktime_delete_mjpa_objects(engine); - quicktime_create_mjpa_objects(engine); - goto finish; - } - - jpeg_buffer_src(&(engine->jpeg_decompress), engine->input_ptr, engine->input_size); - if(engine->markers_only) - jpeg_save_markers(&(engine->jpeg_decompress), JPEG_APP0 + 1, QUICKTIME_JPEG_MARKSIZE); - - jpeg_read_header(&(engine->jpeg_decompress), TRUE); - - /* printf("jpeg %d %d %d %d %d %d\n", */ - /* engine->jpeg_decompress.comp_info[0].h_samp_factor, */ - /* engine->jpeg_decompress.comp_info[0].v_samp_factor, */ - /* engine->jpeg_decompress.comp_info[1].h_samp_factor, */ - /* engine->jpeg_decompress.comp_info[1].v_samp_factor, */ - /* engine->jpeg_decompress.comp_info[2].h_samp_factor, */ - /* engine->jpeg_decompress.comp_info[2].v_samp_factor); */ - - if(engine->markers_only) - { - quicktime_read_markers_jpeg(&(engine->mjpeg_hdr), &(engine->jpeg_decompress)); - engine->field_offset = engine->mjpeg_hdr.next_offset; - pthread_mutex_unlock(&(engine->output_lock)); - pthread_mutex_lock(&(engine->input_lock)); - } - - jpeg_start_decompress(&(engine->jpeg_decompress)); - if(!engine->interlaced) - { - while(engine->jpeg_decompress.output_scanline < engine->jpeg_decompress.output_height) - { - jpeg_read_scanlines(&engine->jpeg_decompress, - (JSAMPROW*)&engine->row_pointers[engine->jpeg_decompress.output_scanline], - engine->jpeg_decompress.output_height - engine->jpeg_decompress.output_scanline); - } - } - else - { - interlaced_row = engine->row_pointers; - last_row = &(engine->row_pointers[engine->height]); - while(engine->jpeg_decompress.output_scanline < engine->jpeg_decompress.output_height && - interlaced_row < last_row) - { - jpeg_read_scanlines(&(engine->jpeg_decompress), - (JSAMPROW*)interlaced_row, - 1); - - interlaced_row += 2; - } - } - jpeg_finish_decompress(&(engine->jpeg_decompress)); - } - - finish: - pthread_mutex_unlock(&(engine->output_lock)); - } - } - - int quicktime_startdecompressor_jpeg(mjpa_decompress_engine *engine) - { - pthread_attr_t attr; - struct sched_param param; - pthread_mutexattr_t mutex_attr; - - pthread_mutexattr_init(&mutex_attr); - pthread_mutex_init(&(engine->input_lock), &mutex_attr); - pthread_mutex_lock(&(engine->input_lock)); - pthread_mutex_init(&(engine->output_lock), &mutex_attr); - pthread_mutex_lock(&(engine->output_lock)); - - pthread_attr_init(&attr); - pthread_create(&(engine->tid), &attr, (void*)quicktime_decompressor_jpeg, engine); - return 0; - } - - int quicktime_enddecompressor_jpeg(mjpa_decompress_engine *engine) - { - engine->done = 1; - pthread_mutex_unlock(&(engine->input_lock)); - pthread_join(engine->tid, 0); - pthread_mutex_destroy(&(engine->input_lock)); - pthread_mutex_destroy(&(engine->output_lock)); - return 0; - } - - int quicktime_decompressfield_jpeg(mjpa_decompress_engine *engine, - char *input_ptr, - long input_size, - unsigned char **row_pointers, - int markers_only, - int resume) - { - engine->markers_only = markers_only; - engine->row_pointers = row_pointers; - engine->input_ptr = input_ptr; - engine->input_size = input_size; - pthread_mutex_unlock(&(engine->input_lock)); - return 0; - } - - int quicktime_decompresswait_jpeg(mjpa_decompress_engine *engine) - { - pthread_mutex_lock(&(engine->output_lock)); - return 0; - } - - - static int quicktime_decode_jpeg(quicktime_t *file, unsigned char **row_pointers, int track) - { - int result = 0; - register int i; - long color_channels, bytes; - quicktime_trak_t *trak = file->vtracks[track].track; - quicktime_video_map_t *vtrack = &(file->vtracks[track]); - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - int is_mjpa = codec->jpeg_type == 1; - int is_mjpb = codec->jpeg_type == 2; - int interlaced = is_mjpa || is_mjpb; - int row_offset, field_offset; - unsigned char **interlaced_row, **last_row; - int field_dominance = trak->mdia.minf.stbl.stsd.table[0].field_dominance; - long size; - long size_remaining; - int height = (int)trak->tkhd.track_height; - int width = (int)trak->tkhd.track_width; - - /* Create decompression engines as needed */ - for(i = 0; i < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1); i++) - { - if(!codec->decompressors[i]) - { - codec->decompressors[i] = malloc(sizeof(mjpa_decompress_engine)); - codec->decompressors[i]->done = 0; - quicktime_create_mjpa_objects(codec->decompressors[i]); - codec->decompressors[i]->is_mjpa = is_mjpa; - codec->decompressors[i]->mjpeg_hdr.mjpg_kludge = 0; - codec->decompressors[i]->interlaced = interlaced; - codec->decompressors[i]->width = width; - codec->decompressors[i]->height = height; - codec->decompressors[i]->codec = codec; - quicktime_startdecompressor_jpeg(codec->decompressors[i]); - codec->total_decompressors++; - } - } - - /* Read the entire chunk from disk. */ - - quicktime_set_video_position(file, vtrack->current_position, track); - size = quicktime_frame_size(file, vtrack->current_position, track); - if(size > codec->buffer_size && codec->input_buffer) - { - free(codec->input_buffer); - codec->input_buffer = 0; - } - if(!codec->input_buffer) - { - codec->input_buffer = malloc(size); - codec->buffer_size = size; - } - result = quicktime_read_data(file, codec->input_buffer, size); - result = !result; - - /* Start the decompressors */ - if(field_dominance >= 2 && interlaced) - row_offset = 1; - else - row_offset = 0; - - field_offset = 0; - for(i = 0; i < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1) && !result; i++) - { - interlaced_row = row_pointers + row_offset; - - if(i > 0) size_remaining = size - field_offset; - else - size_remaining = size; - - quicktime_decompressfield_jpeg(codec->decompressors[i], - codec->input_buffer + field_offset, - size_remaining, - interlaced_row, - (interlaced && i == 0), - 0); - - if(interlaced && i == 0) - { - /* Get field offset from first field */ - quicktime_decompresswait_jpeg(codec->decompressors[i]); - field_offset = codec->decompressors[i]->field_offset; - quicktime_decompressfield_jpeg(codec->decompressors[i], - codec->input_buffer, - field_offset, - interlaced_row, - 0, - 1); - } - - /* Wait for decompressor completion on uniprocessor */ - if(file->cpus < 2) - { - quicktime_decompresswait_jpeg(codec->decompressors[i]); - } - - row_offset ^= 1; - } - - /* Wait for decompressor completion */ - for(i = 0; i < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1) && !result && file->cpus > 1; i++) - { - quicktime_decompresswait_jpeg(codec->decompressors[i]); - } - - return result; - } - - /* Compress a JPEG field */ - unsigned char* quicktime_compress_jpeg(mjpa_compress_engine *engine, - unsigned char **row_pointers, - long *image_size, - int write_next_offset) - { - unsigned char **interlaced_row, **last_row; - - last_row = &row_pointers[engine->height - 1]; - engine->output_size = 0; - jpeg_buffer_dest(&(engine->jpeg_compress), engine); - - /* Initialize interlaced output */ - jpeg_start_compress(&(engine->jpeg_compress), TRUE); - - /* Write a fake MJPA marker */ - if(engine->is_mjpa) - { - jpeg_write_marker(&(engine->jpeg_compress), - JPEG_APP0 + 1, - engine->mjpeg_hdr.mjpeg_marker, - QUICKTIME_JPEG_MARKSIZE); - } - - if(!engine->interlaced) - { - while(engine->jpeg_compress.next_scanline < engine->jpeg_compress.image_height) - { - jpeg_write_scanlines(&engine->jpeg_compress, - &(row_pointers[engine->jpeg_compress.next_scanline]), - engine->jpeg_compress.image_height - engine->jpeg_compress.next_scanline); - } - } - else - { - interlaced_row = row_pointers; - while(engine->jpeg_compress.next_scanline < engine->jpeg_compress.image_height) - { - if(interlaced_row > last_row) interlaced_row = last_row; - jpeg_write_scanlines(&engine->jpeg_compress, - (JSAMPROW*)interlaced_row, - 1); - - interlaced_row += 2; - } - } - jpeg_finish_compress(&engine->jpeg_compress); - - if(engine->is_mjpa) - { - /* Fix markers and write whole thing */ - quicktime_fixmarker_jpeg(&(engine->mjpeg_hdr), - engine->output_buffer, - engine->output_size, - write_next_offset); - } - *image_size = engine->output_size; - return engine->output_buffer; - } - - /* Main loop for JPEG compression */ - void quicktime_compressor_jpeg(mjpa_compress_engine *engine) - { - long fake_size; - - /* Run continuously */ - while(!engine->done) - { - pthread_mutex_lock(&(engine->input_lock)); - - if(!engine->done) - { - /* Image compression core */ - quicktime_compress_jpeg(engine, engine->row_pointers, &fake_size, engine->write_next_offset); - pthread_mutex_unlock(&(engine->output_lock)); - } - } - } - - void quicktime_startcompressor_jpeg(mjpa_compress_engine *engine) - { - pthread_attr_t attr; - struct sched_param param; - pthread_mutexattr_t mutex_attr; - - pthread_mutexattr_init(&mutex_attr); - pthread_mutex_init(&(engine->input_lock), &mutex_attr); - pthread_mutex_lock(&(engine->input_lock)); - pthread_mutex_init(&(engine->output_lock), &mutex_attr); - pthread_mutex_lock(&(engine->output_lock)); - - pthread_attr_init(&attr); - pthread_create(&(engine->tid), &attr, (void*)quicktime_compressor_jpeg, engine); - } - - void quicktime_compressfield_jpeg(mjpa_compress_engine *engine, - unsigned char **row_pointers, int write_next_offset) - { - engine->row_pointers = row_pointers; - engine->write_next_offset = write_next_offset; - pthread_mutex_unlock(&(engine->input_lock)); - } - - void quicktime_compresswait_jpeg(mjpa_compress_engine *engine) - { - pthread_mutex_lock(&(engine->output_lock)); - } - - mjpa_compress_engine* quicktime_jpeg_new_compress_engine(int width, - int height, - int quality, - int use_float, - int interlaced, - int is_mjpa, - int field_number) - { - mjpa_compress_engine *new_compressor; - - new_compressor = malloc(sizeof(mjpa_compress_engine)); - new_compressor->output_buffer = malloc(512); - new_compressor->output_allocated = 512; - new_compressor->output_size = 0; - new_compressor->row_pointers = 0; - new_compressor->write_next_offset = 0; - new_compressor->done = 0; - /* Initialize the jpeglib structures here */ - new_compressor->jpeg_compress.err = jpeg_std_error(&(new_compressor->jpeg_error)); - jpeg_create_compress(&(new_compressor->jpeg_compress)); - new_compressor->jpeg_compress.input_components = 3; - new_compressor->jpeg_compress.in_color_space = JCS_RGB; - jpeg_set_defaults(&(new_compressor->jpeg_compress)); - jpeg_set_quality(&(new_compressor->jpeg_compress), quality, 0); - if(use_float) - new_compressor->jpeg_compress.dct_method = JDCT_FLOAT; - - /* Progression made it twice as slow. */ - /* jpeg_simple_progression(&(codec->compressors[i]->jpeg_compress)); */ - - /* Changing the sampling to all values but default increased compression time. */ - /* 211111 sampling is required for playback on the LML33 */ - if(interlaced) - { - /* Fix sampling for interlaced */ - new_compressor->jpeg_compress.comp_info[0].h_samp_factor = 2; - new_compressor->jpeg_compress.comp_info[0].v_samp_factor = 1; - new_compressor->jpeg_compress.comp_info[1].h_samp_factor = 1; - new_compressor->jpeg_compress.comp_info[1].v_samp_factor = 1; - new_compressor->jpeg_compress.comp_info[2].h_samp_factor = 1; - new_compressor->jpeg_compress.comp_info[2].v_samp_factor = 1; - } - /* Huffman optimization saved %5 */ - /* codec->compressors[i]->jpeg_compress.optimize_coding = TRUE; */ - /* Omitting tables saved the same %5 */ - /* jpeg_suppress_tables(&(codec->compressors[i]->jpeg_compress), TRUE); */ - - new_compressor->jpeg_compress.image_width = width; - new_compressor->jpeg_compress.image_height = !interlaced ? height : (height >> 1); - new_compressor->is_mjpa = is_mjpa; - new_compressor->mjpeg_hdr.mjpg_kludge = 0; - new_compressor->width = width; - new_compressor->height = height; - new_compressor->interlaced = interlaced; - return new_compressor; - } - - static int quicktime_encode_jpeg(quicktime_t *file, unsigned char **row_pointers, int track) - { - long offset = quicktime_position(file); - int result = 0; - register int i; - quicktime_trak_t *trak = file->vtracks[track].track; - quicktime_video_map_t *vtrack = &(file->vtracks[track]); - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - int is_mjpa = codec->jpeg_type == 1; - int is_mjpb = codec->jpeg_type == 2; - int interlaced = is_mjpa || is_mjpb; - int row_offset; - int image_start; - unsigned char **interlaced_row, **last_row; - long bytes; - int height = (int)trak->tkhd.track_height; - int width = (int)trak->tkhd.track_width; - - /* Create compression engines as needed */ - for(i = 0; i < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1); i++) - { - if(!codec->compressors[i]) - { - codec->compressors[i] = quicktime_jpeg_new_compress_engine(width, - height, - codec->quality, - codec->use_float, - interlaced, - is_mjpa, - i); - - /* Start threads waiting */ - quicktime_startcompressor_jpeg(codec->compressors[i]); - - codec->total_compressors++; - } - } - - - /* Start the compressors on the image fields */ - for(row_offset = 0; row_offset < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1) && !result; row_offset++) - { - quicktime_compressfield_jpeg(codec->compressors[row_offset], - row_pointers + row_offset, !row_offset); - - if(file->cpus < 2 && row_offset < TOTAL_MJPA_COMPRESSORS - 1) - { - quicktime_compresswait_jpeg(codec->compressors[row_offset]); - } - } - - /* Wait for the compressors and write to disk */ - for(row_offset = 0; row_offset < (interlaced ? TOTAL_MJPA_COMPRESSORS : 1) && !result; row_offset++) - { - if(file->cpus > 1 || row_offset == TOTAL_MJPA_COMPRESSORS - 1) - { - quicktime_compresswait_jpeg(codec->compressors[row_offset]); - } - - result = quicktime_write_data(file, - codec->compressors[row_offset]->output_buffer, - codec->compressors[row_offset]->output_size); - result = !result; - } - - bytes = quicktime_position(file) - offset; - quicktime_update_tables(file, - vtrack->track, - offset, - vtrack->current_chunk, - vtrack->current_position, - 1, - bytes); - - vtrack->current_chunk++; - return result; - } - - static int reads_colormodel(quicktime_t *file, - int colormodel, - int track) - { - quicktime_video_map_t *vtrack = &(file->vtracks[track]); - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - - if(codec->jpeg_type == 0) - { - return (colormodel == BC_RGB888 || - colormodel == BC_YUV888 || - colormodel == BC_YUV420); - } - else - if(codec->jpeg_type == 1) - { - return (colormodel == BC_RGB888 || - colormodel == BC_YUV888 || - colormodel == BC_YUV422); - } - } - - static int writes_colormodel(quicktime_t *file, - int colormodel, - int track) - { - quicktime_video_map_t *vtrack = &(file->vtracks[track]); - quicktime_jpeg_codec_t *codec = ((quicktime_codec_t*)vtrack->codec)->priv; - - if(codec->jpeg_type == 0) - { - return (colormodel == BC_RGB888 || - colormodel == BC_YUV888 || - colormodel == BC_YUV420); - } - else - if(codec->jpeg_type == 1) - { - return (colormodel == BC_RGB888 || - colormodel == BC_YUV888 || - colormodel == BC_YUV422); - } - } - - - void quicktime_init_codec_jpeg(quicktime_video_map_t *vtrack, int jpeg_type) - { - char *compressor = vtrack->track->mdia.minf.stbl.stsd.table[0].format; - quicktime_jpeg_codec_t *codec; - int i; - - /* Init public items */ - ((quicktime_codec_t*)vtrack->codec)->priv = calloc(1, sizeof(quicktime_jpeg_codec_t)); - ((quicktime_codec_t*)vtrack->codec)->delete_vcodec = quicktime_delete_codec_jpeg; - ((quicktime_codec_t*)vtrack->codec)->decode_video = quicktime_decode_jpeg; - ((quicktime_codec_t*)vtrack->codec)->encode_video = quicktime_encode_jpeg; - ((quicktime_codec_t*)vtrack->codec)->decode_audio = 0; - ((quicktime_codec_t*)vtrack->codec)->encode_audio = 0; - ((quicktime_codec_t*)vtrack->codec)->reads_colormodel = reads_colormodel; - ((quicktime_codec_t*)vtrack->codec)->writes_colormodel = writes_colormodel - - /* Init private items */ - codec = ((quicktime_codec_t*)vtrack->codec)->priv; - codec->quality = 100; - codec->use_float = 0; - codec->jpeg_type = jpeg_type; - - for(i = 0; i < TOTAL_MJPA_COMPRESSORS; i++) - { - codec->compressors[i] = 0; - codec->decompressors[i] = 0; - } - codec->total_compressors = 0; - codec->total_decompressors = 0; - codec->input_buffer = 0; - - - /* This information must be stored in the initialization routine because of */ - /* direct copy rendering. Quicktime for Windows must have this information. */ - if(quicktime_match_32(compressor, QUICKTIME_MJPA) && !vtrack->track->mdia.minf.stbl.stsd.table[0].fields) - { - vtrack->track->mdia.minf.stbl.stsd.table[0].fields = 2; - vtrack->track->mdia.minf.stbl.stsd.table[0].field_dominance = 1; - } - } --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/libdv/.cvsignore bcast-2000c-mf3/quicktime/libdv/.cvsignore *** bcast-2000c/quicktime/libdv/.cvsignore Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/.cvsignore Thu Jan 1 01:00:00 1970 *************** *** 1,9 **** - *.d - .nfs* - asmoff.h - bb.out - gasmoff - gmon.out - gprof.* - playdv - testvlc --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/libdv/AUTHORS bcast-2000c-mf3/quicktime/libdv/AUTHORS *** bcast-2000c/quicktime/libdv/AUTHORS Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/AUTHORS Thu Jan 1 01:00:00 1970 *************** *** 1,9 **** - Erik Walthinsen - Charles 'Buck' Krasic - - Contributors: - James Bowman - Scott F. Johnston - Stefan Lucke - Adam Williams - --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/libdv/COPYING bcast-2000c-mf3/quicktime/libdv/COPYING *** bcast-2000c/quicktime/libdv/COPYING Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/COPYING Thu Jan 1 01:00:00 1970 *************** *** 1,340 **** - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your - freedom to share and change it. By contrast, the GNU General Public - License is intended to guarantee your freedom to share and change free - software--to make sure the software is free for all its users. This - General Public License applies to most of the Free Software - Foundation's software and to any other program whose authors commit to - using it. (Some other Free Software Foundation software is covered by - the GNU Library General Public License instead.) You can apply it to - your programs, too. - - When we speak of free software, we are referring to freedom, not - price. Our General Public Licenses are designed to make sure that you - have the freedom to distribute copies of free software (and charge for - this service if you wish), that you receive source code or can get it - if you want it, that you can change the software or use pieces of it - in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid - anyone to deny you these rights or to ask you to surrender the rights. - These restrictions translate to certain responsibilities for you if you - distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether - gratis or for a fee, you must give the recipients all the rights that - you have. You must make sure that they, too, receive or can get the - source code. And you must show them these terms so they know their - rights. - - We protect your rights with two steps: (1) copyright the software, and - (2) offer you this license which gives you legal permission to copy, - distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain - that everyone understands that there is no warranty for this free - software. If the software is modified by someone else and passed on, we - want its recipients to know that what they have is not the original, so - that any problems introduced by others will not reflect on the original - authors' reputations. - - Finally, any free program is threatened constantly by software - patents. We wish to avoid the danger that redistributors of a free - program will individually obtain patent licenses, in effect making the - program proprietary. To prevent this, we have made it clear that any - patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and - modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains - a notice placed by the copyright holder saying it may be distributed - under the terms of this General Public License. The "Program", below, - refers to any such program or work, and a "work based on the Program" - means either the Program or any derivative work under copyright law: - that is to say, a work containing the Program or a portion of it, - either verbatim or with modifications and/or translated into another - language. (Hereinafter, translation is included without limitation in - the term "modification".) Each licensee is addressed as "you". - - Activities other than copying, distribution and modification are not - covered by this License; they are outside its scope. The act of - running the Program is not restricted, and the output from the Program - is covered only if its contents constitute a work based on the - Program (independent of having been made by running the Program). - Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's - source code as you receive it, in any medium, provided that you - conspicuously and appropriately publish on each copy an appropriate - copyright notice and disclaimer of warranty; keep intact all the - notices that refer to this License and to the absence of any warranty; - and give any other recipients of the Program a copy of this License - along with the Program. - - You may charge a fee for the physical act of transferring a copy, and - you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion - of it, thus forming a work based on the Program, and copy and - distribute such modifications or work under the terms of Section 1 - above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - - These requirements apply to the modified work as a whole. If - identifiable sections of that work are not derived from the Program, - and can be reasonably considered independent and separate works in - themselves, then this License, and its terms, do not apply to those - sections when you distribute them as separate works. But when you - distribute the same sections as part of a whole which is a work based - on the Program, the distribution of the whole must be on the terms of - this License, whose permissions for other licensees extend to the - entire whole, and thus to each and every part regardless of who wrote it. - - Thus, it is not the intent of this section to claim rights or contest - your rights to work written entirely by you; rather, the intent is to - exercise the right to control the distribution of derivative or - collective works based on the Program. - - In addition, mere aggregation of another work not based on the Program - with the Program (or with a work based on the Program) on a volume of - a storage or distribution medium does not bring the other work under - the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, - under Section 2) in object code or executable form under the terms of - Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - - The source code for a work means the preferred form of the work for - making modifications to it. For an executable work, complete source - code means all the source code for all modules it contains, plus any - associated interface definition files, plus the scripts used to - control compilation and installation of the executable. However, as a - special exception, the source code distributed need not include - anything that is normally distributed (in either source or binary - form) with the major components (compiler, kernel, and so on) of the - operating system on which the executable runs, unless that component - itself accompanies the executable. - - If distribution of executable or object code is made by offering - access to copy from a designated place, then offering equivalent - access to copy the source code from the same place counts as - distribution of the source code, even though third parties are not - compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program - except as expressly provided under this License. Any attempt - otherwise to copy, modify, sublicense or distribute the Program is - void, and will automatically terminate your rights under this License. - However, parties who have received copies, or rights, from you under - this License will not have their licenses terminated so long as such - parties remain in full compliance. - - 5. You are not required to accept this License, since you have not - signed it. However, nothing else grants you permission to modify or - distribute the Program or its derivative works. These actions are - prohibited by law if you do not accept this License. Therefore, by - modifying or distributing the Program (or any work based on the - Program), you indicate your acceptance of this License to do so, and - all its terms and conditions for copying, distributing or modifying - the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the - Program), the recipient automatically receives a license from the - original licensor to copy, distribute or modify the Program subject to - these terms and conditions. You may not impose any further - restrictions on the recipients' exercise of the rights granted herein. - You are not responsible for enforcing compliance by third parties to - this License. - - 7. If, as a consequence of a court judgment or allegation of patent - infringement or for any other reason (not limited to patent issues), - conditions are imposed on you (whether by court order, agreement or - otherwise) that contradict the conditions of this License, they do not - excuse you from the conditions of this License. If you cannot - distribute so as to satisfy simultaneously your obligations under this - License and any other pertinent obligations, then as a consequence you - may not distribute the Program at all. For example, if a patent - license would not permit royalty-free redistribution of the Program by - all those who receive copies directly or indirectly through you, then - the only way you could satisfy both it and this License would be to - refrain entirely from distribution of the Program. - - If any portion of this section is held invalid or unenforceable under - any particular circumstance, the balance of the section is intended to - apply and the section as a whole is intended to apply in other - circumstances. - - It is not the purpose of this section to induce you to infringe any - patents or other property right claims or to contest validity of any - such claims; this section has the sole purpose of protecting the - integrity of the free software distribution system, which is - implemented by public license practices. Many people have made - generous contributions to the wide range of software distributed - through that system in reliance on consistent application of that - system; it is up to the author/donor to decide if he or she is willing - to distribute software through any other system and a licensee cannot - impose that choice. - - This section is intended to make thoroughly clear what is believed to - be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in - certain countries either by patents or by copyrighted interfaces, the - original copyright holder who places the Program under this License - may add an explicit geographical distribution limitation excluding - those countries, so that distribution is permitted only in or among - countries not thus excluded. In such case, this License incorporates - the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions - of the General Public License from time to time. Such new versions will - be similar in spirit to the present version, but may differ in detail to - address new problems or concerns. - - Each version is given a distinguishing version number. If the Program - specifies a version number of this License which applies to it and "any - later version", you have the option of following the terms and conditions - either of that version or of any later version published by the Free - Software Foundation. If the Program does not specify a version number of - this License, you may choose any version ever published by the Free Software - Foundation. - - 10. If you wish to incorporate parts of the Program into other free - programs whose distribution conditions are different, write to the author - to ask for permission. For software which is copyrighted by the Free - Software Foundation, write to the Free Software Foundation; we sometimes - make exceptions for this. Our decision will be guided by the two goals - of preserving the free status of all derivatives of our free software and - of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY - FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN - OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES - PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED - OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS - TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE - PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, - REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING - WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR - REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, - INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING - OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED - TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY - YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER - PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest - possible use to the public, the best way to achieve this is to make it - free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest - to attach them to the start of each source file to most effectively - convey the exclusion of warranty; and each file should have at least - the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Also add information on how to contact you by electronic and paper mail. - - If the program is interactive, make it output a short notice like this - when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - - The hypothetical commands `show w' and `show c' should show the appropriate - parts of the General Public License. Of course, the commands you use may - be called something other than `show w' and `show c'; they could even be - mouse-clicks or menu items--whatever suits your program. - - You should also get your employer (if you work as a programmer) or your - school, if any, to sign a "copyright disclaimer" for the program, if - necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - - This General Public License does not permit incorporating your program into - proprietary programs. If your program is a subroutine library, you may - consider it more useful to permit linking proprietary applications with the - library. If this is what you want to do, use the GNU Library General - Public License instead of this License. --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/libdv/CVS/Entries bcast-2000c-mf3/quicktime/libdv/CVS/Entries *** bcast-2000c/quicktime/libdv/CVS/Entries Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/CVS/Entries Thu Dec 6 18:10:50 2001 *************** *** 1,42 **** ! /.cvsignore/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /AUTHORS/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /COPYING/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /ChangeLog/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /Makefile/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /README/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /TODO/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /bitstream.c/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /bitstream.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /c_flags/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /dct.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /dct.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /dovlc.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /dv.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /dvprivate.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /gasmoff.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /idct_248.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /idct_248.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /idct_block_mmx.S/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /libdv.c/1.1.1.1/Thu Nov 2 04:28:54 2000// ! /libdv.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /mmx.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /parse.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /parse.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /place.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /place.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /playdv.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /playdv2.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /quant.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /quant.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /quant_x86.S/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /testbitstream.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /testdct.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /testvlc.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /vlc.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /vlc.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /vlc_x86.S/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /weighting.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /weighting.h/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /ycrcb_to_rgb32.c/1.1.1.1/Thu Nov 2 04:28:55 2000// ! /ycrcb_to_rgb32.h/1.1.1.1/Thu Nov 2 04:28:55 2000// D --- 1,56 ---- ! /Makefile/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /Makefile.am/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /Makefile.in/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /YUY2.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /YUY2.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /YV12.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /YV12.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /asmoff.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /audio.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /audio.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /bitstream.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /bitstream.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dct.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dct.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dct_block_mmx.S/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dovlc.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dv.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dv.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /dv_types.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /enc_audio_input.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /enc_audio_input.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /enc_input.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /enc_output.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /enc_output.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /encode.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /encode_x86.S/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /gasmoff.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /headers.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /idct_248.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /idct_248.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /idct_block_mmx.S/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /mmx.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /parse.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /parse.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /place.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /place.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /quant.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /quant.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /quant_x86.S/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rgb.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rgb.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /rgbtoyuv.S/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /testbitstream.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /testvlc.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /transpose_x86.S/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /util.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /util.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /vlc.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /vlc.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /vlc_x86.S/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /weighting.c/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /weighting.h/1.1.1.1/Mon Oct 1 03:16:38 2001// ! /enc_input.c/1.2/Thu Dec 6 15:53:52 2001// ! /encode.c/1.2/Thu Dec 6 17:06:27 2001// ! /headers.c/1.2/Thu Dec 6 16:12:50 2001// D diff -C2 -r -N bcast-2000c/quicktime/libdv/CVS/Root bcast-2000c-mf3/quicktime/libdv/CVS/Root *** bcast-2000c/quicktime/libdv/CVS/Root Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/CVS/Root Tue Nov 6 14:47:04 2001 *************** *** 1 **** ! heroines@cvs.heroines.sourceforge.net:/cvsroot/heroines --- 1 ---- ! :pserver:myrina@amazon:/usr/cvs diff -C2 -r -N bcast-2000c/quicktime/libdv/ChangeLog bcast-2000c-mf3/quicktime/libdv/ChangeLog *** bcast-2000c/quicktime/libdv/ChangeLog Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/ChangeLog Thu Jan 1 01:00:00 1970 *************** *** 1,34 **** - 2000-05-08 Charlie Krasic - - * Moved to macroblock at a time color conversion, based on the work - of Scott F. Johnston . I rewrote his - shuffle code. Partly so I could understand it better (I added - lots of comments), and also I did the PAL version too. I decided - to leave mapping between dif blocks/segments and superblock - row/columns to the parse code. I took his block at a time ycrcb - conversion directly, except for making clamp_y lookup based. - - 2000-05-05 Charles 'Buck' Krasic - - * New idct code for 2-4-8. It's an integer version, based on an - approach like that of the AAN algorithm. Next step will be to MMX - it. - - 2000-04-20 Charles 'Buck' Krasic - - * place.c: Fixes to 4:2:0 placement. Color resembles something - like correct now. :} - - * Add initial macroblock placement for 4:2:0 (IEC61834). Initial - test shows luma is OK, but color isn't working correctly. - - 2000-04-19 Erik Walthinnsen (Omega) - - * Added rudimentary PAL decoding, as well as a way to - differentiate between IEC61834 and SMPTE314M video, which is - critical for dealing with PAL data. - - 2000-04-18 Charles 'Buck' Krasic - - * Version 0.1 - first release at libdv.sourceforge.net - --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/libdv/Makefile bcast-2000c-mf3/quicktime/libdv/Makefile *** bcast-2000c/quicktime/libdv/Makefile Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/Makefile Mon Oct 1 05:16:38 2001 *************** *** 1,30 **** ! include ../global_config ! LFLAGS += $(shell glib-config --libs) $(shell gtk-config --libs) ! LIBS = -lm -lraw1394 -lpthread ! OBJS = \ ! bitstream.o \ ! dct.o \ ! idct_248.o \ ! libdv.o \ ! place.o \ ! parse.o \ ! quant.o \ ! vlc.o \ ! weighting.o \ ! ycrcb_to_rgb32.o - all: $(OBJS) $(DVMMX_OBJS2) ! playdv: playdv.o $(OBJS) ! gcc -o playdv playdv.o $(OBJS) $(DVMMX_OBJS2) $(LFLAGS) $(LIBS) .c.o: ! $(CC) -c `./c_flags` $*.c .S.o: ! $(CC) -c `./c_flags` $*.S ! clean: ! rm -f *.o *.a playdv core --- 1,474 ---- ! # Generated automatically from Makefile.in by configure. ! # Makefile.in generated automatically by automake 1.4 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. ! # This Makefile.in is free software; the Free Software Foundation ! # gives unlimited permission to copy and/or distribute it, ! # with or without modifications, as long as this notice is preserved. ! # This program is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY, to the extent permitted by law; without ! # even the implied warranty of MERCHANTABILITY or FITNESS FOR A ! # PARTICULAR PURPOSE. ! SHELL = /bin/sh ! ! srcdir = . ! top_srcdir = .. ! prefix = /usr/local ! exec_prefix = ${prefix} ! ! bindir = ${exec_prefix}/bin ! sbindir = ${exec_prefix}/sbin ! libexecdir = ${exec_prefix}/libexec ! datadir = ${prefix}/share ! sysconfdir = ${prefix}/etc ! sharedstatedir = ${prefix}/com ! localstatedir = ${prefix}/var ! libdir = ${exec_prefix}/lib ! infodir = ${prefix}/info ! mandir = ${prefix}/man ! includedir = ${prefix}/include ! oldincludedir = /usr/include ! ! DESTDIR = ! ! pkgdatadir = $(datadir)/libdv ! pkglibdir = $(libdir)/libdv ! pkgincludedir = $(includedir)/libdv ! ! top_builddir = .. ! ! ACLOCAL = aclocal ! AUTOCONF = autoconf ! AUTOMAKE = automake ! AUTOHEADER = autoheader ! ! INSTALL = /usr/bin/install -c ! INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) ! INSTALL_DATA = ${INSTALL} -m 644 ! INSTALL_SCRIPT = ${INSTALL_PROGRAM} ! transform = s,x,x, ! ! NORMAL_INSTALL = : ! PRE_INSTALL = : ! POST_INSTALL = : ! NORMAL_UNINSTALL = : ! PRE_UNINSTALL = : ! POST_UNINSTALL = : ! host_alias = i686-pc-linux ! host_triplet = i686-pc-linux-gnu ! AS = @AS@ ! CC = gcc ! CFLAGS = -O3 -march=i686 -fmessage-length=0 -funroll-all-loops -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -I/usr/local/include -I . -I .. -Wall -O2 -g -I/usr/lib/glib/include -I/usr/lib/glib/include -I/usr/X11R6/include ! DLLTOOL = @DLLTOOL@ ! GLIB_CFLAGS = -I/usr/lib/glib/include ! GLIB_CONFIG = /usr/bin/glib-config ! GLIB_LIBS = -L/usr/lib -lglib ! GTK_CFLAGS = -I/usr/lib/glib/include -I/usr/X11R6/include ! GTK_CONFIG = /usr/bin/gtk-config ! GTK_LIBS = -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm ! LIBTOOL = $(SHELL) $(top_builddir)/libtool ! LN_S = ln -s ! MAINT = # ! MAKEINFO = makeinfo ! OBJDUMP = @OBJDUMP@ ! PACKAGE = libdv ! RANLIB = ranlib ! RPM_RELEASE = 1 ! SDL_CFLAGS = ! SDL_CONFIG = ! SDL_LIBS = ! VERSION = 0.8 ! ac_aux_dir = config ! ! MAINTAINERCLEANFILES = Makefile.in $(AUX_DIST) ! ! CLEANFILES = asmoff.h ! ! lib_LTLIBRARIES = libdv.la ! GASMOFF = gasmoff ! #GASMOFF = ! ! noinst_PROGRAMS = dovlc testvlc testbitstream $(GASMOFF) ! ! # ! # If HOST_X86 is set, we build all the x86 asm stuff.. ! # ! ! BUILT_SOURCES = asmoff.h ! ! libdv_la_ASMS = vlc_x86.S quant_x86.S idct_block_mmx.S dct_block_mmx.S rgbtoyuv.S encode_x86.S transpose_x86.S ! libdv_la_ASM_HS = asmoff.h mmx.h ! gasmoff_SOURCES = gasmoff.c bitstream.c bitstream.h ! #gasmoff_SOURCES = ! ! #ASMS = ! ! pkginclude_HEADERS = dv_types.h dv.h ! ! noinst_HEADERS = YUY2.h bitstream.h parse.h rgb.h YV12.h dct.h idct_248.h place.h vlc.h quant.h weighting.h audio.h rgb.h audio.h encode.h enc_input.h enc_audio_input.h enc_output.h headers.h util.h $(libdv_la_ASM_HS) ! ! ! libdv_la_SOURCES = dv.c dct.c idct_248.c weighting.c quant.c vlc.c place.c parse.c bitstream.c YUY2.c YV12.c rgb.c audio.c util.c encode.c headers.c enc_input.c enc_audio_input.c enc_output.c $(libdv_la_ASMS) ! ! ! libdv_la_LDFLAGS = -version-info 1:0:0 ! ! dovlc_SOURCES = dovlc.c ! dovlc_LDADD = libdv.la ! ! testvlc_SOURCES = testvlc.c ! testvlc_LDADD = libdv.la ! ! testbitstream_SOURCES = testbitstream.c bitstream.c bitstream.h ! mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs ! CONFIG_HEADER = ../config.h ! CONFIG_CLEAN_FILES = ! LTLIBRARIES = $(lib_LTLIBRARIES) ! ! ! DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I.. ! CPPFLAGS = ! LDFLAGS = ! LIBS = -lpopt -lm -lXv -L/usr/lib -lglib -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm ! libdv_la_LIBADD = ! #libdv_la_OBJECTS = dv.lo dct.lo idct_248.lo \ ! #weighting.lo quant.lo vlc.lo place.lo parse.lo \ ! #bitstream.lo YUY2.lo YV12.lo rgb.lo audio.lo util.lo \ ! #encode.lo headers.lo enc_input.lo enc_audio_input.lo \ ! #enc_output.lo ! libdv_la_OBJECTS = dv.lo dct.lo idct_248.lo weighting.lo \ ! quant.lo vlc.lo place.lo parse.lo bitstream.lo YUY2.lo \ ! YV12.lo rgb.lo audio.lo util.lo encode.lo headers.lo \ ! enc_input.lo enc_audio_input.lo enc_output.lo vlc_x86.lo \ ! quant_x86.lo idct_block_mmx.lo dct_block_mmx.lo \ ! rgbtoyuv.lo encode_x86.lo transpose_x86.lo ! PROGRAMS = $(noinst_PROGRAMS) ! ! dovlc_OBJECTS = dovlc.o ! dovlc_DEPENDENCIES = libdv.la ! dovlc_LDFLAGS = ! testvlc_OBJECTS = testvlc.o ! testvlc_DEPENDENCIES = libdv.la ! testvlc_LDFLAGS = ! testbitstream_OBJECTS = testbitstream.o bitstream.o ! testbitstream_LDADD = $(LDADD) ! testbitstream_DEPENDENCIES = ! testbitstream_LDFLAGS = ! #gasmoff_OBJECTS = ! gasmoff_OBJECTS = gasmoff.o bitstream.o ! gasmoff_LDADD = $(LDADD) ! gasmoff_DEPENDENCIES = ! gasmoff_LDFLAGS = ! COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) ! LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) ! CCLD = $(CC) ! LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ ! HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS) ! ! DIST_COMMON = Makefile.am Makefile.in ! ! ! DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) ! ! TAR = gtar ! GZIP_ENV = --best ! SOURCES = $(libdv_la_SOURCES) $(dovlc_SOURCES) $(testvlc_SOURCES) $(testbitstream_SOURCES) $(gasmoff_SOURCES) ! OBJECTS = $(libdv_la_OBJECTS) $(dovlc_OBJECTS) $(testvlc_OBJECTS) $(testbitstream_OBJECTS) $(gasmoff_OBJECTS) ! ! all: all-redirect ! .SUFFIXES: ! .SUFFIXES: .S .c .lo .o .s ! $(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) ! cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps libdv/Makefile ! ! Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ! cd $(top_builddir) \ ! && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status ! ! ! mostlyclean-libLTLIBRARIES: ! ! clean-libLTLIBRARIES: ! -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) ! ! distclean-libLTLIBRARIES: ! ! maintainer-clean-libLTLIBRARIES: ! ! install-libLTLIBRARIES: $(lib_LTLIBRARIES) ! @$(NORMAL_INSTALL) ! $(mkinstalldirs) $(DESTDIR)$(libdir) ! @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ ! if test -f $$p; then \ ! echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ ! $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ ! else :; fi; \ ! done ! ! uninstall-libLTLIBRARIES: ! @$(NORMAL_UNINSTALL) ! list='$(lib_LTLIBRARIES)'; for p in $$list; do \ ! $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ ! done .c.o: ! $(COMPILE) -c $< ! ! .s.o: ! $(COMPILE) -c $< .S.o: ! $(COMPILE) -c $< ! ! mostlyclean-compile: ! -rm -f *.o core *.core ! ! clean-compile: ! ! distclean-compile: ! -rm -f *.tab.c ! ! maintainer-clean-compile: ! ! .c.lo: ! $(LIBTOOL) --mode=compile $(COMPILE) -c $< ! ! .s.lo: ! $(LIBTOOL) --mode=compile $(COMPILE) -c $< ! ! .S.lo: ! $(LIBTOOL) --mode=compile $(COMPILE) -c $< ! ! mostlyclean-libtool: ! -rm -f *.lo ! ! clean-libtool: ! -rm -rf .libs _libs ! ! distclean-libtool: ! ! maintainer-clean-libtool: ! ! libdv.la: $(libdv_la_OBJECTS) $(libdv_la_DEPENDENCIES) ! $(LINK) -rpath $(libdir) $(libdv_la_LDFLAGS) $(libdv_la_OBJECTS) $(libdv_la_LIBADD) $(LIBS) ! ! mostlyclean-noinstPROGRAMS: ! ! clean-noinstPROGRAMS: ! -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) ! ! distclean-noinstPROGRAMS: ! ! maintainer-clean-noinstPROGRAMS: ! ! dovlc: $(dovlc_OBJECTS) $(dovlc_DEPENDENCIES) ! @rm -f dovlc ! $(LINK) $(dovlc_LDFLAGS) $(dovlc_OBJECTS) $(dovlc_LDADD) $(LIBS) ! ! testvlc: $(testvlc_OBJECTS) $(testvlc_DEPENDENCIES) ! @rm -f testvlc ! $(LINK) $(testvlc_LDFLAGS) $(testvlc_OBJECTS) $(testvlc_LDADD) $(LIBS) ! ! testbitstream: $(testbitstream_OBJECTS) $(testbitstream_DEPENDENCIES) ! @rm -f testbitstream ! $(LINK) $(testbitstream_LDFLAGS) $(testbitstream_OBJECTS) $(testbitstream_LDADD) $(LIBS) ! ! gasmoff: $(gasmoff_OBJECTS) $(gasmoff_DEPENDENCIES) ! @rm -f gasmoff ! $(LINK) $(gasmoff_LDFLAGS) $(gasmoff_OBJECTS) $(gasmoff_LDADD) $(LIBS) ! ! install-pkgincludeHEADERS: $(pkginclude_HEADERS) ! @$(NORMAL_INSTALL) ! $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) ! @list='$(pkginclude_HEADERS)'; for p in $$list; do \ ! if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ ! echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p"; \ ! $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p; \ ! done ! ! uninstall-pkgincludeHEADERS: ! @$(NORMAL_UNINSTALL) ! list='$(pkginclude_HEADERS)'; for p in $$list; do \ ! rm -f $(DESTDIR)$(pkgincludedir)/$$p; \ ! done ! ! tags: TAGS ! ! ID: $(HEADERS) $(SOURCES) $(LISP) ! list='$(SOURCES) $(HEADERS)'; \ ! unique=`for i in $$list; do echo $$i; done | \ ! awk ' { files[$$0] = 1; } \ ! END { for (i in files) print i; }'`; \ ! here=`pwd` && cd $(srcdir) \ ! && mkid -f$$here/ID $$unique $(LISP) ! ! TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) ! tags=; \ ! here=`pwd`; \ ! list='$(SOURCES) $(HEADERS)'; \ ! unique=`for i in $$list; do echo $$i; done | \ ! awk ' { files[$$0] = 1; } \ ! END { for (i in files) print i; }'`; \ ! test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ ! || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) ! ! mostlyclean-tags: ! ! clean-tags: ! ! distclean-tags: ! -rm -f TAGS ID ! ! maintainer-clean-tags: ! ! distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) ! ! subdir = libdv ! ! distdir: $(DISTFILES) ! @for file in $(DISTFILES); do \ ! d=$(srcdir); \ ! if test -d $$d/$$file; then \ ! cp -pr $$d/$$file $(distdir)/$$file; \ ! else \ ! test -f $(distdir)/$$file \ ! || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ ! || cp -p $$d/$$file $(distdir)/$$file || :; \ ! fi; \ ! done ! YUY2.lo YUY2.o : YUY2.c dv_types.h ../config.h YUY2.h dv_types.h mmx.h ! YV12.lo YV12.o : YV12.c dv_types.h ../config.h YV12.h dv_types.h mmx.h ! audio.lo audio.o : audio.c dv_types.h ../config.h util.h dv_types.h \ ! audio.h ! bitstream.lo bitstream.o : bitstream.c ../config.h bitstream.h \ ! dv_types.h ! dct.lo dct.o : dct.c dv_types.h ../config.h dct.h dv_types.h weighting.h \ ! mmx.h ! dovlc.o: dovlc.c dv_types.h ../config.h vlc.h dv_types.h bitstream.h \ ! bitstream.h ! dv.lo dv.o : dv.c dv_types.h ../config.h dv.h dv_types.h encode.h dct.h \ ! enc_input.h enc_output.h enc_audio_input.h util.h dct.h audio.h \ ! idct_248.h quant.h weighting.h vlc.h bitstream.h parse.h \ ! place.h rgb.h YUY2.h YV12.h mmx.h ! enc_audio_input.lo enc_audio_input.o : enc_audio_input.c \ ! enc_audio_input.h dv_types.h ../config.h ! enc_input.lo enc_input.o : enc_input.c enc_input.h dv_types.h \ ! ../config.h encode.h dct.h dv_types.h enc_input.h enc_output.h \ ! enc_audio_input.h dct.h mmx.h ! enc_output.lo enc_output.o : enc_output.c enc_audio_input.h dv_types.h \ ! ../config.h enc_output.h headers.h ! encode.lo encode.o : encode.c encode.h dct.h dv_types.h ../config.h \ ! enc_input.h enc_output.h enc_audio_input.h idct_248.h quant.h \ ! weighting.h vlc.h bitstream.h dv_types.h parse.h place.h mmx.h \ ! enc_input.h enc_output.h ! gasmoff.o: gasmoff.c dv_types.h ../config.h ! headers.lo headers.o : headers.c headers.h ! idct_248.lo idct_248.o : idct_248.c dv_types.h ../config.h ! parse.lo parse.o : parse.c dv_types.h ../config.h util.h dv_types.h dv.h \ ! bitstream.h vlc.h bitstream.h parse.h audio.h ! place.lo place.o : place.c dv_types.h ../config.h place.h dv_types.h ! quant.lo quant.o : quant.c dv_types.h ../config.h mmx.h quant.h \ ! dv_types.h idct_248.h ! rgb.lo rgb.o : rgb.c dv_types.h ../config.h ! testbitstream.o: testbitstream.c dv_types.h ../config.h bitstream.h ! testvlc.o: testvlc.c dv_types.h ../config.h vlc.h dv_types.h bitstream.h ! util.lo util.o : util.c util.h dv_types.h ../config.h ! vlc.lo vlc.o : vlc.c dv_types.h ../config.h vlc.h dv_types.h bitstream.h ! weighting.lo weighting.o : weighting.c dv_types.h ../config.h \ ! weighting.h dv_types.h ! ! info-am: ! info: info-am ! dvi-am: ! dvi: dvi-am ! check-am: all-am ! check: check-am ! installcheck-am: ! installcheck: installcheck-am ! install-exec-am: install-libLTLIBRARIES ! install-exec: install-exec-am ! ! install-data-am: install-pkgincludeHEADERS ! install-data: install-data-am ! ! install-am: all-am ! @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am ! install: install-am ! uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS ! uninstall: uninstall-am ! all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) ! all-redirect: all-am ! install-strip: ! $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install ! installdirs: ! $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(pkgincludedir) ! ! ! mostlyclean-generic: ! ! clean-generic: ! -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) ! ! distclean-generic: ! -rm -f Makefile $(CONFIG_CLEAN_FILES) ! -rm -f config.cache config.log stamp-h stamp-h[0-9]* ! ! maintainer-clean-generic: ! -test -z "$(BUILT_SOURCES)$(MAINTAINERCLEANFILES)" || rm -f $(BUILT_SOURCES) $(MAINTAINERCLEANFILES) ! mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ ! mostlyclean-libtool mostlyclean-noinstPROGRAMS \ ! mostlyclean-tags mostlyclean-generic ! ! mostlyclean: mostlyclean-am ! ! clean-am: clean-libLTLIBRARIES clean-compile clean-libtool \ ! clean-noinstPROGRAMS clean-tags clean-generic \ ! mostlyclean-am ! ! clean: clean-am ! ! distclean-am: distclean-libLTLIBRARIES distclean-compile \ ! distclean-libtool distclean-noinstPROGRAMS \ ! distclean-tags distclean-generic clean-am ! -rm -f libtool ! ! distclean: distclean-am ! ! maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ ! maintainer-clean-compile maintainer-clean-libtool \ ! maintainer-clean-noinstPROGRAMS maintainer-clean-tags \ ! maintainer-clean-generic distclean-am ! @echo "This command is intended for maintainers to use;" ! @echo "it deletes files that may require special tools to rebuild." ! ! maintainer-clean: maintainer-clean-am ! ! .PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ ! clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ ! uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ ! distclean-compile clean-compile maintainer-clean-compile \ ! mostlyclean-libtool distclean-libtool clean-libtool \ ! maintainer-clean-libtool mostlyclean-noinstPROGRAMS \ ! distclean-noinstPROGRAMS clean-noinstPROGRAMS \ ! maintainer-clean-noinstPROGRAMS uninstall-pkgincludeHEADERS \ ! install-pkgincludeHEADERS tags mostlyclean-tags distclean-tags \ ! clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ ! check-am installcheck-am installcheck install-exec-am install-exec \ ! install-data-am install-data install-am install uninstall-am uninstall \ ! all-redirect all-am all installdirs mostlyclean-generic \ ! distclean-generic clean-generic maintainer-clean-generic clean \ ! mostlyclean distclean maintainer-clean ! ! ! # Automake doesn't do dependency tracking for asm ! quant_x86.lo vlc_x86.lo: asmoff.h ! ! asmoff.h: gasmoff ! ./gasmoff > asmoff.h ! # Tell versions [3.59,3.63) of GNU make to not export all variables. ! # Otherwise a system limit (for SysV at least) may be exceeded. ! .NOEXPORT: diff -C2 -r -N bcast-2000c/quicktime/libdv/Makefile.am bcast-2000c-mf3/quicktime/libdv/Makefile.am *** bcast-2000c/quicktime/libdv/Makefile.am Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/Makefile.am Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,67 ---- + + MAINTAINERCLEANFILES = Makefile.in $(AUX_DIST) + + CLEANFILES = asmoff.h + + lib_LTLIBRARIES= libdv.la + + if HOST_X86 + GASMOFF=gasmoff + else # HOST_X86 + GASMOFF= + endif # HOST_X86 + + noinst_PROGRAMS= dovlc testvlc testbitstream $(GASMOFF) + + # + # If HOST_X86 is set, we build all the x86 asm stuff.. + # + if HOST_X86 + + BUILT_SOURCES = asmoff.h + + libdv_la_ASMS= vlc_x86.S quant_x86.S idct_block_mmx.S dct_block_mmx.S rgbtoyuv.S encode_x86.S transpose_x86.S + libdv_la_ASM_HS=asmoff.h mmx.h + + + gasmoff_SOURCES= gasmoff.c bitstream.c bitstream.h + + else # HOST_X86 + + ASMS= + gasmoff_SOURCES= + + endif # HOST_X86 + + pkginclude_HEADERS= dv_types.h dv.h + + noinst_HEADERS= YUY2.h bitstream.h parse.h rgb.h \ + YV12.h dct.h idct_248.h place.h vlc.h \ + quant.h weighting.h audio.h rgb.h audio.h \ + encode.h enc_input.h enc_audio_input.h enc_output.h \ + headers.h util.h $(libdv_la_ASM_HS) + + libdv_la_SOURCES= dv.c dct.c idct_248.c weighting.c quant.c vlc.c place.c \ + parse.c bitstream.c YUY2.c YV12.c rgb.c audio.c util.c \ + encode.c headers.c enc_input.c enc_audio_input.c enc_output.c \ + $(libdv_la_ASMS) + + libdv_la_LDFLAGS = -version-info 1:0:0 + + dovlc_SOURCES= dovlc.c + dovlc_LDADD= libdv.la + + testvlc_SOURCES= testvlc.c + testvlc_LDADD=libdv.la + + testbitstream_SOURCES= testbitstream.c bitstream.c bitstream.h + + if HOST_X86 + + # Automake doesn't do dependency tracking for asm + quant_x86.lo vlc_x86.lo: asmoff.h + + asmoff.h: gasmoff + ./gasmoff > asmoff.h + + endif diff -C2 -r -N bcast-2000c/quicktime/libdv/Makefile.in bcast-2000c-mf3/quicktime/libdv/Makefile.in *** bcast-2000c/quicktime/libdv/Makefile.in Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/Makefile.in Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,474 ---- + # Makefile.in generated automatically by automake 1.4 from Makefile.am + + # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + + + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + libexecdir = @libexecdir@ + datadir = @datadir@ + sysconfdir = @sysconfdir@ + sharedstatedir = @sharedstatedir@ + localstatedir = @localstatedir@ + libdir = @libdir@ + infodir = @infodir@ + mandir = @mandir@ + includedir = @includedir@ + oldincludedir = /usr/include + + DESTDIR = + + pkgdatadir = $(datadir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + + top_builddir = .. + + ACLOCAL = @ACLOCAL@ + AUTOCONF = @AUTOCONF@ + AUTOMAKE = @AUTOMAKE@ + AUTOHEADER = @AUTOHEADER@ + + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + transform = @program_transform_name@ + + NORMAL_INSTALL = : + PRE_INSTALL = : + POST_INSTALL = : + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : + host_alias = @host_alias@ + host_triplet = @host@ + AS = @AS@ + CC = @CC@ + CFLAGS = @CFLAGS@ + DLLTOOL = @DLLTOOL@ + GLIB_CFLAGS = @GLIB_CFLAGS@ + GLIB_CONFIG = @GLIB_CONFIG@ + GLIB_LIBS = @GLIB_LIBS@ + GTK_CFLAGS = @GTK_CFLAGS@ + GTK_CONFIG = @GTK_CONFIG@ + GTK_LIBS = @GTK_LIBS@ + LIBTOOL = @LIBTOOL@ + LN_S = @LN_S@ + MAINT = @MAINT@ + MAKEINFO = @MAKEINFO@ + OBJDUMP = @OBJDUMP@ + PACKAGE = @PACKAGE@ + RANLIB = @RANLIB@ + RPM_RELEASE = @RPM_RELEASE@ + SDL_CFLAGS = @SDL_CFLAGS@ + SDL_CONFIG = @SDL_CONFIG@ + SDL_LIBS = @SDL_LIBS@ + VERSION = @VERSION@ + ac_aux_dir = @ac_aux_dir@ + + MAINTAINERCLEANFILES = Makefile.in $(AUX_DIST) + + CLEANFILES = asmoff.h + + lib_LTLIBRARIES = libdv.la + @HOST_X86_TRUE@GASMOFF = gasmoff + @HOST_X86_FALSE@GASMOFF = + + noinst_PROGRAMS = dovlc testvlc testbitstream $(GASMOFF) + + # + # If HOST_X86 is set, we build all the x86 asm stuff.. + # + + @HOST_X86_TRUE@BUILT_SOURCES = asmoff.h + + @HOST_X86_TRUE@libdv_la_ASMS = vlc_x86.S quant_x86.S idct_block_mmx.S dct_block_mmx.S rgbtoyuv.S encode_x86.S transpose_x86.S + @HOST_X86_TRUE@libdv_la_ASM_HS = asmoff.h mmx.h + @HOST_X86_TRUE@gasmoff_SOURCES = gasmoff.c bitstream.c bitstream.h + @HOST_X86_FALSE@gasmoff_SOURCES = + + @HOST_X86_FALSE@ASMS = + + pkginclude_HEADERS = dv_types.h dv.h + + noinst_HEADERS = YUY2.h bitstream.h parse.h rgb.h YV12.h dct.h idct_248.h place.h vlc.h quant.h weighting.h audio.h rgb.h audio.h encode.h enc_input.h enc_audio_input.h enc_output.h headers.h util.h $(libdv_la_ASM_HS) + + + libdv_la_SOURCES = dv.c dct.c idct_248.c weighting.c quant.c vlc.c place.c parse.c bitstream.c YUY2.c YV12.c rgb.c audio.c util.c encode.c headers.c enc_input.c enc_audio_input.c enc_output.c $(libdv_la_ASMS) + + + libdv_la_LDFLAGS = -version-info 1:0:0 + + dovlc_SOURCES = dovlc.c + dovlc_LDADD = libdv.la + + testvlc_SOURCES = testvlc.c + testvlc_LDADD = libdv.la + + testbitstream_SOURCES = testbitstream.c bitstream.c bitstream.h + mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs + CONFIG_HEADER = ../config.h + CONFIG_CLEAN_FILES = + LTLIBRARIES = $(lib_LTLIBRARIES) + + + DEFS = @DEFS@ -I. -I$(srcdir) -I.. + CPPFLAGS = @CPPFLAGS@ + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ + libdv_la_LIBADD = + @HOST_X86_FALSE@libdv_la_OBJECTS = dv.lo dct.lo idct_248.lo \ + @HOST_X86_FALSE@weighting.lo quant.lo vlc.lo place.lo parse.lo \ + @HOST_X86_FALSE@bitstream.lo YUY2.lo YV12.lo rgb.lo audio.lo util.lo \ + @HOST_X86_FALSE@encode.lo headers.lo enc_input.lo enc_audio_input.lo \ + @HOST_X86_FALSE@enc_output.lo + @HOST_X86_TRUE@libdv_la_OBJECTS = dv.lo dct.lo idct_248.lo weighting.lo \ + @HOST_X86_TRUE@quant.lo vlc.lo place.lo parse.lo bitstream.lo YUY2.lo \ + @HOST_X86_TRUE@YV12.lo rgb.lo audio.lo util.lo encode.lo headers.lo \ + @HOST_X86_TRUE@enc_input.lo enc_audio_input.lo enc_output.lo vlc_x86.lo \ + @HOST_X86_TRUE@quant_x86.lo idct_block_mmx.lo dct_block_mmx.lo \ + @HOST_X86_TRUE@rgbtoyuv.lo encode_x86.lo transpose_x86.lo + PROGRAMS = $(noinst_PROGRAMS) + + dovlc_OBJECTS = dovlc.o + dovlc_DEPENDENCIES = libdv.la + dovlc_LDFLAGS = + testvlc_OBJECTS = testvlc.o + testvlc_DEPENDENCIES = libdv.la + testvlc_LDFLAGS = + testbitstream_OBJECTS = testbitstream.o bitstream.o + testbitstream_LDADD = $(LDADD) + testbitstream_DEPENDENCIES = + testbitstream_LDFLAGS = + @HOST_X86_FALSE@gasmoff_OBJECTS = + @HOST_X86_TRUE@gasmoff_OBJECTS = gasmoff.o bitstream.o + gasmoff_LDADD = $(LDADD) + gasmoff_DEPENDENCIES = + gasmoff_LDFLAGS = + COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + CCLD = $(CC) + LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ + HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS) + + DIST_COMMON = Makefile.am Makefile.in + + + DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + + TAR = gtar + GZIP_ENV = --best + SOURCES = $(libdv_la_SOURCES) $(dovlc_SOURCES) $(testvlc_SOURCES) $(testbitstream_SOURCES) $(gasmoff_SOURCES) + OBJECTS = $(libdv_la_OBJECTS) $(dovlc_OBJECTS) $(testvlc_OBJECTS) $(testbitstream_OBJECTS) $(gasmoff_OBJECTS) + + all: all-redirect + .SUFFIXES: + .SUFFIXES: .S .c .lo .o .s + $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps libdv/Makefile + + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + + mostlyclean-libLTLIBRARIES: + + clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + + distclean-libLTLIBRARIES: + + maintainer-clean-libLTLIBRARIES: + + install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + + uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + done + + .c.o: + $(COMPILE) -c $< + + .s.o: + $(COMPILE) -c $< + + .S.o: + $(COMPILE) -c $< + + mostlyclean-compile: + -rm -f *.o core *.core + + clean-compile: + + distclean-compile: + -rm -f *.tab.c + + maintainer-clean-compile: + + .c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + + .s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + + .S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + + mostlyclean-libtool: + -rm -f *.lo + + clean-libtool: + -rm -rf .libs _libs + + distclean-libtool: + + maintainer-clean-libtool: + + libdv.la: $(libdv_la_OBJECTS) $(libdv_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libdv_la_LDFLAGS) $(libdv_la_OBJECTS) $(libdv_la_LIBADD) $(LIBS) + + mostlyclean-noinstPROGRAMS: + + clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) + + distclean-noinstPROGRAMS: + + maintainer-clean-noinstPROGRAMS: + + dovlc: $(dovlc_OBJECTS) $(dovlc_DEPENDENCIES) + @rm -f dovlc + $(LINK) $(dovlc_LDFLAGS) $(dovlc_OBJECTS) $(dovlc_LDADD) $(LIBS) + + testvlc: $(testvlc_OBJECTS) $(testvlc_DEPENDENCIES) + @rm -f testvlc + $(LINK) $(testvlc_LDFLAGS) $(testvlc_OBJECTS) $(testvlc_LDADD) $(LIBS) + + testbitstream: $(testbitstream_OBJECTS) $(testbitstream_DEPENDENCIES) + @rm -f testbitstream + $(LINK) $(testbitstream_LDFLAGS) $(testbitstream_OBJECTS) $(testbitstream_LDADD) $(LIBS) + + gasmoff: $(gasmoff_OBJECTS) $(gasmoff_DEPENDENCIES) + @rm -f gasmoff + $(LINK) $(gasmoff_LDFLAGS) $(gasmoff_OBJECTS) $(gasmoff_LDADD) $(LIBS) + + install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p; \ + done + + uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + list='$(pkginclude_HEADERS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(pkgincludedir)/$$p; \ + done + + tags: TAGS + + ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + + TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + + mostlyclean-tags: + + clean-tags: + + distclean-tags: + -rm -f TAGS ID + + maintainer-clean-tags: + + distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + + subdir = libdv + + distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + YUY2.lo YUY2.o : YUY2.c dv_types.h ../config.h YUY2.h dv_types.h mmx.h + YV12.lo YV12.o : YV12.c dv_types.h ../config.h YV12.h dv_types.h mmx.h + audio.lo audio.o : audio.c dv_types.h ../config.h util.h dv_types.h \ + audio.h + bitstream.lo bitstream.o : bitstream.c ../config.h bitstream.h \ + dv_types.h + dct.lo dct.o : dct.c dv_types.h ../config.h dct.h dv_types.h weighting.h \ + mmx.h + dovlc.o: dovlc.c dv_types.h ../config.h vlc.h dv_types.h bitstream.h \ + bitstream.h + dv.lo dv.o : dv.c dv_types.h ../config.h dv.h dv_types.h encode.h dct.h \ + enc_input.h enc_output.h enc_audio_input.h util.h dct.h audio.h \ + idct_248.h quant.h weighting.h vlc.h bitstream.h parse.h \ + place.h rgb.h YUY2.h YV12.h mmx.h + enc_audio_input.lo enc_audio_input.o : enc_audio_input.c \ + enc_audio_input.h dv_types.h ../config.h + enc_input.lo enc_input.o : enc_input.c enc_input.h dv_types.h \ + ../config.h encode.h dct.h dv_types.h enc_input.h enc_output.h \ + enc_audio_input.h dct.h mmx.h + enc_output.lo enc_output.o : enc_output.c enc_audio_input.h dv_types.h \ + ../config.h enc_output.h headers.h + encode.lo encode.o : encode.c encode.h dct.h dv_types.h ../config.h \ + enc_input.h enc_output.h enc_audio_input.h idct_248.h quant.h \ + weighting.h vlc.h bitstream.h dv_types.h parse.h place.h mmx.h \ + enc_input.h enc_output.h + gasmoff.o: gasmoff.c dv_types.h ../config.h + headers.lo headers.o : headers.c headers.h + idct_248.lo idct_248.o : idct_248.c dv_types.h ../config.h + parse.lo parse.o : parse.c dv_types.h ../config.h util.h dv_types.h dv.h \ + bitstream.h vlc.h bitstream.h parse.h audio.h + place.lo place.o : place.c dv_types.h ../config.h place.h dv_types.h + quant.lo quant.o : quant.c dv_types.h ../config.h mmx.h quant.h \ + dv_types.h idct_248.h + rgb.lo rgb.o : rgb.c dv_types.h ../config.h + testbitstream.o: testbitstream.c dv_types.h ../config.h bitstream.h + testvlc.o: testvlc.c dv_types.h ../config.h vlc.h dv_types.h bitstream.h + util.lo util.o : util.c util.h dv_types.h ../config.h + vlc.lo vlc.o : vlc.c dv_types.h ../config.h vlc.h dv_types.h bitstream.h + weighting.lo weighting.o : weighting.c dv_types.h ../config.h \ + weighting.h dv_types.h + + info-am: + info: info-am + dvi-am: + dvi: dvi-am + check-am: all-am + check: check-am + installcheck-am: + installcheck: installcheck-am + install-exec-am: install-libLTLIBRARIES + install-exec: install-exec-am + + install-data-am: install-pkgincludeHEADERS + install-data: install-data-am + + install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + install: install-am + uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS + uninstall: uninstall-am + all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) + all-redirect: all-am + install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install + installdirs: + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(pkgincludedir) + + + mostlyclean-generic: + + clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + + distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + + maintainer-clean-generic: + -test -z "$(BUILT_SOURCES)$(MAINTAINERCLEANFILES)" || rm -f $(BUILT_SOURCES) $(MAINTAINERCLEANFILES) + mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-noinstPROGRAMS \ + mostlyclean-tags mostlyclean-generic + + mostlyclean: mostlyclean-am + + clean-am: clean-libLTLIBRARIES clean-compile clean-libtool \ + clean-noinstPROGRAMS clean-tags clean-generic \ + mostlyclean-am + + clean: clean-am + + distclean-am: distclean-libLTLIBRARIES distclean-compile \ + distclean-libtool distclean-noinstPROGRAMS \ + distclean-tags distclean-generic clean-am + -rm -f libtool + + distclean: distclean-am + + maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-noinstPROGRAMS maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + maintainer-clean: maintainer-clean-am + + .PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ + clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ + uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ + distclean-compile clean-compile maintainer-clean-compile \ + mostlyclean-libtool distclean-libtool clean-libtool \ + maintainer-clean-libtool mostlyclean-noinstPROGRAMS \ + distclean-noinstPROGRAMS clean-noinstPROGRAMS \ + maintainer-clean-noinstPROGRAMS uninstall-pkgincludeHEADERS \ + install-pkgincludeHEADERS tags mostlyclean-tags distclean-tags \ + clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ + check-am installcheck-am installcheck install-exec-am install-exec \ + install-data-am install-data install-am install uninstall-am uninstall \ + all-redirect all-am all installdirs mostlyclean-generic \ + distclean-generic clean-generic maintainer-clean-generic clean \ + mostlyclean distclean maintainer-clean + + + # Automake doesn't do dependency tracking for asm + @HOST_X86_TRUE@quant_x86.lo vlc_x86.lo: asmoff.h + + @HOST_X86_TRUE@asmoff.h: gasmoff + @HOST_X86_TRUE@ ./gasmoff > asmoff.h + + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: diff -C2 -r -N bcast-2000c/quicktime/libdv/README bcast-2000c-mf3/quicktime/libdv/README *** bcast-2000c/quicktime/libdv/README Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/README Thu Jan 1 01:00:00 1970 *************** *** 1,137 **** - Libdv defines two objects: the dv_t object and the dv_grabber_t object. - - The dv_grabber_t object - - 1) Grabs DV frames from a firewire device, determines the size of each - frame, and hence the conformance. - - The dv_t object - - 1) Decodes video data from a DV frame - 2) Decodes audio data from a DV frame - - DV stores audio and video in each frame. You can either read DV frames - produced by the dv_grabber_t object or from an arbitrary file. The - dv_t object merely needs an input data buffer and a buffer size. Both - objects should exist at the same time if you want to decode frames - simultaneous with grabbing. - - - // ========================== Using the dv_grabber_t object ======================= - Step 1: - - #include libdv.h and create a new grabber object. Only one instance of - dv_grabber_t may exist in an executable. - - dv_grabber_t *grabber = dv_grabber_new(); - - Step 2: - - Start the grabber reading in the background. - - dv_start_grabbing(grabber, firewire_port, firewire_channel, buffers); - - The grabber reads frames continuously until buffers number of buffers - have been filled, then waits until a buffer becomes available before - continuing to read. While it's reading you can call - - dv_grab_frame(grabber, &frame, &size); - - to grab a frame. This points unsigned char *frame to a buffer and long - size to the size of the buffer. You must now either write the frame to - disk or decode it in a dv_t object. The size value is synonymous with - the dimensions of the frame. A size of 120000 is an NTSC frame and - hence 720x480. A size of 140000 is a PAL frame and hence 720x576. - - After you're done with the buffer call - - dv_unlock_frame(grabber); - - to allow the grabber to continue grabbing into the buffer you just read. - - Step 3: - - When you're finished grabbing call - - dv_stop_grabbing(grabber); - - to stop the background process. Follow this with - - dv_grabber_delete(dv); - - to delete the grabber object. - - Step 4: - - Incidentally, the Linux firewire interface has no hot swapping. If you - disconnect a firewire device or turn it off while grabbing the grabber - will lock up. The solution to Linux firewire is the following. - - If - - dv_grabber_crashed(grabber); - - returns 1 you need to override the kernel with - - dv_interrupt_grabber(grabber); - - before stopping the grabber with - - dv_stop_grabbing(grabber); - dv_grabber_delete(dv); - - - // ============================= Using the dv_t object ============================= - Step 1: - - #include libdv.h and create a new dv decoder. - - dv_t *dv = dv_new(); - - Step 2: - - Read video frames. Call dv_read_video for each frame read. - - dv_read_video(dv, rgb_rows, buffer, size, color_model); - - dv is the dv decoding object. - - color_model determines what rgb_rows is. In each case the row size is - 3 * width. - - color_model rgb_rows - BC_RGB888 Each row of an RGB frame - BC_YUV888 Each row of a YUV frame - - - Each row must have enough memory allocated to store a row of the - specified color model. The dimensions of the frame must be determined - by whatever procedure grabs the data from the device. - - buffer is the compressed data. - - size is the size of the compressed data. This can be the size value - returned by dv_grab_frame or a #define from libdv.h. - - color_model is the color model to generate. It can be any of the color - model #defines in libdv.h - - Step 3: - - Read audio frames. This procedure only works for 2 channel 16 bit - encoding. Call dv_read_audio for each frame to extract the audio from. - - dv_read_audio(dv, samples, data, size); - - dv is the dv pointer. Samples is a preallocated buffer of 4096 bytes. - Data is the compressed DV frame. Size is the number of bytes in the DV - frame. - - This function returns the number of 16 bit twos complement samples - deposited in *samples. - - Step 4: - - Delete the dv object when finished reading frames. - - dv_delete(dv); --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/libdv/TODO bcast-2000c-mf3/quicktime/libdv/TODO *** bcast-2000c/quicktime/libdv/TODO Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/TODO Thu Jan 1 01:00:00 1970 *************** *** 1,64 **** - Major features: - - PAL - - Audio - - - Performance: - - - MMX ycrcb conversion to rgb - - - combine multiplies across weight/quant/idct prescale (?) - - - parse: - - re-arrange data so that coeff blocks are all one big array - (alignment + one big memset (mmx!) at beginning of segment) - - more efficient bookkeeping (vs current brute force mark and sweep) - in second and third passes of parse - - - still optimize vlc: - - combine lookup tables that use the same index: - - first level of classes, class_index_mask, class_index_rshift - (all indexed by maxbits) - - vlc_lookups, vlc_index_mask, vlc_index_rshift (all indexed by class) - - sign_mask, sign_rshift (indexed by vlc len) - - - think about optimizing vlc/getbits interface based on a few - observations: - - there are three lookups in vlc of the form ((bits & mask) >> shift) are really doing this: - bitstream_show_skip(bs,skip,len) // show len bits, beginning skip bits from current position - - if we add that interface, and then mmx getbits, this could free registers - for better tuning the rest of the vlc lookup code. - - note that start and len are bounded to the range 0-16, it might pay - to ensure that after flush, show can always count on at least 16 bits - remaining in bs->current_word - - (there are multiple shows for each flush - eliminates branch in show) - - since we parse a whole video segment before we do idcts, we can reserve - mmx registers for getbits state for the entire duration of parsing a video segment - - note that bitstream state is re-initialized everytime we start a new video segment - - - put in decent C version of idct, especially 248 - - C version will let us eliminite last vestage of floating point math - - mmx version of 248 idct - - - efficient interfaces to display (XShm, DGA, Xv) - - what about TV --> computer display sync? - - - hardware assist where available? (ATI 88 idct, full-screen scaling?) - - - tune cache footprint: access input and output withouth polluting L1 - - - get everything working in Windows and use VTune to analyze and - improve x86 performance. - - Documentation: - - - there is none! - - - the contents of this file has/will move to the project task list - on sourceforge. - - - - - - --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/libdv/YUY2.c bcast-2000c-mf3/quicktime/libdv/YUY2.c *** bcast-2000c/quicktime/libdv/YUY2.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/YUY2.c Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,522 ---- + /* + * YUY2.c + * + * Copyright (C) Charles 'Buck' Krasic - April 2000 + * Copyright (C) Erik Walthinsen - April 2000 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + /* Most of this file is derived from patch 101018 submitted by Stefan + * Lucke */ + + #include + + #include + + #include "YUY2.h" + + #if ARCH_X86 + #include "mmx.h" + #endif // ARCH_X68 + + /* Lookup tables for mapping signed to unsigned, and clamping */ + static unsigned char real_uvlut[256], *uvlut; + static unsigned char real_ylut[768], *ylut; + + #if ARCH_X86 + /* Define some constants used in MMX range mapping and clamping logic */ + static mmx_t mmx_0x0010s = (mmx_t) 0x0010001000100010LL, + mmx_0x0080s = (mmx_t) 0x0080008000800080LL, + mmx_0x7f24s = (mmx_t) 0x7f247f247f247f24LL, + mmx_0x7f94s = (mmx_t) 0x7f947f947f947f94LL, + mmx_0xff00s = (mmx_t) 0xff00ff00ff00ff00LL; + #endif // ARCH_X86 + + void + dv_YUY2_init(void) { + gint i; + gint value; + + uvlut = real_uvlut + 128; // index from -128 .. 127 + for(i=-128; + i<128; + ++i) { + if(i < (16-128)) value = 16; + else if(i > (240-128)) value = 240; + else value = i+128; + uvlut[i] = value; + } /* for */ + + ylut = real_ylut + 256; // index from -256 .. 511 + for(i=-256; + i<512; + ++i) { + if(i < (16-128)) value = 16; + else if(i > (235-128)) value = 240; + else value = i+128; + ylut[i] = value; + } /* for */ + } /* dv_YUY2_init */ + + void + dv_mb411_YUY2(dv_macroblock_t *mb, guchar **pixels, gint *pitches) { + dv_coeff_t *Y[4], *cr_frame, *cb_frame; + unsigned char *pyuv, *pwyuv, cb, cr; + int i, j, row; + + Y [0] = mb->b[0].coeffs; + Y [1] = mb->b[1].coeffs; + Y [2] = mb->b[2].coeffs; + Y [3] = mb->b[3].coeffs; + cr_frame = mb->b[4].coeffs; + cb_frame = mb->b[5].coeffs; + + pyuv = pixels[0] + (mb->x * 2) + (mb->y * pitches[0]); + + for (row = 0; row < 8; ++row) { // Eight rows + pwyuv = pyuv; + + for (i = 0; i < 4; ++i) { // Four Y blocks + dv_coeff_t *Ytmp = Y[i]; // less indexing in inner loop speedup? + + for (j = 0; j < 2; ++j) { // two 4-pixel spans per Y block + + cb = CLAMP(*cb_frame, -128, 127) + 128; + cr = CLAMP(*cr_frame, -128, 127) + 128; + cb_frame++; + cr_frame++; + + *pwyuv++ = CLAMP(*Ytmp, -128, 127) + 128; + Ytmp++; + *pwyuv++ = cb; + *pwyuv++ = CLAMP(*Ytmp, -128, 127) + 128; + Ytmp++; + *pwyuv++ = cr; + + *pwyuv++ = CLAMP(*Ytmp, -128, 127) + 128; + Ytmp++; + *pwyuv++ = cb; + *pwyuv++ = CLAMP(*Ytmp, -128, 127) + 128; + Ytmp++; + *pwyuv++ = cr; + + } /* for j */ + + Y[i] = Ytmp; + } /* for i */ + + pyuv += pitches[0]; + } /* for row */ + } /* dv_mb411_YUY2 */ + + void + dv_mb411_right_YUY2(dv_macroblock_t *mb, guchar **pixels, gint *pitches) { + + dv_coeff_t *Y[4], *Ytmp, *cr_frame, *cb_frame; + unsigned char *pyuv, *pwyuv, cb, cr; + int i, j, col, row; + + + Y[0] = mb->b[0].coeffs; + Y[1] = mb->b[1].coeffs; + Y[2] = mb->b[2].coeffs; + Y[3] = mb->b[3].coeffs; + + pyuv = pixels[0] + (mb->x * 2) + (mb->y * pitches[0]); + + for (j = 0; j < 4; j += 2) { // Two rows of blocks + cr_frame = mb->b[4].coeffs + (j * 2); + cb_frame = mb->b[5].coeffs + (j * 2); + + for (row = 0; row < 8; row++) { + pwyuv = pyuv; + + for (i = 0; i < 2; ++i) { // Two columns of blocks + Ytmp = Y[j + i]; + + for (col = 0; col < 8; col+=4) { // two 4-pixel spans per Y block + + cb = CLAMP(*cb_frame, -128, 127) + 128; + cr = CLAMP(*cr_frame, -128, 127) + 128; + cb_frame++; + cr_frame++; + + *pwyuv++ = CLAMP(*Ytmp, -128, 127) + 128; + Ytmp++; + *pwyuv++ = cb; + *pwyuv++ = CLAMP(*Ytmp, -128, 127) + 128; + Ytmp++; + *pwyuv++ = cr; + + *pwyuv++ = CLAMP(*Ytmp, -128, 127) + 128; + Ytmp++; + *pwyuv++ = cb; + *pwyuv++ = CLAMP(*Ytmp, -128, 127) + 128; + Ytmp++; + *pwyuv++ = cr; + } /* for col */ + Y[j + i] = Ytmp; + + } /* for i */ + + cb_frame += 4; + cr_frame += 4; + pyuv += pitches[0]; + } /* for row */ + + } /* for j */ + } /* dv_mb411_right_YUY2 */ + + /* ---------------------------------------------------------------------------- + */ + void + dv_mb420_YUY2 (dv_macroblock_t *mb, guchar **pixels, gint *pitches) { + dv_coeff_t *Y [4], *Ytmp0, *cr_frame, *cb_frame; + unsigned char *pyuv, + *pwyuv0, *pwyuv1, + cb, cr; + int i, j, col, row, inc_l2, inc_l4; + + pyuv = pixels[0] + (mb->x * 2) + (mb->y * pitches[0]); + + Y [0] = mb->b[0].coeffs; + Y [1] = mb->b[1].coeffs; + Y [2] = mb->b[2].coeffs; + Y [3] = mb->b[3].coeffs; + cr_frame = mb->b[4].coeffs; + cb_frame = mb->b[5].coeffs; + inc_l2 = pitches[0]; + inc_l4 = pitches[0]*2; + + for (j = 0; j < 4; j += 2) { // Two rows of blocks j, j+1 + for (row = 0; row < 8; row+=2) { // 4 pairs of two rows + pwyuv0 = pyuv; + pwyuv1 = pyuv + inc_l2; + for (i = 0; i < 2; ++i) { // Two columns of blocks + Ytmp0 = Y[j + i]; + for (col = 0; col < 4; ++col) { // 4 spans of 2x2 pixels + cb = CLAMP(*cb_frame, -128, 127) + 128; + cr = CLAMP(*cr_frame, -128, 127) + 128; + cb_frame++; + cr_frame++; + + *pwyuv0++ = CLAMP(*Ytmp0, -128, 127) + 128; + Ytmp0++; + *pwyuv0++ = cb; + *pwyuv0++ = CLAMP(*Ytmp0, -128, 127) + 128; + Ytmp0++; + *pwyuv0++ = cr; + + + *pwyuv1++ = CLAMP(*(Ytmp0 + 6), -128, 127) + 128; + Ytmp0++; + *pwyuv1++ = cb; + *pwyuv1++ = CLAMP(*(Ytmp0 + 7), -128, 127) + 128; + Ytmp0++; + *pwyuv1++ = cr; + + *pwyuv1++ = ylut [*(Ytmp0 + 6)]; + *pwyuv1++ = cb; + *pwyuv1++ = ylut [*(Ytmp0 + 7)]; + *pwyuv1++ = cr; + } + Y[j + i] = Ytmp0 + 8; + } + pyuv += inc_l4; + } + } + } + + #if ARCH_X86 + + /* TODO (by Buck): + * + * When testing YV12.c, I discovered that my video card (RAGE 128) + * doesn't care that pixel components are strictly clamped to Y + * (16..235), UV (16..240). So I was able to use MMX pack with + * unsigned saturation to go from 16 to 8 bit representation. This + * clamps to (0..255). Applying this to the code here might allow + * us to reduce instruction count below. + * + * Question: do other video cards behave the same way? + * */ + void + dv_mb411_YUY2_mmx(dv_macroblock_t *mb, guchar **pixels, gint *pitches) { + dv_coeff_t *Y[4], *cr_frame, *cb_frame; + unsigned char *pyuv, *pwyuv; + int i, row; + + Y[0] = mb->b[0].coeffs; + Y[1] = mb->b[1].coeffs; + Y[2] = mb->b[2].coeffs; + Y[3] = mb->b[3].coeffs; + cr_frame = mb->b[4].coeffs; + cb_frame = mb->b[5].coeffs; + + pyuv = pixels[0] + (mb->x * 2) + (mb->y * pitches[0]); + + movq_m2r (mmx_0x7f94s, mm6); + movq_m2r (mmx_0x7f24s, mm5); + + for (row = 0; row < 8; ++row) { // Eight rows + pwyuv = pyuv; + for (i = 0; i < 4; ++i) { // Four Y blocks + dv_coeff_t *Ytmp = Y [i]; // less indexing in inner loop speedup? + /* --------------------------------------------------------------------- + */ + movq_m2r (*cb_frame, mm2); // cb0 cb1 cb2 cb3 + paddw_m2r (mmx_0x0080s, mm2); // add 128 + + psllw_i2r (8, mm2); // move into high byte + movq_m2r (*cr_frame, mm3); // cr0 cr1 cr2 cr3 + + paddw_m2r (mmx_0x0080s, mm3); // add 128 + psllw_i2r (8, mm3); // move into high byte + + movq_r2r (mm2, mm4); + punpcklwd_r2r (mm3, mm4); // cb0cr0 cb1cr1 + + punpckldq_r2r (mm4, mm4); // cb0cr0 cb0cr0 + pand_m2r (mmx_0xff00s, mm4); /* Buck wants to know: is this just for pairing? + low bytes are zero already-right? */ + + /* --------------------------------------------------------------------- + */ + movq_m2r (*Ytmp, mm0); + paddsw_r2r (mm6, mm0); // clamp hi + + psubusw_r2r (mm5, mm0); // clamp low + paddw_m2r (mmx_0x0010s, mm0); // adjust back into 16-235 range + + por_r2r (mm4, mm0); // interleave with 4 bytes of crcb with 4 Ys + movq_r2m (mm0, *pwyuv); + + Ytmp += 4; + pwyuv += 8; + + /* --------------------------------------------------------------------- + */ + movq_r2r (mm2, mm4); + punpcklwd_r2r (mm3, mm4); + punpckhdq_r2r (mm4, mm4); + + /* --------------------------------------------------------------------- + */ + movq_m2r (*Ytmp, mm0); + paddsw_r2r (mm6, mm0); + psubusw_r2r (mm5, mm0); + paddw_m2r (mmx_0x0010s, mm0); + por_r2r (mm4, mm0); + movq_r2m (mm0, *pwyuv); + Ytmp += 4; + pwyuv += 8; + + cr_frame += 2; + cb_frame += 2; + Y [i] = Ytmp; + } /* for i */ + pyuv += pitches[0]; + } /* for j */ + emms (); + } /* dv_mb411_YUY2_mmx */ + + void + dv_mb411_right_YUY2_mmx(dv_macroblock_t *mb, guchar **pixels, gint *pitches) { + + dv_coeff_t *Y[4], *Ytmp, *cr_frame, *cb_frame; + unsigned char *pyuv; + int j, row; + + Y[0] = mb->b[0].coeffs; + Y[1] = mb->b[1].coeffs; + Y[2] = mb->b[2].coeffs; + Y[3] = mb->b[3].coeffs; + + pyuv = pixels[0] + (mb->x * 2) + (mb->y * pitches[0]); + + movq_m2r(mmx_0x0080s,mm7); + + for (j = 0; j < 4; j += 2) { // Two rows of blocks + cr_frame = mb->b[4].coeffs + (j * 2); + cb_frame = mb->b[5].coeffs + (j * 2); + + for (row = 0; row < 8; row++) { + + movq_m2r(*cb_frame, mm0); + paddw_r2r(mm7,mm0); // +128 + packuswb_r2r(mm0,mm0); + + movq_m2r(*cr_frame, mm1); + paddw_r2r(mm7,mm1); // +128 + packuswb_r2r(mm1,mm1); + + punpcklbw_r2r(mm1,mm0); + movq_r2r(mm0,mm1); + + punpcklwd_r2r(mm0,mm0); // pack doubled low cb and crs + punpckhwd_r2r(mm1,mm1); // pack doubled high cb and crs + + Ytmp = Y[j]; + + movq_m2r(*Ytmp,mm2); + paddw_r2r(mm7,mm2); // +128 + + movq_m2r(*(Ytmp+4),mm3); + paddw_r2r(mm7,mm3); // +128 + + packuswb_r2r(mm3,mm2); // pack Ys from signed 16-bit to unsigned 8-bit + movq_r2r(mm2,mm3); + + punpcklbw_r2r(mm0,mm3); // interlieve low Ys with crcbs + movq_r2m(mm3,*(pyuv)); + + punpckhbw_r2r(mm0,mm2); // interlieve high Ys with crcbs + movq_r2m(mm2,*(pyuv+8)); + + Y[j] += 8; + + Ytmp = Y[j+1]; + + movq_m2r(*Ytmp,mm2); + paddw_r2r(mm7,mm2); // +128 + + movq_m2r(*(Ytmp+4),mm3); + paddw_r2r(mm7,mm3); // +128 + + packuswb_r2r(mm3,mm2); // pack Ys from signed 16-bit to unsigned 8-bit + movq_r2r(mm2,mm3); + + punpcklbw_r2r(mm1,mm3); + movq_r2m(mm3,*(pyuv+16)); + + punpckhbw_r2r(mm1,mm2); // interlieve low Ys with crcbs + movq_r2m(mm2,*(pyuv+24)); // interlieve high Ys with crcbs + + Y[j+1] += 8; + cr_frame += 8; + cb_frame += 8; + + pyuv += pitches[0]; + } /* for row */ + + } /* for j */ + emms(); + } /* dv_mb411_right_YUY2_mmx */ + + /* ---------------------------------------------------------------------------- + */ + void + dv_mb420_YUY2_mmx (dv_macroblock_t *mb, guchar **pixels, gint *pitches) { + dv_coeff_t *Y [4], *Ytmp0, *cr_frame, *cb_frame; + unsigned char *pyuv, + *pwyuv0, *pwyuv1; + int i, j, row, inc_l2, inc_l4; + + pyuv = pixels[0] + (mb->x * 2) + (mb->y * pitches[0]); + + Y [0] = mb->b[0].coeffs; + Y [1] = mb->b[1].coeffs; + Y [2] = mb->b[2].coeffs; + Y [3] = mb->b[3].coeffs; + cr_frame = mb->b[4].coeffs; + cb_frame = mb->b[5].coeffs; + inc_l2 = pitches[0]; + inc_l4 = pitches[0]*2; + + movq_m2r (mmx_0x7f94s, mm6); + movq_m2r (mmx_0x7f24s, mm5); + + for (j = 0; j < 4; j += 2) { // Two rows of blocks j, j+1 + for (row = 0; row < 8; row+=2) { // 4 pairs of two rows + pwyuv0 = pyuv; + pwyuv1 = pyuv + inc_l2; + for (i = 0; i < 2; ++i) { // Two columns of blocks + Ytmp0 = Y[j + i]; + + /* ------------------------------------------------------------------- + */ + movq_m2r (*cb_frame, mm2); + paddw_m2r (mmx_0x0080s, mm2); + + psllw_i2r (8, mm2); + movq_m2r (*cr_frame, mm3); + + paddw_m2r (mmx_0x0080s, mm3); + psllw_i2r (8, mm3); + + movq_r2r (mm2, mm4); + punpcklwd_r2r (mm3, mm4); + + /* ------------------------------------------------------------------- + */ + movq_m2r (Ytmp0[0], mm0); + paddsw_r2r (mm6, mm0); + psubusw_r2r (mm5, mm0); + paddw_m2r (mmx_0x0010s, mm0); + por_r2r (mm4, mm0); + + movq_m2r (Ytmp0[8], mm1); + paddsw_r2r (mm6, mm1); + + movq_r2m (mm0, pwyuv0[0]); + + psubusw_r2r (mm5, mm1); + paddw_m2r (mmx_0x0010s, mm1); + por_r2r (mm4, mm1); + + movq_r2m (mm1, pwyuv1[0]); + + movq_r2r (mm2, mm4); + + punpckhwd_r2r (mm3, mm4); + + movq_m2r (Ytmp0[4], mm0); + paddsw_r2r (mm6, mm0); + psubusw_r2r (mm5, mm0); + paddw_m2r (mmx_0x0010s, mm0); + por_r2r (mm4, mm0); + + movq_m2r (Ytmp0[12], mm1); + paddsw_r2r (mm6, mm1); + + movq_r2m (mm0, pwyuv0[8]); + + psubusw_r2r (mm5, mm1); + paddw_m2r (mmx_0x0010s, mm1); + por_r2r (mm4, mm1); + + movq_r2m (mm1, pwyuv1[8]); + + pwyuv0 += 16; + pwyuv1 += 16; + cb_frame += 4; + cr_frame += 4; + Y[j + i] = Ytmp0 + 16; + } + pyuv += inc_l4; + } + } + emms (); + } + + #endif // ARCH_X86 + + diff -C2 -r -N bcast-2000c/quicktime/libdv/YUY2.h bcast-2000c-mf3/quicktime/libdv/YUY2.h *** bcast-2000c/quicktime/libdv/YUY2.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/YUY2.h Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,68 ---- + /* + * YUY2.h + * + * Copyright (C) Charles 'Buck' Krasic - April 2000 + * Copyright (C) Erik Walthinsen - April 2000 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + #ifndef DV_YUY2_H + #define DV_YUY2_H + + #include + + /* Convert output of decoder to YUY2 conforming layout. YUY2 is a + * format supported directly by many display adaptors. See + * the following website for details of YUY2: + * + * http://www.webartz.com/fourcc/fccyuv.htm#YUY2 + * + * + * The convertion entails going from 16bit to 8bit, properly clamping + * YUV values, and upsampling to 422 by duplicating chroma values. + * + * These conversions make sense to use if the HW supports YUY2 and the + * DV is NTSC or SMPTE PAL. Older IEC 61834 PAL DV is completely 420 + * sampled, so it is better to convert that to YV12 format. */ + + #ifdef __cplusplus + extern "C" { + #endif + + extern void dv_YUY2_init(void); + + /* scalar versions */ + extern void dv_mb411_YUY2(dv_macroblock_t *mb, guchar **pixels, gint *pitches); + extern void dv_mb411_right_YUY2(dv_macroblock_t *mb, guchar **pixels, gint *pitches); + extern void dv_mb420_YUY2(dv_macroblock_t *mb, guchar **pixels, gint *pitches); + + #if ARCH_X86 + /* pentium architecture mmx versions */ + extern void dv_mb411_YUY2_mmx(dv_macroblock_t *mb, guchar **pixels, gint *pitches); + extern void dv_mb411_right_YUY2_mmx(dv_macroblock_t *mb, guchar **pixels, gint *pitches); + extern void dv_mb420_YUY2_mmx(dv_macroblock_t *mb, guchar **pixels, gint *pitches); + #endif // ARCH_X86 + + #ifdef __cplusplus + } + #endif + + #endif // DV_YUY2_H diff -C2 -r -N bcast-2000c/quicktime/libdv/YV12.c bcast-2000c-mf3/quicktime/libdv/YV12.c *** bcast-2000c/quicktime/libdv/YV12.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/YV12.c Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,219 ---- + /* + * YV12.c + * + * Copyright (C) Charles 'Buck' Krasic - April 2000 + * Copyright (C) Erik Walthinsen - April 2000 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + #include + + #include + + #include "YV12.h" + + #if ARCH_X86 + #include "mmx.h" + #endif // ARCH_X86 + + /* Lookup tables for mapping signed to unsigned, and clamping */ + static unsigned char real_uvlut[256], *uvlut; + static unsigned char real_ylut[768], *ylut; + + #if ARCH_X86 + /* Define some constants used in MMX range mapping and clamping logic */ + static mmx_t mmx_0x10s = (mmx_t) 0x1010101010101010LL, + mmx_0x0080s = (mmx_t) 0x0080008000800080LL, + mmx_0x7f24s = (mmx_t) 0x7f247f247f247f24LL, + mmx_0x7f94s = (mmx_t) 0x7f947f947f947f94LL; + #endif // ARCH_X86 + + void + dv_YV12_init(void) { + gint i; + gint value; + + uvlut = real_uvlut + 128; // index from -128 .. 127 + for(i=-128; + i<128; + ++i) { + if(i < (16-128)) value = 16; + else if(i > (240-128)) value = 240; + else value = i+128; + uvlut[i] = value; + } /* for */ + + ylut = real_ylut + 256; // index from -256 .. 511 + for(i=-256; + i<512; + ++i) { + if(i < (16-128)) value = 16; + else if(i > (235-128)) value = 240; + else value = i+128; + ylut[i] = value; + } /* for */ + } /* dv_YV12_init */ + + void + dv_mb420_YV12(dv_macroblock_t *mb, guchar **pixels, guint16 *pitches) { + dv_coeff_t *Y[4], *UV[2], *Ytmp, *UVtmp; + unsigned char *py, *pwy, *puv, *pwuv; + int i, j, row, col; + + Y [0] = mb->b[0].coeffs; + Y [1] = mb->b[1].coeffs; + Y [2] = mb->b[2].coeffs; + Y [3] = mb->b[3].coeffs; + UV[0] = mb->b[4].coeffs; + UV[1] = mb->b[5].coeffs; + + + py = pixels[0] + mb->x + (mb->y * pitches[0]); + + for(i=0; i<4; i+=2) { // two rows of Y blocks + + for(row=0; + row < 8; + row++) { + + pwy = py; + + for(j=0; j<2; j++) { // two columns of Y blocks + Ytmp = Y[i+j]; + for(col = 0; col < 8; col++) { + *pwy++ = ylut[*Ytmp++]; + } + Y[i+j] = Ytmp; + } /* for j */ + + py += pitches[0]; + + } /* for row */ + } /* for i */ + + for(i=1; + i<3; + i++) { // two Chroma blocks + + puv = pixels[i] + (mb->x/2) + ((mb->y/2) * pitches[i]); + UVtmp = UV[i-1]; + + for(row=0; + row < 8; + row++, puv += pitches[i]) { + + pwuv = puv; + for(col=0; + col<8; + col++) { + *pwuv++ = uvlut[*UVtmp++]; + } /* for col */ + + } /* for row */ + + } // for i + + } /* dv_mb420_YV12 */ + + #if ARCH_X86 + + void + dv_mb420_YV12_mmx(dv_macroblock_t *mb, guchar **pixels, guint16 *pitches) { + dv_coeff_t *Y[4], *UV[2], *Ytmp, *UVtmp; + unsigned char *py, *pwy, *puv; + int i, j, row; + + Y [0] = mb->b[0].coeffs; + Y [1] = mb->b[1].coeffs; + Y [2] = mb->b[2].coeffs; + Y [3] = mb->b[3].coeffs; + UV[0] = mb->b[4].coeffs; + UV[1] = mb->b[5].coeffs; + + py = pixels[0] + mb->x + (mb->y * pitches[0]); + + movq_m2r(mmx_0x0080s,mm0); + movq_m2r(mmx_0x10s,mm1); + + movq_m2r(mmx_0x7f94s,mm2); + movq_m2r(mmx_0x7f24s,mm3); + + for(i=0; i<4; i+=2) { // two rows of Y blocks + + for(row=0; + row < 8; + row++) { + + pwy = py; + + for(j=0; j<2; j++) { // two columns of Y blocks + Ytmp = Y[i+j]; + + movq_m2r(*(Ytmp ),mm4); + movq_m2r(*(Ytmp+4),mm5); + + paddw_r2r(mm0,mm4); // +128 + paddw_r2r(mm0,mm5); // +128 + + packuswb_r2r(mm5,mm4); // 16 -> 8 bit + movq_r2m(mm4, *pwy); + + Y[i+j] = Ytmp + 8; + pwy += 8; + } /* for j */ + + py += pitches[0]; + + } /* for row */ + } /* for i */ + + for(i=1; + i<3; + i++) { // two Chroma blocks + + puv = pixels[i] + (mb->x/2) + ((mb->y/2) * pitches[i]); + UVtmp = UV[i-1]; + + for(row=0; + row < 8; + row++) { + + movq_m2r(*(UVtmp ),mm4); + movq_m2r(*(UVtmp+4),mm5); + + paddw_r2r(mm0,mm4); // +128 + paddw_r2r(mm0,mm5); // +128 + + packuswb_r2r(mm5,mm4); // 16 -> 8 bit + movq_r2m(mm4, *puv); + + UVtmp += 8; + puv += pitches[i]; + } /* for row */ + + } // for i + emms(); + + } /* dv_mb420_YV12_mmx */ + + + #endif // ARCH_X86 + diff -C2 -r -N bcast-2000c/quicktime/libdv/YV12.h bcast-2000c-mf3/quicktime/libdv/YV12.h *** bcast-2000c/quicktime/libdv/YV12.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/YV12.h Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,63 ---- + /* + * YV12.h + * + * Copyright (C) Charles 'Buck' Krasic - April 2000 + * Copyright (C) Erik Walthinsen - April 2000 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + #ifndef DV_YV12_H + #define DV_YV12_H + + #include + + /* Convert output of decoder to YV12 conforming layout. YV12 is a + * format supported directly by many display adaptors. See + * the following website for details of YV12: + * + * http://www.webartz.com/fourcc/fccyuv.htm#YV12 + * + * The conversion entails going from 16bit to 8bit and properly + * clamping YUV values. + * + * These conversions make sense to use if the HW supports YV12 and the + * DV is IEC 61834 PAL. SMPTE 314M PAL uses 411, so it is better to + * upsample that to YUY2. */ + + #ifdef __cplusplus + extern "C" { + #endif + + extern void dv_YV12_init(void); + + /* scalar version */ + extern void dv_mb420_YV12(dv_macroblock_t *mb, guchar **pixels, guint16 *pitches); + + #if ARCH_X86 + /* pentium architecture mmx version */ + extern void dv_mb420_YV12_mmx(dv_macroblock_t *mb, guchar **pixels, guint16 *pitches); + #endif // ARCH_X86 + + #ifdef __cplusplus + } + #endif + + #endif /* DV_YV12_H */ diff -C2 -r -N bcast-2000c/quicktime/libdv/asmoff.h bcast-2000c-mf3/quicktime/libdv/asmoff.h *** bcast-2000c/quicktime/libdv/asmoff.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/asmoff.h Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,33 ---- + #define dv_videosegment_t_i 0 + #define dv_videosegment_t_k 4 + #define dv_videosegment_t_bs 8 + #define dv_videosegment_t_mb 12 + #define dv_videosegment_t_isPAL 4992 + #define dv_macroblock_t_size 996 + #define dv_macroblock_t_b 20 + #define dv_macroblock_t_eob_count 992 + #define dv_macroblock_t_vlc_error 988 + #define dv_macroblock_t_qno 980 + #define dv_macroblock_t_sta 984 + #define dv_macroblock_t_i 0 + #define dv_macroblock_t_j 4 + #define dv_macroblock_t_k 8 + #define dv_block_t_size 160 + #define dv_block_t_coeffs 0 + #define dv_block_t_dct_mode 128 + #define dv_block_t_class_no 132 + #define dv_block_t_reorder 136 + #define dv_block_t_reorder_sentinel 140 + #define dv_block_t_offset 144 + #define dv_block_t_end 148 + #define dv_block_t_eob 152 + #define dv_block_t_mark 156 + #define bitstream_t_buf 12 + #define DV_QUALITY_BEST 5 + #define DV_QUALITY_FASTEST 0 + #define DV_QUALITY_COLOR 1 + #define DV_QUALITY_AC_MASK 6 + #define DV_QUALITY_DC 0 + #define DV_QUALITY_AC_1 2 + #define DV_QUALITY_AC_2 4 + #define DV_WEIGHT_BIAS 6 diff -C2 -r -N bcast-2000c/quicktime/libdv/audio.c bcast-2000c-mf3/quicktime/libdv/audio.c *** bcast-2000c/quicktime/libdv/audio.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/audio.c Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,527 ---- + /* + * audio.c + * + * Copyright (C) Charles 'Buck' Krasic - January 2001 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + #include + + #include + #include + + #include "util.h" + #include "audio.h" + + /* + * DV audio data is shuffled within the frame data. The unshuffle + * tables are indexed by DIF sequence number, then audio DIF block number. + * The first audio channel (pair) is in the first half of DIF sequences, and the + * second audio channel (pair) is in the second half. + * + * DV audio can be sampled at 48, 44.1, and 32 kHz. Normally, samples + * are quantized to 16 bits, with 2 channels. In 32 kHz mode, it is + * possible to support 4 channels by non-linearly quantizing to 12 + * bits. + * + * The code here always returns 16 bit samples. In the case of 12 + * bit, we upsample to 16 according to the DV standard defined + * mapping. + * + * DV audio can be "locked" or "unlocked". In unlocked mode, the + * number of audio samples per video frame can vary somewhat. Header + * info in the audio sections (AAUX AS) is used to tell the decoder on + * a frame be frame basis how many samples are present. + * */ + + static int dv_audio_unshuffle_60[5][9] = { + { 0, 15, 30, 10, 25, 40, 5, 20, 35 }, + { 3, 18, 33, 13, 28, 43, 8, 23, 38 }, + { 6, 21, 36, 1, 16, 31, 11, 26, 41 }, + { 9, 24, 39, 4, 19, 34, 14, 29, 44 }, + {12, 27, 42, 7, 22, 37, 2, 17, 32 }, + }; + + static int dv_audio_unshuffle_50[6][9] = { + { 0, 18, 36, 13, 31, 49, 8, 26, 44 }, + { 3, 21, 39, 16, 34, 52, 11, 29, 47 }, + { 6, 24, 42, 1, 19, 37, 14, 32, 50 }, + { 9, 27, 45, 4, 22, 40, 17, 35, 53 }, + { 12, 30, 48, 7, 24, 43, 2, 20, 38 }, + { 15, 33, 51, 10, 28, 46, 5, 23, 41 }, + }; + + /* Minumum number of samples, indexed by system (PAL/NTSC) and + sampling rate (32 kHz, 44.1 kHz, 48 kHz) */ + + static gint min_samples[2][3] = { + { 1580, 1452, 1053 }, /* 60 fields (NTSC) */ + { 1896, 1742, 1264 }, /* 50 fields (PAL) */ + }; + + static gint max_samples[2][3] = { + { 1620, 1489, 1080 }, /* 60 fields (NTSC) */ + { 1944, 1786, 1296 }, /* 50 fields (PAL) */ + }; + + static gint frequency[3] = { + 48000, 44100, 32000 + }; + + + #ifdef __GNUC__ + static gint quantization[8] = { + [0] 16, + [1] 12, + [2] 20, + [3 ... 7] = -1, + }; + #else /* ! __GNUC__ */ + static gint quantization[8] = { + 16, + 12, + 20, + -1, + -1, + -1, + -1, + -1, + }; + #endif /* ! __GNUC__ */ + + + + #if HAVE_LIBPOPT + static void + dv_audio_popt_callback(poptContext con, enum poptCallbackReason reason, + const struct poptOption * opt, const char * arg, const void * data) + { + dv_audio_t *audio = (dv_audio_t *)data; + + if((audio->arg_audio_frequency < 0) || (audio->arg_audio_frequency > 3)) { + dv_opt_usage(con, audio->option_table, DV_AUDIO_OPT_FREQUENCY); + } /* if */ + + if((audio->arg_audio_quantization < 0) || (audio->arg_audio_quantization > 2)) { + dv_opt_usage(con, audio->option_table, DV_AUDIO_OPT_QUANTIZATION); + } /* if */ + + if((audio->arg_audio_emphasis < 0) || (audio->arg_audio_emphasis > 2)) { + dv_opt_usage(con, audio->option_table, DV_AUDIO_OPT_EMPHASIS); + } /* if */ + + } /* dv_audio_popt_callback */ + #endif /* HAVE_LIBPOPT */ + + static gint + dv_audio_samples_per_frame(dv_aaux_as_t *dv_aaux_as, gint freq) { + gint result = -1; + gint col; + + switch(freq) { + case 48000: + col = 0; + break; + case 44100: + col = 1; + break; + case 32000: + col = 2; + break; + default: + goto unknown_freq; + break; + } + if(!(dv_aaux_as->pc3.system < 2)) goto unknown_format; + + result = dv_aaux_as->pc1.af_size + min_samples[dv_aaux_as->pc3.system][col]; + done: + return(result); + + unknown_format: + fprintf(stderr, "libdv(%s): badly formed AAUX AS data [pc3.system:%d, pc4.smp:%d]\n", + __FUNCTION__, dv_aaux_as->pc3.system, dv_aaux_as->pc4.smp); + goto done; + + unknown_freq: + fprintf(stderr, "libdv(%s): frequency %d not supported\n", + __FUNCTION__, freq); + goto done; + } /* dv_audio_samples_per_frame */ + + /* Take a DV 12bit audio sample upto 16 bits. + * See IEC 61834-2, Figure 16, on p. 129 */ + + static __inline__ gint32 + dv_upsample(gint32 sample) { + gint32 shift, result; + + shift = (sample & 0xf00) >> 8; + switch(shift) { + + #ifdef __GNUC__ + case 0x2 ... 0x7: + shift--; + result = (sample - (256 * shift)) << shift; + break; + case 0x8 ... 0xd: + shift = 0xe - shift; + result = ((sample + ((256 * shift) + 1)) << shift) - 1; + break; + #else /* ! __GNUC__ */ + case 0x2: + case 0x3: + case 0x4: + case 0x5: + case 0x6: + case 0x7: + shift--; + result = (sample - (256 * shift)) << shift; + break; + case 0x8: + case 0x9: + case 0xa: + case 0xb: + case 0xc: + case 0xd: + shift = 0xe - shift; + result = ((sample + ((256 * shift) + 1)) << shift) - 1; + break; + #endif /* ! __GNUC__ */ + + default: + result = sample; + break; + } /* switch */ + return(result); + } /* dv_upsample */ + + dv_audio_t * + dv_audio_new(void) + { + dv_audio_t *result; + + if(!(result = (dv_audio_t *)calloc(1,sizeof(dv_audio_t)))) goto no_mem; + + #if HAVE_LIBPOPT + result->option_table[DV_AUDIO_OPT_FREQUENCY] = (struct poptOption){ + longName: "frequency", + shortName: 'f', + argInfo: POPT_ARG_INT, + arg: &result->arg_audio_frequency, + descrip: "audio frequency: 0=autodetect [default], 1=32 kHz, 2=44.1 kHz, 3=48 kHz", + argDescrip: "(0|1|2|3)" + }; /* freq */ + + result->option_table[DV_AUDIO_OPT_QUANTIZATION] = (struct poptOption){ + longName: "quantization", + shortName: 'Q', + argInfo: POPT_ARG_INT, + arg: &result->arg_audio_quantization, + descrip: "audio quantization: 0=autodetect [default], 1=12 bit, 2=16bit", + argDescrip: "(0|1|2)" + }; /* quant */ + + result->option_table[DV_AUDIO_OPT_EMPHASIS] = (struct poptOption){ + longName: "emphasis", + shortName: 'e', + argInfo: POPT_ARG_INT, + arg: &result->arg_audio_emphasis, + descrip: "first-order preemphasis of 50/15 us: 0=autodetect [default], 1=on, 2=off", + argDescrip: "(0|1|2)" + }; /* quant */ + + result->option_table[DV_AUDIO_OPT_CALLBACK] = (struct poptOption){ + argInfo: POPT_ARG_CALLBACK|POPT_CBFLAG_POST, + arg: dv_audio_popt_callback, + descrip: (char *)result, /* data passed to callback */ + }; /* callback */ + + #endif /* HAVE_LIBPOPT */ + return(result); + + no_mem: + return(result); + } /* dv_audio_new */ + + void + dv_dump_aaux_as(void *buffer, int ds, int audio_dif) + { + dv_aaux_as_t *dv_aaux_as; + + dv_aaux_as = (dv_aaux_as_t *)buffer + 3; /* Is this correct after cast? */ + + if(dv_aaux_as->pc0 == 0x50) { + /* AAUX AS */ + + printf("DS %d, Audio DIF %d, AAUX AS pack: ", ds, audio_dif); + + if(dv_aaux_as->pc1.lf) { + printf("Unlocked audio"); + } else { + printf("Locked audio"); + } + + printf(", Sampling "); + printf("%.1f kHz", (float)frequency[dv_aaux_as->pc4.smp] / 1000.0); + + printf(" (%d samples, %d fields)", + dv_audio_samples_per_frame(dv_aaux_as,frequency[dv_aaux_as->pc4.smp]), + (dv_aaux_as->pc3.system ? 50 : 60)); + + printf(", Quantization %d bits", quantization[dv_aaux_as->pc4.qu]); + + printf(", Emphasis %s\n", (dv_aaux_as->pc4.ef ? "off" : "on")); + + } else { + + fprintf(stderr, "libdv(%s): Missing AAUX AS PACK!\n", __FUNCTION__); + + } /* else */ + + } /* dv_dump_aaux_as */ + + gboolean + dv_parse_audio_header(dv_decoder_t *decoder, guchar *inbuf) + { + dv_audio_t *audio = decoder->audio; + dv_aaux_as_t *dv_aaux_as = (dv_aaux_as_t *) (inbuf + 80*6+80*16*3 + 3); + dv_aaux_asc_t *dv_aaux_asc = (dv_aaux_asc_t *)(inbuf + 80*6+80*16*4 + 3); + gboolean normal_speed = FALSE; + + if((dv_aaux_as->pc0 != 0x50) || (dv_aaux_asc->pc0 != 0x51)) goto bad_id; + + audio->max_samples = max_samples[dv_aaux_as->pc3.system][dv_aaux_as->pc4.smp]; + /* For now we assume that 12bit = 4 channels */ + if(dv_aaux_as->pc4.qu > 1) goto unsupported_quantization; + /*audio->num_channels = (dv_aaux_as->pc4.qu+1) * 2; // TODO verify this is right with known 4-channel input */ + + audio->num_channels = 2; /* TODO verify this is right with known 4-channel input */ + + switch(audio->arg_audio_frequency) { + case 0: + audio->frequency = frequency[dv_aaux_as->pc4.smp]; + break; + case 1: + audio->frequency = 32000; + break; + case 2: + audio->frequency = 44100; + break; + case 3: + audio->frequency = 44100; + break; + } /* switch */ + + switch(audio->arg_audio_quantization) { + case 0: + audio->quantization = quantization[dv_aaux_as->pc4.qu]; + break; + case 1: + audio->quantization = 12; + break; + case 2: + audio->quantization = 16; + break; + } /* switch */ + + switch(audio->arg_audio_emphasis) { + case 0: + if(decoder->std == e_dv_std_iec_61834) { + audio->emphasis = (dv_aaux_as->pc4.ef == 0); + } else if(decoder->std == e_dv_std_iec_61834) { + audio->emphasis = (dv_aaux_asc->pc1.ss == 1); + } else { + /* TODO: should never happen... */ + } + break; + case 1: + audio->emphasis = TRUE; + break; + case 2: + audio->emphasis = FALSE; + break; + } /* switch */ + + audio->samples_this_frame = dv_audio_samples_per_frame(dv_aaux_as,audio->frequency); + + audio->aaux_as = *dv_aaux_as; + audio->aaux_asc = *dv_aaux_asc; + + if(decoder->std == e_dv_std_iec_61834) { + normal_speed = (dv_aaux_asc->pc3.speed == 0x20); + } else if(decoder->std == e_dv_std_iec_61834) { + if(dv_aaux_as->pc3.system) { + /* PAL */ + normal_speed = (dv_aaux_asc->pc3.speed == 0x64); + } else { + /* NTSC */ + normal_speed = (dv_aaux_asc->pc3.speed == 0x78); + } /* else */ + } /* else */ + + return(normal_speed); /* don't do audio if speed is not 1 */ + + bad_id: + return(FALSE); + + unsupported_quantization: + fprintf(stderr, "libdv(%s): Malformrmed AAUX AS? pc4.qu == %d\n", + __FUNCTION__, audio->aaux_as.pc4.qu); + return(FALSE); + + } /* dv_parse_audio_header */ + + gboolean + dv_update_num_samples(dv_audio_t *dv_audio, guint8 *inbuf) { + + dv_aaux_as_t *dv_aaux_as = (dv_aaux_as_t *)(inbuf + 80*6+80*16*3 + 3); + + if(dv_aaux_as->pc0 != 0x50) goto bad_id; + dv_audio->samples_this_frame = dv_audio_samples_per_frame(dv_aaux_as,dv_audio->frequency); + return(TRUE); + + bad_id: + return(FALSE); + + } /* dv_update_num_samples */ + + /* This code originates from cdda2wav, by way of Giovanni Iachello + to Arne Schirmacher . */ + void + dv_audio_deemphasis(dv_audio_t *audio, gint16 *outbuf) + { + gint i; + /* this implements an attenuation treble shelving filter + to undo the effect of pre-emphasis. The filter is of + a recursive first order */ + /* static */ short lastin[2] = { 0, 0 }; + /* static */ double lastout[2] = { 0.0, 0.0 }; + short *pmm; + /* See deemphasis.gnuplot */ + double V0 = 0.3365; + double OMEGAG = (1./19e-6); + double T = (1./audio->frequency); + double H0 = (V0-1.); + double B = (V0*tan((OMEGAG * T)/2.0)); + double a1 = ((B - 1.)/(B + 1.)); + double b0 = (1.0 + (1.0 - a1) * H0/2.0); + double b1 = (a1 + (a1 - 1.0) * H0/2.0); + + /* For 48Khz: a1= -0.659065 b0= 0.449605 b1= -0.108670 + * For 44.1Khz: a1=-0.62786881719628784282 b0= 0.45995451989513153057 b1=-0.08782333709141937339 + * For 32kHZ ? */ + + for (pmm = (short *)outbuf, i=0; + i < audio->samples_this_frame; + i++) { + lastout[0] = *pmm * b0 + lastin[0] * b1 - lastout[0] * a1; + lastin[0] = *pmm; + *pmm++ = lastout[0] > 0.0 ? lastout[0] + 0.5 : lastout[0] - 0.5; + } /* for */ + + } /* dv_audio_deemphasis */ + + + gint + dv_decode_audio_block(dv_audio_t *dv_audio, guint8 *inbuf, gint ds, gint audio_dif, gint16 **outbufs) + { + gint channel, bp, i_base, i, stride; + gint16 *samples, *ysamples, *zsamples; + gint16 y,z; + gint32 msb_y, msb_z, lsb; + gint half_ds; + + #if 0 + if ((inbuf[0] & 0xe0) != 0x60) goto bad_id; + #endif + + half_ds = (dv_audio->aaux_as.pc3.system ? 6 : 5); + + if(ds < half_ds) { + channel = 0; + } else { + channel = 1; + ds -= half_ds; + } /* else */ + + if(dv_audio->aaux_as.pc3.system) { + /* PAL */ + i_base = dv_audio_unshuffle_50[ds][audio_dif]; + stride = 54; + } else { + /* NTSC */ + i_base = dv_audio_unshuffle_60[ds][audio_dif]; + stride = 45; + } /* else */ + + if(dv_audio->quantization == 16) { + + samples = outbufs[channel]; + + for (bp = 8; bp < 80; bp+=2) { + + i = i_base + (bp - 8)/2 * stride; + samples[i] = ((gint16)inbuf[bp] << 8) | inbuf[bp+1]; + + } /* for */ + + } else if(dv_audio->quantization == 12) { + + /* See 61834-2 figure 18, and text of section 6.5.3 and 6.7.2 */ + + ysamples = outbufs[channel * 2]; + zsamples = outbufs[1 + channel * 2]; + + for (bp = 8; bp < 80; bp+=3) { + + i = i_base + (bp - 8)/3 * stride; + + msb_y = inbuf[bp]; + msb_z = inbuf[bp+1]; + lsb = inbuf[bp+2]; + + y = ((msb_y << 4) & 0xff0) | ((lsb >> 4) & 0xf); + if(y > 2047) y -= 4096; + z = ((msb_z << 4) & 0xff0) | (lsb & 0xf); + if(z > 2047) z -= 4096; + + ysamples[i] = dv_upsample(y); + zsamples[i] = dv_upsample(z); + } /* for */ + + } else { + goto unsupported_sampling; + } /* else */ + + return(0); + + unsupported_sampling: + fprintf(stderr, "libdv(%s): unsupported audio sampling.\n", __FUNCTION__); + return(-1); + + #if 0 + bad_id: + fprintf(stderr, "libdv(%s): not an audio block\n", __FUNCTION__); + return(-1); + #endif + + } /* dv_decode_audio_block */ diff -C2 -r -N bcast-2000c/quicktime/libdv/audio.h bcast-2000c-mf3/quicktime/libdv/audio.h *** bcast-2000c/quicktime/libdv/audio.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/audio.h Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,47 ---- + /* + * audio.h + * + * Copyright (C) Charles 'Buck' Krasic - January 2001 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + #ifndef DV_AUDIO_H + #define DV_AUDIO_H + + #include + + #ifdef __cplusplus + extern "C" { + #endif + + /* Low-level routines */ + extern dv_audio_t *dv_audio_new(void); + extern gboolean dv_parse_audio_header(dv_decoder_t *decoder, guchar *inbuf); + extern gboolean dv_update_num_samples(dv_audio_t *dv_audio, guint8 *inbuf); + extern gint dv_decode_audio_block(dv_audio_t *dv_audio, guint8 *buffer, gint ds, gint audio_dif, gint16 **outbufs); + extern void dv_audio_deemphasis(dv_audio_t *dv_audio, gint16 *outbuf); + extern void dv_dump_aaux_as(void *buffer, int ds, int audio_dif); + + #ifdef __cplusplus + } + #endif + + #endif // DV_AUDIO_H diff -C2 -r -N bcast-2000c/quicktime/libdv/bitstream.c bcast-2000c-mf3/quicktime/libdv/bitstream.c *** bcast-2000c/quicktime/libdv/bitstream.c Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/bitstream.c Mon Oct 1 05:16:38 2001 *************** *** 4,11 **** * Copyright (C) Aaron Holtzman - Dec 1999 * Modified by Erik Walthinsen - Feb 2000 ! * Modified by Charles 'Buck' Krasic - April 2000 * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * decoder. * * This file was originally part of mpeg2dec, a free MPEG-2 video --- 4,11 ---- * Copyright (C) Aaron Holtzman - Dec 1999 * Modified by Erik Walthinsen - Feb 2000 ! * Modified by Charles 'Buck' Krasic - April 2000 * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * codec. * * This file was originally part of mpeg2dec, a free MPEG-2 video *************** *** 29,34 **** --- 29,39 ---- */ + #ifdef HAVE_CONFIG_H + #include + #endif + #include #include + #include #include "bitstream.h" diff -C2 -r -N bcast-2000c/quicktime/libdv/bitstream.h bcast-2000c-mf3/quicktime/libdv/bitstream.h *** bcast-2000c/quicktime/libdv/bitstream.h Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/bitstream.h Mon Oct 1 05:16:38 2001 *************** *** 7,14 **** * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * decoder. * * This file was originally part of mpeg2dec, a free MPEG-2 video ! * decoder. * * libdv is free software; you can redistribute it and/or modify it --- 7,14 ---- * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * codec. * * This file was originally part of mpeg2dec, a free MPEG-2 video ! * codec. * * libdv is free software; you can redistribute it and/or modify it *************** *** 29,58 **** * */ ! #ifndef __BITSTREAM_H__ ! #define __BITSTREAM_H__ ! #include //My new and improved vego-matic endian swapping routine //(stolen from the kernel) # define swab32(x)\ ((((guint8*)&x)[0] << 24) | (((guint8*)&x)[1] << 16) | \ (((guint8*)&x)[2] << 8) | (((guint8*)&x)[3])) ! ! typedef struct bitstream_s { ! guint32 current_word; ! guint32 next_word; ! guint16 bits_left; ! guint16 next_bits; ! ! guint8 *buf; ! guint32 buflen; ! gint32 bufoffset; ! ! guint32 (*bitstream_next_buffer) (guint8 **,void *); ! void *priv; ! ! gint32 bitsread; ! } bitstream_t; bitstream_t *bitstream_init(); --- 29,50 ---- * */ ! #ifndef DV_BITSTREAM_H ! #define DV_BITSTREAM_H ! #include ! ! #ifdef __cplusplus ! extern "C" { ! #endif //My new and improved vego-matic endian swapping routine //(stolen from the kernel) + #if defined(WORDS_BIGENDIAN) + #define swab32(x) (x) + #else // LITTLE_ENDIAN # define swab32(x)\ ((((guint8*)&x)[0] << 24) | (((guint8*)&x)[1] << 16) | \ (((guint8*)&x)[2] << 8) | (((guint8*)&x)[3])) ! #endif // LITTLE_ENDIAN bitstream_t *bitstream_init(); *************** *** 209,211 **** ! #endif /* __BITSTREAM_H__ */ --- 201,207 ---- ! #ifdef __cplusplus ! } ! #endif ! ! #endif /* DV_BITSTREAM_H */ diff -C2 -r -N bcast-2000c/quicktime/libdv/c_flags bcast-2000c-mf3/quicktime/libdv/c_flags *** bcast-2000c/quicktime/libdv/c_flags Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/c_flags Thu Jan 1 01:00:00 1970 *************** *** 1 **** - echo $CFLAGS --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/libdv/dct.c bcast-2000c-mf3/quicktime/libdv/dct.c *** bcast-2000c/quicktime/libdv/dct.c Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/dct.c Mon Oct 1 05:16:38 2001 *************** *** 6,10 **** * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * decoder. * * libdv is free software; you can redistribute it and/or modify it --- 6,10 ---- * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * codec. * * libdv is free software; you can redistribute it and/or modify it *************** *** 25,51 **** */ #include #include "dct.h" static double KC248[8][4][4][8]; ! static double KC88[8][8][8][8]; static double C[8]; ! void dct_init(void) { ! int x, y, z, h, v, u, i; ! ! for (x = 0; x < 8; x++) { ! for (z = 0; z < 4; z++) { ! for (u = 0; u < 4; u++) { ! for (h = 0; h < 8; h++) { ! KC248[x][z][u][h] = ! cos((M_PI * u * ((2.0 * z) + 1.0)) / 8.0) * ! cos((M_PI * h * ((2.0 * x) + 1.0)) / 16.0); ! } /* for h */ ! } /* for u */ ! } /* for z */ ! } /* for x */ for (x = 0; x < 8; x++) { for (y = 0; y < 8; y++) { --- 25,70 ---- */ + #include + #include + #include + #include "dct.h" + #include "weighting.h" + + #if ARCH_X86 + #include "mmx.h" + #endif /* ARCH_X86 */ + typedef short var; + #if BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 static double KC248[8][4][4][8]; ! #endif /* BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 */ ! ! #if (!ARCH_X86) || BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 static double C[8]; + static double KC88[8][8][8][8]; + #endif /* (!ARCH_X86) || BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 */ ! #if ARCH_X86 ! void idct_block_mmx(gint16 *block); ! void dct_88_block_mmx(gint16* block); ! void dct_block_mmx_postscale_88(gint16* block, gint16* postscale_matrix); ! void dct_block_mmx_postscale_248(gint16* block, gint16* postscale_matrix); ! void dct_248_block_mmx(gint16* block); ! void dct_248_block_mmx_post_sum(gint16* out_block); ! void transpose_mmx(short * dst); ! #endif /* ARCH_X86 */ ! ! extern dv_coeff_t postSC88[64] ALIGN32; ! extern dv_coeff_t postSC248[64] ALIGN32; + void dct_init(void) { + #if BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 + int u, z; + #endif /* BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 */ + #if (!ARCH_X86) || BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 + int x, y, h, v, i; for (x = 0; x < 8; x++) { for (y = 0; y < 8; y++) { *************** *** 59,102 **** } } ! for (i = 0; i < 8; i++) { C[i] = (i == 0 ? 0.5 / sqrt(2.0) : 0.5); } /* for i */ } ! void dct_88(double *block) { int v,h,y,x,i; double temp[64]; ! bzero(temp, sizeof(temp)); ! for (v=0;v<8;v++) { ! for (h=0;h<8;h++) { ! for (y=0;y<8;y++) { ! for (x=0;x<8;x++) { ! temp[v*8+h] += block[y*8+x] * KC88[x][y][h][v]; ! } } ! temp[v*8+h] *= (C[h] * C[v]); } } ! for (i=0;i<64;i++) ! block[i] = temp[i]; } ! void dct_248(double *block) { int u,h,z,x,i; double temp[64]; ! ! bzero(temp, sizeof(temp)); for (u=0;u<4;u++) { for (h=0;h<8;h++) { for (z=0;z<4;z++) { ! for (x=0;x<8;x++) { ! temp[u*8+h] += (block[(2*z)*8+x] + block[(2*z+1)*8+x]) * ! KC248[x][z][u][h]; ! temp[(u+4)*8+h] += (block[(2*z)*8+x] - block[(2*z+1)*8+x]) * ! KC248[x][z][u][h]; ! } } temp[u*8+h] *= (C[h] * C[u]); --- 78,371 ---- } } ! #endif /* (!ARCH_X86) || BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 */ ! #if BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 ! for (x = 0; x < 8; x++) { ! for (z = 0; z < 4; z++) { ! for (u = 0; u < 4; u++) { ! for (h = 0; h < 8; h++) { ! KC248[x][z][u][h] = ! cos((M_PI * u * ((2.0 * z) + 1.0)) / 8.0) * ! cos((M_PI * h * ((2.0 * x) + 1.0)) / 16.0); ! } /* for h */ ! } /* for u */ ! } /* for z */ ! } /* for x */ ! #endif /* BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 */ ! #if (!ARCH_X86) || BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 for (i = 0; i < 8; i++) { C[i] = (i == 0 ? 0.5 / sqrt(2.0) : 0.5); } /* for i */ + #endif /* (!ARCH_X86) || BRUTE_FORCE_DCT_248 || BRUTE_FORCE_DCT_88 */ + } + + #if 0 + /* Optimized out using integer fixpoint */ + /* for DCT */ + #define A1 0.70711 + #define A2 0.54120 + #define A3 0.70711 + #define A4 1.30658 + #define A5 0.38268 + #endif + + static void dct88_aan_line(short* in, short* out) + { + var v0, v1, v2, v3, v4, v5, v6, v7; + var v00,v01,v02,v03,v04,v05,v06,v07; + var v10,v11,v12,v13,v14,v15,v16; + var v20,v21,v22; + var v32,v34,v35,v36; + var v42,v43,v45,v47; + var v54,v55,v56,v57,va0; + + v0 = in[0]; + v1 = in[1]; + v2 = in[2]; + v3 = in[3]; + v4 = in[4]; + v5 = in[5]; + v6 = in[6]; + v7 = in[7]; + + /* first butterfly stage */ + v00 = v0+v7; /* 0 */ + v07 = v0-v7; /* 7 */ + v01 = v1+v6; /* 1 */ + v06 = v1-v6; /* 6 */ + v02 = v2+v5; /* 2 */ + v05 = v2-v5; /* 5 */ + v03 = v3+v4; /* 3 */ + v04 = v3-v4; /* 4 */ + + /* second low butterfly */ + v10=v00+v03; /* 0 */ + v13=v00-v03; /* 3 */ + v11=v01+v02; /* 1 */ + v12=v01-v02; /* 2 */ + + /* second high */ + v16=v06+v07; /* 6 */ + v15=v05+v06; /* 5 */ + v14=-(v04+v05); /* 4 */ + /* 7 v77 without change */ + + /* third (only 3 real new terms) */ + v20=v10+v11; /* 0 */ + v21=v10-v11; /* 1 */ + v22=v12+v13; /* 2 */ + #if 0 + va0=(v14+v16)*A5; /* temporary for A5 multiply */ + #endif + va0=((v14+v16)*25079) >> 16; /* temporary for A5 multiply */ + + /* fourth */ + #if 0 + v32=v22*A1; /* 2 */ + v34=-(v14*A2+va0); /* 4 ? */ + v36=v16*A4-va0; /* 6 ? */ + v35=v15*A3; /* 5 */ + #endif + + v32=(v22*23171) >> 15; /* 2 */ + v34=-(((v14*17734) >> 15)+va0); /* 4 ? */ + v36=((v16*21407) >> 14)-va0; /* 6 ? */ + v35=(v15*23171) >> 15; /* 5 */ + + /* fifth */ + v42=v32+v13; /* 2 */ + v43=v13-v32; /* 3 */ + v45=v07+v35; /* 5 */ + v47=v07-v35; /* 7 */ + + /* last */ + v54=v34+v47; /* 4 */ + v57=v47-v34; /* 7 */ + v55=v45+v36; /* 5 */ + v56=v45-v36; /* 5 */ + + /* output butterfly */ + + out[0] = v20; + out[1] = v55; + out[2] = v42; + out[3] = v57; + out[4] = v21; + out[5] = v54; + out[6] = v43; + out[7] = v56; + } + + + static void dct44_aan_line(short* in, short* out) + { + var v00,v01,v02,v03; + var v10,v11,v12,v13; + var v20,v21,v22; + var v32; + var v42,v43; + + /* first butterfly stage */ + v00 = in[0]; + v01 = in[2]; + v02 = in[4]; + v03 = in[6]; + + /* second low butterfly */ + v10=v00+v03; /* 0 */ + v13=v00-v03; /* 3 */ + v11=v01+v02; /* 1 */ + v12=v01-v02; /* 2 */ + + /* third (only 3 real new terms) */ + v20=v10+v11; /* 0 */ + v21=v10-v11; /* 1 */ + v22=v12+v13; /* 2 */ + + /* fourth */ + + v32=(v22*23171) >> 15; /* 2 */ + + /* fifth */ + v42=v32+v13; /* 2 */ + v43=v13-v32; /* 3 */ + + /* output butterfly */ + + out[0] = v20; + out[2] = v42; + out[4] = v21; + out[6] = v43; + } + + void postscale88(var v[64]) + { + int i; + int factor = pow(2, 16 + DCT_YUV_PRECISION); + for( i = 0; i < 64; i++ ) { + v[i] = ( v[i] * postSC88[i] ) / factor; + } + } + + /* Input has to be transposed ! */ + + static inline void dct88_aan(short *s_in) + { + int i,j,r,c; + short s_out[64]; + + for(c = 0; c < 64; c += 8 ) /* columns */ + dct88_aan_line(s_in + c, s_in + c); + + for(i = 0; i < 8; i++) { + for (j = 0; j < 8; j++) { + s_out[i * 8 + j] = s_in[j * 8 + i]; + } + } + + for(r = 0; r < 64; r += 8 ) /* then rows */ + dct88_aan_line(s_out + r, s_out + r); + + memcpy(s_in, s_out, 64 * sizeof(short)); + } + + /* Input has to be transposed ! */ + + static inline void dct248_aan(short *s_in) + { + int i,j,r,c; + short s_out[64]; + + for(c = 0; c < 64; c += 8 ) { /* columns */ + dct44_aan_line(s_in + c, s_in + c); + dct44_aan_line(s_in + c + 1, s_in + c + 1); + } + + for(i = 0; i < 8; i++) { + for (j = 0; j < 8; j++) { + s_out[i * 8 + j] = s_in[j * 8 + i]; + } + } + + for(r = 0; r < 64; r += 8 ) { /* then rows */ + dct88_aan_line(s_out + r, s_out + r); + } + + for(i = 0; i < 4; i++) { + for (j = 0; j < 8; j++) { + s_in[i * 8 + j] = s_out[i * 16 + j] + + s_out[i * 16 + 8 + j]; + s_in[i * 8 + 32 + j] = s_out[i * 16 + j] + - s_out[i * 16 + 8 + j]; + } + } + } + + void postscale248(var v[64]) + { + int i; + int factor = pow(2, 16 + DCT_YUV_PRECISION); + for( i=0; i<64; i++ ) { + v[i] = ( v[i] * postSC248[i] ) / factor; + } } ! /* Input has to be transposed !!! */ ! ! void dct_88(dv_coeff_t *block) { ! #if !ARCH_X86 ! #if BRUTE_FORCE_DCT_88 int v,h,y,x,i; double temp[64]; + int factor = pow(2, DCT_YUV_PRECISION); ! memset(temp,0,sizeof(temp)); ! for (v = 0; v < 8; v++) { ! for (h = 0; h < 8; h++) { ! for (y = 0;y < 8; y++) { ! for (x = 0;x < 8; x++) { ! temp[v * 8 + h] += block[x * 8 + y] ! * KC88[x][y][h][v]; ! } } ! temp[v * 8 + h] *= (C[h] * C[v]); } } ! for (i = 0; i < 64; i++) { ! block[i] = temp[i] / factor; ! } ! #else /* BRUTE_FORCE_DCT_88 */ ! dct88_aan(block); ! postscale88(block); ! #endif /* BRUTE_FORCE_DCT_88 */ ! #else /* ARCH_X86 */ ! dct_88_block_mmx(block); ! transpose_mmx(block); ! dct_88_block_mmx(block); ! dct_block_mmx_postscale_88(block, postSC88); ! emms(); ! #endif /* ARCH_X86 */ } ! /* Input has to be transposed !!! */ ! ! void dct_248(dv_coeff_t *block) ! { ! #if !ARCH_X86 ! #if BRUTE_FORCE_DCT_248 int u,h,z,x,i; double temp[64]; ! int factor = pow(2, DCT_YUV_PRECISION); ! ! memset(temp,0,sizeof(temp)); for (u=0;u<4;u++) { for (h=0;h<8;h++) { for (z=0;z<4;z++) { ! for (x=0;x<8;x++) { ! temp[u*8+h] += (block[x*8+2*z] + block[x*8+(2*z+1)]) * ! KC248[x][z][u][h]; ! temp[(u+4)*8+h] += (block[x*8+2*z] - block[x*8+(2*z+1)]) * ! KC248[x][z][u][h]; ! } } temp[u*8+h] *= (C[h] * C[u]); *************** *** 106,146 **** for (i=0;i<64;i++) ! block[i] = temp[i]; } ! void idct_block_mmx(gint16 *block); ! ! void idct_88(dv_coeff_t *block) { int v,h,y,x,i; double temp[64]; ! bzero(temp, sizeof(temp)); for (v=0;v<8;v++) { for (h=0;h<8;h++) { for (y=0;y<8;y++){ ! for (x=0;x<8;x++) { ! temp[y*8+x] += C[v] * C[h] * block[v*8+h] * KC88[x][y][h][v]; ! } } } } ! for (i=0;i<64;i++) block[i] = temp[i]; } ! #if 0 ! void idct_248(double *block) { int u,h,z,x,i; double temp[64]; double temp2[64]; double b,c; ! double (*in)[8][8], (*out)[8][8]; /* don't really need storage -- fixup later */ ! bzero(temp, sizeof(temp)); out = &temp; in = &temp2; - for(z=0;z<8;z++) { --- 375,441 ---- for (i=0;i<64;i++) ! block[i] = temp[i] / factor; ! #else /* BRUTE_FORCE_DCT_248 */ ! dct248_aan(block); ! postscale248(block); ! #endif /* BRUTE_FORCE_DCT_248 */ ! #else /* ARCH_X86 */ ! dct_88_block_mmx(block); ! transpose_mmx(block); ! dct_248_block_mmx(block); ! dct_248_block_mmx_post_sum(block); ! dct_block_mmx_postscale_248(block, postSC248); ! emms(); ! #endif /* ARCH_X86 */ } ! void idct_88(dv_coeff_t *block) ! { ! #if !ARCH_X86 int v,h,y,x,i; double temp[64]; ! memset(temp,0,sizeof(temp)); for (v=0;v<8;v++) { for (h=0;h<8;h++) { for (y=0;y<8;y++){ ! for (x=0;x<8;x++) { ! temp[y*8+x] += C[v] * C[h] * block[v*8+h] * KC88[x][y][h][v]; ! } } } } ! for (i=0;i<64;i++) block[i] = temp[i]; + #else + idct_block_mmx(block); + emms(); + #endif } ! #if BRUTE_FORCE_248 ! ! void idct_248(double *block) ! { int u,h,z,x,i; double temp[64]; double temp2[64]; double b,c; ! double (*in)[8][8], (*out)[8][8]; /* don't really need storage ! -- fixup later */ ! #if 0 ! /* This is to identify visually where 248 blocks are... */ ! for(i=0;i<64;i++) { ! block[i] = 235 - 128; ! } ! return; ! #endif ! ! memset(temp,0,sizeof(temp)); out = &temp; in = &temp2; for(z=0;z<8;z++) { *************** *** 148,164 **** (*in)[z][x] = block[z*8+x]; } ! for (x = 0; x < 8; x++) { ! for (z = 0; z < 4; z++) { ! for (u = 0; u < 4; u++) { ! for (h = 0; h < 8; h++) { ! b = (double)(*in)[u][h]; ! c = (double)(*in)[u+4][h]; ! (*out)[2*z][x] += C[u] * C[h] * (b + c) * KC248[x][z][u][h]; ! (*out)[2*z+1][x] += C[u] * C[h] * (b - c) * KC248[x][z][u][h]; ! } /* for h */ ! } /* for u */ ! } /* for z */ ! } /* for x */ for(z=0;z<8;z++) { --- 443,474 ---- (*in)[z][x] = block[z*8+x]; } + + for (x = 0; x < 8; x++) { + for (z = 0; z < 4; z++) { + for (u = 0; u < 4; u++) { + for (h = 0; h < 8; h++) { + b = (double)(*in)[u][h]; + c = (double)(*in)[u+4][h]; + (*out)[2*z][x] += C[u] * C[h] * (b + c) * KC248[x][z][u][h]; + (*out)[2*z+1][x] += C[u] * C[h] * (b - c) * KC248[x][z][u][h]; + } /* for h */ + } /* for u */ + } /* for z */ + } /* for x */ ! #if 0 ! for (u=0;u<4;u++) { ! for (h=0;h<8;h++) { ! for (z=0;z<4;z++) { ! for (x=0;x<8;x++) { ! b = block[u*8+h]; ! c = block[(u+4)*8+h]; ! temp[(2*u)*8+h] += C[h] * C[u] * (b + c) * KC248[x][z][h][u]; ! temp[(2*u+1)*8+h] += C[h] * C[u] * (b - c) * KC248[x][z][h][u]; ! } ! } ! } ! } ! #endif for(z=0;z<8;z++) { *************** *** 168,170 **** } ! #endif --- 478,481 ---- } ! ! #endif /* BRUTE_FORCE_248 */ diff -C2 -r -N bcast-2000c/quicktime/libdv/dct.h bcast-2000c-mf3/quicktime/libdv/dct.h *** bcast-2000c/quicktime/libdv/dct.h Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/dct.h Mon Oct 1 05:16:38 2001 *************** *** 6,10 **** * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * decoder. * * libdv is free software; you can redistribute it and/or modify it --- 6,10 ---- * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * codec. * * libdv is free software; you can redistribute it and/or modify it *************** *** 25,36 **** */ ! #ifndef __DCT_H__ ! #define __DCT_H__ ! #include "dv.h" void dct_init(void); ! void dct_88(double *block); ! void dct_248(double *block); void idct_88(dv_coeff_t *block); #if BRUTE_FORCE_248 --- 25,47 ---- */ ! #ifndef DV_DCT_H ! #define DV_DCT_H ! #include ! ! #define DCT_YUV_PRECISION 1 /* means fixpoint with YUV_PRECISION bits ! after the point (if you change this, ! change rgbtoyuv.S and dct_block_mmx.S ! accordingly) */ ! ! #ifdef __cplusplus ! extern "C" { ! #endif void dct_init(void); ! /* Input is transposed ! */ ! void dct_88(dv_coeff_t *block); ! /* Input is transposed ! */ ! void dct_248(dv_coeff_t *block); void idct_88(dv_coeff_t *block); #if BRUTE_FORCE_248 *************** *** 38,40 **** #endif ! #endif // __DCT_H__ --- 49,55 ---- #endif ! #ifdef __cplusplus ! } ! #endif ! ! #endif // DV_DCT_H diff -C2 -r -N bcast-2000c/quicktime/libdv/dct_block_mmx.S bcast-2000c-mf3/quicktime/libdv/dct_block_mmx.S *** bcast-2000c/quicktime/libdv/dct_block_mmx.S Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/dct_block_mmx.S Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,1207 ---- + /* + * dct_block_mmx.S + * + * Copyright (C) Peter Schlaile - February 2001 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + # esi - input and output data pointer + # the input data each 16 bit element in the 8x8 matrix is left aligned: + # the output data is tranposed and each 16 bit element in the 8x8 matrix is left aligned: + # e.g. in 11...1110000 format + # israelh. 11/11/97 removed emms. moved to stub + # MMX implementation. Using MMX transpose + + #define YUV_PRECISION 1 + + #define NSHIFT 15 + #define PRESHIFT 1 + #define WA4_SHIFT (NSHIFT-1) + #define WA5_SHIFT (NSHIFT+1) + + + .data + + .align 8 + + WA1: .word 23171,23171,23171,23171 /* 0.70711 * 32768 */ + WA2: .word 17734,17734,17734,17734 /* 0.54120 * 32768 */ + WA3: .word 23171,23171,23171,23171 /* 0.70711 * 32768 */ + WA4: .word 21407,21407,21407,21407 /* 1.30658 * 16384 */ + WA5: .word 25079,25079,25079,25079 /* 0.38268 * 65536 */ + + scratch1: .quad 0 + scratch2: .quad 0 + scratch3: .quad 0 + scratch4: .quad 0 + + .text + + .align 8 + .global dct_88_block_mmx + dct_88_block_mmx: + + pushl %ebp + movl %esp, %ebp + pushl %esi + + movl 8(%ebp), %esi # source + + # column 0 + movq 16*0(%esi), %mm0 # v0 + movq 16*7(%esi), %mm1 # v7 + movq %mm0, %mm2 # duplicate v0 + paddw %mm1, %mm0 # v00: v0+v7 + psubw %mm1, %mm2 # v07: v0-v7 + + movq 16*1(%esi), %mm1 # v1 + movq 16*6(%esi), %mm3 # v6 + movq %mm1, %mm4 # duplicate v1 + paddw %mm3, %mm1 # v01: v1+v6 + psubw %mm3, %mm4 # v06: v1-v6 + + movq 16*2(%esi), %mm3 # v2 + movq 16*5(%esi), %mm5 # v5 + movq %mm3, %mm6 # duplicate v2 + paddw %mm5, %mm3 # v02: v2+v5 + psubw %mm5, %mm6 # v05: v2-v5 + + movq 16*3(%esi), %mm5 # v3 + movq 16*4(%esi), %mm7 # v4 + movq %mm7, scratch1 # scratch1: v4 ; + movq %mm5, %mm7 # duplicate v3 + paddw scratch1, %mm5 # v03: v3+v4 + psubw scratch1, %mm7 # v04: v3-v4 + movq %mm5, scratch2 # scratch2: v03 + movq %mm0, %mm5 # mm5: v00 + + paddw scratch2, %mm0 # v10: v00+v03 + psubw scratch2, %mm5 # v13: v00-v03 + movq %mm3, scratch3 # scratch3: v02 + movq %mm1, %mm3 # duplicate v01 + + paddw scratch3, %mm1 # v11: v01+v02 + psubw scratch3, %mm3 # v12: v01-v02 + + movq %mm6, scratch4 # scratch4: v05 + movq %mm0, %mm6 # duplicate v10 + + paddw %mm1, %mm0 # v10+v11 + psubw %mm1, %mm6 # v10-v11 + + movq %mm0, (%esi) # out0: v10+v11 + movq %mm6, 16*4(%esi) # out4: v10-v11 + + movq %mm4, %mm0 # mm0: v06 + paddw scratch4, %mm4 # v15: v05+v06 + paddw %mm2, %mm0 # v16: v07+v06 + + pmulhw WA3, %mm4 # v35~: WA3*v15 + psllw $1, %mm4 # v35: compensate the coeefient scale + + movq %mm4, %mm6 # duplicate v35 + paddw %mm2, %mm4 # v45: v07+v35 + psubw %mm6, %mm2 # v47: v07-v35 + + paddw %mm5, %mm3 # v22: v12+v13 + + pmulhw WA1, %mm3 # v32~: WA1*v22 + psllw $16-NSHIFT, %mm3 # v32: compensate the coeefient scale + movq %mm5, %mm6 # duplicate v13 + + paddw %mm3, %mm5 # v13+v32 + psubw %mm3, %mm6 # v13-v32 + + movq %mm5, 16*2(%esi) # out2: v13+v32 + movq %mm6, 16*6(%esi) # out6: v13-v32 + + + paddw scratch4, %mm7 # v14n: v04+v05 + movq %mm0, %mm5 # duplicate v16 + + psubw %mm7, %mm0 # va1: v16-v14n + pmulhw WA5, %mm0 # va0~: va1*WA5 + pmulhw WA4, %mm5 # v36~~: v16*WA4 + pmulhw WA2, %mm7 # v34~~: v14n*WA2 + psllw $16-WA4_SHIFT, %mm5 # v36: compensate the coeefient scale + psllw $16-NSHIFT, %mm7 # v34: compensate the coeefient scale + + psubw %mm0, %mm5 # v36~: v36~~-va0~ + psubw %mm0, %mm7 # v34~: v34~~-va0~ + + movq %mm4, %mm0 # duplicate v45 + paddw %mm5, %mm4 # v45+v36 + psubw %mm5, %mm0 # v45-v36 + + movq %mm4, 16*1(%esi) # out1: v45+v36 + movq %mm0, 16*7(%esi) # out7: v45-v36 + + movq %mm2, %mm5 # duplicate v47 + paddw %mm7, %mm2 # v47+v34 + psubw %mm7, %mm5 # v47-v34 + + movq %mm2, 16*5(%esi) # out5: v47+v34 + movq %mm5, 16*3(%esi) # out3: v47-v34 + + + # column 1 + + addl $8, %esi # point to the next 4 columns. + # it can be done by adding 8 to + # immediates but this is nicer + + movq (%esi), %mm0 # v0 + movq 16*7(%esi), %mm1 # v7 + movq %mm0, %mm2 # duplicate v0 + paddw %mm1, %mm0 # v00: v0+v7 + psubw %mm1, %mm2 # v07: v0-v7 + + movq 16(%esi), %mm1 # v1 + movq 16*6(%esi), %mm3 # v6 + movq %mm1, %mm4 # duplicate v1 + paddw %mm3, %mm1 # v01: v1+v6 + psubw %mm3, %mm4 # v06: v1-v6 + + movq 16*2(%esi), %mm3 # v2 + movq 16*5(%esi), %mm5 # v5 + movq %mm3, %mm6 # duplicate v2 + paddw %mm5, %mm3 # v02: v2+v5 + psubw %mm5, %mm6 # v05: v2-v5 + + movq 16*3(%esi), %mm5 # v3 + movq 16*4(%esi), %mm7 # v4 + movq %mm7, scratch1 # scratch1: v4 ; + movq %mm5, %mm7 # duplicate v3 + paddw scratch1, %mm5 # v03: v3+v4 + psubw scratch1, %mm7 # v04: v3-v4 + movq %mm5, scratch2 # scratch2: v03 + movq %mm0, %mm5 # mm5: v00 + + paddw scratch2, %mm0 # v10: v00+v03 + psubw scratch2, %mm5 # v13: v00-v03 + movq %mm3, scratch3 # scratc3: v02 + movq %mm1, %mm3 # duplicate v01 + + paddw scratch3, %mm1 # v11: v01+v02 + psubw scratch3, %mm3 # v12: v01-v02 + + movq %mm6, scratch4 # scratc4: v05 + movq %mm0, %mm6 # duplicate v10 + + paddw %mm1, %mm0 # v10+v11 + psubw %mm1, %mm6 # v10-v11 + + movq %mm0, (%esi) # out0: v10+v11 + movq %mm6, 16*4(%esi) # out4: v10-v11 + + movq %mm4, %mm0 # mm0: v06 + paddw scratch4, %mm4 # v15: v05+v06 + paddw %mm2, %mm0 # v16: v07+v06 + + pmulhw WA3, %mm4 # v35~: WA3*v15 + psllw $16-NSHIFT, %mm4 # v35: compensate the coeefient scale + + movq %mm4, %mm6 # duplicate v35 + paddw %mm2, %mm4 # v45: v07+v35 + psubw %mm6, %mm2 # v47: v07-v35 + + paddw %mm5, %mm3 # v22: v12+v13 + + pmulhw WA1, %mm3 # v32~: WA3*v15 + psllw $16-NSHIFT, %mm3 # v32: compensate the coeefient scale + movq %mm5, %mm6 # duplicate v13 + + paddw %mm3, %mm5 # v13+v32 + psubw %mm3, %mm6 # v13-v32 + + movq %mm5, 16*2(%esi) # out2: v13+v32 + movq %mm6, 16*6(%esi) # out6: v13-v32 + + paddw scratch4, %mm7 # v14n: v04+v05 + movq %mm0, %mm5 # duplicate v16 + + psubw %mm7, %mm0 # va1: v16-v14n + pmulhw WA2, %mm7 # v34~~: v14n*WA2 + pmulhw WA5, %mm0 # va0~: va1*WA5 + pmulhw WA4, %mm5 # v36~~: v16*WA4 + psllw $16-NSHIFT, %mm7 + psllw $16-WA4_SHIFT, %mm5 # v36: compensate the coeffient + # scale note that WA4 is shifted 1 bit less than the others + + psubw %mm0, %mm5 # v36~: v36~~-va0~ + psubw %mm0, %mm7 # v34~: v34~~-va0~ + + movq %mm4, %mm0 # duplicate v45 + paddw %mm5, %mm4 # v45+v36 + psubw %mm5, %mm0 # v45-v36 + + movq %mm4, 16*1(%esi) # out1: v45+v36 + movq %mm0, 16*7(%esi) # out7: v45-v36 + + movq %mm2, %mm5 # duplicate v47 + paddw %mm7, %mm2 # v47+v34 + psubw %mm7, %mm5 # v47-v34 + + movq %mm2, 16*5(%esi) # out5: v47+v34 + movq %mm5, 16*3(%esi) # out3: v47-v34 + + popl %esi + popl %ebp + + ret $0 + + /* do mmx postscaling and reordering... */ + + .align 8 + .global dct_block_mmx_postscale_88 + dct_block_mmx_postscale_88: + + pushl %ebp + movl %esp,%ebp + pushl %esi + pushl %edi + pushl %ebx + + movl 8(%ebp),%esi # source matrix + movl 12(%ebp), %edi # postscale matrix + + subl $128+2, %esp + + movq 0*8(%esi), %mm0 + movq 1*8(%esi), %mm1 + movq 2*8(%esi), %mm2 + movq 3*8(%esi), %mm3 + + movq %mm0, %mm4 + movq %mm1, %mm5 + movq %mm2, %mm6 + movq %mm3, %mm7 + psraw $0xf, %mm4 + psraw $0xf, %mm5 + psraw $0xf, %mm6 + psraw $0xf, %mm7 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + pmulhw 0*8(%edi), %mm0 + pmulhw 1*8(%edi), %mm1 + pmulhw 2*8(%edi), %mm2 + pmulhw 3*8(%edi), %mm3 + + psraw $YUV_PRECISION, %mm0 + psraw $YUV_PRECISION, %mm1 + psraw $YUV_PRECISION, %mm2 + psraw $YUV_PRECISION, %mm3 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movq %mm0, 0*8(%esi) + movq %mm1, 1*8(%esi) + movq %mm2, 2*8(%esi) + movq %mm3, 3*8(%esi) + + movq 4*8(%esi), %mm0 + movq 5*8(%esi), %mm1 + movq 6*8(%esi), %mm2 + movq 7*8(%esi), %mm3 + + movq %mm0, %mm4 + movq %mm1, %mm5 + + movl 0*2(%esi), %eax + movw 2*2(%esi), %bx + + movq %mm2, %mm6 + movq %mm3, %mm7 + + movl %eax, 1*2(%esp) + movw %bx, 6*2(%esp) + + psraw $0xf, %mm4 + psraw $0xf, %mm5 + + movw 3*2(%esi), %ax + movw 4*2(%esi), %bx + + psraw $0xf, %mm6 + psraw $0xf, %mm7 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + + movw %ax, 7*2(%esp) + movw %bx, 15*2(%esp) + + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + movw 5*2(%esi), %ax + movw 6*2(%esi), %bx + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + + movw %ax, 16*2(%esp) + movw %bx, 28*2(%esp) + + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movw 7*2(%esi), %ax + movw 8*2(%esi), %bx + + pmulhw 4*8(%edi), %mm0 + pmulhw 5*8(%edi), %mm1 + + movw %ax, 29*2(%esp) + movw %bx, 3*2(%esp) + + pmulhw 6*8(%edi), %mm2 + pmulhw 7*8(%edi), %mm3 + + movw 9*2(%esi), %ax + movw 10*2(%esi), %bx + + psraw $YUV_PRECISION, %mm0 + psraw $YUV_PRECISION, %mm1 + + movw %ax, 5*2(%esp) + movw %bx, 8*2(%esp) + + psraw $YUV_PRECISION, %mm2 + psraw $YUV_PRECISION, %mm3 + + movw 11*2(%esi), %ax + movw 12*2(%esi), %bx + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + + movw %ax, 14*2(%esp) + movw %bx, 17*2(%esp) + + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + movw 13*2(%esi), %ax + movw 14*2(%esi), %bx + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + + movw %ax, 27*2(%esp) + movw %bx, 30*2(%esp) + + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movq %mm0, 4*8(%esi) + movq %mm1, 5*8(%esi) + movq %mm2, 6*8(%esi) + movq %mm3, 7*8(%esi) + + movq 8*8(%esi), %mm0 + movq 9*8(%esi), %mm1 + + movw 15*2(%esi), %ax + movw 16*2(%esi), %bx + + movq 10*8(%esi), %mm2 + movq 11*8(%esi), %mm3 + + movw %ax, 43*2(%esp) + movw %bx, 4*2(%esp) + + movq %mm0, %mm4 + movq %mm1, %mm5 + + movw 17*2(%esi), %ax + movw 18*2(%esi), %bx + + movq %mm2, %mm6 + movq %mm3, %mm7 + + movw %ax, 9*2(%esp) + movw %bx, 13*2(%esp) + + psraw $0xf, %mm4 + psraw $0xf, %mm5 + + movw 19*2(%esi), %ax + movw 20*2(%esi), %bx + + psraw $0xf, %mm6 + psraw $0xf, %mm7 + + movw %ax, 18*2(%esp) + movw %bx, 26*2(%esp) + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + + movw 21*2(%esi), %ax + movw 22*2(%esi), %bx + + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + movw %ax, 31*2(%esp) + movw %bx, 42*2(%esp) + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + + movw 23*2(%esi), %ax + movw 24*2(%esi), %bx + + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movw %ax, 44*2(%esp) + movw %bx, 10*2(%esp) + + pmulhw 8*8(%edi), %mm0 + pmulhw 9*8(%edi), %mm1 + + movw 25*2(%esi), %ax + movw 26*2(%esi), %bx + + pmulhw 10*8(%edi), %mm2 + pmulhw 11*8(%edi), %mm3 + + psraw $YUV_PRECISION, %mm0 + psraw $YUV_PRECISION, %mm1 + + movw %ax, 12*2(%esp) + movw %bx, 19*2(%esp) + + psraw $YUV_PRECISION, %mm2 + psraw $YUV_PRECISION, %mm3 + + movw 27*2(%esi), %ax + movw 28*2(%esi), %bx + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + + movw %ax, 25*2(%esp) + movw %bx, 32*2(%esp) + + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + movw 29*2(%esi), %ax + movw 30*2(%esi), %bx + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + + movw %ax, 41*2(%esp) + movw %bx, 45*2(%esp) + + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movq %mm0, 8*8(%esi) + movq %mm1, 9*8(%esi) + movq %mm2, 10*8(%esi) + movq %mm3, 11*8(%esi) + + + movq 12*8(%esi), %mm0 + movq 13*8(%esi), %mm1 + movq 14*8(%esi), %mm2 + movq 15*8(%esi), %mm3 + + movq %mm0, %mm4 + movq %mm1, %mm5 + + movw 31*2(%esi), %ax + movw 32*2(%esi), %bx + + movq %mm2, %mm6 + movq %mm3, %mm7 + + movw %ax, 54*2(%esp) + movw %bx, 11*2(%esp) + + psraw $0xf, %mm4 + psraw $0xf, %mm5 + + movw 33*2(%esi), %ax + movw 34*2(%esi), %bx + + psraw $0xf, %mm6 + psraw $0xf, %mm7 + + movw %ax, 20*2(%esp) + movw %bx, 24*2(%esp) + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + + movw 35*2(%esi), %ax + movw 36*2(%esi), %bx + + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + movw %ax, 33*2(%esp) + movw %bx, 40*2(%esp) + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + + movw 37*2(%esi), %ax + movw 38*2(%esi), %bx + + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movw %ax, 46*2(%esp) + movw %bx, 53*2(%esp) + + pmulhw 12*8(%edi), %mm0 + pmulhw 13*8(%edi), %mm1 + + movw 39*2(%esi), %ax + movw 40*2(%esi), %bx + + pmulhw 14*8(%edi), %mm2 + pmulhw 15*8(%edi), %mm3 + + movw %ax, 55*2(%esp) + movw %bx, 21*2(%esp) + + psraw $YUV_PRECISION, %mm0 + psraw $YUV_PRECISION, %mm1 + + movw 41*2(%esi), %ax + movw 42*2(%esi), %bx + + psraw $YUV_PRECISION, %mm2 + psraw $YUV_PRECISION, %mm3 + + movw %ax, 23*2(%esp) + movw %bx, 34*2(%esp) + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + + movw 43*2(%esi), %ax + movw 44*2(%esi), %bx + + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + movw %ax, 39*2(%esp) + movw %bx, 47*2(%esp) + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + + movw 45*2(%esi), %ax + movw 46*2(%esi), %bx + + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movw %ax, 52*2(%esp) + movw %bx, 56*2(%esp) + + movq %mm0, 12*8(%esi) + movq %mm1, 13*8(%esi) + + movw 47*2(%esi), %ax + movw 48*2(%esi), %bx + + movq %mm2, 14*8(%esi) + movq %mm3, 15*8(%esi) + + movw %ax, 61*2(%esp) + movw %bx, 22*2(%esp) + + movw 49*2(%esi), %ax + movw 50*2(%esi), %bx + + + movw %ax, 35*2(%esp) + movw %bx, 38*2(%esp) + + + movw 51*2(%esi), %ax + movw 52*2(%esi), %bx + + movw %ax, 48*2(%esp) + movw %bx, 51*2(%esp) + + + movw 53*2(%esi), %ax + movw 54*2(%esi), %bx + + movw %ax, 57*2(%esp) + movw %bx, 60*2(%esp) + + movw 55*2(%esi), %ax + movw 56*2(%esi), %bx + + + movw %ax, 62*2(%esp) + movw %bx, 36*2(%esp) + + movw 57*2(%esi), %ax + movw 58*2(%esi), %bx + + movw %ax, 37*2(%esp) + movw %bx, 49*2(%esp) + + movw 59*2(%esi), %ax + movw 60*2(%esi), %bx + + movw %ax, 50*2(%esp) + movw %bx, 58*2(%esp) + + movw 61*2(%esi), %ax + movl 62*2(%esi), %ebx + + movw %ax, 59*2(%esp) + movl %ebx, 63*2(%esp) + + addl $2, %esp + + movq (%esp) , %mm0 + movq 8(%esp) , %mm1 + movq 16(%esp), %mm2 + movq 24(%esp), %mm3 + + movq %mm0, (%esi) + movq %mm1, 8(%esi) + movq %mm2, 16(%esi) + movq %mm3, 24(%esi) + + movq 32(%esp) , %mm0 + movq 32+8(%esp) , %mm1 + movq 32+16(%esp), %mm2 + movq 32+24(%esp), %mm3 + + movq %mm0, 32(%esi) + movq %mm1, 32+8(%esi) + movq %mm2, 32+16(%esi) + movq %mm3, 32+24(%esi) + + movq 64(%esp) , %mm0 + movq 64+8(%esp) , %mm1 + movq 64+16(%esp), %mm2 + movq 64+24(%esp), %mm3 + + movq %mm0, 64(%esi) + movq %mm1, 64+8(%esi) + movq %mm2, 64+16(%esi) + movq %mm3, 64+24(%esi) + + movq 96(%esp) , %mm0 + movq 96+8(%esp) , %mm1 + movq 96+16(%esp), %mm2 + movq 96+24(%esp), %mm3 + + addl $128, %esp + + popl %ebx + popl %edi + popl %esi + popl %ebp + ret + + .align 8 + .global dct_248_block_mmx + dct_248_block_mmx: + + pushl %ebp + movl %esp, %ebp + pushl %esi + pushl %edi + + movl 8(%ebp), %esi # source + + # column 0 + + movq 16*0(%esi), %mm0 # v00 + movq 16*2(%esi), %mm1 # v01 + movq 16*4(%esi), %mm2 # v02 + movq 16*6(%esi), %mm3 # v03 + + movq %mm0, %mm4 # v00 + movq %mm1, %mm5 # v01 + + paddw %mm3, %mm0 # v10: v00+v03 + psubw %mm3, %mm4 # v13: v00-v03 + + paddw %mm2, %mm1 # v11: v01+v02 + psubw %mm2, %mm5 # v12: v01-v02 + + movq %mm0, %mm3 # v10 + + paddw %mm4, %mm5 # v22: v12+v13 + paddw %mm1, %mm0 # v20: v10+v11 + psubw %mm1, %mm3 # v21: v10-v11 + + pmulhw WA1, %mm5 # v32~: WA1*v22 + movq %mm4, %mm2 + psllw $16-NSHIFT, %mm5 # v32: compensate the coeffient scale + + movq %mm0, 16*0(%esi) + + psubw %mm5, %mm2 # v43: v13-v32 + paddw %mm4, %mm5 # v42: v32+v13 + + movq %mm2, 16*6(%esi) + movq %mm3, 16*4(%esi) + movq %mm5, 16*2(%esi) + + # column 1 + + addl $8, %esi # point to the next 4 columns. + # it can be done by adding 8 to immediates + # but this is nicer + + movq 16*0(%esi), %mm0 # v00 + movq 16*2(%esi), %mm1 # v01 + movq 16*4(%esi), %mm2 # v02 + movq 16*6(%esi), %mm3 # v03 + + movq %mm0, %mm4 + movq %mm1, %mm5 + + paddw %mm3, %mm0 # v10: v00+v03 + psubw %mm3, %mm4 # v13: v00-v03 + + paddw %mm2, %mm1 # v11: v01+v02 + psubw %mm2, %mm5 # v12: v01-v02 + + movq %mm0, %mm3 + + paddw %mm4, %mm5 # v22: v12+v13 + paddw %mm1, %mm0 # v20: v10+v11 + psubw %mm1, %mm3 # v21: v10-v11 + + pmulhw WA1, %mm5 # v32~: WA1*v22 + movq %mm4, %mm2 + psllw $16-NSHIFT, %mm5 # v32: compensate the coeffient scale + + movq %mm0, 16*0(%esi) + + psubw %mm5, %mm2 # v43: v13-v32 + paddw %mm4, %mm5 # v42: v32+v13 + + movq %mm2, 16*6(%esi) + movq %mm3, 16*4(%esi) + movq %mm5, 16*2(%esi) + + # column 0 ... second line + + addl $8, %esi + + movq 16*0(%esi), %mm0 # v00 + movq 16*2(%esi), %mm1 # v01 + movq 16*4(%esi), %mm2 # v02 + movq 16*6(%esi), %mm3 # v03 + + movq %mm0, %mm4 + movq %mm1, %mm5 + + paddw %mm3, %mm0 # v10: v00+v03 + psubw %mm3, %mm4 # v13: v00-v03 + + paddw %mm2, %mm1 # v11: v01+v02 + psubw %mm2, %mm5 # v12: v01-v02 + + movq %mm0, %mm3 + + paddw %mm4, %mm5 # v22: v12+v13 + paddw %mm1, %mm0 # v20: v10+v11 + psubw %mm1, %mm3 # v21: v10-v11 + + pmulhw WA1, %mm5 # v32~: WA1*v22 + movq %mm4, %mm2 + psllw $16-NSHIFT, %mm5 # v32: compensate the coeffient scale + + movq %mm0, 16*0(%esi) + + psubw %mm5, %mm2 # v43: v13-v32 + paddw %mm4, %mm5 # v42: v32+v13 + + movq %mm2, 16*6(%esi) + movq %mm3, 16*4(%esi) + movq %mm5, 16*2(%esi) + + # column 1 ... second line + + addl $8, %esi + + movq 16*0(%esi), %mm0 # v00 + movq 16*2(%esi), %mm1 # v01 + movq 16*4(%esi), %mm2 # v02 + movq 16*6(%esi), %mm3 # v03 + + movq %mm0, %mm4 + movq %mm1, %mm5 + + paddw %mm3, %mm0 # v10: v00+v03 + psubw %mm3, %mm4 # v13: v00-v03 + + paddw %mm2, %mm1 # v11: v01+v02 + psubw %mm2, %mm5 # v12: v01-v02 + + movq %mm0, %mm3 + + paddw %mm4, %mm5 # v22: v12+v13 + paddw %mm1, %mm0 # v20: v10+v11 + psubw %mm1, %mm3 # v21: v10-v11 + + pmulhw WA1, %mm5 # v32~: WA1*v22 + movq %mm4, %mm2 + psllw $16-NSHIFT, %mm5 # v32: compensate the coeffient scale + + movq %mm0, 16*0(%esi) + + psubw %mm5, %mm2 # v43: v13-v32 + paddw %mm4, %mm5 # v42: v32+v13 + + movq %mm2, 16*6(%esi) + movq %mm3, 16*4(%esi) + movq %mm5, 16*2(%esi) + + popl %edi + popl %esi + popl %ebp + ret + + .align 8 + .global dct_248_block_mmx_post_sum + dct_248_block_mmx_post_sum: + + pushl %ebp + movl %esp, %ebp + pushl %esi + + movl 8(%ebp), %esi # source + + movq 16*0(%esi), %mm0 + movq 16*1(%esi), %mm1 + movq 16*2(%esi), %mm2 + movq 16*3(%esi), %mm3 + movq 16*4(%esi), %mm4 + movq 16*5(%esi), %mm5 + movq 16*6(%esi), %mm6 + movq 16*7(%esi), %mm7 + + psubw %mm1, %mm0 + paddw 16*0(%esi), %mm1 + movq %mm0, 16*4(%esi) + movq %mm1, 16*0(%esi) + + movq %mm4, %mm1 + movq %mm2, %mm0 + paddw %mm5, %mm1 + psubw %mm5, %mm4 + paddw %mm3, %mm0 + psubw %mm3, %mm2 + + movq %mm0, 16*1(%esi) + movq %mm2, 16*5(%esi) + movq %mm1, 16*2(%esi) + movq %mm4, 16*6(%esi) + + paddw %mm6, %mm7 + psubw 16*7(%esi), %mm6 + + movq %mm7, 16*3(%esi) + movq %mm6, 16*7(%esi) + + addl $8, %esi + + movq 16*0(%esi), %mm0 + movq 16*1(%esi), %mm1 + movq 16*2(%esi), %mm2 + movq 16*3(%esi), %mm3 + movq 16*4(%esi), %mm4 + movq 16*5(%esi), %mm5 + movq 16*6(%esi), %mm6 + movq 16*7(%esi), %mm7 + + psubw %mm1, %mm0 + paddw 16*0(%esi), %mm1 + movq %mm0, 16*4(%esi) + movq %mm1, 16*0(%esi) + + movq %mm4, %mm1 + movq %mm2, %mm0 + paddw %mm5, %mm1 + psubw %mm5, %mm4 + paddw %mm3, %mm0 + psubw %mm3, %mm2 + + movq %mm0, 16*1(%esi) + movq %mm2, 16*5(%esi) + movq %mm1, 16*2(%esi) + movq %mm4, 16*6(%esi) + + paddw %mm6, %mm7 + psubw 16*7(%esi), %mm6 + + movq %mm7, 16*3(%esi) + movq %mm6, 16*7(%esi) + + popl %esi + popl %ebp + ret + + .align 8 + .global dct_block_mmx_postscale_248 + dct_block_mmx_postscale_248: + + pushl %ebp + movl %esp,%ebp + pushl %esi + pushl %edi + + movl 8(%ebp),%esi # source matrix + movl 12(%ebp), %edi # postscale matrix + + movq 0*8(%esi), %mm0 + movq 1*8(%esi), %mm1 + movq 2*8(%esi), %mm2 + movq 3*8(%esi), %mm3 + + movq %mm0, %mm4 + movq %mm1, %mm5 + movq %mm2, %mm6 + movq %mm3, %mm7 + psraw $0xf, %mm4 + psraw $0xf, %mm5 + psraw $0xf, %mm6 + psraw $0xf, %mm7 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + pmulhw 0*8(%edi), %mm0 + pmulhw 1*8(%edi), %mm1 + pmulhw 2*8(%edi), %mm2 + pmulhw 3*8(%edi), %mm3 + + psraw $YUV_PRECISION, %mm0 + psraw $YUV_PRECISION, %mm1 + psraw $YUV_PRECISION, %mm2 + psraw $YUV_PRECISION, %mm3 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movq %mm0, 0*8(%esi) + movq %mm1, 1*8(%esi) + movq %mm2, 2*8(%esi) + movq %mm3, 3*8(%esi) + + + movq 4*8(%esi), %mm0 + movq 5*8(%esi), %mm1 + movq 6*8(%esi), %mm2 + movq 7*8(%esi), %mm3 + + movq %mm0, %mm4 + movq %mm1, %mm5 + movq %mm2, %mm6 + movq %mm3, %mm7 + psraw $0xf, %mm4 + psraw $0xf, %mm5 + psraw $0xf, %mm6 + psraw $0xf, %mm7 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + pmulhw 4*8(%edi), %mm0 + pmulhw 5*8(%edi), %mm1 + pmulhw 6*8(%edi), %mm2 + pmulhw 7*8(%edi), %mm3 + + psraw $YUV_PRECISION, %mm0 + psraw $YUV_PRECISION, %mm1 + psraw $YUV_PRECISION, %mm2 + psraw $YUV_PRECISION, %mm3 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movq %mm0, 4*8(%esi) + movq %mm1, 5*8(%esi) + movq %mm2, 6*8(%esi) + movq %mm3, 7*8(%esi) + + + movq 8*8(%esi), %mm0 + movq 9*8(%esi), %mm1 + movq 10*8(%esi), %mm2 + movq 11*8(%esi), %mm3 + + movq %mm0, %mm4 + movq %mm1, %mm5 + movq %mm2, %mm6 + movq %mm3, %mm7 + psraw $0xf, %mm4 + psraw $0xf, %mm5 + psraw $0xf, %mm6 + psraw $0xf, %mm7 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + pmulhw 8*8(%edi), %mm0 + pmulhw 9*8(%edi), %mm1 + pmulhw 10*8(%edi), %mm2 + pmulhw 11*8(%edi), %mm3 + + psraw $YUV_PRECISION, %mm0 + psraw $YUV_PRECISION, %mm1 + psraw $YUV_PRECISION, %mm2 + psraw $YUV_PRECISION, %mm3 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movq %mm0, 8*8(%esi) + movq %mm1, 9*8(%esi) + movq %mm2, 10*8(%esi) + movq %mm3, 11*8(%esi) + + + movq 12*8(%esi), %mm0 + movq 13*8(%esi), %mm1 + movq 14*8(%esi), %mm2 + movq 15*8(%esi), %mm3 + + movq %mm0, %mm4 + movq %mm1, %mm5 + movq %mm2, %mm6 + movq %mm3, %mm7 + psraw $0xf, %mm4 + psraw $0xf, %mm5 + psraw $0xf, %mm6 + psraw $0xf, %mm7 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + pmulhw 12*8(%edi), %mm0 + pmulhw 13*8(%edi), %mm1 + pmulhw 14*8(%edi), %mm2 + pmulhw 15*8(%edi), %mm3 + + psraw $YUV_PRECISION, %mm0 + psraw $YUV_PRECISION, %mm1 + psraw $YUV_PRECISION, %mm2 + psraw $YUV_PRECISION, %mm3 + + pxor %mm4, %mm0 + pxor %mm5, %mm1 + pxor %mm6, %mm2 + pxor %mm7, %mm3 + + psubw %mm4, %mm0 + psubw %mm5, %mm1 + psubw %mm6, %mm2 + psubw %mm7, %mm3 + + movq %mm0, 12*8(%esi) + movq %mm1, 13*8(%esi) + movq %mm2, 14*8(%esi) + movq %mm3, 15*8(%esi) + + popl %edi + popl %esi + popl %ebp + ret diff -C2 -r -N bcast-2000c/quicktime/libdv/dovlc.c bcast-2000c-mf3/quicktime/libdv/dovlc.c *** bcast-2000c/quicktime/libdv/dovlc.c Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/dovlc.c Mon Oct 1 05:16:38 2001 *************** *** 6,10 **** * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * decoder. * * libdv is free software; you can redistribute it and/or modify it --- 6,10 ---- * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * codec. * * libdv is free software; you can redistribute it and/or modify it *************** *** 25,37 **** */ ! #include #include ! #include ! #include int main(int argc, char **argv) { int c, bit, bits_left, count, coeff_count; ! gint run,amp,used; unsigned char *p; static unsigned char buffer[256]; --- 25,39 ---- */ ! #include ! #include ! ! #include "vlc.h" ! #include "bitstream.h" int main(int argc, char **argv) { int c, bit, bits_left, count, coeff_count; ! dv_vlc_t vlc; unsigned char *p; static unsigned char buffer[256]; *************** *** 55,72 **** bitstream_new_buffer(bs,buffer,256); while(count >0) { ! used =dv_peek_vlc(bs,count,&run,&); ! if(used > 0) { ! printf("(%d,%d,%d)",run,amp,used); ! bitstream_flush(bs,used); ! count-=used; ! coeff_count+=(run+1); ! } else if(used == VLC_ERROR) { printf("X (%d tossed)\n", count); exit(-1); ! } else if(used == VLC_NOBITS) { printf("* (%d tossed)\n", count); printf("*coeff_count=%d \n",coeff_count); exit(0); ! } else if(used == 0) { printf("#"); bitstream_flush(bs,4); --- 57,74 ---- bitstream_new_buffer(bs,buffer,256); while(count >0) { ! dv_peek_vlc(bs,count,&vlc); ! if(vlc.len > 0) { ! printf("(%d,%d,%d)",vlc.run,vlc.amp,vlc.len); ! bitstream_flush(bs,vlc.len); ! count-=vlc.len; ! coeff_count+=(vlc.run+1); ! } else if(vlc.len == VLC_ERROR) { printf("X (%d tossed)\n", count); exit(-1); ! } else if(vlc.len == VLC_NOBITS) { printf("* (%d tossed)\n", count); printf("*coeff_count=%d \n",coeff_count); exit(0); ! } else if(vlc.len == 0) { printf("#"); bitstream_flush(bs,4); diff -C2 -r -N bcast-2000c/quicktime/libdv/dv.c bcast-2000c-mf3/quicktime/libdv/dv.c *** bcast-2000c/quicktime/libdv/dv.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/dv.c Fri Dec 28 21:42:15 2001 *************** *** 0 **** --- 1,588 ---- + /* + * dv.c + * + * Copyright (C) Charles 'Buck' Krasic - November 2000 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + #include + #include + #include + + #include "dv_types.h" + #include "dv.h" + #include "encode.h" + #include "util.h" + #include "dct.h" + #include "audio.h" + #include "idct_248.h" + #include "quant.h" + #include "weighting.h" + #include "vlc.h" + #include "parse.h" + #include "place.h" + #include "rgb.h" + #include "YUY2.h" + #include "YV12.h" + #if ARCH_X86 + #include "mmx.h" + #endif + + #if YUV_420_USE_YV12 + #define DV_MB420_YUV(a,b,c) dv_mb420_YV12 (a,b,c) + #define DV_MB420_YUV_MMX(a,b,c) dv_mb420_YV12_mmx(a,b,c) + #else + #define DV_MB420_YUV(a,b,c) dv_mb420_YUY2 (a,b,c) + #define DV_MB420_YUV_MMX(a,b,c) dv_mb420_YUY2_mmx(a,b,c) + #endif + + gboolean dv_use_mmx; + + #if HAVE_LIBPOPT + static void + dv_decoder_popt_callback(poptContext con, enum poptCallbackReason reason, + const struct poptOption * opt, const char * arg, const void * data) + { + dv_decoder_t *decoder = (dv_decoder_t *)data; + + if((decoder->arg_video_system < 0) || (decoder->arg_video_system > 3)) { + dv_opt_usage(con, decoder->option_table, DV_DECODER_OPT_SYSTEM); + } /* if */ + + } /* dv_decoder_popt_callback */ + #endif /* HAVE_LIBPOPT */ + + dv_decoder_t * + dv_decoder_new(void) { + dv_decoder_t *result; + + result = (dv_decoder_t *)calloc(1,sizeof(dv_decoder_t)); + if(!result) goto no_mem; + + result->video = dv_video_new(); + if(!result->video) goto no_video; + + result->audio = dv_audio_new(); + if(!result->audio) goto no_audio; + + #if HAVE_LIBPOPT + result->option_table[DV_DECODER_OPT_SYSTEM] = (struct poptOption) { + longName: "video-system", + shortName: 'V', + argInfo: POPT_ARG_INT, + descrip: "video standard:" + "0=autoselect [default]," + " 1=525/60 4:1:1 (NTSC)," + " 2=625/50 4:2:0 (PAL,IEC 61834 DV)," + " 3=625/50 4:1:1 (PAL,SMPTE 314M DV)", + argDescrip: "(0|1|2|3)", + arg: &result->arg_video_system, + }; /* system */ + + result->option_table[DV_DECODER_OPT_VIDEO_INCLUDE] = (struct poptOption) { + argInfo: POPT_ARG_INCLUDE_TABLE, + descrip: "Video decode options", + arg: &result->video->option_table[0], + }; /* video include */ + + result->option_table[DV_DECODER_OPT_AUDIO_INCLUDE] = (struct poptOption) { + argInfo: POPT_ARG_INCLUDE_TABLE, + descrip: "Audio decode options", + arg: result->audio->option_table, + }; /* audio include */ + + result->option_table[DV_DECODER_OPT_CALLBACK] = (struct poptOption){ + argInfo: POPT_ARG_CALLBACK|POPT_CBFLAG_POST, + arg: dv_decoder_popt_callback, + descrip: (char *)result, /* data passed to callback */ + }; /* callback */ + + #endif /* HAVE_LIBPOPT */ + + return(result); + + no_audio: + free(result->video); + no_video: + free(result); + result=NULL; + no_mem: + return(result); + } /* dv_decoder_new */ + + void + dv_init(void) { + static gboolean done=FALSE; + if(done) goto init_done; + #if ARCH_X86 + dv_use_mmx = mmx_ok(); + #endif + weight_init(); + dct_init(); + dv_dct_248_init(); + dv_construct_vlc_table(); + dv_parse_init(); + dv_place_init(); + dv_quant_init(); + dv_rgb_init(); + dv_YUY2_init(); + dv_YV12_init(); + init_vlc_test_lookup(); + init_vlc_encode_lookup(); + init_qno_start(); + prepare_reorder_tables(); + + done=TRUE; + init_done: + return; + } /* dv_init */ + + static inline void + dv_decode_macroblock(dv_decoder_t *dv, dv_macroblock_t *mb, guint quality) { + gint i; + for (i=0; + i<((quality & DV_QUALITY_COLOR) ? 6 : 4); + i++) { + if (mb->b[i].dct_mode == DV_DCT_248) { + dv_248_coeff_t co248[64]; + + quant_248_inverse (mb->b[i].coeffs, mb->qno, mb->b[i].class_no, co248); + dv_idct_248 (co248, mb->b[i].coeffs); + } else { + #if ARCH_X86 + quant_88_inverse_x86(mb->b[i].coeffs,mb->qno,mb->b[i].class_no); + idct_88(mb->b[i].coeffs); + #else /* ARCH_X86 */ + quant_88_inverse(mb->b[i].coeffs,mb->qno,mb->b[i].class_no); + weight_88_inverse(mb->b[i].coeffs); + idct_88(mb->b[i].coeffs); + #endif /* ARCH_X86 */ + } /* else */ + } /* for b */ + } /* dv_decode_macroblock */ + + void + dv_decode_video_segment(dv_decoder_t *dv, dv_videosegment_t *seg, guint quality) { + dv_macroblock_t *mb; + dv_block_t *bl; + gint m, b; + for (m=0,mb = seg->mb; + m<5; + m++,mb++) { + for (b=0,bl = mb->b; + b<((quality & DV_QUALITY_COLOR) ? 6 : 4); + b++,bl++) { + if (bl->dct_mode == DV_DCT_248) { + dv_248_coeff_t co248[64]; + + quant_248_inverse (mb->b[b].coeffs, mb->qno, mb->b[b].class_no, co248); + dv_idct_248 (co248, mb->b[b].coeffs); + } else { + #if ARCH_X86 + quant_88_inverse_x86(bl->coeffs,mb->qno,bl->class_no); + weight_88_inverse(bl->coeffs); + idct_88(bl->coeffs); + #else /* ARCH_X86 */ + quant_88_inverse(bl->coeffs,mb->qno,bl->class_no); + weight_88_inverse(bl->coeffs); + idct_88(bl->coeffs); + #endif /* ARCH_X86 */ + } /* else */ + } /* for b */ + } /* for mb */ + } /* dv_decode_video_segment */ + + static inline void + dv_render_macroblock_rgb(dv_decoder_t *dv, dv_macroblock_t *mb, guchar **pixels, gint *pitches ) { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_rgb(mb, pixels, pitches); /* Right edge are 16x16 */ + } else { + dv_mb411_rgb(mb, pixels, pitches); + } /* else */ + } else { + dv_mb420_rgb(mb, pixels, pitches); + } /* else */ + } /* dv_render_macroblock_rgb */ + + void + dv_render_video_segment_rgb(dv_decoder_t *dv, dv_videosegment_t *seg, guchar **pixels, gint *pitches ) { + dv_macroblock_t *mb; + gint m; + for (m=0,mb = seg->mb; + m<5; + m++,mb++) { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_rgb(mb, pixels, pitches); /* Right edge are 16x16 */ + } else { + dv_mb411_rgb(mb, pixels, pitches); + } /* else */ + } else { + dv_mb420_rgb(mb, pixels, pitches); + } /* else */ + } /* for */ + } /* dv_render_video_segment_rgb */ + + static inline void + dv_render_macroblock_bgr0(dv_decoder_t *dv, dv_macroblock_t *mb, guchar **pixels, gint *pitches ) { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_bgr0(mb, pixels, pitches); /* Right edge are 16x16 */ + } else { + dv_mb411_bgr0(mb, pixels, pitches); + } /* else */ + } else { + dv_mb420_bgr0(mb, pixels, pitches); + } /* else */ + } /* dv_render_macroblock_bgr0 */ + + void + dv_render_video_segment_bgr0(dv_decoder_t *dv, dv_videosegment_t *seg, guchar **pixels, gint *pitches ) { + dv_macroblock_t *mb; + gint m; + for (m=0,mb = seg->mb; + m<5; + m++,mb++) { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_bgr0(mb, pixels, pitches); /* Right edge are 16x16 */ + } else { + dv_mb411_bgr0(mb, pixels, pitches); + } /* else */ + } else { + dv_mb420_bgr0(mb, pixels, pitches); + } /* else */ + } /* for */ + } /* dv_render_video_segment_bgr0 */ + + #if ARCH_X86 + + static inline void + dv_render_macroblock_yuv(dv_decoder_t *dv, dv_macroblock_t *mb, guchar **pixels, gint *pitches) { + if(0) { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_YUY2_mmx(mb, pixels, pitches); /* Right edge are 420! */ + } else { + dv_mb411_YUY2_mmx(mb, pixels, pitches); + } /* else */ + } else { + DV_MB420_YUV_MMX(mb, pixels, pitches); + } /* else */ + } else { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_YUY2(mb, pixels, pitches); /* Right edge are 420! */ + } else { + dv_mb411_YUY2(mb, pixels, pitches); + } /* else */ + } else { + DV_MB420_YUV(mb, pixels, pitches); + } /* else */ + } /* else */ + } /* dv_render_macroblock_yuv */ + + void + dv_render_video_segment_yuv(dv_decoder_t *dv, dv_videosegment_t *seg, guchar **pixels, gint *pitches) { + dv_macroblock_t *mb; + gint m; + for (m=0,mb = seg->mb; + m<5; + m++,mb++) { + if(dv_use_mmx) { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_YUY2_mmx(mb, pixels, pitches); /* Right edge are 420! */ + } else { + dv_mb411_YUY2_mmx(mb, pixels, pitches); + } /* else */ + } else { + DV_MB420_YUV_MMX(mb, pixels, pitches); + } /* else */ + } else { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_YUY2(mb, pixels, pitches); /* Right edge are 420! */ + } else { + dv_mb411_YUY2(mb, pixels, pitches); + } /* else */ + } else { + DV_MB420_YUV(mb, pixels, pitches); + } /* else */ + } /* else */ + } /* for */ + } /* dv_render_video_segment_yuv */ + + #else /* ARCH_X86 */ + + static inline void + dv_render_macroblock_yuv(dv_decoder_t *dv, dv_macroblock_t *mb, guchar **pixels, gint *pitches) { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_YUY2(mb, pixels, pitches); /* Right edge are 420! */ + } else { + dv_mb411_YUY2(mb, pixels, pitches); + } /* else */ + } else { + DV_MB420_YUV(mb, pixels, pitches); + } /* else */ + } /* dv_render_macroblock_yuv */ + + void + dv_render_video_segment_yuv(dv_decoder_t *dv, dv_videosegment_t *seg, guchar **pixels, gint *pitches) { + dv_macroblock_t *mb; + gint m; + for (m=0,mb = seg->mb; + m<5; + m++,mb++) { + if(dv->sampling == e_dv_sample_411) { + if(mb->x >= 704) { + dv_mb411_right_YUY2(mb, pixels, pitches); /* Right edge are 420! */ + } else { + dv_mb411_YUY2(mb, pixels, pitches); + } /* else */ + } else { + DV_MB420_YUV(mb, pixels, pitches); + } /* else */ + } /* for */ + } /* dv_render_video_segment_yuv */ + + #endif /* ! ARCH_X86 */ + + static gint32 ranges[6][2]; + + void dv_check_coeff_ranges(dv_macroblock_t *mb) { + dv_block_t *bl; + gint b, i; + for (b=0,bl = mb->b; + b<6; + b++,bl++) { + for(i=0;i<64;i++) { + ranges[b][0] = MIN(ranges[b][0],bl->coeffs[i]); + ranges[b][1] = MAX(ranges[b][1],bl->coeffs[i]); + } + } + } + + void + dv_decode_full_frame(dv_decoder_t *dv, guchar *buffer, + dv_color_space_t color_space, guchar **pixels, gint *pitches) { + + static dv_videosegment_t vs; + dv_videosegment_t *seg = &vs; + dv_macroblock_t *mb; + gint ds, v, m; + guint offset = 0, dif = 0, audio=0; + + if(!seg->bs) { + seg->bs = bitstream_init(); + if(!seg->bs) + goto no_mem; + } /* if */ + seg->isPAL = (dv->system == e_dv_system_625_50); + + /* each DV frame consists of a sequence of DIF segments */ + for (ds=0; ds < dv->num_dif_seqs; ds++) { + /* Each DIF segment conists of 150 dif blocks, 135 of which are video blocks */ + /* A video segment consists of 5 video blocks, where each video + block contains one compressed macroblock. DV bit allocation + for the VLC stage can spill bits between blocks in the same + video segment. So parsing needs the whole segment to decode + the VLC data */ + dif += 6; + audio=0; + /* Loop through video segments */ + for (v=0;v<27;v++) { + /* skip audio block - interleaved before every 3rd video segment */ + if(!(v % 3)) { + /*dv_dump_aaux_as(buffer+(dif*80), ds, audio); */ + dif++; + audio++; + } /* if */ + /* stage 1: parse and VLC decode 5 macroblocks that make up a video segment */ + offset = dif * 80; + bitstream_new_buffer(seg->bs, buffer + offset, 80*5); + dv_parse_video_segment(seg, dv->quality); + /* stage 2: dequant/unweight/iDCT blocks, and place the macroblocks */ + dif+=5; + seg->i = ds; + seg->k = v; + switch(color_space) { + case e_dv_color_yuv: + for (m=0,mb = seg->mb; + m<5; + m++,mb++) { + dv_decode_macroblock(dv, mb, dv->quality); + dv_place_macroblock(dv, seg, mb, m); + dv_render_macroblock_yuv(dv, mb, pixels, pitches); + } /* for m */ + break; + case e_dv_color_bgr0: + for (m=0,mb = seg->mb; + m<5; + m++,mb++) { + dv_decode_macroblock(dv, mb, dv->quality); + dv_place_macroblock(dv, seg, mb, m); + dv_render_macroblock_bgr0(dv, mb, pixels, pitches); + } /* for m */ + break; + case e_dv_color_rgb: + for (m=0,mb = seg->mb; + m<5; + m++,mb++) { + dv_decode_macroblock(dv, mb, dv->quality); + dv_place_macroblock(dv, seg, mb, m); + #if RANGE_CHECKING + dv_check_coeff_ranges(mb); + #endif + dv_render_macroblock_rgb(dv, mb, pixels, pitches); + } /* for m */ + break; + } /* switch */ + } /* for v */ + } /* ds */ + #if RANGE_CHECKING + for(i=0;i<6;i++) { + fprintf(stderr, "range[%d] min %d max %d\n", i, ranges[i][0], ranges[i][1]); + } + #endif + return; + no_mem: + fprintf(stderr,"no memory for bitstream!\n"); + exit(-1); + } /* dv_decode_full_frame */ + + gboolean + dv_decode_full_audio(dv_decoder_t *dv, guchar *buffer, gint16 **outbufs) + { + gint ds, dif, audio_dif, result; + gint ch; + + dif=0; + if(!dv_parse_audio_header(dv, buffer)) goto no_audio; + + for (ds=0; ds < dv->num_dif_seqs; ds++) { + dif += 6; + for(audio_dif=0; audio_dif<9; audio_dif++) { + if((result = dv_decode_audio_block(dv->audio, buffer+(dif *80), ds, audio_dif, outbufs))) goto fail; + dif+=16; + } /* for */ + } /* for */ + + if(dv->audio->emphasis) { + for(ch=0; ch< dv->audio->num_channels; ch++) { + dv_audio_deemphasis(dv->audio, outbufs[ch]); + } /* for */ + } /* if */ + + return(TRUE); + + fail: + no_audio: + return(FALSE); + + } /* dv_decode_full_audio */ + + + /* + * query functions based upon vaux data + */ + + int + dv_get_vaux_pack (dv_decoder_t *dv, guint8 pack_id, guint8 *data) + { + guint8 id; + if ((id = dv -> vaux_pack [pack_id]) == 0xff) + return -1; + memcpy (data, dv -> vaux_data [id], 4); + return 0; + } /* dv_get_vaux_pack */ + + int + dv_frame_is_color (dv_decoder_t *dv) + { + guint8 id; + + if ((id = dv -> vaux_pack [0x60]) != 0xff) { + if (dv -> vaux_data [id] [1] & 0x80) { + return 1; + } + return 0; + } + return -1; + } + + int + dv_system_50_fields (dv_decoder_t *dv) + { + guint8 id; + + if ((id = dv -> vaux_pack [0x60]) != 0xff) { + if (dv -> vaux_data [id] [2] & 0x20) { + return 1; + } + return 0; + } + return -1; + } + + int + dv_format_normal (dv_decoder_t *dv) + { + guint8 id; + + if ((id = dv -> vaux_pack [0x61]) != 0xff) { + if (!(dv -> vaux_data [id] [1] & 0x07)) { + return 1; + } + return 0; + } + return -1; + } + + int + dv_format_wide (dv_decoder_t *dv) + { + guint8 id; + + if ((id = dv -> vaux_pack [0x61]) != 0xff) { + if (dv -> vaux_data [id] [1] & 0x07) { + return 1; + } + return 0; + } + return -1; + } + + int + dv_frame_changed (dv_decoder_t *dv) + { + guint8 id; + + if ((id = dv -> vaux_pack [0x61]) != 0xff) { + if (dv -> vaux_data [id] [2] & 0x20) { + return 1; + } + return 0; + } + return -1; + } diff -C2 -r -N bcast-2000c/quicktime/libdv/dv.h bcast-2000c-mf3/quicktime/libdv/dv.h *** bcast-2000c/quicktime/libdv/dv.h Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/dv.h Mon Oct 1 05:16:38 2001 *************** *** 6,10 **** * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * decoder. * * libdv is free software; you can redistribute it and/or modify it --- 6,10 ---- * * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) ! * codec. * * libdv is free software; you can redistribute it and/or modify it *************** *** 25,110 **** */ ! #ifndef __DV_H__ ! #define __DV_H__ - #include ! #define DV_DCT_248 (1) ! #define DV_DCT_88 (0) ! #define DV_SCT_HEADER (0x0) ! #define DV_SCT_SUBCODE (0x1) ! #define DV_SCT_VAUX (0x2) ! #define DV_SCT_AUDIO (0x3) ! #define DV_SCT_VIDEO (0x4) ! #define DV_AAUX_SOURCE 0x50 ! ! #define DV_FSC_0 (0) ! #define DV_FSC_1 (1) ! ! #if USE_MMX ! #define DV_WEIGHT_BIAS 6 ! #else ! #define DV_WEIGHT_BIAS 0 #endif ! #define DV_QUALITY_COLOR 1 /* Clear this bit to make monochrome */ ! #define DV_QUALITY_AC_MASK (0x3 << 1) ! #define DV_QUALITY_DC (0x0 << 1) ! #define DV_QUALITY_AC_1 (0x1 << 1) ! #define DV_QUALITY_AC_2 (0x2 << 1) ! ! #define DV_QUALITY_BEST (DV_QUALITY_COLOR | DV_QUALITY_AC_2) ! #define DV_QUALITY_FASTEST 0 /* Monochrome, DC coeffs only */ ! ! typedef enum sample_s { ! e_dv_sample_411, ! e_dv_sample_420, ! e_dv_sample_422 ! } dv_sample_t; ! ! typedef gint16 dv_coeff_t; ! typedef gint32 dv_248_coeff_t; ! ! typedef struct dv_block_s { ! dv_coeff_t coeffs[64] __attribute__ ((aligned (8))); ! dv_248_coeff_t coeffs248[64]; ! gint dct_mode; ! gint class_no; ! gint8 *reorder; ! gint8 *reorder_sentinel; ! gint offset; // bitstream offset of first unused bit ! gint end; // bitstream offset of last bit + 1 ! gint eob; ! gboolean mark; // used during passes 2 & 3 for tracking fragmented vlcs ! } dv_block_t; ! ! typedef struct dv_macroblock_s { ! gint i,j,k; /* i,j are superblock row/column, ! k is macroblock within superblock */ ! dv_block_t b[6]; ! gint qno; ! gint sta; ! gint vlc_error; ! gint eob_count; ! } dv_macroblock_t; ! ! typedef struct dv_videosegment_s { ! gint i, k; ! bitstream_t *bs; ! dv_macroblock_t mb[5]; ! gboolean isPAL; ! } dv_videosegment_t; ! ! typedef struct dv_audiosegment_s { ! gint samples_read; ! ! gint map1[2000]; ! gint map2[2000]; ! gint map_norm; ! bitstream_t *bs; ! } dv_audiosegment_t; ! #endif /* __DV_H__ */ --- 25,75 ---- */ ! #ifndef DV_H ! #define DV_H ! #include ! #include ! #include ! #ifdef __cplusplus ! extern "C" { #endif ! /* Main API */ ! extern dv_decoder_t *dv_decoder_new (void); ! extern void dv_init (void); ! extern gint dv_parse_header (dv_decoder_t *dv, guchar *buffer); ! extern void dv_decode_full_frame(dv_decoder_t *dv, ! guchar *buffer, dv_color_space_t color_space, ! guchar **pixels, gint *pitches); ! extern gint dv_decode_full_audio(dv_decoder_t *dv, ! guchar *buffer, gint16 **outbufs); ! ! /* Low level API */ ! extern gint dv_parse_video_segment(dv_videosegment_t *seg, guint quality); ! extern void dv_decode_video_segment(dv_decoder_t *dv, dv_videosegment_t *seg, guint quality); ! ! extern void dv_render_video_segment_rgb(dv_decoder_t *dv, dv_videosegment_t *seg, ! guchar **pixels, gint *pitches); ! ! extern void dv_render_video_segment_yuv(dv_decoder_t *dv, dv_videosegment_t *seg, ! guchar **pixels, gint *pitches); ! ! /* --------------------------------------------------------------------------- ! * functions based on vaux data ! * return value: <0 unknown, 0 no, >0 yes ! */ ! extern int dv_frame_changed (dv_decoder_t *dv), ! dv_frame_is_color (dv_decoder_t *dv), ! dv_system_50_fields (dv_decoder_t *dv), ! dv_format_normal (dv_decoder_t *dv), ! dv_format_wide (dv_decoder_t *dv), ! dv_get_vaux_pack (dv_decoder_t *dv, guint8 pack_id, guint8 *pack_data); ! #ifdef __cplusplus ! } ! #endif ! #endif // DV_H diff -C2 -r -N bcast-2000c/quicktime/libdv/dv_types.h bcast-2000c-mf3/quicktime/libdv/dv_types.h *** bcast-2000c/quicktime/libdv/dv_types.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/dv_types.h Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,430 ---- + /* + * dv_types.h + * + * Copyright (C) Charles 'Buck' Krasic - April 2000 + * Copyright (C) Erik Walthinsen - April 2000 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + #ifndef DV_TYPES_H + #define DV_TYPES_H + + #ifdef HAVE_CONFIG_H + #include + #endif // HAVE_CONFIG_H + + #if HAVE_LIBPOPT + #include + #endif // HAVE_LIBPOPT + + #include + #include + + // For now assume ARCH_X86 means GCC with hints. + #define HAVE_GCC ARCH_X86 + //#define HAVE_GCC 0 + + #if HAVE_GCC + #define ALIGN64 __attribute__ ((aligned (64))) + #define ALIGN32 __attribute__ ((aligned (32))) + #define ALIGN8 __attribute__ ((aligned (8))) + #else + #define ALIGN64 + #define ALIGN32 + #define ALIGN8 + #define __inline__ inline + #define __FUNCTION__ __FILE__ // Less specific info, but it's a string. + #endif + + #define DV_AUDIO_MAX_SAMPLES 1920 + + #define DV_AUDIO_OPT_FREQUENCY 0 + #define DV_AUDIO_OPT_QUANTIZATION 1 + #define DV_AUDIO_OPT_EMPHASIS 2 + #define DV_AUDIO_OPT_CALLBACK 3 + #define DV_AUDIO_NUM_OPTS 4 + + #define DV_VIDEO_OPT_BLOCK_QUALITY 0 + #define DV_VIDEO_OPT_MONOCHROME 1 + #define DV_VIDEO_OPT_CALLBACK 2 + #define DV_VIDEO_NUM_OPTS 3 + + #define DV_DECODER_OPT_SYSTEM 0 + #define DV_DECODER_OPT_VIDEO_INCLUDE 1 + #define DV_DECODER_OPT_AUDIO_INCLUDE 2 + #define DV_DECODER_OPT_CALLBACK 3 + #define DV_DECODER_NUM_OPTS 4 + + #define DV_OSS_OPT_DEVICE 0 + #define DV_OSS_OPT_FILE 1 + #define DV_OSS_NUM_OPTS 2 + + #define DV_DCT_248 (1) + #define DV_DCT_88 (0) + + #define DV_SCT_HEADER (0x0) + #define DV_SCT_SUBCODE (0x1) + #define DV_SCT_VAUX (0x2) + #define DV_SCT_AUDIO (0x3) + #define DV_SCT_VIDEO (0x4) + + #define DV_FSC_0 (0) + #define DV_FSC_1 (1) + + #if ARCH_X86 + #define DV_WEIGHT_BIAS 6 + #else + #define DV_WEIGHT_BIAS 0 + #endif + + #define DV_QUALITY_COLOR 1 /* Clear this bit to make monochrome */ + + #define DV_QUALITY_AC_MASK (0x3 << 1) + #define DV_QUALITY_DC (0x0 << 1) + #define DV_QUALITY_AC_1 (0x1 << 1) + #define DV_QUALITY_AC_2 (0x2 << 1) + + #define DV_QUALITY_BEST (DV_QUALITY_COLOR | DV_QUALITY_AC_2) + #define DV_QUALITY_FASTEST 0 /* Monochrome, DC coeffs only */ + + static const gint header_size = 80 * 52; // upto first audio AAUX AS + static const gint frame_size_525_60 = 10 * 150 * 80; + static const gint frame_size_625_50 = 12 * 150 * 80; + + typedef enum color_space_e { + e_dv_color_yuv, + e_dv_color_rgb, + e_dv_color_bgr0, + } dv_color_space_t; + + typedef enum sample_e { + e_dv_sample_none = 0, + e_dv_sample_411, + e_dv_sample_420, + e_dv_sample_422, + } dv_sample_t; + + typedef enum system_e { + e_dv_system_none = 0, + e_dv_system_525_60, // NTSC + e_dv_system_625_50, // PAL + } dv_system_t; + + typedef enum std_e { + e_dv_std_none = 0, + e_dv_std_smpte_314m, + e_dv_std_iec_61834, + } dv_std_t; + + typedef gint16 dv_coeff_t; + typedef gint32 dv_248_coeff_t; + + typedef struct bitstream_s { + guint32 current_word; + guint32 next_word; + guint16 bits_left; + guint16 next_bits; + + guint8 *buf; + guint32 buflen; + gint32 bufoffset; + + guint32 (*bitstream_next_buffer) (guint8 **,void *); + void *priv; + + gint32 bitsread; + } bitstream_t; + + typedef struct { + gint8 sct; // Section type (header,subcode,aux,audio,video) + gint8 dsn; // DIF sequence number (0-12) + gboolean fsc; // First (0)/Second channel (1) + gint8 dbn; // DIF block number (0-134) + } dv_id_t; + + typedef struct { + gboolean dsf; // DIF sequence flag: 525/60 (0) or 625,50 (1) + gint8 apt; + gboolean tf1; + gint8 ap1; + gboolean tf2; + gint8 ap2; + gboolean tf3; + gint8 ap3; + } dv_header_t; + + typedef struct { + dv_coeff_t coeffs[64] ALIGN8; + gint dct_mode; + gint class_no; + gint8 *reorder; + gint8 *reorder_sentinel; + gint offset; // bitstream offset of first unused bit + gint end; // bitstream offset of last bit + 1 + gint eob; + gboolean mark; // used during passes 2 & 3 for tracking fragmented vlcs + } dv_block_t; + + typedef struct { + gint i,j; // superblock row/column, + gint k; // macroblock no. within superblock */ + gint x, y; // top-left corner position + dv_block_t b[6]; + gint qno; + gint sta; + gint vlc_error; + gint eob_count; + } dv_macroblock_t; + + typedef struct { + gint i, k; + bitstream_t *bs; + dv_macroblock_t mb[5]; + gboolean isPAL; + } dv_videosegment_t; + + typedef struct { + dv_videosegment_t seg[27]; + } dv_dif_sequence_t; + + // Frame + typedef struct { + gboolean placement_done; + dv_dif_sequence_t ds[12]; + } dv_frame_t; + + /* From Section 8.1 of 61834-4: Audio auxiliary data source pack fields pc1-pc4. + * Need this data to figure out what format audio is in the stream. */ + + /* About bitfield ordering: The C standard does not specify the order + of bits within a unit of storage. In the code here, I will use the + definition of WORDS_BIGENDIAN to determine whether to set + BIG_ENDIAN_BITFIELD or LITTLE_ENDIAN_BITFIELD. There is nothing + that guarantees this relationship to be correct, but I know of no + counter examples. If we do find out there is one, we'll have to + fix it... */ + + #if defined(WORDS_BIGENDIAN) + #define BIG_ENDIAN_BITFIELD + #else + #define LITTLE_ENDIAN_BITFIELD + #endif // WORDS_BIGENDIAN + + typedef struct { + #if defined(LITTLE_ENDIAN_BITFIELD) + guint8 af_size : 6; /* Samples per frame: + * 32 kHz: 1053-1080 + * 44.1: 1452-1489 + * 48: 1580-1620 */ + guint8 : 1; // Should be 1 + guint8 lf : 1; // Locked mode flag (1 = unlocked) + #elif defined(BIG_ENDIAN_BITFIELD) + guint8 lf : 1; // Locked mode flag (1 = unlocked) + guint8 : 1; // Should be 1 + guint8 af_size : 6; /* Samples per frame: + * 32 kHz: 1053-1080 + * 44.1: 1452-1489 + * 48: 1580-1620 */ + #endif // BIG_ENDIAN_BITFIELD + } dv_aaux_as_pc1_t; + + typedef struct { + #if defined(LITTLE_ENDIAN_BITFIELD) + guint8 audio_mode: 4; // See 8.1... + guint8 pa : 1; // pair bit: 0 = one pair of channels, 1 = independent channel (for sm = 1, pa shall be 1) + guint8 chn : 2; // number of audio channels per block: 0 = 1 channel, 1 = 2 channels, others reserved + guint8 sm : 1; // stereo mode: 0 = Multi-stereo, 1 = Lumped + #elif defined(BIG_ENDIAN_BITFIELD) + guint8 sm : 1; // stereo mode: 0 = Multi-stereo, 1 = Lumped + guint8 chn : 2; // number of audio channels per block: 0 = 1 channel, 1 = 2 channels, others reserved + guint8 pa : 1; // pair bit: 0 = one pair of channels, 1 = independent channel (for sm = 1, pa shall be 1) + guint8 audio_mode: 4; // See 8.1... + #endif // BIG_ENDIAN_BITFIELD + } dv_aaux_as_pc2_t; + + typedef struct { + #if defined(LITTLE_ENDIAN_BITFIELD) + guint8 stype :5; // 0x0 = SD (525/625), 0x2 = HD (1125,1250), others reserved + guint8 system :1; // 0 = 60 fields, 1 = 50 field + guint8 ml :1; // Multi-languag flag + guint8 :1; + #elif defined(BIG_ENDIAN_BITFIELD) + guint8 :1; + guint8 ml :1; // Multi-languag flag + guint8 system :1; // 0 = 60 fields, 1 = 50 field + guint8 stype :5; // 0x0 = SD (525/625), 0x2 = HD (1125,1250), others reserved + #endif // BIG_ENDIAN_BITFIELD + } dv_aaux_as_pc3_t; + + typedef struct { + #if defined(LITTLE_ENDIAN_BITFIELD) + guint8 qu :3; // quantization: 0=16bits linear, 1=12bits non-linear, 2=20bits linear, others reserved + guint8 smp :3; // sampling frequency: 0=48kHz, 1=44,1 kHz, 2=32 kHz + guint8 tc :1; // time constant of emphasis: 1=50/15us, 0=reserved + guint8 ef :1; // emphasis: 0=on, 1=off + #elif defined(BIG_ENDIAN_BITFIELD) + guint8 ef :1; // emphasis: 0=on, 1=off + guint8 tc :1; // time constant of emphasis: 1=50/15us, 0=reserved + guint8 smp :3; // sampling frequency: 0=48kHz, 1=44,1 kHz, 2=32 kHz + guint8 qu :3; // quantization: 0=16bits linear, 1=12bits non-linear, 2=20bits linear, others reserved + #endif // BIG_ENDIAN_BITFIELD + } dv_aaux_as_pc4_t; + + // AAUX source pack (AS) + typedef struct { + guint8 pc0; // value is 0x50; + dv_aaux_as_pc1_t pc1; + dv_aaux_as_pc2_t pc2; + dv_aaux_as_pc3_t pc3; + dv_aaux_as_pc4_t pc4; + } dv_aaux_as_t; + + // From 61834-4 (section 8.2), and SMPE 314M (section 4.6.2.3.2) + typedef struct { + #if defined(LITTLE_ENDIAN_BITFIELD) + guint8 ss :2; /* 61834 says "Source and recorded situation...", SMPTE says EFC (emphasis audio channel flag) + 0=emphasis off, 1=emphasis on, others reserved. EFC shall be set for each audio block. */ + guint8 cmp :2; /* number of times compression: 0=once, 1=twice, 2=three or more, 3=no information */ + guint8 isr :2; /* 0=analog input, 1=digital input, 2=reserved, 3=no information */ + guint8 cgms :2; /* Copy generation management system: + 0=unrestricted, 1=not used, 2=one generation only, 3=no copy */ + #elif defined(BIG_ENDIAN_BITFIELD) + guint8 cgms :2; /* Copy generation management system: + 0=unrestricted, 1=not used, 2=one generation only, 3=no copy */ + guint8 isr :2; /* 0=analog input, 1=digital input, 2=reserved, 3=no information */ + guint8 cmp :2; /* number of times compression: 0=once, 1=twice, 2=three or more, 3=no information */ + guint8 ss :2; /* 61834 says "Source and recorded situation...", SMPTE says EFC (emphasis audio channel flag) + 0=emphasis off, 1=emphasis on, others reserved. EFC shall be set for each audio block. */ + #endif // BIG_ENDIAN_BITFIELD + } dv_aaux_asc_pc1_t; + + typedef struct { + #if defined(LITTLE_ENDIAN_BITFIELD) + guint8 insert_ch :3; /* see 61834-4... */ + guint8 rec_mode :3; /* recording mode: 1=original, others=various dubs... (see 68134-4) */ + guint8 rec_end :1; /* recording end point: same as starting... */ + guint8 rec_st :1; /* recording start point: 0=yes,1=no */ + #elif defined(BIG_ENDIAN_BITFIELD) + guint8 rec_st :1; /* recording start point: 0=yes,1=no */ + guint8 rec_end :1; /* recording end point: same as starting... */ + guint8 rec_mode :3; /* recording mode: 1=original, others=various dubs... (see 68134-4) */ + guint8 insert_ch :3; /* see 61834-4... */ + #endif // BIG_ENDIAN_BITFIELD + } dv_aaux_asc_pc2_t; + + typedef struct { + #if defined(LITTLE_ENDIAN_BITFIELD) + guint8 speed :7; /* speed: see tables in 314M and 61834-4 (they differ), except 0xff = invalid/unkown */ + guint8 drf :1; /* direction: 1=forward, 0=reverse */ + #elif defined(BIG_ENDIAN_BITFIELD) + guint8 drf :1; /* direction: 1=forward, 0=reverse */ + guint8 speed :7; /* speed: see tables in 314M and 61834-4 (they differ), except 0xff = invalid/unkown */ + #endif // BIG_ENDIAN_BITFIELD + } dv_aaux_asc_pc3_t; + + typedef struct { + #if defined(LITTLE_ENDIAN_BITFIELD) + guint8 genre_category: 7; + guint8 : 1; + #elif defined(BIG_ENDIAN_BITFIELD) + guint8 : 1; + guint8 genre_category: 7; + #endif // BIG_ENDIAN_BITFIELD + } dv_aaux_asc_pc4_t; + + // AAUX source control pack (ASC) + typedef struct { + guint8 pc0; // value is 0x51; + dv_aaux_asc_pc1_t pc1; + dv_aaux_asc_pc2_t pc2; + dv_aaux_asc_pc3_t pc3; + dv_aaux_asc_pc4_t pc4; + } dv_aaux_asc_t; + + typedef struct { + dv_aaux_as_t aaux_as; // low-level audio format info direct from the stream + dv_aaux_asc_t aaux_asc; + gint samples_this_frame; + gint quantization; + gint max_samples; + gint frequency; + gint num_channels; + gboolean emphasis; + gint arg_audio_emphasis; + gint arg_audio_frequency; + gint arg_audio_quantization; + #if HAVE_LIBPOPT + struct poptOption option_table[DV_AUDIO_NUM_OPTS+1]; + #endif // HAVE_LIBPOPT + } dv_audio_t; + + typedef struct { + guint quality; + gint arg_block_quality; // default 3 + gint arg_monochrome; + + #if HAVE_LIBPOPT + struct poptOption option_table[DV_VIDEO_NUM_OPTS+1]; + #endif // HAVE_LIBPOPT + + } dv_video_t; + + typedef struct { + guint quality; + dv_system_t system; + dv_std_t std; + dv_sample_t sampling; + gint num_dif_seqs; // DIF sequences per frame + gint height, width; + size_t frame_size; + dv_header_t header; + dv_audio_t *audio; + dv_video_t *video; + gint arg_video_system; + + gboolean prev_frame_decoded; + /* ------------------------------------------------------------------------- + * per dif sequence! there are 45 vaux data packs + * 1 byte header 4 byte data. + */ + guint8 vaux_next; + guint8 vaux_pack [256]; + guint8 vaux_data [45][4]; + + #if HAVE_LIBPOPT + struct poptOption option_table[DV_DECODER_NUM_OPTS+1]; + #endif // HAVE_LIBPOPT + } dv_decoder_t; + + typedef struct { + gint fd; + gint16 *buffer; + gchar *arg_audio_file; + gchar *arg_audio_device; + #if HAVE_LIBPOPT + struct poptOption option_table[DV_OSS_NUM_OPTS+1]; + #endif // HAVE_LIBPOPT + } dv_oss_t; + + #if ARCH_X86 + extern gboolean dv_use_mmx; + #endif + + #endif // DV_TYPES_H diff -C2 -r -N bcast-2000c/quicktime/libdv/dvprivate.h bcast-2000c-mf3/quicktime/libdv/dvprivate.h *** bcast-2000c/quicktime/libdv/dvprivate.h Mon Jan 22 21:55:48 2001 --- bcast-2000c-mf3/quicktime/libdv/dvprivate.h Thu Jan 1 01:00:00 1970 *************** *** 1,47 **** - #ifndef DVPRIVATE_H - #define DVPRIVATE_H - - #include "dv.h" - #include - #include - #include - - #ifdef HAVE_FIREWIRE - #include "../libraw1394/raw1394.h" - - typedef struct - { - raw1394handle_t handle; - int done; - unsigned char **frame_buffer; - long bytes_read; - long frame_size; - int output_frame, input_frame; - int frames; - int port; - int channel; - - int crash; - int still_alive; - int interrupted; - int capturing; - struct timeval delay; - pthread_t keepalive_tid; - - pthread_t tid; - pthread_mutex_t *input_lock, *output_lock; - } dv_grabber_t; - #endif - - typedef struct - { - dv_videosegment_t videoseg __attribute__ ((aligned (64))); - dv_audiosegment_t audioseg; - int use_mmx; - } dv_t; - - - - - - #endif --- 0 ---- diff -C2 -r -N bcast-2000c/quicktime/libdv/enc_audio_input.c bcast-2000c-mf3/quicktime/libdv/enc_audio_input.c *** bcast-2000c/quicktime/libdv/enc_audio_input.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/enc_audio_input.c Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,397 ---- + /* + * enc_input.c + * + * Copyright (C) Peter Schlaile - Feb 2001 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + #include + #include + #include + #include + #include + + #include "enc_audio_input.h" + + #if HAVE_SYS_SOUNDCARD_H + #define HAVE_DEV_DSP 1 + #endif + + #if HAVE_DEV_DSP + #include + #include + #include + #include + #include + #include + #include + #include + #endif + + // #define ARCH_X86 0 + + static jmp_buf error_jmp_env; + + static void (*audio_converter)(unsigned char* in_buf, unsigned char* out_buf, + int num_samples) = NULL; + + static void convert_u8(unsigned char* in_buf, unsigned char* out_buf, + int num_samples) + { + int i; + for (i = 0; i < num_samples; i++) { + int val = *in_buf++ - 128; + *out_buf++ = val >> 8; + *out_buf++ = val & 0xff; + } + } + + + static void convert_s16_le(unsigned char* in_buf, unsigned char* out_buf, + int num_samples) + { + int i; + for (i = 0; i < num_samples; i++) { + *out_buf++ = in_buf[1]; + *out_buf++ = in_buf[0]; + in_buf += 2; + } + } + + static void convert_s16_be(unsigned char* in_buf, unsigned char* out_buf, + int num_samples) + { + memcpy(out_buf, in_buf, 2*num_samples); + } + + static void convert_u16_le(unsigned char* in_buf, unsigned char* out_buf, + int num_samples) + { + int i; + for (i = 0; i < num_samples; i++) { + int val = (in_buf[0] + (in_buf[1] << 8)) - 32768; + *out_buf++ = val >> 8; + *out_buf++ = val & 0xff; + in_buf += 2; + } + } + + static void convert_u16_be(unsigned char* in_buf, unsigned char* out_buf, + int num_samples) + { + int i; + for (i = 0; i < num_samples; i++) { + int val = (in_buf[1] + (in_buf[0] << 8)) - 32768; + *out_buf++ = val >> 8; + *out_buf++ = val & 0xff; + in_buf += 2; + } + } + + + unsigned long read_long(FILE* in_wav) + { + unsigned char buf[4]; + + if (fread(buf, 1, 4, in_wav) != 4) { + fprintf(stderr, "WAV: Short read!\n"); + longjmp(error_jmp_env, 1); + } + + return buf[0] + (buf[1] << 8) + (buf[2] << 16) + (buf[3] << 24); + } + + unsigned long read_short(FILE* in_wav) + { + unsigned char buf[2]; + if (fread(buf, 1, 2, in_wav) != 2) { + fprintf(stderr, "WAV: Short read!\n"); + longjmp(error_jmp_env, 1); + } + + return buf[0] + (buf[1] << 8); + } + + void read_header(FILE* in_wav, char* header) + { + unsigned char buf[4]; + + if (fread(buf, 1, 4, in_wav) != 4) { + fprintf(stderr, "WAV: Short read!\n"); + longjmp(error_jmp_env, 1); + } + + if (memcmp(buf, header, 4) != 0) { + fprintf(stderr, "WAV: No %s header!\n", header); + longjmp(error_jmp_env, 1); + } + } + + int parse_wave_header(FILE* in_wav, dv_enc_audio_info_t * res) + { + unsigned char fmt_header_junk[1024]; + int header_len; + + if (setjmp(error_jmp_env)) { + return -1; + } + + read_header(in_wav, "RIFF"); + read_long(in_wav); /* ignore length, this is important, + since stream generated wavs do not have a + valid length! */ + + read_header(in_wav, "WAVE"); + read_header(in_wav, "fmt "); + header_len = read_long(in_wav); + if (header_len > 1024) { + fprintf(stderr, "WAV: Header too large!\n"); + return -1; + } + + read_short(in_wav); /* format tag */ + res->channels = read_short(in_wav); + res->frequency = read_long(in_wav); + res->bytespersecond = read_long(in_wav); /* bytes per second */ + res->bytealignment = read_short(in_wav); /* byte alignment */ + res->bitspersample = read_short(in_wav); + if (header_len - 16) { + fread(fmt_header_junk, 1, header_len - 16, in_wav); + } + read_header(in_wav, "data"); + read_long(in_wav); /* ignore length, this is important, + since stream generated wavs do not have a + valid length! */ + + switch (res->frequency) { + case 48000: + case 44100: + if (res->channels != 2) { + fprintf(stderr, + "WAV: Unsupported channel count (%d) for " + "frequency %d!\n", res->channels, + res->frequency); + return(-1); + } + break; + case 32000: + if (res->channels != 4 && res->channels != 2) { + fprintf(stderr, + "WAV: Unsupported channel count (%d) for " + "frequency %d!\n", res->channels, + res->frequency); + return(-1); + } + break; + default: + fprintf(stderr, "WAV: Unsupported frequency: %d\n", + res->frequency); + return(-1); + } + if (res->bitspersample != 16) { + fprintf(stderr, "WAV: Unsupported bitspersample: %d Only 16 " + "bits are supported right now. (FIXME: just look in " + "audio.c and copy the code if you " + "really need this!)\n", res->bitspersample); + return(-1); + } + + return 0; + } + + static void bytesperframe(dv_enc_audio_info_t * audio_info, int isPAL) + { + audio_info->bytesperframe = audio_info->bytespersecond/(isPAL?25 : 30); + } + + static FILE* audio_fp = NULL; + + int wav_init(const char* filename, dv_enc_audio_info_t * audio_info) + { + audio_fp = fopen(filename, "r"); + + if (!audio_fp) { + fprintf(stderr, "Can't open WAV file: %s\n", filename); + return(-1); + } + + if (parse_wave_header(audio_fp, audio_info)) { + return(-1); + } + + audio_converter = convert_s16_le; + + return(0); + } + + void wav_finish() + { + fclose(audio_fp); + } + + int wav_load(dv_enc_audio_info_t * audio_info, int isPAL) + { + int rval; + unsigned char data[1920 * 2 * 2]; + + bytesperframe(audio_info, isPAL); + + rval = (fread(data, 1, audio_info->bytesperframe, audio_fp) + != audio_info->bytesperframe); + if (!rval) { + audio_converter(data, audio_info->data, + audio_info->bytesperframe / 2); + } + return rval; + } + + #if HAVE_DEV_DSP + + #define ioerror(msg, res) \ + if (res == -1) { \ + perror(msg); \ + return(-1); \ + } + + static int audio_fd = -1; + static int audio_fmt = 0; + + static int dsp_bytes_per_sample; + + static int dsp_init(const char* filename, dv_enc_audio_info_t * audio_info) + { + int frequencies[] = {48000, 44100, 32000, 0}; + int * p; + + audio_fd = open(filename, O_RDONLY); + + if (audio_fd == -1) { + perror("Can't open /dev/dsp"); + return(-1); + } + + ioerror("DSP_GETFMTS", ioctl(audio_fd, SNDCTL_DSP_GETFMTS,&audio_fmt)); + + dsp_bytes_per_sample = 2*2; + + if (audio_fmt & AFMT_S16_BE) { + audio_converter = convert_s16_be; + audio_fmt = AFMT_S16_BE; + } else if (audio_fmt & AFMT_S16_LE) { + audio_converter = convert_s16_le; + audio_fmt = AFMT_S16_LE; + } else if (audio_fmt & AFMT_U16_BE) { + audio_converter = convert_u16_be; + audio_fmt = AFMT_U16_BE; + } else if (audio_fmt & AFMT_U16_LE) { + audio_converter = convert_u16_le; + audio_fmt = AFMT_U16_LE; + } else if (audio_fmt & AFMT_U8) { + audio_converter = convert_u8; + audio_fmt = AFMT_U8; + dsp_bytes_per_sample = 1*2; + } else { + fprintf(stderr, "DSP: No supported audio format found for " + "device %s!\n", filename); + return(-1); + } + + ioerror("DSP_SETFMT", ioctl(audio_fd, SNDCTL_DSP_SETFMT, &audio_fmt)); + + audio_info->channels = 2; + + ioerror("DSP_CHANNELS", ioctl(audio_fd, SNDCTL_DSP_CHANNELS, + &audio_info->channels)); + + for (p = frequencies; *p; p++) { + audio_info->frequency = *p; + + ioerror("DSP_SPEED", ioctl(audio_fd, SNDCTL_DSP_SPEED, + &audio_info->frequency)); + if (audio_info->frequency == *p) { + break; + } + } + + if (!*p) { + fprintf(stderr, "DSP: No supported sampling rate found for " + "device %s (48000, 44100 or 32000)!\n", filename); + return(-1); + } + + audio_info->bitspersample = 16; + audio_info->bytespersecond = audio_info->frequency * 4; + audio_info->bytealignment = 4; + + return 0; + } + + static void dsp_finish() + { + close(audio_fd); + } + + static int dsp_load(dv_enc_audio_info_t * audio_info, int isPAL) + { + int rval; + unsigned char data[1920 * 2 * 2]; + int wanted = audio_info->bytesperframe * dsp_bytes_per_sample / 4; + + bytesperframe(audio_info, isPAL); + + rval = (read(audio_fd, data, wanted) != wanted); + + if (!rval) { + audio_converter(data, audio_info->data, + audio_info->bytesperframe / 2); + } + return rval; + } + + #endif + + static dv_enc_audio_input_filter_t filters[DV_ENC_MAX_AUDIO_INPUT_FILTERS] = { + { wav_init, wav_finish, wav_load, "wav" }, + #if HAVE_DEV_DSP + { dsp_init, dsp_finish, dsp_load, "dsp" }, + #endif + { NULL, NULL, NULL, NULL } + }; + + void dv_enc_register_audio_input_filter(dv_enc_audio_input_filter_t filter) + { + dv_enc_audio_input_filter_t * p = filters; + while (p->filter_name) p++; + *p++ = filter; + p->filter_name = NULL; + } + + int get_dv_enc_audio_input_filters(dv_enc_audio_input_filter_t ** filters_, + int * count) + { + dv_enc_audio_input_filter_t * p = filters; + + *count = 0; + while (p->filter_name) p++, (*count)++; + + *filters_ = filters; + return 0; + } diff -C2 -r -N bcast-2000c/quicktime/libdv/enc_audio_input.h bcast-2000c-mf3/quicktime/libdv/enc_audio_input.h *** bcast-2000c/quicktime/libdv/enc_audio_input.h Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/enc_audio_input.h Mon Oct 1 05:16:38 2001 *************** *** 0 **** --- 1,68 ---- + /* + * enc_audio_input.h + * + * Copyright (C) Peter Schlaile - Feb 2001 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + #ifndef DV_ENC_AUDIO_INPUT_H + #define DV_ENC_AUDIO_INPUT_H + + #include "dv_types.h" + + #ifdef __cplusplus + extern "C" { + #endif + #define DV_ENC_MAX_AUDIO_INPUT_FILTERS 32 + + typedef struct dv_enc_audio_info_s { + /* stored by init (but could be used for on the fly sample + rate changes) */ + int channels; + int frequency; + int bitspersample; + int bytespersecond; + int bytealignment; + /* stored by load */ + int bytesperframe; + /* big endian 12/16 bit is assumed */ + unsigned char data[1920 * 2 * 2]; /* max 48000.0 Hz PAL */ + } dv_enc_audio_info_t; + + typedef struct dv_audio_enc_input_filter_s { + int (*init)(const char* filename, + dv_enc_audio_info_t * audio_info); + void (*finish)(); + int (*load)(dv_enc_audio_info_t * audio_info, int isPAL); + + const char* filter_name; + } dv_enc_audio_input_filter_t; + + extern void dv_enc_register_audio_input_filter( + dv_enc_audio_input_filter_t filter); + extern int get_dv_enc_audio_input_filters( + dv_enc_audio_input_filter_t ** filters, int * count); + + #ifdef __cplusplus + } + #endif + + #endif // DV_ENC_AUDIO_INPUT_H diff -C2 -r -N bcast-2000c/quicktime/libdv/enc_input.c bcast-2000c-mf3/quicktime/libdv/enc_input.c *** bcast-2000c/quicktime/libdv/enc_input.c Thu Jan 1 01:00:00 1970 --- bcast-2000c-mf3/quicktime/libdv/enc_input.c Thu Dec 6 16:53:52 2001 *************** *** 0 **** --- 1,1072 ---- + /* + * enc_input.c + * + * Copyright (C) Peter Schlaile - Feb 2001 + * + * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) + * codec. + * + * libdv is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * libdv 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The libdv homepage is http://libdv.sourceforge.net/. + */ + + #include + #include + #include + #include + + #include "enc_input.h" + #include "encode.h" + #include "dct.h" + #include "dv_types.h" + #if ARCH_X86 + #include "mmx.h" + #endif + + #if HAVE_LINUX_VIDEODEV_H + #define HAVE_DEV_VIDEO 1 + #endif + + #if HAVE_DEV_VIDEO + #include + #include + #include + #include + #include + #include + #include + #include + #endif + + // #define ARCH_X86 0 + + #if !ARCH_X86 + inline gint f2b(float f) + { + int b = rint(f); + if (b < 0) + b = 0; + if (b > 255) + b = 255; + + return b; + } + + + inline gint f2sb(float f) + { + int b = rint(f); + + return b; + } + #endif + + + + + + + + + + + + + + + + + + + + + + #if 0 + + + + + + + extern void rgbtoycb_mmx(unsigned char* inPtr, int rows, int columns, + short* outyPtr, short* outuPtr, short* outvPtr); + + void dv_enc_rgb_to_ycb(unsigned char* img_rgb, int height, + short* img_y, short* img_cr, short* img_cb) + { + #if !ARCH_X86 + #if 1 + int i; + int ti; + unsigned char *ip; + register long r,g,b ; + long colr, colb; + register short int *ty, *tr, *tb; + ip = img_rgb; + colr = colb = 0; + ty = img_y; + tr = img_cr; + tb = img_cb; + ti = height * DV_WIDTH ; + for (i = 0; i < ti; i++) { + r = *ip++; + g = *ip++; + b = *ip++; + + *ty++ = (( ( (16828 * r) + (33038 * g) + (6416 * b) ) + >> 16 ) - 128 + 16) << DCT_YUV_PRECISION; + + colr += ( (28784 * r) + (-24121 * g) + (-4663 * b) ) ; + colb += ( (-9729 * r) + (-19055 * g) + (28784 * b) ) ; + if (! (i % 2)) { + *tr++ = colr >> (16 + 1 - DCT_YUV_PRECISION); + *tb++ = colb >> (16 + 1 - DCT_YUV_PRECISION); + colr = colb = 0; + } + } + #else + int x,y; + /* This is the RGB -> YUV color matrix */ + static const double cm[3][3] = { + {.299 * 219.0/255.0,.587* 219.0/255.0,.114* 219.0/255.0}, + {.5* 224.0/255.0,-.419* 224.0/255.0,-.081* 224.0/255.0}, + {-.169 * 224.0/255.0,-.331* 224.0/255.0,.5* 224.0/255.0} + }; + + double tmp_cr[DV_PAL_HEIGHT][DV_WIDTH]; + double tmp_cb[DV_PAL_HEIGHT][DV_WIDTH]; + double fac = pow(2, DCT_YUV_PRECISION); + int i,j; + + for (y = 0; y < height; y++) { + for (x = 0; x < DV_WIDTH; x++) { + register double cy, cr, cb; + register int r = img_rgb[(y * DV_WIDTH + x)*3 + 0]; + register int g = img_rgb[(y * DV_WIDTH + x)*3 + 1]; + register int b = img_rgb[(y * DV_WIDTH + x)*3 + 2