Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package webpjs_fla {
- import com.adobe.serialization.json.*;
- import flash.events.*;
- import flash.display.*;
- import flash.net.*;
- import flash.text.*;
- import flash.utils.*;
- import adobe.utils.*;
- import flash.accessibility.*;
- import flash.desktop.*;
- import flash.errors.*;
- import flash.external.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.media.*;
- import flash.printing.*;
- import flash.profiler.*;
- import flash.sampler.*;
- import flash.system.*;
- import flash.text.engine.*;
- import flash.ui.*;
- import flash.xml.*;
- public dynamic class MainTimeline extends MovieClip {
- public var VP8FilterHeader;
- public var NUM_MV_PROBAS;
- public var MODE_RGB;
- public var VP8SimpleVFilter16;
- public var VP8FInfo;
- public var WebPRescaler;
- public var MODE_BGR;
- public var loader:URLLoader;
- public var MODE_YUV;
- public var DEC_REV_VERSION;
- public var VP8VFilter8i;
- public var my_imgHeight;
- public var TM_PRED;
- public var ALIGN_MASK;
- public var VP8_STATUS_BITSTREAM_ERROR;
- public var B_PRED;
- public var my_styleHeight;
- public var Y_SIZE;
- public var NUM_REF_LF_DELTAS;
- public var VP8ThreadContext;
- public var VP8HFilter16i;
- public var kZigzag;
- public var CoeffsUpdateProba;
- public var my_url;
- public var VP8StatusCode;
- public var VP8kClip;
- public var YUV_SIZE;
- public var Y_OFF;
- public var V_PRED;
- public var WebPDecoderOptions;
- public var token_br;
- public var VP8Transform;
- public var short;
- public var NUM_MODE_LF_DELTAS;
- public var my_mode;
- public var MODE_RGB_565;
- public var B_HD_PRED;
- public var PackedNz;
- public var param;
- public var WebPDecodeARGB;
- public var uint8_t;
- public var YUV_HALF;
- public var my_id;
- public var VP8PredLuma16;
- public var VP8TransformDCUV;
- public var WebPGetDecoderVersion;
- public var info;
- public var VP8SimpleVFilter16i;
- public var stopAction:Boolean;
- public var WebPDecodeRGBA;
- public var WebPDecodeBGRA;
- public var uint32_t;
- public var my_imgWidth;
- public var VP8HFilter16;
- public var VP8PictureHeader;
- public var kVP8NewRange;
- public var B_RD_PRED;
- public var VP8BitReader;
- public var VP8X_HEADER_SIZE;
- public var VP8HFilter8;
- public var VP8SimpleHFilter16i;
- public var VP8kClip4Bits;
- public var B_TM_PRED;
- public var B_HE_PRED;
- public var MT_CACHE_LINES;
- public var NUM_B_DC_MODES;
- public var WebPUpsamplersKeepAlpha;
- public var kVP8Log2Range;
- public var NUM_PROBAS;
- public var VP8VFilter8;
- public var int16_t;
- public var void_;
- public var VP8TransformDC;
- public var VP8kUToB;
- public var VP8kUToG;
- public var kFilterExtraRows;
- public var kScan;
- public var pic:MovieClip;
- public var B_LD_PRED;
- public var uint64_t;
- public var MODE_RGBA_4444;
- public var VP8Proba;
- public var MAX_NUM_PARTITIONS;
- public var firstTime;
- public var VP8Decoder;
- public var NUM_CTX;
- public var BPS;
- public var WebPUpsamplers;
- public var DEC_MAJ_VERSION;
- public var kUnpackTab;
- public var YUV_RANGE_MAX;
- public var kAcTable;
- public var VP8kVToG;
- public var WEBP_CSP_MODE;
- public var V_OFF;
- public var MODE_ARGB;
- public var WebPBitstreamFeatures;
- public var DC_PRED;
- public var VP8SimpleHFilter16;
- public var tables_ok;
- public var kC1;
- public var kC2;
- public var abs0;
- public var abs1;
- public var score_t;
- public var VP8kVToR;
- public var myText_txt:TextField;
- public var ProbaArray;
- public var kCat3;
- public var kCat4;
- public var kCat6;
- public var VP8HFilter8i;
- public var VP8PredLuma4;
- public var kCat5;
- public var B_DC_PRED_NOTOPLEFT;
- public var NUM_TYPES;
- public var sclip1;
- public var sclip2;
- public var int_;
- public var MODE_RGBA;
- public var kModeBpp;
- public var float;
- public var MODE_BGRA;
- public var U_OFF;
- public var WebPDecoderConfig;
- public var RFIX;
- public var long;
- public var WebPYUVABuffer;
- public var VP8Io;
- public var CoeffsProba0;
- public var bmData:BitmapData;
- public var NUM_BANDS;
- public var WebPDecBuffer;
- public var kCat3456;
- public var B_VE_PRED;
- public var B_DC_PRED_NOTOP;
- public var VP8FrameHeader;
- public var kYModesIntra4;
- public var PACK_CST;
- public var B_VR_PRED;
- public var VP8_STATUS_USER_ABORT;
- public var YUV_RANGE_MIN;
- public var DEC_MIN_VERSION;
- public var VP8MB;
- public var clip1;
- public var B_DC_PRED;
- public var ST_CACHE_LINES;
- public var kSamplers;
- public var YUV_FIX;
- public var kBModesProba;
- public var VP8_STATUS_UNSUPPORTED_FEATURE;
- public var int32_t;
- public var VP8_STATUS_OK;
- public var WEBP_DECODER_ABI_VERSION;
- public var B_VL_PRED;
- public var NUM_BMODES;
- public var VP8_STATUS_SUSPENDED;
- public var B_DC_PRED_NOLEFT;
- public var VP8VFilter16;
- public var B_HU_PRED;
- public var my_styleWidth;
- public var WebPImage;
- public var WebPRGBABuffer;
- public var kBands;
- public var uint16_t;
- public var VP8QuantMatrix;
- public var char;
- public var VP8_STATUS_INVALID_PARAM;
- public var RIFF_HEADER_SIZE;
- public var VP8TransformUV;
- public var my_bgRepeat;
- public var VP8SegmentHeader;
- public var VP8PredChroma8;
- public var done;
- public var WebPFreeDecBuffer;
- public var my_bgpos;
- public var kYUV444Converters;
- public var int64_t;
- public var MB_FEATURE_TREE_PROBS;
- public var NUM_MB_SEGMENTS;
- public var MODE_LAST;
- public var kDcTable;
- public var size_t;
- public var H_PRED;
- public var WebPDecodeRGB;
- public var WebPDecodeRGBA_4444;
- public var double;
- public var WebPDecodeBGR;
- public var int8_t;
- public var VP8_STATUS_NOT_ENOUGH_DATA;
- public var MODE_YUVA;
- public var VP8_STATUS_OUT_OF_MEMORY;
- public var WebPDecParams;
- public var VP8VFilter16i;
- public function MainTimeline(){
- addFrameScript(0, this.frame1);
- }
- public function DC8uvNoTop(_arg1, _arg2){
- var _local4:*;
- var _local3:* = 4;
- _local4 = 0;
- while (_local4 < 8) {
- _local3 = (_local3 + _arg1[((_arg2 - 1) + (_local4 * this.BPS))]);
- _local4++;
- };
- this.Put8x8uv(((_local3 >> 3) * 1), _arg1, _arg2);
- }
- public function VP8New(_arg1){
- var _local2:* = this.newObjectIt(this.VP8Decoder);
- if (_local2){
- this.SetOk(_local2);
- _local2.ready_ = 0;
- };
- return (_local2);
- }
- public function HFilter16(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
- this.FilterLoop26(_arg1, (_arg2 + 0), 1, _arg3, 16, _arg4, _arg5, _arg6);
- }
- public function VP8Delete(_arg1){
- if (_arg1){
- this.VP8Clear(_arg1);
- _arg1 = 0;
- };
- }
- public function Put8x8uv(_arg1, _arg2, _arg3){
- var _local4:*;
- var _local5:*;
- _local4 = 0;
- while (_local4 < 8) {
- _local5 = 0;
- while (_local5 < 8) {
- _arg2[((_arg3 + _local5) + (_local4 * this.BPS))] = _arg1;
- _local5++;
- };
- _local4++;
- };
- }
- public function do_filter2(_arg1, _arg2, _arg3){
- var _local4:* = _arg1[(_arg2 - (2 * _arg3))];
- var _local5:* = _arg1[(_arg2 - _arg3)];
- var _local6:* = _arg1[(_arg2 + 0)];
- var _local7:* = _arg1[(_arg2 + _arg3)];
- var _local8:* = ((3 * (_local6 - _local5)) + this.sclip1[((1020 + _local4) - _local7)]);
- var _local9:* = this.sclip2[(112 + ((_local8 + 4) >> 3))];
- var _local10:* = this.sclip2[(112 + ((_local8 + 3) >> 3))];
- _arg1[(_arg2 - _arg3)] = this.clip1[((0xFF + _local5) + _local10)];
- _arg1[(_arg2 + 0)] = this.clip1[((0xFF + _local6) - _local9)];
- }
- public function do_filter4(_arg1, _arg2, _arg3){
- var _local4:* = _arg1[(_arg2 - (2 * _arg3))];
- var _local5:* = _arg1[(_arg2 - _arg3)];
- var _local6:* = _arg1[(_arg2 + 0)];
- var _local7:* = _arg1[(_arg2 + _arg3)];
- var _local8:* = (3 * (_local6 - _local5));
- var _local9:* = this.sclip2[(112 + ((_local8 + 4) >> 3))];
- var _local10:* = this.sclip2[(112 + ((_local8 + 3) >> 3))];
- var _local11:* = ((_local9 + 1) >> 1);
- _arg1[(_arg2 - (2 * _arg3))] = this.clip1[((0xFF + _local4) + _local11)];
- _arg1[(_arg2 - _arg3)] = this.clip1[((0xFF + _local5) + _local10)];
- _arg1[(_arg2 + 0)] = this.clip1[((0xFF + _local6) - _local9)];
- _arg1[(_arg2 + _arg3)] = this.clip1[((0xFF + _local7) - _local11)];
- }
- public function VP8ParseIntraMode(_arg1, _arg2){
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local3:* = _arg2.intra_t_;
- _local3[(_local3.length - 1)] = (0 + (4 * _arg2.mb_x_));
- var _local4:* = _arg2.intra_l_;
- _arg2.is_i4x4_ = !(this.VP8GetBit(_arg1, 145));
- if (!_arg2.is_i4x4_){
- _local5 = ((this.VP8GetBit(_arg1, 156)) ? ((this.VP8GetBit(_arg1, 128)) ? this.TM_PRED : this.H_PRED) : ((this.VP8GetBit(_arg1, 163)) ? this.V_PRED : this.DC_PRED));
- _arg2.imodes_[0] = _local5;
- _local11 = 0;
- while (_local11 < 4) {
- _local3[(_local11 + _local3[(_local3.length - 1)])] = _local5;
- _local11++;
- };
- _local11 = 0;
- while (_local11 < 4) {
- _local4[_local11] = _local5;
- _local11++;
- };
- } else {
- _local6 = _arg2.imodes_;
- _local7 = 0;
- _local8 = 0;
- while (_local8 < 4) {
- _local5 = _local4[_local8];
- _local9 = 0;
- while (_local9 < 4) {
- _local10 = this.kBModesProba[_local3[(_local3[(_local3.length - 1)] + _local9)]][_local5];
- _local11 = 0;
- do {
- _local11 = this.kYModesIntra4[((2 * _local11) + this.VP8GetBit(_arg1, _local10[_local11]))];
- } while (_local11 > 0);
- _local5 = -(_local11);
- _local3[(_local3[(_local3.length - 1)] + _local9)] = _local5;
- _local6[_local7] = _local5;
- _local7++;
- _local9++;
- };
- _local4[_local8] = _local5;
- _local8++;
- };
- };
- _arg2.uvmode_ = ((this.VP8GetBit(_arg1, 142)) ? ((this.VP8GetBit(_arg1, 114)) ? ((this.VP8GetBit(_arg1, 183)) ? this.TM_PRED : this.H_PRED) : this.V_PRED) : this.DC_PRED);
- }
- public function InitYUVRescaler(_arg1, _arg2){
- var _local3:*;
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local12:*;
- var _local13:*;
- var _local14:*;
- var _local15:*;
- _local3 = this.IsAlphaMode(_arg2.output.colorspace);
- _local4 = _arg2.output.u.YUVA;
- _local5 = _arg1.scaled_width;
- _local6 = _arg1.scaled_height;
- _local7 = ((_local5 + 1) >> 1);
- _local8 = ((_local6 + 1) >> 1);
- _local9 = ((_arg1.mb_w + 1) >> 1);
- _local10 = ((_arg1.mb_h + 1) >> 1);
- _local11 = (2 * _local5);
- _local12 = (2 * _local7);
- _local13 = this.size_t;
- _local14 = this.int32_t;
- _local15 = 0;
- _local13 = (_local11 + (2 * _local12));
- if (_local3){
- _local13 = (_local13 + _local11);
- };
- _arg2.memory = this.malloc(((_local13 * this.sizeof(_local14)) * 4), 0);
- if (_arg2.memory == null){
- return (0);
- };
- _local14 = _arg2.memory;
- _local15 = 0;
- this.InitRescaler(_arg2.scaler_y, _arg1.mb_w, _arg1.mb_h, _local4.y, _local4.y_off, _local5, _local6, _local4.y_stride, _arg1.mb_w, _local5, _arg1.mb_h, _local6, _local14, _local15);
- this.InitRescaler(_arg2.scaler_u, _local9, _local10, _local4.u, _local4.u_off, _local7, _local8, _local4.u_stride, _local9, _local7, _local10, _local8, _local14, (_local15 + _local11));
- this.InitRescaler(_arg2.scaler_v, _local9, _local10, _local4.v, _local4.v_off, _local7, _local8, _local4.v_stride, _local9, _local7, _local10, _local8, _local14, ((_local15 + _local11) + _local12));
- _arg2.emit = this.EmitRescaledYUV;
- if (_local3){
- this.InitRescaler(_arg2.scaler_a, _arg1.mb_w, _arg1.mb_h, _local4.a, _local4.a_off, _local5, _local6, _local4.a_stride, _arg1.mb_w, _local5, _arg1.mb_h, _local6, _local14, ((_local15 + _local11) + (2 * _local12)));
- _arg2.emit_alpha = this.EmitRescaledAlphaYUV;
- };
- return (1);
- }
- public function do_filter6(_arg1, _arg2, _arg3){
- var _local4:* = _arg1[(_arg2 - (3 * _arg3))];
- var _local5:* = _arg1[(_arg2 - (2 * _arg3))];
- var _local6:* = _arg1[(_arg2 - _arg3)];
- var _local7:* = _arg1[(_arg2 + 0)];
- var _local8:* = _arg1[(_arg2 + _arg3)];
- var _local9:* = _arg1[(_arg2 + (2 * _arg3))];
- var _local10:* = this.sclip1[((1020 + (3 * (_local7 - _local6))) + this.sclip1[((1020 + _local5) - _local8)])];
- var _local11:* = (((27 * _local10) + 63) >> 7);
- var _local12:* = (((18 * _local10) + 63) >> 7);
- var _local13:* = (((9 * _local10) + 63) >> 7);
- _arg1[(_arg2 - (3 * _arg3))] = this.clip1[((0xFF + _local4) + _local13)];
- _arg1[(_arg2 - (2 * _arg3))] = this.clip1[((0xFF + _local5) + _local12)];
- _arg1[(_arg2 - _arg3)] = this.clip1[((0xFF + _local6) + _local11)];
- _arg1[(_arg2 + 0)] = this.clip1[((0xFF + _local7) - _local11)];
- _arg1[(_arg2 + _arg3)] = this.clip1[((0xFF + _local8) - _local12)];
- _arg1[(_arg2 + (2 * _arg3))] = this.clip1[((0xFF + _local9) - _local13)];
- }
- public function DoFilter(_arg1, _arg2, _arg3){
- var _local12:*;
- var _local13:*;
- var _local14:*;
- var _local15:*;
- var _local16:*;
- var _local17:*;
- var _local4:* = _arg1.thread_ctx_;
- var _local5:* = _arg1.cache_y_stride_;
- var _local6:* = _local4.f_info_[(1 + _arg2)];
- var _local7:* = _arg1.cache_y_;
- var _local8:* = ((_arg1.cache_y_off + ((_local4.id_ * 16) * _local5)) + (_arg2 * 16));
- var _local9:* = _local6.f_level_;
- var _local10:* = _local6.f_ilevel_;
- var _local11:* = ((2 * _local9) + _local10);
- if (_local9 == 0){
- return;
- };
- if (_arg1.filter_type_ == 1){
- if (_arg2 > 0){
- this.VP8SimpleHFilter16(_local7, _local8, _local5, (_local11 + 4));
- };
- if (_local6.f_inner_){
- this.VP8SimpleHFilter16i(_local7, _local8, _local5, _local11);
- };
- if (_arg3 > 0){
- this.VP8SimpleVFilter16(_local7, _local8, _local5, (_local11 + 4));
- };
- if (_local6.f_inner_){
- this.VP8SimpleVFilter16i(_local7, _local8, _local5, _local11);
- };
- } else {
- _local12 = _arg1.cache_uv_stride_;
- _local13 = _arg1.cache_u_;
- _local14 = ((_arg1.cache_u_off + ((_local4.id_ * 8) * _local12)) + (_arg2 * 8));
- _local15 = _arg1.cache_v_;
- _local16 = ((_arg1.cache_v_off + ((_local4.id_ * 8) * _local12)) + (_arg2 * 8));
- _local17 = this.hev_thresh_from_level(_local9, _arg1.frm_hdr_.key_frame_);
- if (_arg2 > 0){
- this.VP8HFilter16(_local7, _local8, _local5, (_local11 + 4), _local10, _local17);
- this.VP8HFilter8(_local13, _local14, _local15, _local16, _local12, (_local11 + 4), _local10, _local17);
- };
- if (_local6.f_inner_){
- this.VP8HFilter16i(_local7, _local8, _local5, _local11, _local10, _local17);
- this.VP8HFilter8i(_local13, _local14, _local15, _local16, _local12, _local11, _local10, _local17);
- };
- if (_arg3 > 0){
- this.VP8VFilter16(_local7, _local8, _local5, (_local11 + 4), _local10, _local17);
- this.VP8VFilter8(_local13, _local14, _local15, _local16, _local12, (_local11 + 4), _local10, _local17);
- };
- if (_local6.f_inner_){
- this.VP8VFilter16i(_local7, _local8, _local5, _local11, _local10, _local17);
- this.VP8VFilter8i(_local13, _local14, _local15, _local16, _local12, _local11, _local10, _local17);
- };
- };
- }
- public function EmitRescaledAlphaYUV(_arg1, _arg2){
- if (_arg1.a != null){
- this.Rescale(_arg1.a, _arg1.a_off, _arg1.width, _arg1.mb_h, _arg2.scaler_a);
- };
- return (0);
- }
- public function ParseResiduals(_arg1, _arg2, _arg3){
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local17:*;
- var _local18:*;
- var _local19:*;
- var _local20:*;
- var _local21:*;
- var _local22:*;
- var _local23:*;
- var _local7:* = this.ProbaArray;
- var _local8:* = _arg1.dqm_[_arg1.segment_];
- var _local9:* = _arg1.coeffs_;
- var _local10:* = _arg1.mb_info_[(1 - 1)];
- var _local11:* = this.Arr(4, 0);
- var _local12:* = this.Arr(4, 0);
- var _local13:* = this.Arr(4, 0);
- var _local14:* = this.Arr(4, 0);
- var _local15:* = 0;
- var _local16:* = 0;
- _local9 = this.memset(0, (384 * this.sizeof(_local9)));
- if (!_arg1.is_i4x4_){
- _local20 = this.Arr(16, 0);
- _local21 = (_arg2.dc_nz_ + _local10.dc_nz_);
- _arg2.dc_nz_ = (_local10.dc_nz_ = ((this.GetCoeffs(_arg3, _arg1.proba_.coeffs_[1], _local21, _local8.y2_mat_, 0, _local20) > 0) + 0));
- _local6 = 1;
- _local7 = _arg1.proba_.coeffs_[0];
- this.VP8TransformWHT(_local20, _local9);
- _local9[(_local9.length - 1)] = 0;
- } else {
- _local6 = 0;
- _local7 = _arg1.proba_.coeffs_[3];
- };
- _local13 = this.ArrCopy(this.kUnpackTab[(_arg2.nz_ & 15)]);
- _local14 = this.ArrCopy(this.kUnpackTab[(_local10.nz_ & 15)]);
- _local18 = 0;
- while (_local18 < 4) {
- _local22 = _local14[_local18];
- _local17 = 0;
- while (_local17 < 4) {
- _local21 = (_local22 + _local13[_local17]);
- _local23 = this.GetCoeffs(_arg3, _local7, _local21, _local8.y1_mat_, _local6, _local9);
- _local22 = ((_local23 > 0) + 0);
- _local13[_local17] = _local22;
- _local12[_local17] = (!((_local9[(_local9[(_local9.length - 1)] + 0)] == 0)) + 0);
- _local11[_local17] = ((_local23 > 1) + 0);
- _local9[(_local9.length - 1)] = (_local9[(_local9.length - 1)] + 16);
- _local17++;
- };
- _local14[_local18] = _local22;
- _local16 = (_local16 | this.PACK(_local12, (24 - (_local18 * 4))));
- _local15 = (_local15 | this.PACK(_local11, (24 - (_local18 * 4))));
- _local18++;
- };
- _local4 = this.PACK(_local13, 24);
- _local5 = this.PACK(_local14, 24);
- _local13 = this.ArrCopy(this.kUnpackTab[(_arg2.nz_ >> 4)]);
- _local14 = this.ArrCopy(this.kUnpackTab[(_local10.nz_ >> 4)]);
- _local19 = 0;
- while (_local19 < 4) {
- _local18 = 0;
- while (_local18 < 2) {
- _local22 = _local14[(_local19 + _local18)];
- _local17 = 0;
- while (_local17 < 2) {
- _local21 = (_local22 + _local13[(_local19 + _local17)]);
- _local23 = this.GetCoeffs(_arg3, _arg1.proba_.coeffs_[2], _local21, _local8.uv_mat_, 0, _local9);
- _local22 = ((_local23 > 0) + 0);
- _local13[(_local19 + _local17)] = _local22;
- _local12[((_local18 * 2) + _local17)] = (!((_local9[(_local9[(_local9.length - 1)] + 0)] == 0)) + 0);
- _local11[((_local18 * 2) + _local17)] = ((_local23 > 1) + 0);
- _local9[(_local9.length - 1)] = (_local9[(_local9.length - 1)] + 16);
- _local17++;
- };
- _local14[(_local19 + _local18)] = _local22;
- _local18++;
- };
- _local16 = (_local16 | this.PACK(_local12, (8 - (_local19 * 2))));
- _local15 = (_local15 | this.PACK(_local11, (8 - (_local19 * 2))));
- _local19 = (_local19 + 2);
- };
- _local4 = (_local4 | this.PACK(_local13, 20));
- _local5 = (_local5 | this.PACK(_local14, 20));
- _arg2.nz_ = _local4;
- _local10.nz_ = _local5;
- _arg1.coeffs_ = _local9;
- _arg1.non_zero_ac_ = (_local15 + 0);
- _arg1.non_zero_ = (_local15 | _local16);
- _arg2.skip_ = (!(_arg1.non_zero_) + 0);
- }
- public function SimpleVFilter16i(_arg1, _arg2, _arg3, _arg4){
- var _local5:*;
- _local5 = 3;
- while (_local5 > 0) {
- _arg2 = (_arg2 + (4 * _arg3));
- this.SimpleVFilter16(_arg1, (_arg2 + 0), _arg3, _arg4);
- _local5--;
- };
- }
- public function VP8ParseProba(_arg1, _arg2){
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local3:* = _arg2.proba_;
- _local4 = 0;
- while (_local4 < this.NUM_TYPES) {
- _local5 = 0;
- while (_local5 < this.NUM_BANDS) {
- _local6 = 0;
- while (_local6 < this.NUM_CTX) {
- _local7 = 0;
- while (_local7 < this.NUM_PROBAS) {
- if (this.VP8GetBit(_arg1, this.CoeffsUpdateProba[_local4][_local5][_local6][_local7])){
- _local3.coeffs_[_local4][_local5][_local6][_local7] = this.VP8GetValue(_arg1, 8);
- };
- _local7++;
- };
- _local6++;
- };
- _local5++;
- };
- _local4++;
- };
- _arg2.use_skip_proba_ = this.VP8Get(_arg1);
- if (_arg2.use_skip_proba_){
- _arg2.skip_p_ = this.VP8GetValue(_arg1, 8);
- };
- }
- public function VP8DspInitTables(_arg1){
- var _local2:*;
- if (!this.tables_ok){
- _local2 = -255;
- while (_local2 <= 0xFF) {
- this.abs0[(0xFF + _local2)] = ((_local2)<0) ? -(_local2) : _local2;
- this.abs1[(0xFF + _local2)] = (this.abs0[(0xFF + _local2)] >> 1);
- _local2++;
- };
- _local2 = -1020;
- while (_local2 <= 1020) {
- this.sclip1[(1020 + _local2)] = ((_local2)<-128) ? -128 : ((_local2)>127) ? 127 : _local2;
- _local2++;
- };
- _local2 = -112;
- while (_local2 <= 112) {
- this.sclip2[(112 + _local2)] = ((_local2)<-16) ? -16 : ((_local2)>15) ? 15 : _local2;
- _local2++;
- };
- _local2 = -255;
- while (_local2 <= (0xFF + 0xFF)) {
- this.clip1[(0xFF + _local2)] = ((_local2)<0) ? 0 : ((_local2)>0xFF) ? 0xFF : _local2;
- _local2++;
- };
- this.tables_ok = 1;
- };
- }
- public function EmitRescaledAlphaRGB(_arg1, _arg2){
- var _local3:*;
- var _local4:*;
- if (_arg1.a != null){
- _local3 = 0;
- _local4 = 0;
- while (_local3 < _arg1.mb_h) {
- _local3 = (_local3 + this.Import(_arg1.a, (_arg1.a_off + (_local3 * _arg1.width)), _arg1.width, (_arg1.mb_h - _local3), _arg2.scaler_a));
- _local4 = (_local4 + this.ExportAlpha(_arg2, _local4));
- };
- };
- return (0);
- }
- public function VP8YuvToRgba4444(_arg1, _arg2, _arg3, _arg4, _arg5){
- _arg4[(_arg5 + 1)] = 15;
- this.VP8YuvToRgba4444KeepA(_arg1, _arg2, _arg3, _arg4, _arg5);
- }
- public function VP8GetBit(_arg1, _arg2){
- var _local3:* = ((_arg1.range_ * _arg2) >> 8);
- var _local4:* = this.VP8BitUpdate(_arg1, _local3);
- if (_arg1.range_ < 127){
- this.VP8Shift(_arg1);
- };
- return (_local4);
- }
- public function needs_filter2(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:* = _arg1[(_arg2 - (4 * _arg3))];
- var _local7:* = _arg1[(_arg2 - (3 * _arg3))];
- var _local8:* = _arg1[(_arg2 - (2 * _arg3))];
- var _local9:* = _arg1[(_arg2 - _arg3)];
- var _local10:* = _arg1[(_arg2 + 0)];
- var _local11:* = _arg1[(_arg2 + _arg3)];
- var _local12:* = _arg1[(_arg2 + (2 * _arg3))];
- var _local13:* = _arg1[(_arg2 + (3 * _arg3))];
- if (((2 * this.abs0[((0xFF + _local9) - _local10)]) + this.abs1[((0xFF + _local8) - _local11)]) > _arg4){
- return (0);
- };
- return ((((((((((((this.abs0[((0xFF + _local6) - _local7)] <= _arg5)) && ((this.abs0[((0xFF + _local7) - _local8)] <= _arg5)))) && ((this.abs0[((0xFF + _local8) - _local9)] <= _arg5)))) && ((this.abs0[((0xFF + _local13) - _local12)] <= _arg5)))) && ((this.abs0[((0xFF + _local12) - _local11)] <= _arg5)))) && ((this.abs0[((0xFF + _local11) - _local10)] <= _arg5))));
- }
- public function RD4(_arg1, _arg2){
- var _local3:* = _arg1[((_arg2 - 1) + (0 * this.BPS))];
- var _local4:* = _arg1[((_arg2 - 1) + (1 * this.BPS))];
- var _local5:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
- var _local6:* = _arg1[((_arg2 - 1) + (3 * this.BPS))];
- var _local7:* = _arg1[((_arg2 - 1) - this.BPS)];
- var _local8:* = _arg1[((_arg2 + 0) - this.BPS)];
- var _local9:* = _arg1[((_arg2 + 1) - this.BPS)];
- var _local10:* = _arg1[((_arg2 + 2) - this.BPS)];
- var _local11:* = _arg1[((_arg2 + 3) - this.BPS)];
- _arg1[((_arg2 + 0) + (3 * this.BPS))] = this.AVG3(_local4, _local5, _local6);
- _arg1[((_arg2 + 0) + (2 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local3, _local4, _local5));
- _arg1[((_arg2 + 0) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG3(_local7, _local3, _local4)));
- _arg1[((_arg2 + 0) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = (_arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local8, _local7, _local3))));
- _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 3) + (2 * this.BPS))] = this.AVG3(_local9, _local8, _local7)));
- _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 3) + (1 * this.BPS))] = this.AVG3(_local10, _local9, _local8));
- _arg1[((_arg2 + 3) + (0 * this.BPS))] = this.AVG3(_local11, _local10, _local9);
- }
- public function VP8YuvToArgb(_arg1, _arg2, _arg3, _arg4, _arg5){
- _arg4[(_arg5 + 0)] = 0xFF;
- this.VP8YuvToArgbKeepA(_arg1, _arg2, _arg3, _arg4, _arg5);
- }
- public function InitFromOptions(_arg1, _arg2){
- var _local3:*;
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- _local3 = _arg2.width;
- _local4 = _arg2.height;
- _local5 = 0;
- _local6 = 0;
- _local7 = _local3;
- _local8 = _local4;
- _arg2.use_cropping = ((!((_arg1 == null))) && ((_arg1.use_cropping > 0)));
- if (_arg2.use_cropping){
- _local7 = _arg1.crop_width;
- _local8 = _arg1.crop_height;
- _local5 = (_arg1.crop_left & ~(1));
- _local6 = (_arg1.crop_top & ~(1));
- if ((((((((((((_local5 < 0)) || ((_local6 < 0)))) || ((_local7 <= 0)))) || ((_local8 <= 0)))) || (((_local5 + _local7) > _local3)))) || (((_local6 + _local8) > _local4)))){
- return (0);
- };
- };
- _arg2.crop_left = _local5;
- _arg2.crop_top = _local6;
- _arg2.crop_right = (_local5 + _local7);
- _arg2.crop_bottom = (_local6 + _local8);
- _arg2.mb_w = _local7;
- _arg2.mb_h = _local8;
- _arg2.use_scaling = (((!((_arg1 == null))) && ((_arg1.use_scaling > 0))) + 0);
- if (_arg2.use_scaling){
- if ((((_arg1.scaled_width <= 0)) || ((_arg1.scaled_height <= 0)))){
- return (0);
- };
- _arg2.scaled_width = _arg1.scaled_width;
- _arg2.scaled_height = _arg1.scaled_height;
- };
- _arg2.bypass_filtering = ((_arg1) && (_arg1.bypass_filtering));
- _arg2.fancy_upsampling = ((((_arg1 == null)) || (!(_arg1.no_fancy_upsampling))) + 0);
- if (_arg2.use_scaling){
- _arg2.bypass_filtering = ((((_arg2.scaled_width < parseInt(String(((_local3 * 3) / 4)))) + 0)) && (((_arg2.scaled_height < parseInt(String(((_local4 * 3) / 4)))) + 0)));
- _arg2.fancy_upsampling = 0;
- };
- return (1);
- }
- public function VL4(_arg1, _arg2){
- var _local3:* = _arg1[((_arg2 + 0) - this.BPS)];
- var _local4:* = _arg1[((_arg2 + 1) - this.BPS)];
- var _local5:* = _arg1[((_arg2 + 2) - this.BPS)];
- var _local6:* = _arg1[((_arg2 + 3) - this.BPS)];
- var _local7:* = _arg1[((_arg2 + 4) - this.BPS)];
- var _local8:* = _arg1[((_arg2 + 5) - this.BPS)];
- var _local9:* = _arg1[((_arg2 + 6) - this.BPS)];
- var _local10:* = _arg1[((_arg2 + 7) - this.BPS)];
- _arg1[((_arg2 + 0) + (0 * this.BPS))] = this.AVG2(_local3, _local4);
- _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 0) + (2 * this.BPS))] = this.AVG2(_local4, _local5));
- _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = this.AVG2(_local5, _local6));
- _arg1[((_arg2 + 3) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = this.AVG2(_local6, _local7));
- _arg1[((_arg2 + 0) + (1 * this.BPS))] = this.AVG3(_local3, _local4, _local5);
- _arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 0) + (3 * this.BPS))] = this.AVG3(_local4, _local5, _local6));
- _arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local5, _local6, _local7));
- _arg1[((_arg2 + 3) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG3(_local6, _local7, _local8));
- _arg1[((_arg2 + 3) + (2 * this.BPS))] = this.AVG3(_local7, _local8, _local9);
- _arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local8, _local9, _local10);
- }
- public function SampleRgb565LinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
- this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToRgb565, 2);
- }
- public function VP8Clear(_arg1){
- if (_arg1 == null){
- return;
- };
- if (_arg1.use_threads_){
- };
- if (_arg1.mem_){
- _arg1.mem_ = 0;
- };
- _arg1.mem_ = null;
- _arg1.mem_size_ = 0;
- _arg1.ready_ = 0;
- }
- public function VP8Decode(_arg1, _arg2){
- var _local3:* = 0;
- if (_arg1 == null){
- return (0);
- };
- if (_arg2 == null){
- return (this.VP8SetError(_arg1, "VP8_STATUS_INVALID_PARAM", "NULL VP8Io parameter in VP8Decode()."));
- };
- if (!_arg1.ready_){
- if (!this.VP8GetHeaders(_arg1, _arg2)){
- return (0);
- };
- };
- this.assert(_arg1.ready_);
- _local3 = (this.VP8EnterCritical(_arg1, _arg2) == this.VP8_STATUS_OK);
- if (_local3){
- if (_local3){
- _local3 = this.VP8InitFrame(_arg1, _arg2);
- };
- if (_local3){
- _local3 = this.ParseFrame(_arg1, _arg2);
- };
- _local3 = (_local3 & this.VP8ExitCritical(_arg1, _arg2));
- };
- if (!_local3){
- this.VP8Clear(_arg1);
- return (0);
- };
- _arg1.ready_ = 0;
- return (1);
- }
- public function VP8ProcessRow(_arg1, _arg2){
- var _local5:*;
- var _local6:*;
- var _local3:* = 1;
- var _local4:* = _arg1.thread_ctx_;
- if (!_arg1.use_threads_){
- _local4.mb_y_ = _arg1.mb_y_;
- _local4.filter_row_ = _arg1.filter_row_;
- _local3 = this.VP8FinishRow(_arg1, _arg2);
- } else {
- _local5 = _arg1.worker_;
- if (_local3){
- _local4.io_ = _arg2;
- _local4.id_ = _arg1.cache_id_;
- _local4.mb_y_ = _arg1.mb_y_;
- _local4.filter_row_ = _arg1.filter_row_;
- if (_local4.filter_row_){
- _local6 = _local4.f_info_;
- _local4.f_info_ = _arg1.f_info_;
- _arg1.f_info_ = _local6;
- };
- if (++_arg1.cache_id_ == _arg1.num_caches_){
- _arg1.cache_id_ = 0;
- };
- };
- };
- return (_local3);
- }
- public function SimpleHFilter16i(_arg1, _arg2, _arg3, _arg4){
- var _local5:*;
- _local5 = 3;
- while (_local5 > 0) {
- _arg2 = (_arg2 + 4);
- this.SimpleHFilter16(_arg1, (_arg2 + 0), _arg3, _arg4);
- _local5--;
- };
- }
- public function ExportRGB(_arg1, _arg2){
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local3:* = this.kYUV444Converters[_arg1.output.colorspace];
- _local4 = _arg1.output.u.RGBA;
- _local5 = _local4.rgba;
- _local6 = (_local4.rgba_off + ((_arg1.last_y + _arg2) * _local4.stride));
- _local7 = 0;
- while ((((_arg1.scaler_y.y_accum <= 0)) && ((_arg1.scaler_u.y_accum <= 0)))) {
- this.assert((((_arg1.last_y + _arg2) + _local7) < _arg1.output.height));
- this.assert((_arg1.scaler_u.y_accum == _arg1.scaler_v.y_accum));
- this.ExportRow(_arg1.scaler_y);
- this.ExportRow(_arg1.scaler_u);
- this.ExportRow(_arg1.scaler_v);
- _local3(_arg1.scaler_y.dst, _arg1.scaler_y.dst_off, _arg1.scaler_u.dst, _arg1.scaler_u.dst_off, _arg1.scaler_v.dst, _arg1.scaler_v.dst_off, _local5, _local6, _arg1.scaler_y.dst_width);
- _local6 = (_local6 + _local4.stride);
- _local7++;
- };
- return (_local7);
- }
- public function WebPDecodeRGBAInto(_arg1, _arg2, _arg3, _arg4, _arg5){
- return (this.DecodeIntoRGBABuffer(this.MODE_RGBA, _arg1, _arg2, _arg3, _arg5, _arg4));
- }
- public function VP8DecodeLayer(_arg1){
- this.assert(_arg1);
- this.assert((_arg1.layer_data_size_ > 0));
- return (1);
- }
- public function ioErrorHandler(_arg1:IOErrorEvent):void{
- this.alert("#2: no valid url");
- }
- function frame1(){
- this.char = 0;
- this.short = 0;
- this.int_ = 0;
- this.long = 0;
- this.void_ = 0;
- this.int8_t = this.char;
- this.uint8_t = this.char;
- this.int16_t = this.short;
- this.uint16_t = this.short;
- this.int32_t = this.int_;
- this.uint32_t = this.int_;
- this.uint64_t = this.long;
- this.int64_t = this.long;
- this.float = 0;
- this.size_t = 0;
- this.double = 0;
- this.score_t = this.int64_t;
- this.WEBP_DECODER_ABI_VERSION = 2;
- this.MODE_RGB = 0;
- this.MODE_RGBA = 1;
- this.MODE_BGR = 2;
- this.MODE_BGRA = 3;
- this.MODE_ARGB = 4;
- this.MODE_RGBA_4444 = 5;
- this.MODE_RGB_565 = 6;
- this.MODE_YUV = 7;
- this.MODE_YUVA = 8;
- this.MODE_LAST = 9;
- this.WEBP_CSP_MODE = {
- MODE_RGB:0,
- MODE_RGBA:1,
- MODE_BGR:2,
- MODE_BGRA:3,
- MODE_ARGB:4,
- MODE_RGBA_4444:5,
- MODE_RGB_565:6,
- MODE_YUV:7,
- MODE_YUVA:8,
- MODE_LAST:9
- };
- this.WebPRGBABuffer = {
- rgba:this.uint8_t,
- rgba_off:0,
- stride:this.int_,
- size:this.int_
- };
- this.WebPYUVABuffer = {
- y:this.uint8_t,
- u:this.uint8_t,
- v:this.uint8_t,
- a:this.uint8_t,
- y_off:this.uint8_t,
- u_off:this.uint8_t,
- v_off:this.uint8_t,
- a_off:this.uint8_t,
- y_stride:this.int_,
- u_stride:this.int_,
- v_stride:this.int_,
- a_stride:this.int_,
- y_size:this.int_,
- u_size:this.int_,
- v_size:this.int_,
- a_size:this.int_
- };
- this.WebPDecBuffer = {
- colorspace:"WEBP_CSP_MODE",
- width:this.int_,
- height:this.int_,
- is_external_memory:this.int_,
- u:{
- RGBA:this.WebPRGBABuffer,
- YUVA:this.WebPYUVABuffer
- },
- private_memory:null,
- private_memory_off:this.uint8_t
- };
- this.VP8_STATUS_OK = 0;
- this.VP8_STATUS_OUT_OF_MEMORY = 1;
- this.VP8_STATUS_INVALID_PARAM = 2;
- this.VP8_STATUS_BITSTREAM_ERROR = 3;
- this.VP8_STATUS_UNSUPPORTED_FEATURE = 4;
- this.VP8_STATUS_SUSPENDED = 5;
- this.VP8_STATUS_USER_ABORT = 6;
- this.VP8_STATUS_NOT_ENOUGH_DATA = 7;
- this.VP8StatusCode = {
- VP8_STATUS_OK:0,
- VP8_STATUS_OUT_OF_MEMORY:1,
- VP8_STATUS_INVALID_PARAM:2,
- VP8_STATUS_BITSTREAM_ERROR:3,
- VP8_STATUS_UNSUPPORTED_FEATURE:4,
- VP8_STATUS_SUSPENDED:5,
- VP8_STATUS_USER_ABORT:6,
- VP8_STATUS_NOT_ENOUGH_DATA:7
- };
- this.WebPBitstreamFeatures = {
- width:{value:this.int_},
- height:{value:this.int_},
- has_alpha:{value:this.int_},
- no_incremental_decoding:this.int_,
- rotate:this.int_,
- uv_sampling:this.int_,
- bitstream_version:this.int_
- };
- this.WebPDecoderOptions = {
- bypass_filtering:this.int_,
- no_fancy_upsampling:this.int_,
- use_cropping:this.int_,
- crop_left:this.int_,
- crop_top:this.int_,
- crop_width:this.int_,
- crop_height:this.int_,
- use_scaling:this.int_,
- scaled_width:this.int_,
- scaled_height:this.int_,
- force_rotation:this.int_,
- no_enhancement:this.int_,
- use_threads:this.int_
- };
- this.WebPDecoderConfig = {
- input:this.newObjectIt(this.WebPBitstreamFeatures),
- output:this.newObjectIt(this.WebPDecBuffer),
- options:this.newObjectIt(this.WebPDecoderOptions)
- };
- this.VP8Io = {
- width:this.int_,
- height:this.int_,
- mb_y:this.int_,
- mb_w:this.int_,
- mb_h:this.int_,
- y:this.uint8_t,
- u:this.uint8_t,
- v:this.uint8_t,
- y_off:0,
- u_off:0,
- v_off:0,
- y_stride:this.int_,
- uv_stride:this.int_,
- opaque:this.void_,
- put:0,
- setup:0,
- teardown:0,
- fancy_upsampling:this.int_,
- data_size:this.uint32_t,
- data:this.uint8_t,
- data_off:0,
- bypass_filtering:this.int_,
- use_cropping:this.int_,
- crop_left:this.int_,
- crop_right:this.int_,
- crop_top:this.int_,
- crop_bottom:this.int_,
- use_scaling:this.int_,
- scaled_width:this.int_,
- scaled_height:this.int_,
- a:this.uint8_t,
- a_off:0
- };
- this.WebPRescaler = {
- x_expand:this.int_,
- fy_scale:this.int_,
- fx_scale:this.int_,
- fxy_scale:this.int64_t,
- y_accum:this.int_,
- y_add:this.int_,
- y_sub:this.int_,
- x_add:this.int_,
- x_sub:this.int_,
- src_width:this.int_,
- src_height:this.int_,
- dst_width:this.int_,
- dst_height:this.int_,
- dst:this.uint8_t,
- dst_off:0,
- dst_stride:this.int_,
- irow:this.int32_t,
- irow_off:0,
- frow:this.int32_t,
- frow_off:0
- };
- this.WebPDecParams = {
- output:this.newObjectIt(this.WebPDecBuffer),
- tmp_y:this.uint8_t,
- tmp_u:this.uint8_t,
- tmp_v:this.uint8_t,
- tmp_y_off:0,
- tmp_u_off:0,
- tmp_v_off:0,
- last_y:this.int_,
- options_:this.newObjectIt(this.WebPDecoderOptions),
- scaler_y:this.newObjectIt(this.WebPRescaler),
- scaler_u:this.newObjectIt(this.WebPRescaler),
- scaler_v:this.newObjectIt(this.WebPRescaler),
- scaler_a:this.newObjectIt(this.WebPRescaler),
- memory:this.void_,
- emit:"(OutputFunc)",
- emit_alpha:"(OutputFunc)"
- };
- this.VP8BitReader = {
- buf_:this.uint8_t,
- buf_off:null,
- buf_end_:this.uint8_t,
- eof_:this.int_,
- range_:this.uint32_t,
- value_:this.uint32_t,
- missing_:this.int_
- };
- this.kVP8Log2Range = new Array(7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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);
- this.kVP8NewRange = new Array(127, 127, 191, 127, 159, 191, 223, 127, 143, 159, 175, 191, 207, 223, 239, 127, 135, 143, 151, 159, 167, 175, 183, 191, 199, 207, 215, 223, 231, 239, 247, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 127);
- this.DEC_MAJ_VERSION = 0;
- this.DEC_MIN_VERSION = 1;
- this.DEC_REV_VERSION = 2;
- this.B_DC_PRED = 0;
- this.B_TM_PRED = 1;
- this.B_VE_PRED = 2;
- this.B_HE_PRED = 3;
- this.B_RD_PRED = 4;
- this.B_VR_PRED = 5;
- this.B_LD_PRED = 6;
- this.B_VL_PRED = 7;
- this.B_HD_PRED = 8;
- this.B_HU_PRED = 9;
- this.NUM_BMODES = ((this.B_HU_PRED + 1) - this.B_DC_PRED);
- this.DC_PRED = this.B_DC_PRED;
- this.V_PRED = this.B_VE_PRED;
- this.H_PRED = this.B_HE_PRED;
- this.TM_PRED = this.B_TM_PRED;
- this.B_PRED = this.NUM_BMODES;
- this.B_DC_PRED_NOTOP = 4;
- this.B_DC_PRED_NOLEFT = 5;
- this.B_DC_PRED_NOTOPLEFT = 6;
- this.NUM_B_DC_MODES = 7;
- this.MB_FEATURE_TREE_PROBS = 3;
- this.NUM_MB_SEGMENTS = 4;
- this.NUM_REF_LF_DELTAS = 4;
- this.NUM_MODE_LF_DELTAS = 4;
- this.MAX_NUM_PARTITIONS = 8;
- this.NUM_TYPES = 4;
- this.NUM_BANDS = 8;
- this.NUM_CTX = 3;
- this.NUM_PROBAS = 11;
- this.NUM_MV_PROBAS = 19;
- this.BPS = 32;
- this.YUV_SIZE = ((this.BPS * 17) + (this.BPS * 9));
- this.Y_SIZE = (this.BPS * 17);
- this.Y_OFF = ((this.BPS * 1) + 8);
- this.U_OFF = ((this.Y_OFF + (this.BPS * 16)) + this.BPS);
- this.V_OFF = (this.U_OFF + 16);
- this.VP8FrameHeader = {
- key_frame_:this.uint8_t,
- profile_:this.uint8_t,
- show_:this.uint8_t,
- partition_length_:this.uint32_t
- };
- this.VP8PictureHeader = {
- width_:this.uint16_t,
- height_:this.uint16_t,
- xscale_:this.uint8_t,
- yscale_:this.uint8_t,
- colorspace_:this.uint8_t,
- clamp_type_:this.uint8_t
- };
- this.VP8SegmentHeader = {
- use_segment_:this.int_,
- update_map_:this.int_,
- absolute_delta_:this.int_,
- quantizer_:this.Arr(this.NUM_MB_SEGMENTS, this.int8_t),
- filter_strength_:this.Arr(this.NUM_MB_SEGMENTS, this.int8_t)
- };
- this.VP8Proba = {
- segments_:this.Arr(this.MB_FEATURE_TREE_PROBS, this.uint8_t),
- coeffs_:this.ArrM(new Array(this.NUM_TYPES, this.NUM_BANDS, this.NUM_CTX, this.NUM_PROBAS), this.uint8_t)
- };
- this.VP8FilterHeader = {
- simple_:this.int_,
- level_:this.int_,
- sharpness_:this.int_,
- use_lf_delta_:this.int_,
- ref_lf_delta_:this.Arr(this.NUM_REF_LF_DELTAS, this.int_),
- mode_lf_delta_:this.Arr(this.NUM_REF_LF_DELTAS, this.int_)
- };
- this.VP8FInfo = {
- f_level_:this.int_,
- f_ilevel_:this.int_,
- f_inner_:this.int_
- };
- this.VP8MB = {
- nz_:this.int_,
- dc_nz_:this.int_,
- skip_:this.int_
- };
- this.VP8QuantMatrix = {
- y1_mat_:this.Arr(2, this.uint16_t),
- y2_mat_:this.Arr(2, this.uint16_t),
- uv_mat_:this.Arr(2, this.uint16_t)
- };
- this.VP8ThreadContext = {
- id_:this.int_,
- mb_y_:this.int_,
- filter_row_:this.int_,
- f_info_:this.VP8FInfo,
- io_:this.VP8Io
- };
- this.VP8Decoder = {
- status_:"VP8StatusCode",
- ready_:this.int_,
- error_msg_:this.char,
- br_:this.newObjectIt(this.VP8BitReader),
- frm_hdr_:this.newObjectIt(this.VP8FrameHeader),
- pic_hdr_:this.newObjectIt(this.VP8PictureHeader),
- filter_hdr_:this.newObjectIt(this.VP8FilterHeader),
- segment_hdr_:this.newObjectIt(this.VP8SegmentHeader),
- worker_:"WebPWorker",
- use_threads_:this.int_,
- cache_id_:this.int_,
- num_caches_:this.int_,
- thread_ctx_:this.VP8ThreadContext,
- mb_w_:this.int_,
- mb_h_:this.int_,
- tl_mb_x_:this.int_,
- tl_mb_y_:this.int_,
- br_mb_x_:this.int_,
- br_mb_y_:this.int_,
- num_parts_:this.int_,
- parts_:this.Arr_nOI(this.MAX_NUM_PARTITIONS, this.VP8BitReader),
- buffer_flags_:this.uint32_t,
- dqm_:this.Arr_nOI(this.NUM_MB_SEGMENTS, this.VP8QuantMatrix),
- proba_:this.newObjectIt(this.VP8Proba),
- use_skip_proba_:this.int_,
- skip_p_:this.uint8_t,
- intra_t_:this.uint8_t,
- intra_l_:this.Arr(4, this.uint8_t),
- y_t_:this.uint8_t,
- u_t_:this.uint8_t,
- v_t_:this.uint8_t,
- mb_info_:this.newObjectIt(this.VP8MB),
- f_info_:this.newObjectIt(this.VP8FInfo),
- yuv_b_:this.uint8_t,
- coeffs_:this.int16_t,
- cache_y_:this.uint8_t,
- cache_u_:this.uint8_t,
- cache_v_:this.uint8_t,
- cache_y_off:this.int_,
- cache_u_off:this.int_,
- cache_v_off:this.int_,
- cache_y_stride_:this.int_,
- cache_uv_stride_:this.int_,
- mem_:this.void_,
- mem_size_:this.int_,
- mb_x_:this.int_,
- mb_y_:this.int_,
- is_i4x4_:this.uint8_t,
- imodes_:this.Arr(16, this.uint8_t),
- imodes_offset_:0,
- uvmode_:this.uint8_t,
- segment_:this.uint8_t,
- non_zero_:this.uint32_t,
- non_zero_ac_:this.uint32_t,
- filter_type_:this.int_,
- filter_row_:this.int_,
- filter_levels_:this.Arr(this.NUM_MB_SEGMENTS, this.uint8_t),
- alpha_data_:this.uint8_t,
- alpha_data_off:0,
- alpha_data_size_:this.size_t,
- alpha_plane_:this.uint8_t,
- alpha_plane_off:0,
- layer_colorspace_:this.int_,
- layer_data_:this.uint8_t,
- layer_data_off:0,
- layer_data_size_:this.size_t
- };
- this.kModeBpp = new Array(3, 4, 3, 4, 4, 2, 2, 1, 1);
- this.WebPFreeDecBuffer = function (_arg1){
- if (_arg1){
- if (!_arg1.is_external_memory){
- _arg1.private_memory = "";
- };
- _arg1.private_memory_off = 0;
- _arg1.private_memory = (_arg1.private_memory_off = null);
- };
- };
- this.abs0 = this.Arr(((0xFF + 0xFF) + 1), this.uint8_t);
- this.abs1 = this.Arr(((0xFF + 0xFF) + 1), this.uint8_t);
- this.sclip1 = this.Arr(((1020 + 1020) + 1), this.int8_t);
- this.sclip2 = this.Arr(((112 + 112) + 1), this.int8_t);
- this.clip1 = this.Arr(((0xFF + 510) + 1), this.uint8_t);
- this.tables_ok = 0;
- this.kC1 = (20091 + (1 << 16));
- this.kC2 = 35468;
- this.VP8PredLuma4 = new Array(function (_arg1, _arg2){
- DC4(_arg1, _arg2);
- }, function (_arg1, _arg2){
- TM4(_arg1, _arg2);
- }, function (_arg1, _arg2){
- VE4(_arg1, _arg2);
- }, function (_arg1, _arg2){
- HE4(_arg1, _arg2);
- }, function (_arg1, _arg2){
- RD4(_arg1, _arg2);
- }, function (_arg1, _arg2){
- VR4(_arg1, _arg2);
- }, function (_arg1, _arg2){
- LD4(_arg1, _arg2);
- }, function (_arg1, _arg2){
- VL4(_arg1, _arg2);
- }, function (_arg1, _arg2){
- HD4(_arg1, _arg2);
- }, function (_arg1, _arg2){
- HU4(_arg1, _arg2);
- });
- this.VP8PredLuma16 = new Array(function (_arg1, _arg2){
- DC16(_arg1, _arg2);
- }, function (_arg1, _arg2){
- TM16(_arg1, _arg2);
- }, function (_arg1, _arg2){
- VE16(_arg1, _arg2);
- }, function (_arg1, _arg2){
- HE16(_arg1, _arg2);
- }, function (_arg1, _arg2){
- DC16NoTop(_arg1, _arg2);
- }, function (_arg1, _arg2){
- DC16NoLeft(_arg1, _arg2);
- }, function (_arg1, _arg2){
- DC16NoTopLeft(_arg1, _arg2);
- });
- this.VP8PredChroma8 = new Array(function (_arg1, _arg2){
- DC8uv(_arg1, _arg2);
- }, function (_arg1, _arg2){
- TM8uv(_arg1, _arg2);
- }, function (_arg1, _arg2){
- VE8uv(_arg1, _arg2);
- }, function (_arg1, _arg2){
- HE8uv(_arg1, _arg2);
- }, function (_arg1, _arg2){
- DC8uvNoTop(_arg1, _arg2);
- }, function (_arg1, _arg2){
- DC8uvNoLeft(_arg1, _arg2);
- }, function (_arg1, _arg2){
- DC8uvNoTopLeft(_arg1, _arg2);
- });
- this.ALIGN_MASK = (32 - 1);
- this.MT_CACHE_LINES = 3;
- this.ST_CACHE_LINES = 1;
- this.kFilterExtraRows = new Array(0, 2, 8);
- this.kScan = new Array((0 + (0 * this.BPS)), (4 + (0 * this.BPS)), (8 + (0 * this.BPS)), (12 + (0 * this.BPS)), (0 + (4 * this.BPS)), (4 + (4 * this.BPS)), (8 + (4 * this.BPS)), (12 + (4 * this.BPS)), (0 + (8 * this.BPS)), (4 + (8 * this.BPS)), (8 + (8 * this.BPS)), (12 + (8 * this.BPS)), (0 + (12 * this.BPS)), (4 + (12 * this.BPS)), (8 + (12 * this.BPS)), (12 + (12 * this.BPS)));
- this.kDcTable = new Array(4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157);
- this.kAcTable = new Array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284);
- this.kYModesIntra4 = new Array(-(this.B_DC_PRED), 1, -(this.B_TM_PRED), 2, -(this.B_VE_PRED), 3, 4, 6, -(this.B_HE_PRED), 5, -(this.B_RD_PRED), -(this.B_VR_PRED), -(this.B_LD_PRED), 7, -(this.B_VL_PRED), 8, -(this.B_HD_PRED), -(this.B_HU_PRED));
- this.CoeffsProba0 = new Array(new Array(new Array(new Array(128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128), new Array(128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128), new Array(128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128)), new Array(new Array(253, 136, 254, 0xFF, 228, 219, 128, 128, 128, 128, 128), new Array(189, 129, 242, 0xFF, 227, 213, 0xFF, 219, 128, 128, 128), new Array(106, 126, 227, 252, 214, 209, 0xFF, 0xFF, 128, 128, 128)), new Array(new Array(1, 98, 248, 0xFF, 236, 226, 0xFF, 0xFF, 128, 128, 128), new Array(181, 133, 238, 254, 221, 234, 0xFF, 154, 128, 128, 128), new Array(78, 134, 202, 247, 198, 180, 0xFF, 219, 128, 128, 128)), new Array(new Array(1, 185, 249, 0xFF, 243, 0xFF, 128, 128, 128, 128, 128), new Array(184, 150, 247, 0xFF, 236, 224, 128, 128, 128, 128, 128), new Array(77, 110, 216, 0xFF, 236, 230, 128, 128, 128, 128, 128)), new Array(new Array(1, 101, 251, 0xFF, 241, 0xFF, 128, 128, 128, 128, 128), new Array(170, 139, 241, 252, 236, 209, 0xFF, 0xFF, 128, 128, 128), new Array(37, 116, 196, 243, 228, 0xFF, 0xFF, 0xFF, 128, 128, 128)), new Array(new Array(1, 204, 254, 0xFF, 245, 0xFF, 128, 128, 128, 128, 128), new Array(207, 160, 250, 0xFF, 238, 128, 128, 128, 128, 128, 128), new Array(102, 103, 231, 0xFF, 211, 171, 128, 128, 128, 128, 128)), new Array(new Array(1, 152, 252, 0xFF, 240, 0xFF, 128, 128, 128, 128, 128), new Array(177, 135, 243, 0xFF, 234, 225, 128, 128, 128, 128, 128), new Array(80, 129, 211, 0xFF, 194, 224, 128, 128, 128, 128, 128)), new Array(new Array(1, 1, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128), new Array(246, 1, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128), new Array(0xFF, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128))), new Array(new Array(new Array(198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62), new Array(131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1), new Array(68, 47, 146, 208, 149, 167, 221, 162, 0xFF, 223, 128)), new Array(new Array(1, 149, 241, 0xFF, 221, 224, 0xFF, 0xFF, 128, 128, 128), new Array(184, 141, 234, 253, 222, 220, 0xFF, 199, 128, 128, 128), new Array(81, 99, 181, 242, 176, 190, 249, 202, 0xFF, 0xFF, 128)), new Array(new Array(1, 129, 232, 253, 214, 197, 242, 196, 0xFF, 0xFF, 128), new Array(99, 121, 210, 250, 201, 198, 0xFF, 202, 128, 128, 128), new Array(23, 91, 163, 242, 170, 187, 247, 210, 0xFF, 0xFF, 128)), new Array(new Array(1, 200, 246, 0xFF, 234, 0xFF, 128, 128, 128, 128, 128), new Array(109, 178, 241, 0xFF, 231, 245, 0xFF, 0xFF, 128, 128, 128), new Array(44, 130, 201, 253, 205, 192, 0xFF, 0xFF, 128, 128, 128)), new Array(new Array(1, 132, 239, 251, 219, 209, 0xFF, 165, 128, 128, 128), new Array(94, 136, 225, 251, 218, 190, 0xFF, 0xFF, 128, 128, 128), new Array(22, 100, 174, 245, 186, 161, 0xFF, 199, 128, 128, 128)), new Array(new Array(1, 182, 249, 0xFF, 232, 235, 128, 128, 128, 128, 128), new Array(124, 143, 241, 0xFF, 227, 234, 128, 128, 128, 128, 128), new Array(35, 77, 181, 251, 193, 211, 0xFF, 205, 128, 128, 128)), new Array(new Array(1, 157, 247, 0xFF, 236, 231, 0xFF, 0xFF, 128, 128, 128), new Array(121, 141, 235, 0xFF, 225, 227, 0xFF, 0xFF, 128, 128, 128), new Array(45, 99, 188, 251, 195, 217, 0xFF, 224, 128, 128, 128)), new Array(new Array(1, 1, 251, 0xFF, 213, 0xFF, 128, 128, 128, 128, 128), new Array(203, 1, 248, 0xFF, 0xFF, 128, 128, 128, 128, 128, 128), new Array(137, 1, 177, 0xFF, 224, 0xFF, 128, 128, 128, 128, 128))), new Array(new Array(new Array(253, 9, 248, 251, 207, 208, 0xFF, 192, 128, 128, 128), new Array(175, 13, 224, 243, 193, 185, 249, 198, 0xFF, 0xFF, 128), new Array(73, 17, 171, 221, 161, 179, 236, 167, 0xFF, 234, 128)), new Array(new Array(1, 95, 247, 253, 212, 183, 0xFF, 0xFF, 128, 128, 128), new Array(239, 90, 244, 250, 211, 209, 0xFF, 0xFF, 128, 128, 128), new Array(155, 77, 195, 248, 188, 195, 0xFF, 0xFF, 128, 128, 128)), new Array(new Array(1, 24, 239, 251, 218, 219, 0xFF, 205, 128, 128, 128), new Array(201, 51, 219, 0xFF, 196, 186, 128, 128, 128, 128, 128), new Array(69, 46, 190, 239, 201, 218, 0xFF, 228, 128, 128, 128)), new Array(new Array(1, 191, 251, 0xFF, 0xFF, 128, 128, 128, 128, 128, 128), new Array(223, 165, 249, 0xFF, 213, 0xFF, 128, 128, 128, 128, 128), new Array(141, 124, 248, 0xFF, 0xFF, 128, 128, 128, 128, 128, 128)), new Array(new Array(1, 16, 248, 0xFF, 0xFF, 128, 128, 128, 128, 128, 128), new Array(190, 36, 230, 0xFF, 236, 0xFF, 128, 128, 128, 128, 128), new Array(149, 1, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128)), new Array(new Array(1, 226, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128), new Array(247, 192, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128), new Array(240, 128, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128)), new Array(new Array(1, 134, 252, 0xFF, 0xFF, 128, 128, 128, 128, 128, 128), new Array(213, 62, 250, 0xFF, 0xFF, 128, 128, 128, 128, 128, 128), new Array(55, 93, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128)), new Array(new Array(128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128), new Array(128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128), new Array(128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128))), new Array(new Array(new Array(202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 0xFF), new Array(126, 38, 182, 232, 169, 184, 228, 174, 0xFF, 187, 128), new Array(61, 46, 138, 219, 151, 178, 240, 170, 0xFF, 216, 128)), new Array(new Array(1, 112, 230, 250, 199, 191, 247, 159, 0xFF, 0xFF, 128), new Array(166, 109, 228, 252, 211, 215, 0xFF, 174, 128, 128, 128), new Array(39, 77, 162, 232, 172, 180, 245, 178, 0xFF, 0xFF, 128)), new Array(new Array(1, 52, 220, 246, 198, 199, 249, 220, 0xFF, 0xFF, 128), new Array(124, 74, 191, 243, 183, 193, 250, 221, 0xFF, 0xFF, 128), new Array(24, 71, 130, 219, 154, 170, 243, 182, 0xFF, 0xFF, 128)), new Array(new Array(1, 182, 225, 249, 219, 240, 0xFF, 224, 128, 128, 128), new Array(149, 150, 226, 252, 216, 205, 0xFF, 171, 128, 128, 128), new Array(28, 108, 170, 242, 183, 194, 254, 223, 0xFF, 0xFF, 128)), new Array(new Array(1, 81, 230, 252, 204, 203, 0xFF, 192, 128, 128, 128), new Array(123, 102, 209, 247, 188, 196, 0xFF, 233, 128, 128, 128), new Array(20, 95, 153, 243, 164, 173, 0xFF, 203, 128, 128, 128)), new Array(new Array(1, 222, 248, 0xFF, 216, 213, 128, 128, 128, 128, 128), new Array(168, 175, 246, 252, 235, 205, 0xFF, 0xFF, 128, 128, 128), new Array(47, 116, 215, 0xFF, 211, 212, 0xFF, 0xFF, 128, 128, 128)), new Array(new Array(1, 121, 236, 253, 212, 214, 0xFF, 0xFF, 128, 128, 128), new Array(141, 84, 213, 252, 201, 202, 0xFF, 219, 128, 128, 128), new Array(42, 80, 160, 240, 162, 185, 0xFF, 205, 128, 128, 128)), new Array(new Array(1, 1, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128), new Array(244, 1, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128), new Array(238, 1, 0xFF, 128, 128, 128, 128, 128, 128, 128, 128))));
- this.kBModesProba = new Array(new Array(new Array(231, 120, 48, 89, 115, 113, 120, 152, 112), new Array(152, 179, 64, 126, 170, 118, 46, 70, 95), new Array(175, 69, 143, 80, 85, 82, 72, 155, 103), new Array(56, 58, 10, 171, 218, 189, 17, 13, 152), new Array(114, 26, 17, 163, 44, 195, 21, 10, 173), new Array(121, 24, 80, 195, 26, 62, 44, 64, 85), new Array(144, 71, 10, 38, 171, 213, 144, 34, 26), new Array(170, 46, 55, 19, 136, 160, 33, 206, 71), new Array(63, 20, 8, 114, 114, 208, 12, 9, 226), new Array(81, 40, 11, 96, 182, 84, 29, 16, 36)), new Array(new Array(134, 183, 89, 137, 98, 101, 106, 165, 148), new Array(72, 187, 100, 130, 157, 111, 32, 75, 80), new Array(66, 102, 167, 99, 74, 62, 40, 234, 128), new Array(41, 53, 9, 178, 241, 141, 26, 8, 107), new Array(74, 43, 26, 146, 73, 166, 49, 23, 157), new Array(65, 38, 105, 160, 51, 52, 31, 115, 128), new Array(104, 79, 12, 27, 217, 0xFF, 87, 17, 7), new Array(87, 68, 71, 44, 114, 51, 15, 186, 23), new Array(47, 41, 14, 110, 182, 183, 21, 17, 194), new Array(66, 45, 25, 102, 197, 189, 23, 18, 22)), new Array(new Array(88, 88, 147, 150, 42, 46, 45, 196, 205), new Array(43, 97, 183, 117, 85, 38, 35, 179, 61), new Array(39, 53, 200, 87, 26, 21, 43, 232, 171), new Array(56, 34, 51, 104, 114, 102, 29, 93, 77), new Array(39, 28, 85, 171, 58, 165, 90, 98, 64), new Array(34, 22, 116, 206, 23, 34, 43, 166, 73), new Array(107, 54, 32, 26, 51, 1, 81, 43, 31), new Array(68, 25, 106, 22, 64, 171, 36, 225, 114), new Array(34, 19, 21, 102, 132, 188, 16, 76, 124), new Array(62, 18, 78, 95, 85, 57, 50, 48, 51)), new Array(new Array(193, 101, 35, 159, 215, 111, 89, 46, 111), new Array(60, 148, 31, 172, 219, 228, 21, 18, 111), new Array(112, 113, 77, 85, 179, 0xFF, 38, 120, 114), new Array(40, 42, 1, 196, 245, 209, 10, 25, 109), new Array(88, 43, 29, 140, 166, 213, 37, 43, 154), new Array(61, 63, 30, 155, 67, 45, 68, 1, 209), new Array(100, 80, 8, 43, 154, 1, 51, 26, 71), new Array(142, 78, 78, 16, 0xFF, 128, 34, 197, 171), new Array(41, 40, 5, 102, 211, 183, 4, 1, 221), new Array(51, 50, 17, 168, 209, 192, 23, 25, 82)), new Array(new Array(138, 31, 36, 171, 27, 166, 38, 44, 229), new Array(67, 87, 58, 169, 82, 115, 26, 59, 179), new Array(63, 59, 90, 180, 59, 166, 93, 73, 154), new Array(40, 40, 21, 116, 143, 209, 34, 39, 175), new Array(47, 15, 16, 183, 34, 223, 49, 45, 183), new Array(46, 17, 33, 183, 6, 98, 15, 32, 183), new Array(57, 46, 22, 24, 128, 1, 54, 17, 37), new Array(65, 32, 73, 115, 28, 128, 23, 128, 205), new Array(40, 3, 9, 115, 51, 192, 18, 6, 223), new Array(87, 37, 9, 115, 59, 77, 64, 21, 47)), new Array(new Array(104, 55, 44, 218, 9, 54, 53, 130, 226), new Array(64, 90, 70, 205, 40, 41, 23, 26, 57), new Array(54, 57, 112, 184, 5, 41, 38, 166, 213), new Array(30, 34, 26, 133, 152, 116, 10, 32, 134), new Array(39, 19, 53, 221, 26, 114, 32, 73, 0xFF), new Array(31, 9, 65, 234, 2, 15, 1, 118, 73), new Array(75, 32, 12, 51, 192, 0xFF, 160, 43, 51), new Array(88, 31, 35, 67, 102, 85, 55, 186, 85), new Array(56, 21, 23, 111, 59, 205, 45, 37, 192), new Array(55, 38, 70, 124, 73, 102, 1, 34, 98)), new Array(new Array(125, 98, 42, 88, 104, 85, 117, 175, 82), new Array(95, 84, 53, 89, 128, 100, 113, 101, 45), new Array(75, 79, 123, 47, 51, 128, 81, 171, 1), new Array(57, 17, 5, 71, 102, 57, 53, 41, 49), new Array(38, 33, 13, 121, 57, 73, 26, 1, 85), new Array(41, 10, 67, 138, 77, 110, 90, 47, 114), new Array(115, 21, 2, 10, 102, 0xFF, 166, 23, 6), new Array(101, 29, 16, 10, 85, 128, 101, 196, 26), new Array(57, 18, 10, 102, 102, 213, 34, 20, 43), new Array(117, 20, 15, 36, 163, 128, 68, 1, 26)), new Array(new Array(102, 61, 71, 37, 34, 53, 31, 243, 192), new Array(69, 60, 71, 38, 73, 119, 28, 222, 37), new Array(68, 45, 128, 34, 1, 47, 11, 245, 171), new Array(62, 17, 19, 70, 146, 85, 55, 62, 70), new Array(37, 43, 37, 154, 100, 163, 85, 160, 1), new Array(63, 9, 92, 136, 28, 64, 32, 201, 85), new Array(75, 15, 9, 9, 64, 0xFF, 184, 119, 16), new Array(86, 6, 28, 5, 64, 0xFF, 25, 248, 1), new Array(56, 8, 17, 132, 137, 0xFF, 55, 116, 128), new Array(58, 15, 20, 82, 135, 57, 26, 121, 40)), new Array(new Array(164, 50, 31, 137, 154, 133, 25, 35, 218), new Array(51, 103, 44, 131, 131, 123, 31, 6, 158), new Array(86, 40, 64, 135, 148, 224, 45, 183, 128), new Array(22, 26, 17, 131, 240, 154, 14, 1, 209), new Array(45, 16, 21, 91, 64, 222, 7, 1, 197), new Array(56, 21, 39, 155, 60, 138, 23, 102, 213), new Array(83, 12, 13, 54, 192, 0xFF, 68, 47, 28), new Array(85, 26, 85, 85, 128, 128, 32, 146, 171), new Array(18, 11, 7, 63, 144, 171, 4, 4, 246), new Array(35, 27, 10, 146, 174, 171, 12, 26, 128)), new Array(new Array(190, 80, 35, 99, 180, 80, 126, 54, 45), new Array(85, 126, 47, 87, 176, 51, 41, 20, 32), new Array(101, 75, 128, 139, 118, 146, 116, 128, 85), new Array(56, 41, 15, 176, 236, 85, 37, 9, 62), new Array(71, 30, 17, 119, 118, 0xFF, 17, 18, 138), new Array(101, 38, 60, 138, 55, 70, 43, 26, 142), new Array(146, 36, 19, 30, 171, 0xFF, 97, 27, 20), new Array(138, 45, 61, 62, 219, 1, 81, 188, 64), new Array(32, 41, 20, 117, 151, 142, 20, 21, 163), new Array(112, 19, 12, 61, 195, 128, 48, 4, 24)));
- this.CoeffsUpdateProba = new Array(new Array(new Array(new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(176, 246, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(223, 241, 252, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(249, 253, 253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 244, 252, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(234, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 246, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(239, 253, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(254, 0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 248, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(251, 0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 253, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(251, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(254, 0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 254, 253, 0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(250, 0xFF, 254, 0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF))), new Array(new Array(new Array(217, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(225, 252, 241, 253, 0xFF, 0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF), new Array(234, 250, 241, 250, 253, 0xFF, 253, 254, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(223, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(238, 253, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 248, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(249, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(247, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 253, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(252, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 254, 253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(250, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF))), new Array(new Array(new Array(186, 251, 250, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(234, 251, 244, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(251, 251, 243, 253, 254, 0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 253, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(236, 253, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(251, 253, 253, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(254, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF))), new Array(new Array(new Array(248, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(250, 254, 252, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(248, 254, 249, 253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 253, 253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(246, 253, 253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(252, 254, 251, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 254, 252, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(248, 254, 253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(253, 0xFF, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 251, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(245, 251, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(253, 253, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 251, 253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(252, 253, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 252, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(249, 0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 0xFF, 253, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(250, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)), new Array(new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(254, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), new Array(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF))));
- this.RIFF_HEADER_SIZE = 12;
- this.VP8X_HEADER_SIZE = 20;
- this.WebPGetDecoderVersion = function (_arg1){
- return ((((DEC_MAJ_VERSION << 16) | (DEC_MIN_VERSION << 8)) | DEC_REV_VERSION));
- };
- this.kBands = new Array(0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0);
- this.kCat3 = new Array(173, 148, 140, 0);
- this.kCat4 = new Array(176, 155, 140, 135, 0);
- this.kCat5 = new Array(180, 157, 141, 134, 130, 0);
- this.kCat6 = new Array(254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0);
- this.kCat3456 = new Array(this.kCat3, this.kCat4, this.kCat5, this.kCat6);
- this.kZigzag = new Array(0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15);
- this.ProbaArray = this.ArrM(new Array(this.NUM_CTX, this.NUM_PROBAS), "");
- this.PackedNz = {
- i8:this.Arr(4, this.uint8_t),
- i32:this.uint32_t
- };
- this.kUnpackTab = new Array(new Array(0, 0, 0, 0), new Array(1, 0, 0, 0), new Array(0, 1, 0, 0), new Array(1, 1, 0, 0), new Array(0, 0, 1, 0), new Array(1, 0, 1, 0), new Array(0, 1, 1, 0), new Array(1, 1, 1, 0), new Array(0, 0, 0, 1), new Array(1, 0, 0, 1), new Array(0, 1, 0, 1), new Array(1, 1, 0, 1), new Array(0, 0, 1, 1), new Array(1, 0, 1, 1), new Array(0, 1, 1, 1), new Array(1, 1, 1, 1));
- this.PACK_CST = 134480385;
- this.YUV_FIX = 16;
- this.YUV_RANGE_MIN = -227;
- this.YUV_RANGE_MAX = (0x0100 + 226);
- this.YUV_HALF = (1 << (this.YUV_FIX - 1));
- this.VP8kVToR = this.Arr(0x0100, this.int16_t);
- this.VP8kUToB = this.Arr(0x0100, this.int16_t);
- this.VP8kVToG = this.Arr(0x0100, this.int32_t);
- this.VP8kUToG = this.Arr(0x0100, this.int32_t);
- this.VP8kClip = this.Arr((this.YUV_RANGE_MAX - this.YUV_RANGE_MIN), this.uint8_t);
- this.VP8kClip4Bits = this.Arr((this.YUV_RANGE_MAX - this.YUV_RANGE_MIN), this.uint8_t);
- this.done = 0;
- this.WebPUpsamplers = new Array(this.MODE_LAST);
- this.WebPUpsamplersKeepAlpha = new Array(this.MODE_LAST);
- this.kSamplers = new Array(this.SampleRgbLinePair, this.SampleRgbaLinePair, this.SampleBgrLinePair, this.SampleBgraLinePair, this.SampleArgbLinePair, this.SampleRgba4444LinePair, this.SampleRgb565LinePair);
- this.kYUV444Converters = new Array(this.Yuv444ToRgb, this.Yuv444ToRgba, this.Yuv444ToBgr, this.Yuv444ToBgra, this.Yuv444ToArgb, this.Yuv444ToRgba4444, this.Yuv444ToRgb565);
- this.RFIX = 30;
- this.WebPDecodeRGB = function (_arg1, _arg2, _arg3, _arg4){
- return (Decode(MODE_RGB, _arg1, _arg2, _arg3, _arg4, null));
- };
- this.WebPDecodeRGBA = function (_arg1, _arg2, _arg3, _arg4){
- return (Decode(MODE_RGBA, _arg1, _arg2, _arg3, _arg4, null));
- };
- this.WebPDecodeRGBA_4444 = function (_arg1, _arg2, _arg3, _arg4){
- return (Decode(MODE_RGBA_4444, _arg1, _arg2, _arg3, _arg4, null));
- };
- this.WebPDecodeARGB = function (_arg1, _arg2, _arg3, _arg4){
- return (Decode(MODE_ARGB, _arg1, _arg2, _arg3, _arg4, null));
- };
- this.WebPDecodeBGR = function (_arg1, _arg2, _arg3, _arg4){
- return (Decode(MODE_BGR, _arg1, _arg2, _arg3, _arg4, null));
- };
- this.WebPDecodeBGRA = function (_arg1, _arg2, _arg3, _arg4){
- return (Decode(MODE_BGRA, _arg1, _arg2, _arg3, _arg4, null));
- };
- this.pic = new MovieClip();
- addChild(this.pic);
- stage.align = StageAlign.TOP_LEFT;
- stage.scaleMode = StageScaleMode.NO_SCALE;
- if (root.loaderInfo.parameters.url){
- this.param = root.loaderInfo.parameters;
- this.my_mode = this.param.mode;
- this.my_id = this.param.id;
- if (this.my_mode){
- if (this.my_mode == "bg"){
- this.my_bgRepeat = this.param.backgroundRepeat;
- this.my_bgpos = this.param.backgroundPosition.replace("left", "0%").replace("right", "100%").replace("top", "0%").replace("bottom", "100%").replace("center", "50%").split(" ");
- } else {
- if (this.my_mode == "img"){
- this.my_imgWidth = this.param.imgWidth;
- this.my_imgHeight = this.param.imgHeight;
- this.my_styleWidth = this.param.styleWidth;
- this.my_styleHeight = this.param.styleHeight;
- };
- };
- };
- };
- this.firstTime = true;
- if (root.loaderInfo.parameters.url){
- this.loader = new URLLoader();
- this.loader.dataFormat = URLLoaderDataFormat.BINARY;
- this.my_url = root.loaderInfo.parameters.url;
- if (this.my_url == null){
- this.alert("#1: no valid url");
- };
- if (this.my_url.lastIndexOf("http:") != 0){
- this.alert("#3: no valid url");
- };
- if (this.my_url.length <= 3){
- this.alert("#4: no valid url");
- };
- if (((!((this.my_url.indexOf("../") == -1))) || (!((this.my_url.indexOf("./") == -1))))){
- this.alert("#5: no valid url");
- };
- this.loader.load(new URLRequest(this.my_url));
- this.loader.addEventListener(Event.COMPLETE, this.completeHandler);
- this.loader.addEventListener(IOErrorEvent.IO_ERROR, this.ioErrorHandler);
- this.loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.ioSecurityErrorHandler);
- };
- this.WebPImage = {
- bitmap:{value:[0]},
- width:{value:0},
- height:{value:0}
- };
- }
- public function WebPGetFeaturesInternal(_arg1, _arg2, _arg3, _arg4){
- var _local5:*;
- if (_arg4 != this.WEBP_DECODER_ABI_VERSION){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- if (_arg3 == null){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- _local5 = {value:0};
- _arg2 = {value:_arg2};
- return (this.GetFeatures(_arg1, _local5, _arg2, _arg3));
- }
- public function WebPDecodeBGRAInto(_arg1, _arg2, _arg3, _arg4, _arg5){
- return (this.DecodeIntoRGBABuffer(this.MODE_BGRA, _arg1, _arg2, _arg3, _arg5, _arg4));
- }
- public function VP8XGetInfo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
- var _local8:*;
- if (((((!(_arg1)) || (!(_arg3)))) || (!(_arg4)))){
- return (0);
- };
- if (_arg3.value >= this.VP8X_HEADER_SIZE){
- if (!this.memcmp(_arg1, _arg2.value, "VP8X", 4)){
- _local8 = this.get_le32(_arg1, (_arg2.value + 4));
- _arg4.value = 1;
- if (_local8.value != (this.VP8X_HEADER_SIZE - 8)){
- return (0);
- };
- if (_arg7){
- _arg7.value = this.get_le32(_arg1, (_arg2.value + 8));
- };
- if (_arg5){
- _arg5.value = this.get_le32(_arg1, (_arg2.value + 12));
- };
- if (_arg6){
- _arg6.value = this.get_le32(_arg1, (_arg2.value + 16));
- };
- _arg2.value = (_arg2.value + this.VP8X_HEADER_SIZE);
- _arg3.value = (_arg3.value - this.VP8X_HEADER_SIZE);
- } else {
- _arg4.value = 0;
- };
- } else {
- _arg4.value = -1;
- };
- return (1);
- }
- public function WebPGetFeatures(_arg1, _arg2, _arg3){
- return (this.WebPGetFeaturesInternal(_arg1, _arg2, _arg3, this.WEBP_DECODER_ABI_VERSION));
- }
- public function SimpleVFilter16(_arg1, _arg2, _arg3, _arg4){
- var _local5:*;
- _local5 = 0;
- while (_local5 < 16) {
- if (this.needs_filter(_arg1, (_arg2 + _local5), _arg3, _arg4)){
- this.do_filter2(_arg1, (_arg2 + _local5), _arg3);
- };
- _local5++;
- };
- }
- public function VP8TransformWHT(_arg1, _arg2){
- this.TransformWHT(_arg1, _arg2);
- }
- public function LOAD_UV(_arg1, _arg2){
- return ((_arg1 | (_arg2 << 16)));
- }
- public function WebPDecode(_arg1, _arg2, _arg3){
- var _local4:*;
- var _local5:*;
- var _local6:*;
- _local4 = this.newObjectIt(this.WebPDecParams);
- _local5 = "VP8StatusCode";
- if (!_arg3){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- _local6 = {value:0};
- _arg2 = {value:_arg2};
- _local5 = this.GetFeatures(_arg1, _local6, _arg2, _arg3.input);
- if (_local5 != this.VP8_STATUS_OK){
- return (_local5);
- };
- this.WebPResetDecParams(_local4);
- _local4.output = _arg3.output;
- _local4.options_ = _arg3.options;
- _local5 = this.DecodeInto(_arg1, _local6.value, _arg2.value, _local4);
- return (_local5);
- }
- public function VP8YuvToBgra(_arg1, _arg2, _arg3, _arg4, _arg5){
- this.VP8YuvToBgr(_arg1, _arg2, _arg3, _arg4, _arg5);
- _arg4[(_arg5 + 3)] = 0xFF;
- }
- public function TransformDCUV(_arg1, _arg2, _arg3, _arg4){
- if (_arg1[(_arg2 + (0 * 16))]){
- this.TransformDC(_arg1, (_arg2 + (0 * 16)), _arg3, (_arg4 + 0));
- };
- if (_arg1[(_arg2 + (1 * 16))]){
- this.TransformDC(_arg1, (_arg2 + (1 * 16)), _arg3, (_arg4 + 4));
- };
- if (_arg1[(_arg2 + (2 * 16))]){
- this.TransformDC(_arg1, (_arg2 + (2 * 16)), _arg3, (_arg4 + (4 * this.BPS)));
- };
- if (_arg1[(_arg2 + (3 * 16))]){
- this.TransformDC(_arg1, (_arg2 + (3 * 16)), _arg3, ((_arg4 + (4 * this.BPS)) + 4));
- };
- }
- public function WebPCopyDecBuffer(_arg1, _arg2){
- this.alert("todo: WebPCopyDecBuffer");
- }
- public function VP8YuvToRgba(_arg1, _arg2, _arg3, _arg4, _arg5){
- this.VP8YuvToRgb(_arg1, _arg2, _arg3, _arg4, _arg5);
- _arg4[(_arg5 + 3)] = 0xFF;
- }
- public function VP8InitIo(_arg1){
- return (this.VP8InitIoInternal(_arg1, this.WEBP_DECODER_ABI_VERSION));
- }
- public function VFilter16i(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
- var _local7:*;
- _local7 = 3;
- while (_local7 > 0) {
- _arg2 = (_arg2 + (4 * _arg3));
- this.FilterLoop24(_arg1, (_arg2 + 0), _arg3, 1, 16, _arg4, _arg5, _arg6);
- _local7--;
- };
- }
- public function SampleRgbLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
- this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToRgb, 3);
- }
- public function WebPDecodeRGBInto(_arg1, _arg2, _arg3, _arg4, _arg5){
- return (this.DecodeIntoRGBABuffer(this.MODE_RGB, _arg1, _arg2, _arg3, _arg5, _arg4));
- }
- public function SampleArgbLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
- this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToArgb, 4);
- }
- public function HU4(_arg1, _arg2){
- var _local3:* = _arg1[((_arg2 - 1) + (0 * this.BPS))];
- var _local4:* = _arg1[((_arg2 - 1) + (1 * this.BPS))];
- var _local5:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
- var _local6:* = _arg1[((_arg2 - 1) + (3 * this.BPS))];
- _arg1[((_arg2 + 0) + (0 * this.BPS))] = this.AVG2(_local3, _local4);
- _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 0) + (1 * this.BPS))] = this.AVG2(_local4, _local5));
- _arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 0) + (2 * this.BPS))] = this.AVG2(_local5, _local6));
- _arg1[((_arg2 + 1) + (0 * this.BPS))] = this.AVG3(_local3, _local4, _local5);
- _arg1[((_arg2 + 3) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (1 * this.BPS))] = this.AVG3(_local4, _local5, _local6));
- _arg1[((_arg2 + 3) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = this.AVG3(_local5, _local6, _local6));
- _arg1[((_arg2 + 3) + (2 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = (_arg1[((_arg2 + 0) + (3 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = (_arg1[((_arg2 + 3) + (3 * this.BPS))] = _local6)))));
- }
- public function SampleBgrLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
- this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToBgr, 3);
- }
- public function write32BitIn4Bytes(_arg1, _arg2, _arg3){
- var _local4:int;
- _local4 = 3;
- while (_local4 >= 0) {
- _arg1[(_arg2 + (3 - _local4))] = ((_arg3 >> (8 * _local4)) & 0xFF);
- _local4--;
- };
- }
- public function VP8ReconstructBlock(_arg1){
- var _local15:*;
- var _local16:*;
- var _local17:*;
- var _local18:int;
- var _local19:*;
- var _local20:*;
- var _local21:int;
- var _local22:*;
- var _local23:*;
- var _local24:*;
- var _local25:*;
- var _local26:*;
- var _local2:* = _arg1.yuv_b_;
- var _local3:* = this.Y_OFF;
- var _local4:* = _arg1.yuv_b_;
- var _local5:* = this.U_OFF;
- var _local6:* = _arg1.yuv_b_;
- var _local7:* = this.V_OFF;
- if (_arg1.mb_x_ > 0){
- _local17 = -1;
- while (_local17 < 16) {
- this.Copy32b(_local2, ((_local3 + (_local17 * this.BPS)) - 4), _local2, ((_local3 + (_local17 * this.BPS)) + 12));
- _local17++;
- };
- _local17 = -1;
- while (_local17 < 8) {
- this.Copy32b(_local4, ((_local5 + (_local17 * this.BPS)) - 4), _local4, ((_local5 + (_local17 * this.BPS)) + 4));
- this.Copy32b(_local6, ((_local7 + (_local17 * this.BPS)) - 4), _local6, ((_local7 + (_local17 * this.BPS)) + 4));
- _local17++;
- };
- } else {
- _local17 = 0;
- while (_local17 < 16) {
- _local2[((_local3 + (_local17 * this.BPS)) - 1)] = 129;
- _local17++;
- };
- _local17 = 0;
- while (_local17 < 8) {
- _local4[((_local5 + (_local17 * this.BPS)) - 1)] = 129;
- _local6[((_local7 + (_local17 * this.BPS)) - 1)] = 129;
- _local17++;
- };
- if (_arg1.mb_y_ > 0){
- _local2[((_local3 - 1) - this.BPS)] = (_local4[((_local5 - 1) - this.BPS)] = (_local6[((_local7 - 1) - this.BPS)] = 129));
- };
- };
- var _local8:* = _arg1.y_t_;
- var _local9:* = (_arg1.mb_x_ * 16);
- var _local10:* = _arg1.u_t_;
- var _local11:* = (_arg1.mb_x_ * 8);
- var _local12:* = _arg1.v_t_;
- var _local13:* = (_arg1.mb_x_ * 8);
- var _local14:* = _arg1.coeffs_;
- if (_arg1.mb_y_ > 0){
- this.memcpy(_local2, (_local3 - this.BPS), _local8, _local9, 16);
- this.memcpy(_local4, (_local5 - this.BPS), _local10, _local11, 8);
- this.memcpy(_local6, (_local7 - this.BPS), _local12, _local13, 8);
- } else {
- if (_arg1.mb_x_ == 0){
- _local18 = 0;
- while (_local18 < ((16 + 4) + 1)) {
- _local2[(((_local3 - this.BPS) - 1) + _local18)] = 127;
- _local18++;
- };
- _local18 = 0;
- while (_local18 < (8 + 1)) {
- _local4[(((_local5 - this.BPS) - 1) + _local18)] = 127;
- _local18++;
- };
- _local18 = 0;
- while (_local18 < (8 + 1)) {
- _local6[(((_local7 - this.BPS) - 1) + _local18)] = 127;
- _local18++;
- };
- };
- };
- if (_arg1.is_i4x4_){
- _local19 = _local2;
- _local20 = ((_local3 - this.BPS) + 16);
- if (_arg1.mb_y_ > 0){
- if (_arg1.mb_x_ >= (_arg1.mb_w_ - 1)){
- _local19[(_local20 + 0)] = (_local19[(_local20 + 1)] = (_local19[(_local20 + 2)] = (_local19[(_local20 + 3)] = _local8[(_local9 + 15)])));
- } else {
- this.memcpy(_local19, (_local20 + 0), _local8, (_local9 + 16), 4);
- };
- };
- _local21 = 0;
- while (_local21 < 4) {
- _local19[((_local21 + _local20) + (this.BPS * 4))] = (_local19[((_local21 + _local20) + ((1 * this.BPS) * 4))] = (_local19[((_local21 + _local20) + ((2 * this.BPS) * 4))] = (_local19[((_local21 + _local20) + ((3 * this.BPS) * 4))] = _local19[((_local21 + _local20) + (0 * 4))])));
- _local21++;
- };
- _local15 = 0;
- while (_local15 < 16) {
- _local22 = _local2;
- _local23 = (_local3 + this.kScan[_local15]);
- var _local27 = this.VP8PredLuma4;
- _local27[_arg1.imodes_[_local15]](_local22, _local23);
- if ((_arg1.non_zero_ac_ & (1 << _local15))){
- this.VP8Transform(_local14, (_local15 * 16), _local22, _local23, 0);
- } else {
- if ((_arg1.non_zero_ & (1 << _local15))){
- this.VP8TransformDC(_local14, (_local15 * 16), _local22, _local23);
- };
- };
- _local15++;
- };
- } else {
- _local16 = this.CheckMode(_arg1, _arg1.imodes_[0]);
- _local27 = this.VP8PredLuma16;
- _local27[_local16](_local2, _local3);
- if (_arg1.non_zero_){
- _local15 = 0;
- while (_local15 < 16) {
- _local22 = _local2;
- _local23 = (_local3 + this.kScan[_local15]);
- if ((_arg1.non_zero_ac_ & (1 << _local15))){
- this.VP8Transform(_local14, (_local15 * 16), _local22, _local23, 0);
- } else {
- if ((_arg1.non_zero_ & (1 << _local15))){
- this.VP8TransformDC(_local14, (_local15 * 16), _local22, _local23);
- };
- };
- _local15++;
- };
- };
- };
- _local16 = this.CheckMode(_arg1, _arg1.uvmode_);
- _local27 = this.VP8PredChroma8;
- _local27[_local16](_local4, _local5);
- _local27 = this.VP8PredChroma8;
- _local27[_local16](_local6, _local7);
- if ((_arg1.non_zero_ & 983040)){
- _local24 = _arg1.coeffs_;
- _local25 = (16 * 16);
- if ((_arg1.non_zero_ac_ & 983040)){
- this.VP8TransformUV(_local24, _local25, _local4, _local5);
- } else {
- this.VP8TransformDCUV(_local24, _local25, _local4, _local5);
- };
- };
- if ((_arg1.non_zero_ & 0xF00000)){
- _local26 = _arg1.coeffs_;
- _local25 = (20 * 16);
- if ((_arg1.non_zero_ac_ & 0xF00000)){
- this.VP8TransformUV(_local26, _local25, _local6, _local7);
- } else {
- this.VP8TransformDCUV(_local26, _local25, _local6, _local7);
- };
- };
- if (_arg1.mb_y_ < (_arg1.mb_h_ - 1)){
- this.memcpy(_local8, _local9, _local2, (_local3 + (15 * this.BPS)), 16);
- this.memcpy(_local10, _local11, _local4, (_local5 + (7 * this.BPS)), 8);
- this.memcpy(_local12, _local13, _local6, (_local7 + (7 * this.BPS)), 8);
- };
- }
- public function TransformWHT(_arg1, _arg2){
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local3:* = this.Arr(16, this.int_);
- var _local4:* = this.int_;
- _local4 = 0;
- while (_local4 < 4) {
- _local5 = (_arg1[(0 + _local4)] + _arg1[(12 + _local4)]);
- _local6 = (_arg1[(4 + _local4)] + _arg1[(8 + _local4)]);
- _local7 = (_arg1[(4 + _local4)] - _arg1[(8 + _local4)]);
- _local8 = (_arg1[(0 + _local4)] - _arg1[(12 + _local4)]);
- _local3[(0 + _local4)] = (_local5 + _local6);
- _local3[(8 + _local4)] = (_local5 - _local6);
- _local3[(4 + _local4)] = (_local8 + _local7);
- _local3[(12 + _local4)] = (_local8 - _local7);
- _local4++;
- };
- _local4 = 0;
- while (_local4 < 4) {
- _local9 = _arg2[(_arg2.length - 1)];
- _local10 = (_local3[(0 + (_local4 * 4))] + 3);
- _local5 = (_local10 + _local3[(3 + (_local4 * 4))]);
- _local6 = (_local3[(1 + (_local4 * 4))] + _local3[(2 + (_local4 * 4))]);
- _local7 = (_local3[(1 + (_local4 * 4))] - _local3[(2 + (_local4 * 4))]);
- _local8 = (_local10 - _local3[(3 + (_local4 * 4))]);
- _arg2[(_local9 + 0)] = ((_local5 + _local6) >> 3);
- _arg2[(_local9 + 16)] = ((_local8 + _local7) >> 3);
- _arg2[(_local9 + 32)] = ((_local5 - _local6) >> 3);
- _arg2[(_local9 + 48)] = ((_local8 - _local7) >> 3);
- _arg2[(_arg2.length - 1)] = (_arg2[(_arg2.length - 1)] + 64);
- _local4++;
- };
- }
- public function TransformDC(_arg1, _arg2, _arg3, _arg4){
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local5:* = (_arg1[(_arg2 + 0)] + 4);
- _local7 = 0;
- while (_local7 < 4) {
- _local6 = 0;
- while (_local6 < 4) {
- _local8 = _arg3[((_arg4 + _local6) + (_local7 * this.BPS))];
- _arg3[((_arg4 + _local6) + (_local7 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + _local6) + (_local7 * this.BPS))] + (_local5 >> 3)));
- _local6++;
- };
- _local7++;
- };
- }
- public function get_le32(_arg1, _arg2){
- return ((((_arg1[(_arg2 + 0)] | (_arg1[(_arg2 + 1)] << 8)) | (_arg1[(_arg2 + 2)] << 16)) | (_arg1[(_arg2 + 3)] << 24)));
- }
- public function VP8InitBitReader(_arg1, _arg2, _arg3, _arg4){
- this.assert(_arg1);
- this.assert(_arg2);
- this.assert(_arg4);
- _arg1.range_ = (0xFF - 1);
- _arg1.buf_ = _arg2;
- _arg1.buf_off = _arg3;
- _arg1.buf_end_ = _arg4;
- _arg1.value_ = 0;
- _arg1.missing_ = 8;
- _arg1.eof_ = 0;
- }
- public function FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15){
- var _local16:*;
- _local16 = 0;
- while (_local16 < (_arg13 - 1)) {
- _arg14(_arg1[(_arg2 + 0)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg9, _arg10);
- _arg14(_arg1[(_arg2 + 1)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg9, (_arg10 + _arg15));
- _arg14(_arg3[(_arg4 + 0)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg11, _arg12);
- _arg14(_arg3[(_arg4 + 1)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg11, (_arg12 + _arg15));
- _arg2 = (_arg2 + 2);
- _arg4 = (_arg4 + 2);
- _arg6++;
- _arg8++;
- _arg10 = (_arg10 + (2 * _arg15));
- _arg12 = (_arg12 + (2 * _arg15));
- _local16 = (_local16 + 2);
- };
- if (_local16 == (_arg13 - 1)){
- _arg14(_arg1[(_arg2 + 0)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg9, _arg10);
- _arg14(_arg3[(_arg4 + 0)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg11, _arg12);
- };
- }
- public function WebPDecodeBGRInto(_arg1, _arg2, _arg3, _arg4, _arg5){
- return (this.DecodeIntoRGBABuffer(this.MODE_BGR, _arg1, _arg2, _arg3, _arg5, _arg4));
- }
- public function TM4(_arg1, _arg2){
- this.TrueMotion(_arg1, _arg2, 4);
- }
- public function InitThreadContext(_arg1){
- var _local2:*;
- _arg1.cache_id_ = 0;
- if (_arg1.use_threads_){
- _local2 = _arg1.worker_;
- _local2.data1 = _arg1;
- _local2.data2 = _arg1.thread_ctx_.io_;
- _local2.hook = this.VP8FinishRow;
- _arg1.num_caches_ = ((_arg1.filter_type_)>0) ? this.MT_CACHE_LINES : (this.MT_CACHE_LINES - 1);
- } else {
- _arg1.num_caches_ = this.ST_CACHE_LINES;
- };
- return (1);
- }
- public function CustomTeardown(_arg1){
- var _local2:*;
- _local2 = _arg1.opaque;
- _local2.memory = "";
- _local2.memory = null;
- }
- public function Yuv444ToRgb565(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
- this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToRgb565, 2);
- }
- public function HFilter16i(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
- var _local7:*;
- _local7 = 3;
- while (_local7 > 0) {
- _arg2 = (_arg2 + 4);
- this.FilterLoop24(_arg1, (_arg2 + 0), 1, _arg3, 16, _arg4, _arg5, _arg6);
- _local7--;
- };
- }
- public function VE16(_arg1, _arg2){
- var _local3:*;
- _local3 = 0;
- while (_local3 < 16) {
- this.memcpy(_arg1, (_arg2 + (_local3 * this.BPS)), _arg1, (_arg2 - this.BPS), 16);
- _local3++;
- };
- }
- public function VP8InitScanline(_arg1){
- var _local2:* = _arg1.mb_info_[(1 - 1)];
- _local2.nz_ = 0;
- _local2.dc_nz_ = 0;
- this.memset_(_arg1.intra_l_, 0, this.B_DC_PRED, _arg1.intra_l_.length);
- _arg1.filter_row_ = ((((((_arg1.filter_type_ > 0)) && ((_arg1.mb_y_ >= _arg1.tl_mb_y_)))) && ((_arg1.mb_y_ <= _arg1.br_mb_y_))) + 0);
- }
- public function VP8BitUpdate(_arg1, _arg2){
- var _local3:* = this.uint32_t;
- var _local4:* = ((_arg2 + 1) << 8);
- if (_arg1.missing_ > 0){
- _arg1.value_ = (_arg1.value_ | (this.VP8GetByte(_arg1) << _arg1.missing_));
- _arg1.missing_ = (_arg1.missing_ - 8);
- };
- _local3 = ((_arg1.value_ >= _local4) + 0);
- if (_local3){
- _arg1.range_ = (_arg1.range_ - (_arg2 + 1));
- _arg1.value_ = (_arg1.value_ - _local4);
- } else {
- _arg1.range_ = _arg2;
- };
- return (_local3);
- }
- public function VR4(_arg1, _arg2){
- var _local3:* = _arg1[((_arg2 - 1) + (0 * this.BPS))];
- var _local4:* = _arg1[((_arg2 - 1) + (1 * this.BPS))];
- var _local5:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
- var _local6:* = _arg1[((_arg2 - 1) - this.BPS)];
- var _local7:* = _arg1[((_arg2 + 0) - this.BPS)];
- var _local8:* = _arg1[((_arg2 + 1) - this.BPS)];
- var _local9:* = _arg1[((_arg2 + 2) - this.BPS)];
- var _local10:* = _arg1[((_arg2 + 3) - this.BPS)];
- _arg1[((_arg2 + 0) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = this.AVG2(_local6, _local7));
- _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = this.AVG2(_local7, _local8));
- _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 3) + (2 * this.BPS))] = this.AVG2(_local8, _local9));
- _arg1[((_arg2 + 3) + (0 * this.BPS))] = this.AVG2(_local9, _local10);
- _arg1[((_arg2 + 0) + (3 * this.BPS))] = this.AVG3(_local5, _local4, _local3);
- _arg1[((_arg2 + 0) + (2 * this.BPS))] = this.AVG3(_local4, _local3, _local6);
- _arg1[((_arg2 + 0) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local3, _local6, _local7));
- _arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG3(_local6, _local7, _local8));
- _arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local7, _local8, _local9));
- _arg1[((_arg2 + 3) + (1 * this.BPS))] = this.AVG3(_local8, _local9, _local10);
- }
- public function HFilter8i(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
- this.FilterLoop24(_arg1, (_arg2 + 4), 1, _arg5, 8, _arg6, _arg7, _arg8);
- this.FilterLoop24(_arg3, (_arg4 + 4), 1, _arg5, 8, _arg6, _arg7, _arg8);
- }
- public function InitRGBRescaler(_arg1, _arg2){
- var _local3:*;
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local12:*;
- var _local13:*;
- var _local14:*;
- _local3 = this.IsAlphaMode(_arg2.output.colorspace);
- _local4 = _arg1.scaled_width;
- _local5 = _arg1.scaled_height;
- _local6 = ((_arg1.mb_w + 1) >> 1);
- _local7 = ((_arg1.mb_h + 1) >> 1);
- _local8 = (2 * _local4);
- _local9 = this.int32_t;
- _local10 = 0;
- _local11 = this.uint8_t;
- _local12 = 0;
- _local13 = this.size_t;
- _local14 = this.size_t;
- _local13 = (3 * _local8);
- _local14 = (3 * _local4);
- if (_local3){
- _local13 = (_local13 + _local8);
- _local14 = (_local14 + _local4);
- };
- _arg2.memory = this.malloc((((_local13 * this.sizeof(_local9)) * 4) + ((_local14 * this.sizeof(_local11)) * 1)), 0);
- _arg2.memory_off = 0;
- if (_arg2.memory == null){
- this.alert("memory error");
- return (0);
- };
- _local9 = _arg2.memory;
- _local10 = _arg2.memory_off;
- _local11 = _local9;
- _local12 = (_local10 + (_local13 * 1));
- this.InitRescaler(_arg2.scaler_y, _arg1.mb_w, _arg1.mb_h, _local11, (_local12 + ((0 * _local4) * 1)), _local4, _local5, 0, _arg1.mb_w, _local4, _arg1.mb_h, _local5, _local9, (_local10 + ((0 * _local8) * 4)));
- this.InitRescaler(_arg2.scaler_u, _local6, _local7, _local11, (_local12 + ((1 * _local4) * 1)), _local4, _local5, 0, _arg1.mb_w, (2 * _local4), _arg1.mb_h, (2 * _local5), _local9, (_local10 + ((1 * _local8) * 4)));
- this.InitRescaler(_arg2.scaler_v, _local6, _local7, _local11, (_local12 + ((2 * _local4) * 1)), _local4, _local5, 0, _arg1.mb_w, (2 * _local4), _arg1.mb_h, (2 * _local5), _local9, (_local10 + ((2 * _local8) * 4)));
- _arg2.emit = this.EmitRescaledRGB;
- if (_local3){
- this.InitRescaler(_arg2.scaler_a, _arg1.mb_w, _arg1.mb_h, _local11, (_local12 + ((3 * _local4) * 1)), _local4, _local5, 0, _arg1.mb_w, _local4, _arg1.mb_h, _local5, _local9, (_local10 + ((3 * _local8) * 4)));
- _arg2.emit_alpha = this.EmitRescaledAlphaRGB;
- };
- return (1);
- }
- public function VP8FinishRow(_arg1, _arg2){
- var _local20:*;
- var _local3:* = 1;
- var _local4:* = _arg1.thread_ctx_;
- var _local5:* = this.kFilterExtraRows[_arg1.filter_type_];
- var _local6:* = (_local5 * _arg1.cache_y_stride_);
- var _local7:* = (parseInt(String((_local5 / 2))) * _arg1.cache_uv_stride_);
- var _local8:* = ((_local4.id_ * 16) * _arg1.cache_y_stride_);
- var _local9:* = ((_local4.id_ * 8) * _arg1.cache_uv_stride_);
- var _local10:* = _arg1.cache_y_;
- var _local11:* = ((_arg1.cache_y_off - _local6) + _local8);
- var _local12:* = _arg1.cache_u_;
- var _local13:* = ((_arg1.cache_u_off - _local7) + _local9);
- var _local14:* = _arg1.cache_v_;
- var _local15:* = ((_arg1.cache_v_off - _local7) + _local9);
- var _local16:* = (_local4.mb_y_ == 0);
- var _local17:* = ((_local4.mb_y_ >= (_arg1.mb_h_ - 1)) + 0);
- var _local18:* = this.MACROBLOCK_VPOS(_local4.mb_y_);
- var _local19:* = this.MACROBLOCK_VPOS((_local4.mb_y_ + 1));
- if (_local4.filter_row_){
- this.FilterRow(_arg1);
- };
- if (_arg2.put){
- if (!_local16){
- _local18 = (_local18 - _local5);
- _arg2.y = _local10;
- _arg2.y_off = _local11;
- _arg2.u = _local12;
- _arg2.u_off = _local13;
- _arg2.v = _local14;
- _arg2.v_off = _local15;
- } else {
- _arg2.y = _arg1.cache_y_;
- _arg2.y_off = (_arg1.cache_y_off + _local8);
- _arg2.u = _arg1.cache_u_;
- _arg2.u_off = (_arg1.cache_u_off + _local9);
- _arg2.v = _arg1.cache_v_;
- _arg2.v_off = (_arg1.cache_v_off + _local9);
- };
- if (!_local17){
- _local19 = (_local19 - _local5);
- };
- if (_local19 > _arg2.crop_bottom){
- _local19 = _arg2.crop_bottom;
- };
- if (_arg1.alpha_data_){
- if (_local18 == 0){
- _arg2.a = this.VP8DecompressAlphaRows(_arg1, _local18, (_local19 - _local18));
- _arg2.a_off = 0;
- } else {
- _arg2.a_off = this.VP8DecompressAlphaRows(_arg1, _local18, (_local19 - _local18));
- };
- if (_arg2.a == null){
- return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "Could not decode alpha data."));
- };
- };
- if (_local18 < _arg2.crop_top){
- _local20 = (_arg2.crop_top - _local18);
- _local18 = _arg2.crop_top;
- this.assert(!((_local20 & 1)));
- _arg2.y_off = (_arg2.y_off + (_arg1.cache_y_stride_ * _local20));
- _arg2.u_off = (_arg2.u_off + (_arg1.cache_uv_stride_ * (_local20 >> 1)));
- _arg2.v_off = (_arg2.v_off + (_arg1.cache_uv_stride_ * (_local20 >> 1)));
- if (_arg2.a){
- _arg2.a_off = (_arg2.a_off + (_arg2.width * _local20));
- };
- };
- if (_local18 < _local19){
- _arg2.y_off = (_arg2.y_off + _arg2.crop_left);
- _arg2.u_off = (_arg2.u_off + (_arg2.crop_left >> 1));
- _arg2.v_off = (_arg2.v_off + (_arg2.crop_left >> 1));
- if (_arg2.a){
- _arg2.a_off = (_arg2.a_off + _arg2.crop_left);
- };
- _arg2.mb_y = (_local18 - _arg2.crop_top);
- _arg2.mb_w = (_arg2.crop_right - _arg2.crop_left);
- _arg2.mb_h = (_local19 - _local18);
- _local3 = _arg2.put(_arg2);
- };
- };
- if ((_local4.id_ + 1) == _arg1.num_caches_){
- if (!_local17){
- this.memcpy(_arg1.cache_y_, (_arg1.cache_y_off - _local6), _local10, (_local11 + (16 * _arg1.cache_y_stride_)), _local6);
- this.memcpy(_arg1.cache_u_, (_arg1.cache_u_off - _local7), _local12, (_local13 + (8 * _arg1.cache_uv_stride_)), _local7);
- this.memcpy(_arg1.cache_v_, (_arg1.cache_v_off - _local7), _local14, (_local15 + (8 * _arg1.cache_uv_stride_)), _local7);
- };
- };
- return (_local3);
- }
- public function SampleRgbaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
- this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToRgba, 4);
- }
- public function SampleBgraLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
- this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToBgra, 4);
- }
- public function WebPInitDecoderConfig(_arg1){
- return (this.WebPInitDecoderConfigInternal(_arg1, this.WEBP_DECODER_ABI_VERSION));
- }
- public function MULT(_arg1, _arg2){
- return ((((_arg1 * _arg2) + (1 << (this.RFIX - 1))) >> this.RFIX));
- }
- public function Yuv444ToArgb(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
- this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToArgb, 4);
- }
- public function stageResize(_arg1:Event=null):void{
- this.WebPChange();
- }
- public function Put16(_arg1, _arg2, _arg3){
- var _local4:*;
- var _local5:*;
- _local4 = 0;
- while (_local4 < 16) {
- _local5 = 0;
- while (_local5 < 16) {
- _arg2[((_arg3 + (_local4 * this.BPS)) + _local5)] = _arg1;
- _local5++;
- };
- _local4++;
- };
- }
- public function ArrCopy(_arg1){
- var _local4:int;
- var _local2:* = new Array();
- var _local3:* = _arg1.length;
- _local4 = 0;
- while (_local4 < _local3) {
- _local2.push(_arg1[_local4]);
- _local4++;
- };
- return (_local2);
- }
- public function ExportRow(_arg1){
- var _local2:*;
- var _local3:*;
- var _local4:*;
- var _local5:*;
- _local2 = this.int_;
- _local3 = (_arg1.fy_scale * -(_arg1.y_accum));
- this.assert((_arg1.y_accum <= 0));
- _local2 = 0;
- while (_local2 < _arg1.dst_width) {
- _local4 = this.MULT(this.write4BytesIn32Bit(_arg1.frow, (_arg1.frow_off + (_local2 * 4))), _local3);
- _local5 = this.MULT((this.write4BytesIn32Bit(_arg1.irow, (_arg1.irow_off + (_local2 * 4))) - _local4), _arg1.fxy_scale);
- _arg1.dst[(_arg1.dst_off + _local2)] = (((_local5 & ~(0xFF))) ? ((_local5)<0) ? 0 : 0xFF : _local5);
- this.write32BitIn4Bytes(_arg1.irow, (_arg1.irow_off + (_local2 * 4)), _local4);
- _local2++;
- };
- _arg1.y_accum = (_arg1.y_accum + _arg1.y_add);
- _arg1.dst_off = (_arg1.dst_off + _arg1.dst_stride);
- }
- public function DC16NoLeft(_arg1, _arg2){
- var _local4:*;
- var _local3:* = 8;
- _local4 = 0;
- while (_local4 < 16) {
- _local3 = (_local3 + _arg1[((_arg2 + _local4) - this.BPS)]);
- _local4++;
- };
- this.Put16((_local3 >> 4), _arg1, _arg2);
- }
- public function CustomSetup(_arg1){
- var _local2:*;
- var _local3:*;
- var _local4:*;
- var _local5:*;
- _local2 = _arg1.opaque;
- _local3 = (_local2.output.colorspace < this.MODE_YUV);
- _local2.memory = null;
- _local2.emit = null;
- _local2.emit_alpha = null;
- if (!this.InitFromOptions(_local2.options_, _arg1)){
- return (0);
- };
- if (_arg1.use_scaling){
- _local4 = ((_local3) ? this.InitRGBRescaler(_arg1, _local2) : this.InitYUVRescaler(_arg1, _local2));
- if (!_local4){
- this.alert("memory error #1");
- return (0);
- };
- } else {
- if (_local3){
- _local2.emit = this.EmitSampledRGB;
- if (_arg1.fancy_upsampling){
- _local5 = ((_arg1.mb_w + 1) >> 1);
- _local2.memory = this.malloc((_arg1.mb_w + (2 * _local5)), 205);
- if (_local2.memory == null){
- this.alert("memory error #2");
- return (0);
- };
- _local2.tmp_y = _local2.memory;
- _local2.tmp_y_off = 0;
- _local2.tmp_u = _local2.tmp_y;
- _local2.tmp_u_off = (_local2.tmp_y_off + _arg1.mb_w);
- _local2.tmp_v = _local2.tmp_u;
- _local2.tmp_v_off = (_local2.tmp_u_off + _local5);
- _local2.emit = this.EmitFancyRGB;
- this.InitUpsamplers(this.void_);
- };
- } else {
- _local2.emit = this.EmitYUV;
- };
- if (this.IsAlphaMode(_local2.output.colorspace)){
- _local2.emit_alpha = ((_local3) ? this.EmitAlphaRGB : this.EmitAlphaYUV);
- };
- };
- if (_local3){
- this.VP8YUVInit(this.void_);
- };
- return (1);
- }
- public function alert(_arg1){
- if (this.firstTime){
- ExternalInterface.call("webpFSCommand", "status", (((("" + this.my_id) + "|error|") + _arg1) + ""));
- };
- this.myText_txt.text = _arg1;
- this.stopAction = true;
- gotoAndStop(2);
- }
- public function WebPInitDecBuffer(_arg1){
- return (this.WebPInitDecBufferInternal(_arg1, this.WEBP_DECODER_ABI_VERSION));
- }
- public function DefaultFeatures(_arg1){
- this.assert(_arg1);
- _arg1.bitstream_version = 0;
- }
- public function GetFeatures(_arg1, _arg2, _arg3, _arg4){
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- _local5 = {value:0};
- _local6 = {value:0};
- _local7 = {value:0};
- _local8 = {value:0};
- _local9 = {value:0};
- if (_arg4 == null){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- this.DefaultFeatures(_arg4);
- if ((((((_arg1 == null)) || ((_arg2 == null)))) || ((_arg3.value == 0)))){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- if (!this.WebPCheckAndSkipRIFFHeader(_arg1, _arg2, _arg3, _local6)){
- return (this.VP8_STATUS_BITSTREAM_ERROR);
- };
- if (!this.VP8XGetInfo(_arg1, _arg2, _arg3, _local8, _arg4.width, _arg4.height, _local7)){
- return (this.VP8_STATUS_BITSTREAM_ERROR);
- };
- if (_local8.value > 0){
- return (this.VP8_STATUS_OK);
- };
- if (!this.VP8CheckAndSkipHeader(_arg1, _arg2, _arg3, _local9, _local5, _local6)){
- return (this.VP8_STATUS_BITSTREAM_ERROR);
- };
- if (_local9.value == -1){
- return (this.VP8_STATUS_BITSTREAM_ERROR);
- };
- if (!_local9.value){
- _local5.value = _arg3.value;
- };
- if (!this.VP8GetInfo(_arg1, _arg2, _arg3, _local5, _arg4.width, _arg4.height, _arg4.has_alpha)){
- return (this.VP8_STATUS_BITSTREAM_ERROR);
- };
- return (this.VP8_STATUS_OK);
- }
- public function sizeof(_arg1){
- return (1);
- }
- public function FilterLoop24(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
- while (_arg5-- > 0) {
- if (this.needs_filter2(_arg1, (_arg2 + 0), _arg3, _arg6, _arg7)){
- if (this.hev(_arg1, (_arg2 + 0), _arg3, _arg8)){
- this.do_filter2(_arg1, (_arg2 + 0), _arg3);
- } else {
- this.do_filter4(_arg1, (_arg2 + 0), _arg3);
- };
- };
- _arg2 = (_arg2 + _arg4);
- };
- }
- public function FilterLoop26(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
- while (_arg5-- > 0) {
- if (this.needs_filter2(_arg1, (_arg2 + 0), _arg3, _arg6, _arg7)){
- if (this.hev(_arg1, (_arg2 + 0), _arg3, _arg8)){
- this.do_filter2(_arg1, (_arg2 + 0), _arg3);
- } else {
- this.do_filter6(_arg1, (_arg2 + 0), _arg3);
- };
- };
- _arg2 = (_arg2 + _arg4);
- };
- }
- public function VP8SetError(_arg1, _arg2, _arg3){
- _arg1.status_ = _arg2;
- _arg1.error_msg_ = _arg3;
- _arg1.ready_ = 0;
- this.alert(((_arg2 + ": ") + _arg3));
- return (0);
- }
- public function Yuv444ToRgba(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
- this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToRgba, 4);
- }
- public function InitRescaler(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14){
- _arg1.x_expand = ((_arg2 < _arg6) + 0);
- _arg1.src_width = _arg2;
- _arg1.src_height = _arg3;
- _arg1.dst_width = _arg6;
- _arg1.dst_height = _arg7;
- _arg1.dst = _arg4;
- _arg1.dst_off = _arg5;
- _arg1.dst_stride = _arg8;
- _arg1.x_add = ((_arg1.x_expand) ? (_arg10 - 1) : (_arg9 - _arg10));
- _arg1.x_sub = ((_arg1.x_expand) ? (_arg9 - 1) : _arg10);
- _arg1.y_accum = _arg11;
- _arg1.y_add = _arg11;
- _arg1.y_sub = _arg12;
- _arg1.fx_scale = parseInt(String(((1 << this.RFIX) / _arg10)));
- _arg1.fy_scale = parseInt(String(((1 << this.RFIX) / _arg12)));
- _arg1.fxy_scale = ((_arg1.x_expand) ? (parseInt(String(this.int64BitLeft(_arg7, this.RFIX))) / (_arg10 * _arg3)) : (parseInt(String(this.int64BitLeft(_arg7, this.RFIX))) / (_arg9 * _arg3)));
- _arg1.irow = _arg13;
- _arg1.irow_off = (0 * 4);
- _arg1.frow = _arg13;
- _arg1.frow_off = (_arg14 + (_arg6 * 4));
- }
- public function Yuv444ToBgra(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
- this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToBgra, 4);
- }
- public function VP8ParseQuant(_arg1){
- var _local11:*;
- var _local12:*;
- var _local2:* = _arg1.br_;
- var _local3:* = this.VP8GetValue(_local2, 7);
- var _local4:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
- var _local5:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
- var _local6:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
- var _local7:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
- var _local8:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
- var _local9:* = _arg1.segment_hdr_;
- var _local10:* = this.int_;
- _local10 = 0;
- for (;_local10 < this.NUM_MB_SEGMENTS;_local10++) {
- _local11 = this.int_;
- if (_local9.use_segment_){
- _local11 = _local9.quantizer_[_local10];
- if (!_local9.absolute_delta_){
- _local11 = (_local11 + _local3);
- };
- } else {
- if (_local10 > 0){
- _arg1.dqm_[_local10] = _arg1.dqm_[0];
- continue;
- };
- _local11 = _local3;
- };
- _local12 = _arg1.dqm_[_local10];
- _local12.y1_mat_[0] = this.kDcTable[this.clip((_local11 + _local4), 127)];
- _local12.y1_mat_[1] = this.kAcTable[this.clip((_local11 + 0), 127)];
- _local12.y2_mat_[0] = (this.kDcTable[this.clip((_local11 + _local5), 127)] * 2);
- _local12.y2_mat_[1] = parseInt(String(((this.kAcTable[this.clip((_local11 + _local6), 127)] * 155) / 100)));
- if (_local12.y2_mat_[1] < 8){
- _local12.y2_mat_[1] = 8;
- };
- _local12.uv_mat_[0] = this.kDcTable[this.clip((_local11 + _local7), 117)];
- _local12.uv_mat_[1] = this.kAcTable[this.clip((_local11 + _local8), 127)];
- };
- }
- public function VP8Get(_arg1){
- return (this.VP8GetValue(_arg1, 1));
- }
- public function membuild(_arg1, _arg2){
- var _local4:int;
- var _local3:* = new Array();
- _local4 = 0;
- while (_local4 < _arg2) {
- _local3.push(_arg1);
- _local4++;
- };
- _local3.push(0);
- return (_local3);
- }
- public function DecodeInto(_arg1, _arg2, _arg3, _arg4){
- var _local5:*;
- var _local6:*;
- var _local7:*;
- _local5 = this.VP8New(this.void_);
- _local6 = this.VP8_STATUS_OK;
- _local7 = this.newObjectIt(this.VP8Io);
- var _local8:* = 1;
- this.assert(_arg4);
- if (_local5 == null){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- this.VP8InitIo(_local7);
- _local7.data = _arg1;
- _local7.data_off = _arg2;
- _local7.data_size = _arg3;
- this.WebPInitCustomIo(_arg4, _local7);
- _local5.use_threads_ = 0;
- if (!this.VP8GetHeaders(_local5, _local7)){
- _local6 = this.VP8_STATUS_BITSTREAM_ERROR;
- } else {
- _local6 = this.WebPAllocateDecBuffer(_local7.width, _local7.height, _arg4.options_, _arg4.output);
- if (_local6 == this.VP8_STATUS_OK){
- if (!this.VP8Decode(_local5, _local7)){
- _local6 = _local5.status_;
- };
- };
- };
- this.VP8Delete(_local5);
- if (_local6 != this.VP8_STATUS_OK){
- this.WebPFreeDecBuffer(_arg4.output);
- };
- return (_local6);
- }
- public function LD4(_arg1, _arg2){
- var _local3:* = _arg1[((_arg2 + 0) - this.BPS)];
- var _local4:* = _arg1[((_arg2 + 1) - this.BPS)];
- var _local5:* = _arg1[((_arg2 + 2) - this.BPS)];
- var _local6:* = _arg1[((_arg2 + 3) - this.BPS)];
- var _local7:* = _arg1[((_arg2 + 4) - this.BPS)];
- var _local8:* = _arg1[((_arg2 + 5) - this.BPS)];
- var _local9:* = _arg1[((_arg2 + 6) - this.BPS)];
- var _local10:* = _arg1[((_arg2 + 7) - this.BPS)];
- _arg1[((_arg2 + 0) + (0 * this.BPS))] = this.AVG3(_local3, _local4, _local5);
- _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 0) + (1 * this.BPS))] = this.AVG3(_local4, _local5, _local6));
- _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 0) + (2 * this.BPS))] = this.AVG3(_local5, _local6, _local7)));
- _arg1[((_arg2 + 3) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = (_arg1[((_arg2 + 0) + (3 * this.BPS))] = this.AVG3(_local6, _local7, _local8))));
- _arg1[((_arg2 + 3) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local7, _local8, _local9)));
- _arg1[((_arg2 + 3) + (2 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG3(_local8, _local9, _local10));
- _arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local9, _local10, _local10);
- }
- public function WebPCheckAndSkipRIFFHeader(_arg1, _arg2, _arg3, _arg4){
- if ((((_arg3.value >= this.RIFF_HEADER_SIZE)) && (!(this.memcmp(_arg1, _arg2.value, "RIFF", 4))))){
- if (this.memcmp(_arg1, (_arg2.value + 8), "WEBP", 4)){
- return (0);
- };
- _arg4.value = this.get_le32(_arg1, (_arg2.value + 4));
- if (_arg4.value < this.RIFF_HEADER_SIZE){
- return (0);
- };
- _arg2.value = (_arg2.value + this.RIFF_HEADER_SIZE);
- _arg3.value = (_arg3.value - this.RIFF_HEADER_SIZE);
- } else {
- _arg4.value = 0;
- };
- return (1);
- }
- public function SetOk(_arg1){
- _arg1.status_ = "VP8_STATUS_OK";
- _arg1.error_msg_ = "OK";
- }
- public function Yuv444ToRgb(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
- this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToRgb, 3);
- }
- public function ParsePartitions(_arg1, _arg2, _arg3, _arg4){
- var _local10:*;
- var _local11:*;
- var _local14:*;
- var _local15:*;
- var _local16:*;
- var _local5:* = _arg1.br_;
- var _local6:* = _arg2;
- var _local7:* = _arg3;
- var _local8:* = _arg2;
- var _local9:* = (_arg3 + _arg4);
- _local11 = 0;
- var _local12:* = this.int_;
- var _local13:* = this.int_;
- _arg1.num_parts_ = (1 << this.VP8GetValue(_local5, 2));
- _local12 = (_arg1.num_parts_ - 1);
- _local10 = _arg2;
- _local11 = (_arg3 + (_local12 * 3));
- if (_local9 < _local11){
- return ("VP8_STATUS_NOT_ENOUGH_DATA");
- };
- _local13 = 0;
- while (_local13 < _local12) {
- _local14 = ((_local6[(_local7 + 0)] | (_local6[(_local7 + 1)] << 8)) | (_local6[(_local7 + 2)] << 16));
- _local15 = _local10;
- _local16 = (_local11 + _local14);
- if (_local16 > _local9){
- _local15 = _local8;
- };
- this.VP8InitBitReader(_arg1.parts_[_local13], _local10, _local11, _local16);
- _local10 = _local15;
- _local11 = _local16;
- _local7 = (_local7 + 3);
- _local13++;
- };
- this.VP8InitBitReader(_arg1.parts_[_local12], _local10, _local11, _local9);
- return (((_local11)<_local9) ? "VP8_STATUS_OK" : "VP8_STATUS_SUSPENDED");
- }
- public function Yuv444ToBgr(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
- this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToBgr, 3);
- }
- public function CustomPut(_arg1){
- var _local2:*;
- var _local3:*;
- var _local4:*;
- var _local5:*;
- _local2 = _arg1.opaque;
- _local3 = _arg1.mb_w;
- _local4 = _arg1.mb_h;
- this.assert(!((_arg1.mb_y & 1)));
- if ((((_local3 <= 0)) || ((_local4 <= 0)))){
- return (0);
- };
- _local5 = _local2.emit(_arg1, _local2);
- _local2.last_y = (_local2.last_y + _local5);
- if (_local2.emit_alpha){
- _local2.emit_alpha(_arg1, _local2);
- };
- return (1);
- }
- public function ioSecurityErrorHandler(_arg1:SecurityErrorEvent):void{
- this.alert("#2.1: security error");
- }
- public function memset_wl(_arg1, _arg2){
- var _local4:int;
- var _local3:* = new Array();
- _local3.push(this.newObjectIt(_arg1));
- _local4 = 0;
- while (_local4 < _arg2) {
- _local3.push(this.newObjectIt(_arg1));
- _local4++;
- };
- _local3.push(0);
- return (_local3);
- }
- public function ExportAlpha(_arg1, _arg2){
- var _local3:*;
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- _local3 = _arg1.output.u.RGBA;
- _local4 = _local3.rgba;
- _local5 = (_local3.rgba_off + ((_arg1.last_y + _arg2) * _local3.stride));
- _local6 = 0;
- while (_arg1.scaler_a.y_accum <= 0) {
- this.assert((((_arg1.last_y + _arg2) + _local6) < _arg1.output.height));
- this.ExportRow(_arg1.scaler_a);
- _local7 = 0;
- while (_local7 < _arg1.scaler_a.dst_width) {
- _local4[((_local5 + (4 * _local7)) + 3)] = _arg1.scaler_a.dst[(_arg1.scaler_a.dst_off + _local7)];
- _local7++;
- };
- _local5 = (_local5 + _local3.stride);
- _local6++;
- };
- return (_local6);
- }
- public function WebPGetInfo(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:*;
- _local6 = this.newObjectIt(this.WebPBitstreamFeatures);
- if (this.GetFeatures(_arg1, _arg2, _arg3, _local6) != this.VP8_STATUS_OK){
- return (0);
- };
- if (_arg4){
- _arg4.value = _local6.width;
- };
- if (_arg5){
- _arg5.value = _local6.height;
- };
- return (1);
- }
- public function FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11){
- var _local12:*;
- _local12 = 0;
- while (_local12 < _arg9) {
- _arg10(_arg1[(_arg2 + _local12)], _arg3[(_arg4 + _local12)], _arg5[(_arg6 + _local12)], _arg7[(_arg8 + (_local12 * _arg11))], 0);
- _local12++;
- };
- }
- public function IsAlphaMode(_arg1){
- return ((((((((((_arg1 == this.MODE_RGBA)) || ((_arg1 == this.MODE_BGRA)))) || ((_arg1 == this.MODE_ARGB)))) || ((_arg1 == this.MODE_RGBA_4444)))) || ((_arg1 == this.MODE_YUVA))));
- }
- public function AllocateBuffer(_arg1){
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local12:*;
- var _local13:*;
- var _local14:*;
- var _local2:* = _arg1.width;
- var _local3:* = _arg1.height;
- if ((((_local2 <= 0)) || ((_local3 <= 0)))){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- if (((!(_arg1.is_external_memory)) && ((_arg1.private_memory == null)))){
- _local4 = this.uint8_t;
- _local5 = 0;
- _local6 = _arg1.colorspace;
- _local7 = this.int_;
- _local8 = 0;
- _local9 = 0;
- _local10 = 0;
- _local11 = this.uint64_t;
- _local12 = 0;
- _local13 = this.uint64_t;
- _local7 = (_local2 * this.kModeBpp[_local6]);
- _local11 = (_local7 * _local3);
- if (_local6 >= this.MODE_YUV){
- _local8 = parseInt(String(((_local2 + 1) / 2)));
- _local10 = (_local8 * parseInt(String(((_local3 + 1) / 2))));
- if (_local6 == this.MODE_YUVA){
- _local9 = _local2;
- _local12 = (_local9 * _local3);
- };
- };
- _local13 = ((_local11 + (2 * _local10)) + _local12);
- if (((_local11 + (2 * _local10)) + _local12) != _local13){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- _local4 = new ByteArray();
- _arg1.private_memory = _local4;
- _local4.length = _local13;
- _local5 = 0;
- _arg1.private_memory_off = _local5;
- if (_local4 == null){
- return (this.VP8_STATUS_OUT_OF_MEMORY);
- };
- if (_local6 >= this.MODE_YUV){
- _local14 = _arg1.u.YUVA;
- _local14.y = _local4;
- _local14.y_off = _local5;
- _local14.y_stride = _local7;
- _local14.y_size = _local11;
- _local14.u = _local4;
- _local14.u_off = (_local5 + _local11);
- _local14.u_stride = _local8;
- _local14.u_size = _local10;
- _local14.v = _local4;
- _local14.v_off = ((_local5 + _local11) + _local10);
- _local14.v_stride = _local8;
- _local14.v_size = _local10;
- if (_local6 == this.MODE_YUVA){
- _local14.a = _local4;
- _local14.a_off = ((_local5 + _local11) + (2 * _local10));
- };
- _local14.a_size = _local12;
- _local14.a_stride = _local9;
- } else {
- _local14 = _arg1.u.RGBA;
- _local14.rgba = _local4;
- _local14.rgba_off = _local5;
- _local14.stride = _local7;
- _local14.size = _local11;
- };
- };
- return (this.CheckDecBuffer(_arg1));
- }
- public function DC8uvNoLeft(_arg1, _arg2){
- var _local4:*;
- var _local3:* = 4;
- _local4 = 0;
- while (_local4 < 8) {
- _local3 = (_local3 + _arg1[((_arg2 + _local4) - this.BPS)]);
- _local4++;
- };
- this.Put8x8uv(((_local3 >> 3) * 1), _arg1, _arg2);
- }
- public function write4BytesIn32Bit(_arg1, _arg2){
- return (((((_arg1[(_arg2 + 0)] << 24) | (_arg1[(_arg2 + 1)] << 16)) | (_arg1[(_arg2 + 2)] << 8)) | _arg1[(_arg2 + 3)]));
- }
- public function WebPInitDecoderConfigInternal(_arg1, _arg2){
- if (_arg2 != this.WEBP_DECODER_ABI_VERSION){
- return (0);
- };
- if (_arg1 == null){
- return (0);
- };
- this.DefaultFeatures(_arg1.input);
- this.WebPInitDecBuffer(_arg1.output);
- return (1);
- }
- public function PACK(_arg1, _arg2){
- return ((((((((_arg1[0] * 16777216) + (_arg1[1] * 65536)) + (_arg1[2] * 0x0100)) + (_arg1[3] * 1)) * this.PACK_CST) & 0xFF000000) >> _arg2));
- }
- public function Decode(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- _local7 = {value:0};
- _arg3 = {value:_arg3};
- _local8 = this.newObjectIt(this.WebPDecParams);
- _local9 = this.newObjectIt(this.WebPDecBuffer);
- this.WebPInitDecBuffer(_local9);
- this.WebPResetDecParams(_local8);
- _local8.output = _local9;
- _local9.colorspace = _arg1;
- _local10 = {
- data_off:{value:0},
- width:{value:_local9.width},
- height:{value:_local9.height}
- };
- if (!this.WebPGetInfo(_arg2, _local7, _arg3, _local10.width, _local10.height)){
- return (null);
- };
- _local9.width = _local10.width.value;
- _local9.height = _local10.height.value;
- if (_arg4){
- _arg4.value = _local9.width.value;
- };
- if (_arg5){
- _arg5.value = _local9.height.value;
- };
- if (this.DecodeInto(_arg2, _local7.value, _arg3.value, _local8) != this.VP8_STATUS_OK){
- return (null);
- };
- if (_arg6){
- this.WebPCopyDecBuffer(_local9, _arg6);
- };
- return (((_arg1)>=this.MODE_YUV) ? _local9.u.YUVA.y : _local9.u.RGBA.rgba);
- }
- public function mallocStr(_arg1, _arg2){
- var _local4:int;
- var _local3:* = new Array();
- _local4 = 0;
- while (_local4 < _arg1) {
- _local3.push(" ");
- _local4++;
- };
- return (_local3.join(""));
- }
- public function VFilter16(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
- this.FilterLoop26(_arg1, (_arg2 + 0), _arg3, 1, 16, _arg4, _arg5, _arg6);
- }
- public function ArrM(_arg1, _arg2){
- var _local3:*;
- var _local5:int;
- var _local4:* = new Array();
- _local5 = (_arg1.length - 1);
- while (_local5 >= 0) {
- _arg2 = this.newObjectIt(this.Arr(_arg1[_local5], _arg2));
- _local5--;
- };
- return (_arg2);
- }
- public function Copy32b(_arg1, _arg2, _arg3, _arg4){
- var _local5:int;
- _local5 = 0;
- while (_local5 < 4) {
- _arg1[(_arg2 + _local5)] = _arg3[(_arg4 + _local5)];
- _local5++;
- };
- }
- public function Arr(_arg1, _arg2){
- var _local4:int;
- var _local3:* = new Array();
- _local4 = 0;
- while (_local4 < _arg1) {
- _local3.push(_arg2);
- _local4++;
- };
- return (_local3);
- }
- public function Yuv444ToRgba4444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
- this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToRgba4444, 2);
- }
- public function WebPResetDecParams(_arg1){
- if (_arg1){
- };
- }
- public function UpsampleArgbKeepAlphaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToArgbKeepA, 4);
- }
- public function HFilter8(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
- this.FilterLoop26(_arg1, _arg2, 1, _arg5, 8, _arg6, _arg7, _arg8);
- this.FilterLoop26(_arg3, _arg4, 1, _arg5, 8, _arg6, _arg7, _arg8);
- }
- public function WebPInitDecBufferInternal(_arg1, _arg2){
- if (_arg2 != this.WEBP_DECODER_ABI_VERSION){
- return (0);
- };
- if (!_arg1){
- return (0);
- };
- this.memset_(_arg1, 0, 0, (this.sizeof(_arg1) * _arg1.length));
- return (1);
- }
- public function InitUpsamplers(_arg1){
- this.WebPUpsamplers[this.MODE_RGB] = this.UpsampleRgbLinePair;
- this.WebPUpsamplers[this.MODE_RGBA] = this.UpsampleRgbaLinePair;
- this.WebPUpsamplers[this.MODE_BGR] = this.UpsampleBgrLinePair;
- this.WebPUpsamplers[this.MODE_BGRA] = this.UpsampleBgraLinePair;
- this.WebPUpsamplers[this.MODE_ARGB] = this.UpsampleArgbLinePair;
- this.WebPUpsamplers[this.MODE_RGBA_4444] = this.UpsampleRgba4444LinePair;
- this.WebPUpsamplers[this.MODE_RGB_565] = this.UpsampleRgb565LinePair;
- this.WebPUpsamplersKeepAlpha[this.MODE_RGB] = this.UpsampleRgbLinePair;
- this.WebPUpsamplersKeepAlpha[this.MODE_RGBA] = this.UpsampleRgbKeepAlphaLinePair;
- this.WebPUpsamplersKeepAlpha[this.MODE_BGR] = this.UpsampleBgrLinePair;
- this.WebPUpsamplersKeepAlpha[this.MODE_BGRA] = this.UpsampleBgrKeepAlphaLinePair;
- this.WebPUpsamplersKeepAlpha[this.MODE_ARGB] = this.UpsampleArgbKeepAlphaLinePair;
- this.WebPUpsamplersKeepAlpha[this.MODE_RGBA_4444] = this.UpsampleRgba4444KeepAlphaLinePair;
- this.WebPUpsamplersKeepAlpha[this.MODE_RGB_565] = this.UpsampleRgb565LinePair;
- }
- public function TM16(_arg1, _arg2){
- this.TrueMotion(_arg1, _arg2, 16);
- }
- public function memcpyArrM(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:int;
- var _local7:*;
- var _local8:*;
- _local6 = 0;
- while (_local6 < _arg5) {
- _local7 = _arg1[(_arg2 + _local6)].length;
- _local8 = 0;
- while (_local8 < _local7) {
- _arg1[(_arg2 + _local6)][_local8] = _arg3[(_arg4 + _local6)][_local8];
- _local8++;
- };
- _local6++;
- };
- }
- public function VP8Shift(_arg1){
- var _local2:* = this.kVP8Log2Range[_arg1.range_];
- _arg1.range_ = this.kVP8NewRange[_arg1.range_];
- _arg1.value_ = (_arg1.value_ << _local2);
- _arg1.missing_ = (_arg1.missing_ + _local2);
- }
- public function ParseFilterHeader(_arg1, _arg2){
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local3:* = _arg2.filter_hdr_;
- _local3.simple_ = this.VP8Get(_arg1);
- _local3.level_ = this.VP8GetValue(_arg1, 6);
- _local3.sharpness_ = this.VP8GetValue(_arg1, 3);
- _local3.use_lf_delta_ = this.VP8Get(_arg1);
- if (_local3.use_lf_delta_){
- if (this.VP8Get(_arg1)){
- _local4 = 0;
- while (_local4 < this.NUM_REF_LF_DELTAS) {
- if (this.VP8Get(_arg1)){
- _local3.ref_lf_delta_[_local4] = this.VP8GetSignedValue(_arg1, 6);
- };
- _local4++;
- };
- _local4 = 0;
- while (_local4 < this.NUM_MODE_LF_DELTAS) {
- if (this.VP8Get(_arg1)){
- _local3.mode_lf_delta_[_local4] = this.VP8GetSignedValue(_arg1, 6);
- };
- _local4++;
- };
- };
- };
- _arg2.filter_type_ = ((_local3.level_)==0) ? 0 : ((_local3.simple_) ? 1 : 2);
- if (_arg2.filter_type_ > 0){
- if (_arg2.segment_hdr_.use_segment_){
- _local5 = 0;
- while (_local5 < this.NUM_MB_SEGMENTS) {
- _local6 = _arg2.segment_hdr_.filter_strength_[_local5];
- if (!_arg2.segment_hdr_.absolute_delta_){
- _local6 = (_local6 + _local3.level_);
- };
- _arg2.filter_levels_[_local5] = _local6;
- _local5++;
- };
- } else {
- _arg2.filter_levels_[0] = _local3.level_;
- };
- };
- return (!(_arg1.eof_));
- }
- public function convertBinaryToArray(_arg1){
- var _local4:*;
- var _local2:* = new Array();
- var _local3:* = _arg1.length;
- _local4 = 0;
- while (_local4 < _local3) {
- _local2.push(_arg1.charCodeAt(_local4));
- _local4++;
- };
- return (_local2);
- }
- public function memset(_arg1, _arg2){
- var _local4:int;
- var _local3:* = new Array();
- _local4 = 0;
- while (_local4 < _arg2) {
- _local3.push(_arg1);
- _local4++;
- };
- _local3.push(0);
- return (_local3);
- }
- public function alert32BitIn4Bytes(_arg1){
- var _local2:int;
- var _local3:* = "";
- _local2 = 3;
- while (_local2 >= 0) {
- _local3 = (_local3 + (" " + ((_arg1 >> (8 * _local2)) & 0xFF)));
- _local2--;
- };
- this.alert(_local3);
- }
- public function EmitFancyRGB(_arg1, _arg2){
- var _local3:* = _arg1.mb_h;
- var _local4:* = _arg2.output.u.RGBA;
- var _local5:* = _local4.rgba;
- var _local6:* = (_local4.rgba_off + (_arg1.mb_y * _local4.stride));
- var _local7:* = ((_arg1.a) ? this.WebPUpsamplersKeepAlpha[_arg2.output.colorspace] : this.WebPUpsamplers[_arg2.output.colorspace]);
- var _local8:* = _arg1.y;
- var _local9:* = _arg1.y_off;
- var _local10:* = _arg1.u;
- var _local11:* = _arg1.u_off;
- var _local12:* = _arg1.v;
- var _local13:* = _arg1.v_off;
- var _local14:* = _arg2.tmp_u;
- var _local15:* = _arg2.tmp_u_off;
- var _local16:* = _arg2.tmp_v;
- var _local17:* = _arg2.tmp_v_off;
- var _local18:* = _arg1.mb_y;
- var _local19:* = (_arg1.mb_y + _arg1.mb_h);
- var _local20:* = _arg1.mb_w;
- var _local21:* = parseInt(String(((_local20 + 1) / 2)));
- if (_local18 == 0){
- _local7(null, null, _local8, _local9, _local10, _local11, _local12, _local13, _local10, _local11, _local12, _local13, null, null, _local5, _local6, _local20);
- } else {
- _local7(_arg2.tmp_y, _arg2.tmp_y_off, _local8, _local9, _local14, _local15, _local16, _local17, _local10, _local11, _local12, _local13, _local5, (_local6 - _local4.stride), _local5, _local6, _local20);
- _local3++;
- };
- while ((_local18 + 2) < _local19) {
- _local14 = _local10;
- _local15 = _local11;
- _local16 = _local12;
- _local17 = _local13;
- _local11 = (_local11 + _arg1.uv_stride);
- _local13 = (_local13 + _arg1.uv_stride);
- _local6 = (_local6 + (2 * _local4.stride));
- _local9 = (_local9 + (2 * _arg1.y_stride));
- _local7(_local8, (_local9 - _arg1.y_stride), _local8, _local9, _local14, _local15, _local16, _local17, _local10, _local11, _local12, _local13, _local5, (_local6 - _local4.stride), _local5, _local6, _local20);
- _local18 = (_local18 + 2);
- };
- _local9 = (_local9 + _arg1.y_stride);
- if ((_arg1.crop_top + _local19) < _arg1.crop_bottom){
- this.memcpy(_arg2.tmp_y, _arg2.tmp_y_off, _local8, _local9, (_local20 * this.sizeof(_arg2.tmp_y)));
- this.memcpy(_arg2.tmp_u, _arg2.tmp_u_off, _local10, _local11, (_local21 * this.sizeof(_arg2.tmp_u)));
- this.memcpy(_arg2.tmp_v, _arg2.tmp_v_off, _local12, _local13, (_local21 * this.sizeof(_arg2.tmp_v)));
- _local3--;
- } else {
- if (!(_local19 & 1)){
- _local7(_local8, _local9, null, null, _local10, _local11, _local12, _local13, _local10, _local11, _local12, _local13, _local5, (_local6 + _local4.stride), null, null, _local20);
- };
- };
- return (_local3);
- }
- public function GetCoeffs(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local12:*;
- var _local13:*;
- var _local14:*;
- var _local7:* = _arg2[this.kBands[_arg5]][_arg3];
- if (!this.VP8GetBit(_arg1, _local7[0])){
- return (0);
- };
- while (1) {
- _arg5++;
- if (!this.VP8GetBit(_arg1, _local7[1])){
- _local7 = _arg2[this.kBands[_arg5]][0];
- } else {
- if (!this.VP8GetBit(_arg1, _local7[2])){
- _local7 = _arg2[this.kBands[_arg5]][1];
- _local8 = 1;
- } else {
- if (!this.VP8GetBit(_arg1, _local7[3])){
- if (!this.VP8GetBit(_arg1, _local7[4])){
- _local8 = 2;
- } else {
- _local8 = (3 + this.VP8GetBit(_arg1, _local7[5]));
- };
- } else {
- if (!this.VP8GetBit(_arg1, _local7[6])){
- if (!this.VP8GetBit(_arg1, _local7[7])){
- _local8 = (5 + this.VP8GetBit(_arg1, 159));
- } else {
- _local8 = (7 + (2 * this.VP8GetBit(_arg1, 165)));
- _local8 = (_local8 + this.VP8GetBit(_arg1, 145));
- };
- } else {
- _local10 = this.uint8_t;
- _local11 = this.VP8GetBit(_arg1, _local7[8]);
- _local12 = this.VP8GetBit(_arg1, _local7[(9 + _local11)]);
- _local13 = ((2 * _local11) + _local12);
- _local8 = 0;
- _local10 = this.kCat3456[_local13];
- _local14 = 0;
- while (_local14 < (_local10.length - 1)) {
- _local8 = (_local8 + (_local8 + this.VP8GetBit(_arg1, _local10[_local14])));
- _local14++;
- };
- _local8 = (_local8 + (3 + (8 << _local13)));
- };
- };
- _local7 = _arg2[this.kBands[_arg5]][2];
- };
- _local9 = this.kZigzag[(_arg5 - 1)];
- _arg6[(_arg6[(_arg6.length - 1)] + _local9)] = (this.VP8GetSigned(_arg1, _local8) * _arg4[((_local9 > 0) + 0)]);
- if ((((_arg5 == 16)) || (!(this.VP8GetBit(_arg1, _local7[0]))))){
- return (_arg5);
- };
- };
- if (_arg5 == 16){
- return (16);
- };
- };
- }
- public function SimpleHFilter16(_arg1, _arg2, _arg3, _arg4){
- var _local5:*;
- _local5 = 0;
- while (_local5 < 16) {
- if (this.needs_filter(_arg1, (_arg2 + (_local5 * _arg3)), 1, _arg4)){
- this.do_filter2(_arg1, (_arg2 + (_local5 * _arg3)), 1);
- };
- _local5++;
- };
- }
- public function UpsampleRgba4444KeepAlphaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgba4444KeepA, 2);
- }
- public function InitIo(_arg1, _arg2){
- _arg2.width = _arg1.pic_hdr_.width_;
- _arg2.height = _arg1.pic_hdr_.height_;
- _arg2.mb_y = 0;
- _arg2.y = _arg1.cache_y_;
- _arg2.y_off = _arg1.cache_y_off;
- _arg2.u = _arg1.cache_u_;
- _arg2.u_off = _arg1.cache_u_off;
- _arg2.v = _arg1.cache_v_;
- _arg2.v_off = _arg1.cache_v_off;
- _arg2.y_stride = _arg1.cache_y_stride_;
- _arg2.uv_stride = _arg1.cache_uv_stride_;
- _arg2.fancy_upsampling = 0;
- _arg2.a = null;
- _arg2.a_off = null;
- }
- public function clip_8b(_arg1){
- return ((((_arg1 & ~(0xFF))) ? ((_arg1)<0) ? 0 : 0xFF : _arg1));
- }
- public function VP8YUVInit(_arg1){
- var _local2:*;
- var _local3:*;
- if (this.done){
- return;
- };
- _local2 = 0;
- while (_local2 < 0x0100) {
- this.VP8kVToR[_local2] = (((89858 * (_local2 - 128)) + this.YUV_HALF) >> this.YUV_FIX);
- this.VP8kUToG[_local2] = ((-22014 * (_local2 - 128)) + this.YUV_HALF);
- this.VP8kVToG[_local2] = (-45773 * (_local2 - 128));
- this.VP8kUToB[_local2] = (((113618 * (_local2 - 128)) + this.YUV_HALF) >> this.YUV_FIX);
- _local2++;
- };
- _local2 = this.YUV_RANGE_MIN;
- while (_local2 < this.YUV_RANGE_MAX) {
- _local3 = ((((_local2 - 16) * 76283) + this.YUV_HALF) >> this.YUV_FIX);
- this.VP8kClip[(_local2 - this.YUV_RANGE_MIN)] = this.clip(_local3, 0xFF);
- this.VP8kClip4Bits[(_local2 - this.YUV_RANGE_MIN)] = this.clip(((_local3 + 8) >> 4), 15);
- _local2++;
- };
- this.done = 1;
- }
- public function VP8YuvToRgb(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:* = this.VP8kVToR[_arg3];
- var _local7:* = ((this.VP8kVToG[_arg3] + this.VP8kUToG[_arg2]) >> this.YUV_FIX);
- var _local8:* = this.VP8kUToB[_arg2];
- _arg4[(_arg5 + 0)] = this.VP8kClip[((_arg1 + _local6) - this.YUV_RANGE_MIN)];
- _arg4[(_arg5 + 1)] = this.VP8kClip[((_arg1 + _local7) - this.YUV_RANGE_MIN)];
- _arg4[(_arg5 + 2)] = this.VP8kClip[((_arg1 + _local8) - this.YUV_RANGE_MIN)];
- }
- public function VP8YuvToBgr(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:* = this.VP8kVToR[_arg3];
- var _local7:* = ((this.VP8kVToG[_arg3] + this.VP8kUToG[_arg2]) >> this.YUV_FIX);
- var _local8:* = this.VP8kUToB[_arg2];
- _arg4[(_arg5 + 0)] = this.VP8kClip[((_arg1 + _local8) - this.YUV_RANGE_MIN)];
- _arg4[(_arg5 + 1)] = this.VP8kClip[((_arg1 + _local7) - this.YUV_RANGE_MIN)];
- _arg4[(_arg5 + 2)] = this.VP8kClip[((_arg1 + _local6) - this.YUV_RANGE_MIN)];
- }
- public function VP8GetInfo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- if (_arg3.value < 10){
- return (0);
- };
- if (((((!((_arg1[(_arg2.value + 3)] == 157))) || (!((_arg1[(_arg2.value + 4)] == 1))))) || (!((_arg1[(_arg2.value + 5)] == 42))))){
- return (0);
- };
- _local8 = ((_arg1[(_arg2.value + 0)] | (_arg1[(_arg2.value + 1)] << 8)) | (_arg1[(_arg2.value + 2)] << 16));
- _local9 = (!((_local8 & 1)) + 0);
- _local10 = (((_arg1[(_arg2.value + 7)] << 8) | _arg1[(_arg2.value + 6)]) & 16383);
- _local11 = (((_arg1[(_arg2.value + 9)] << 8) | _arg1[(_arg2.value + 8)]) & 16383);
- if (_arg7){
- if (_arg3.value < 11){
- return (0);
- };
- _arg7.value = !(!((_arg1[(_arg2.value + 10)] & 128)));
- };
- if (!_local9){
- return (0);
- };
- if (((_local8 >> 1) & 7) > 3){
- return (0);
- };
- if (!((_local8 >> 4) & 1)){
- return (0);
- };
- if ((_local8 >> 5) >= _arg4){
- return (0);
- };
- if (_arg5){
- _arg5.value = _local10;
- };
- if (_arg6){
- _arg6.value = _local11;
- };
- return (1);
- }
- public function VP8EnterCritical(_arg1, _arg2){
- if (((_arg2.setup) && (!(_arg2.setup(_arg2))))){
- this.VP8SetError(_arg1, this.VP8_STATUS_USER_ABORT, "Frame setup failed");
- return (_arg1.status_);
- };
- if (_arg2.bypass_filtering){
- _arg1.filter_type_ = 0;
- };
- var _local3:* = this.kFilterExtraRows[_arg1.filter_type_];
- if (_arg1.filter_type_ == 2){
- _arg1.tl_mb_x_ = 0;
- _arg1.tl_mb_y_ = 0;
- } else {
- _arg1.tl_mb_y_ = (_arg2.crop_top >> 4);
- _arg1.tl_mb_x_ = (_arg2.crop_left >> 4);
- };
- _arg1.br_mb_y_ = (((_arg2.crop_bottom + 15) + _local3) >> 4);
- _arg1.br_mb_x_ = (((_arg2.crop_right + 15) + _local3) >> 4);
- if (_arg1.br_mb_x_ > _arg1.mb_w_){
- _arg1.br_mb_x_ = _arg1.mb_w_;
- };
- if (_arg1.br_mb_y_ > _arg1.mb_h_){
- _arg1.br_mb_y_ = _arg1.mb_h_;
- };
- return (this.VP8_STATUS_OK);
- }
- public function WebPDecodeYUVInto(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14){
- var _local15:*;
- var _local16:*;
- _local15 = this.newObjectIt(this.WebPDecParams);
- _local16 = this.newObjectIt(this.WebPDecBuffer);
- if (_arg3 == null){
- return (null);
- };
- this.WebPInitDecBuffer(_local16);
- this.WebPResetDecParams(_local15);
- _local15.output = _local16;
- _local16.colorspace = this.MODE_YUV;
- _local16.u.YUVA.y = _arg3;
- _local16.u.YUVA.y_off = _arg4;
- _local16.u.YUVA.y_stride = _arg6;
- _local16.u.YUVA.y_size = _arg5;
- _local16.u.YUVA.u = _arg7;
- _local16.u.YUVA.u_off = _arg8;
- _local16.u.YUVA.u_stride = _arg10;
- _local16.u.YUVA.u_size = _arg9;
- _local16.u.YUVA.v = _arg11;
- _local16.u.YUVA.v_off = _arg12;
- _local16.u.YUVA.v_stride = _arg14;
- _local16.u.YUVA.v_size = _arg13;
- _local16.is_external_memory = 1;
- if (this.DecodeInto(_arg1, 0, _arg2, _local15) != this.VP8_STATUS_OK){
- return (null);
- };
- return (_arg3);
- }
- public function newObjectIt(_arg1){
- return (JSON.decode(JSON.encode(_arg1)));
- }
- public function WebPChange():void{
- var _local1:Boolean;
- var _local2:*;
- var _local3:*;
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local12:*;
- var _local13:*;
- var _local14:*;
- var _local15:*;
- var _local16:*;
- var _local17:*;
- var _local18:*;
- var _local19:*;
- var _local20:*;
- if (this.my_mode != "img"){
- _local1 = (((this.my_bgRepeat == "no-repeat")) ? false : true);
- _local2 = (((((this.my_bgRepeat == "repeat-x")) || ((this.my_bgRepeat == "repeat")))) ? (stage.stageWidth + this.WebPImage.width.value) : this.WebPImage.width.value);
- _local3 = (((((this.my_bgRepeat == "repeat-y")) || ((this.my_bgRepeat == "repeat")))) ? (stage.stageHeight + this.WebPImage.height.value) : this.WebPImage.height.value);
- _local4 = Math.round((((this.my_bgpos[0].indexOf("px") > 0)) ? parseInt(this.my_bgpos[0].substr(0, this.my_bgpos[0].indexOf("px"))) : (((this.my_bgpos[0].indexOf("%") > 0)) ? ((stage.stageWidth - this.WebPImage.width.value) / (100 / parseInt(this.my_bgpos[0].substr(0, this.my_bgpos[0].indexOf("%"))))) : 0)));
- _local5 = Math.round((((this.my_bgpos[1].indexOf("px") > 0)) ? parseInt(this.my_bgpos[1].substr(0, this.my_bgpos[1].indexOf("px"))) : (((this.my_bgpos[1].indexOf("%") > 0)) ? ((stage.stageHeight - this.WebPImage.height.value) / (100 / parseInt(this.my_bgpos[1].substr(0, this.my_bgpos[1].indexOf("%"))))) : 0)));
- _local4 = (_local4 + (((((((this.my_bgRepeat == "repeat-x")) || ((this.my_bgRepeat == "repeat")))) && ((_local4 > 0)))) ? -(((Math.floor((_local4 / this.WebPImage.width.value)) * this.WebPImage.width.value) + this.WebPImage.width.value)) : 0));
- _local5 = (_local5 + (((((((this.my_bgRepeat == "repeat-y")) || ((this.my_bgRepeat == "repeat")))) && ((_local5 > 0)))) ? -(((Math.floor((_local5 / this.WebPImage.height.value)) * this.WebPImage.height.value) + this.WebPImage.height.value)) : 0));
- _local6 = new Matrix();
- this.pic.x = _local4;
- this.pic.y = _local5;
- this.pic.graphics.clear();
- this.pic.graphics.beginBitmapFill(this.bmData, _local6, _local1, true);
- this.pic.graphics.drawRect(0, 0, _local2, _local3);
- if (this.firstTime){
- ExternalInterface.call("webpFSCommand", "status", (("" + this.my_id) + "|finish"));
- };
- } else {
- this.pic.width = stage.stageWidth;
- this.pic.height = stage.stageHeight;
- _local7 = this.my_styleWidth;
- _local8 = this.my_styleHeight;
- _local9 = /([\+\-0-9]+)(([a-zA-Z%]+)?)/.exec(_local7);
- _local10 = /([\+\-0-9]+)(([a-zA-Z%]+)?)/.exec(_local8);
- _local11 = this.my_imgWidth;
- _local12 = this.my_imgHeight;
- _local13 = /([\+\-0-9]+)(([a-zA-Z%]+)?)/.exec(_local11);
- _local14 = /([\+\-0-9]+)(([a-zA-Z%]+)?)/.exec(_local12);
- _local15 = this.WebPImage.width.value;
- _local16 = this.WebPImage.height.value;
- _local17 = ((_local8)!="auto") ? _local10 : _local14;
- _local18 = ((_local7)!="auto") ? _local9 : _local13;
- _local19 = ((_local7)!="auto") ? _local7 : ((_local11)!="") ? _local11 : (((((_local8 == "auto")) && ((_local12 == "")))) ? (_local15 + "px") : (((((_local17[2])!="%") ? _local17[1] : stage.stageHeight / _local16) * _local15) + ((_local17[2])!="%") ? _local17[2] : "px"));
- _local20 = ((_local8)!="auto") ? _local8 : ((_local12)!="") ? _local12 : (((((_local7 == "auto")) && ((_local11 == "")))) ? (_local16 + "px") : (((((_local18[2])!="%") ? _local18[1] : stage.stageWidth / _local15) * _local16) + ((_local18[2])!="%") ? _local18[2] : "px"));
- _local19 = (_local19 + (((/([\+\-0-9.]+)(([a-zA-Z%]+)?)/.exec(_local19)[2] == "")) ? "px" : ""));
- _local20 = (_local20 + (((/([\+\-0-9.]+)(([a-zA-Z%]+)?)/.exec(_local20)[2] == "")) ? "px" : ""));
- if (this.firstTime){
- ExternalInterface.call("webpFSCommand", "img", (((((("" + this.my_id) + "|") + _local19) + "|") + _local20) + ""));
- ExternalInterface.call("webpFSCommand", "status", (("" + this.my_id) + "|finish"));
- } else {
- ExternalInterface.call("webpFSCommand", "imgresize", (((((("" + this.my_id) + "|") + _local19) + "|") + _local20) + ""));
- };
- };
- }
- public function VFilter8(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
- this.FilterLoop26(_arg1, _arg2, _arg5, 1, 8, _arg6, _arg7, _arg8);
- this.FilterLoop26(_arg3, _arg4, _arg5, 1, 8, _arg6, _arg7, _arg8);
- }
- public function VP8GetValue(_arg1, _arg2){
- var _local3:* = 0;
- while (_arg2-- > 0) {
- _local3 = (_local3 | (this.VP8GetBit(_arg1, 128) << _arg2));
- };
- return (_local3);
- }
- public function UpsampleArgbLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToArgb, 4);
- }
- public function ParseFrame(_arg1, _arg2){
- _arg1.mb_y_ = 0;
- while (_arg1.mb_y_ < _arg1.br_mb_y_) {
- this.token_br = _arg1.parts_[(_arg1.mb_y_ & (_arg1.num_parts_ - 1))];
- this.VP8InitScanline(_arg1);
- _arg1.mb_x_ = 0;
- while (_arg1.mb_x_ < _arg1.mb_w_) {
- if (!this.VP8DecodeMB(_arg1, this.token_br)){
- return (this.VP8SetError(_arg1, "VP8_STATUS_NOT_ENOUGH_DATA", ((("Premature end-of-file encountered." + _arg1.mb_x_) + " ") + _arg1.mb_y_)));
- };
- this.VP8ReconstructBlock(_arg1);
- this.VP8StoreBlock(_arg1);
- _arg1.mb_x_++;
- };
- if (!this.VP8ProcessRow(_arg1, _arg2)){
- return (this.VP8SetError(_arg1, "VP8_STATUS_USER_ABORT", "Output aborted."));
- };
- _arg1.mb_y_++;
- };
- if (_arg1.layer_data_size_ > 0){
- if (!this.VP8DecodeLayer(_arg1)){
- return (0);
- };
- };
- return (1);
- }
- public function DecodeIntoRGBABuffer(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
- var _local7:*;
- var _local8:*;
- _local7 = this.newObjectIt(this.WebPDecParams);
- _local8 = this.newObjectIt(this.WebPDecBuffer);
- if (_arg4 == null){
- return (null);
- };
- this.WebPInitDecBuffer(_local8);
- this.WebPResetDecParams(_local7);
- _local7.output = _local8;
- _local8.colorspace = _arg1;
- _local8.u.RGBA.rgba = _arg4;
- _local8.u.RGBA.rgba_off = 0;
- _local8.u.RGBA.stride = _arg5;
- _local8.u.RGBA.size = _arg6;
- _local8.is_external_memory = 1;
- if (this.DecodeInto(_arg2, 0, _arg3, _local7) != this.VP8_STATUS_OK){
- return (null);
- };
- return (_arg4);
- }
- public function CheckMode(_arg1, _arg2){
- if (_arg2 == this.B_DC_PRED){
- if (_arg1.mb_x_ == 0){
- return (((_arg1.mb_y_)==0) ? this.B_DC_PRED_NOTOPLEFT : this.B_DC_PRED_NOLEFT);
- };
- return (((_arg1.mb_y_)==0) ? this.B_DC_PRED_NOTOP : this.B_DC_PRED);
- };
- return (_arg2);
- }
- public function VP8GetHeaders(_arg1, _arg2){
- var _local12:*;
- var _local15:*;
- var _local16:*;
- var _local17:*;
- var _local18:*;
- var _local19:*;
- var _local3:* = {value:0};
- var _local4:* = this.uint8_t;
- var _local5:* = {value:this.uint32_t};
- var _local6:* = {value:this.uint32_t};
- var _local7:* = {value:this.uint32_t};
- var _local8:* = {value:0};
- var _local9:* = {value:0};
- var _local10:* = this.newObjectIt(this.VP8FrameHeader);
- var _local11:* = this.newObjectIt(this.VP8PictureHeader);
- _local12 = this.newObjectIt(this.VP8BitReader);
- var _local13:* = "VP8StatusCode";
- if (_arg1 == null){
- this.alert("(dec == null)");
- return (0);
- };
- this.SetOk(_arg1);
- if (_arg2 == null){
- return (this.VP8SetError(_arg1, "VP8_STATUS_INVALID_PARAM", "null VP8Io passed to VP8GetHeaders()"));
- };
- _local4 = _arg2.data;
- _local3.value = _arg2.data_off;
- _local5.value = _arg2.data_size;
- if ((((_local4 == null)) || ((_local5.value <= 4)))){
- return (this.VP8SetError(_arg1, "VP8_STATUS_NOT_ENOUGH_DATA", "Not enough data to parse frame header"));
- };
- if (!this.WebPCheckAndSkipRIFFHeader(_local4, _local3, _local5, _local6)){
- return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "RIFF: Invalid RIFF container"));
- };
- if (!this.VP8XGetInfo(_local4, _local3, _local5, _local8, null, null, null)){
- return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "RIFF: Invalid VP8X container"));
- };
- if (!this.VP8CheckAndSkipHeader(_local4, _local3, _local5, _local9, _local7, _local6)){
- return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "RIFF: Inconsistent size information."));
- };
- if (_local9.value == -1){
- return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "RIFF: Inconsistent size information."));
- };
- if (_local5.value < 4){
- return (this.VP8SetError(_arg1, this.VP8_STATUS_NOT_ENOUGH_DATA, "RIFF: Truncated header."));
- };
- _local3 = _local3.value;
- _local5 = _local5.value;
- var _local14:* = ((_local4[(_local3 + 0)] | (_local4[(_local3 + 1)] << 8)) | (_local4[(_local3 + 2)] << 16));
- _local10 = _arg1.frm_hdr_;
- _local10.key_frame_ = (!((_local14 & 1)) + 0);
- _local10.profile_ = ((_local14 >> 1) & 7);
- _local10.show_ = ((_local14 >> 4) & 1);
- _local10.partition_length_ = (_local14 >> 5);
- if (_local10.profile_ > 3){
- return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "Incorrect keyframe parameters."));
- };
- if (!_local10.show_){
- return (this.VP8SetError(_arg1, "VP8_STATUS_UNSUPPORTED_FEATURE", "Frame not displayable."));
- };
- _local3 = (_local3 + 3);
- _local5 = (_local5 - 3);
- _local11 = _arg1.pic_hdr_;
- if (_local10.key_frame_){
- if (_local5 < 7){
- return (this.VP8SetError(_arg1, "VP8_STATUS_NOT_ENOUGH_DATA", "cannot parse picture header"));
- };
- if (((((!((this.Byte2Hex(_local4[(_local3 + 0)]) == 157))) || (!((this.Byte2Hex(_local4[(_local3 + 1)]) == 1))))) || (!((this.Byte2Hex(_local4[(_local3 + 2)]) == 42))))){
- return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "Bad code word"));
- };
- _local11.width_ = (((_local4[(_local3 + 4)] << 8) | _local4[(_local3 + 3)]) & 16383);
- _local11.xscale_ = (_local4[(_local3 + 4)] >> 6);
- _local11.height_ = (((_local4[(_local3 + 6)] << 8) | _local4[(_local3 + 5)]) & 16383);
- _local11.yscale_ = (_local4[(_local3 + 6)] >> 6);
- _local3 = (_local3 + 7);
- _local5 = (_local5 - 7);
- _arg1.mb_w_ = ((_local11.width_ + 15) >> 4);
- _arg1.mb_h_ = ((_local11.height_ + 15) >> 4);
- _arg2.width = _local11.width_;
- _arg2.height = _local11.height_;
- _arg2.use_scaling = 0;
- _arg2.use_cropping = 0;
- _arg2.crop_top = 0;
- _arg2.crop_left = 0;
- _arg2.crop_right = _arg2.width;
- _arg2.crop_bottom = _arg2.height;
- _arg2.mb_w = _arg2.width;
- _arg2.mb_h = _arg2.height;
- this.VP8ResetProba(_arg1.proba_);
- this.ResetSegmentHeader(_arg1.segment_hdr_);
- _arg1.segment_ = 0;
- };
- if (_local10.partition_length_ > _local5){
- return (this.VP8SetError(_arg1, "VP8_STATUS_NOT_ENOUGH_DATA", "bad partition length"));
- };
- _arg1.alpha_data_ = null;
- _arg1.alpha_data_size_ = 0;
- _local12 = _arg1.br_;
- this.VP8InitBitReader(_local12, _local4, _local3, (_local3 + _local10.partition_length_));
- _local3 = (_local3 + _local10.partition_length_);
- _local5 = (_local5 - _local10.partition_length_);
- if (_local10.key_frame_){
- _local11.colorspace_ = this.VP8Get(_local12);
- _local11.clamp_type_ = this.VP8Get(_local12);
- };
- if (!this.ParseSegmentHeader(_local12, _arg1.segment_hdr_, _arg1.proba_)){
- return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "cannot parse segment header"));
- };
- if (!this.ParseFilterHeader(_local12, _arg1)){
- return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "cannot parse filter header"));
- };
- _local13 = this.ParsePartitions(_arg1, _local4, _local3, _local5);
- if (_local13 != "VP8_STATUS_OK"){
- return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "cannot parse partitions"));
- };
- this.VP8ParseQuant(_arg1);
- if (!_local10.key_frame_){
- return (this.VP8SetError(_arg1, this.VP8_STATUS_UNSUPPORTED_FEATURE, "Not a key frame."));
- };
- _arg1.buffer_flags_ = (3 | 0x0100);
- this.VP8Get(_local12);
- this.VP8ParseProba(_local12, _arg1);
- if (_arg1.pic_hdr_.colorspace_){
- _local15 = 8;
- _local16 = 1;
- _local17 = _local4;
- _local18 = (_local3 - _local15);
- _local19 = this.size_t;
- if ((((_local10.partition_length_ < _local15)) || (!((_local17[((_local18 + _local15) - 1)] == _local16))))){
- };
- _local19 = (((_local17[(_local18 + 4)] << 0) | (_local17[(_local18 + 5)] << 8)) | (_local17[(_local18 + 6)] << 16));
- if (_local10.partition_length_ < (_local19 + _local15)){
- return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "RIFF: Inconsistent extra information."));
- };
- _arg1.alpha_data_ = ((_local19)>0) ? _local17 : null;
- _arg1.alpha_data_off = ((_local19)>0) ? (_local18 - _local19) : null;
- _arg1.alpha_data_size_ = _local19;
- _local19 = (((_local17[(_local18 + 0)] << 0) | (_local17[(_local18 + 1)] << 8)) | (_local17[(_local18 + 2)] << 16));
- _arg1.layer_data_size_ = _local19;
- _arg1.layer_data_ = null;
- _arg1.layer_colorspace_ = _local17[(_local18 + 3)];
- };
- _arg1.ready_ = 1;
- return (1);
- }
- public function Byte2Hex(_arg1){
- return (("0x" + _arg1.toString(16)));
- }
- public function HD4(_arg1, _arg2){
- var _local3:* = _arg1[((_arg2 - 1) + (0 * this.BPS))];
- var _local4:* = _arg1[((_arg2 - 1) + (1 * this.BPS))];
- var _local5:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
- var _local6:* = _arg1[((_arg2 - 1) + (3 * this.BPS))];
- var _local7:* = _arg1[((_arg2 - 1) - this.BPS)];
- var _local8:* = _arg1[((_arg2 + 0) - this.BPS)];
- var _local9:* = _arg1[((_arg2 + 1) - this.BPS)];
- var _local10:* = _arg1[((_arg2 + 2) - this.BPS)];
- _arg1[((_arg2 + 0) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (1 * this.BPS))] = this.AVG2(_local3, _local7));
- _arg1[((_arg2 + 0) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = this.AVG2(_local4, _local3));
- _arg1[((_arg2 + 0) + (2 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG2(_local5, _local4));
- _arg1[((_arg2 + 0) + (3 * this.BPS))] = this.AVG2(_local6, _local5);
- _arg1[((_arg2 + 3) + (0 * this.BPS))] = this.AVG3(_local8, _local9, _local10);
- _arg1[((_arg2 + 2) + (0 * this.BPS))] = this.AVG3(_local7, _local8, _local9);
- _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 3) + (1 * this.BPS))] = this.AVG3(_local3, _local7, _local8));
- _arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 3) + (2 * this.BPS))] = this.AVG3(_local4, _local3, _local7));
- _arg1[((_arg2 + 1) + (2 * this.BPS))] = (_arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local5, _local4, _local3));
- _arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local6, _local5, _local4);
- }
- public function VP8ExitCritical(_arg1, _arg2){
- var _local3:* = 1;
- if (_arg1.use_threads_){
- };
- if (_arg2.teardown){
- _arg2.teardown(_arg2);
- };
- return (_local3);
- }
- public function AllocateMemory(_arg1){
- var _local2:* = _arg1.num_caches_;
- var _local3:* = _arg1.mb_w_;
- var _local4:* = ((4 * _local3) * this.sizeof(this.uint8_t));
- var _local5:* = (((16 + 8) + 8) * _local3);
- var _local6:* = ((_local3 + 1) * this.sizeof(this.VP8MB));
- var _local7:* = ((_arg1.filter_type_)>0) ? ((_local3 * ((_arg1.use_threads_) ? 2 : 1)) * this.sizeof(this.VP8FInfo)) : 0;
- var _local8:* = (this.YUV_SIZE * this.sizeof(_arg1.yuv_b_));
- var _local9:* = (384 * this.sizeof(_arg1.coeffs_));
- var _local10:* = ((16 * _local2) + ((parseInt(this.kFilterExtraRows[_arg1.filter_type_]) * 3) / 2));
- var _local11:* = (_local5 * _local10);
- var _local12:* = ((_arg1.alpha_data_) ? (_arg1.pic_hdr_.width_ * _arg1.pic_hdr_.height_) : 0);
- var _local13:* = ((((((((_local4 + _local5) + _local6) + _local7) + _local8) + _local9) + _local11) + _local12) + this.ALIGN_MASK);
- var _local14:* = this.uint8_t;
- var _local15:* = 0;
- if (_local13 > _arg1.mem_size_){
- _arg1.mem_ = 0;
- _arg1.mem_size_ = 0;
- if (_arg1.mem_ == null){
- return (this.VP8SetError(_arg1, "VP8_STATUS_OUT_OF_MEMORY", "no memory during frame initialization."));
- };
- _arg1.mem_size_ = _local13;
- };
- _local14 = _arg1.mem_;
- _arg1.intra_t_ = 205;
- _arg1.y_t_ = this.memset(205, ((16 * _local3) * this.sizeof(_arg1.y_t_)));
- _arg1.u_t_ = this.memset(205, ((8 * _local3) * this.sizeof(_arg1.u_t_)));
- _arg1.v_t_ = this.memset(205, ((8 * _local3) * this.sizeof(_arg1.v_t_)));
- _arg1.f_info_ = ((_local7) ? this.memset_wl(this.VP8FInfo, _local7) : null);
- _arg1.f_info_off = ((_local7) ? 0 : null);
- _arg1.thread_ctx_.id_ = 0;
- _arg1.thread_ctx_.f_info_ = _arg1.f_info_;
- if (_arg1.use_threads_){
- _arg1.thread_ctx_.f_info_off = (_arg1.thread_ctx_.f_info_off + _local3);
- };
- this.assert(((_local8 & this.ALIGN_MASK) == 0));
- _arg1.yuv_b_ = this.memset(205, (_local8 * this.sizeof(_arg1.yuv_b_)));
- _arg1.coeffs_ = this.memset(0, _local9);
- _arg1.cache_y_stride_ = (16 * _local3);
- _arg1.cache_uv_stride_ = (8 * _local3);
- var _local16:* = this.kFilterExtraRows[_arg1.filter_type_];
- var _local17:* = (_local16 * _arg1.cache_y_stride_);
- var _local18:* = ((_local16 / 2) * _arg1.cache_uv_stride_);
- _arg1.cache_y_ = this.Arr(_local11, 205);
- _arg1.cache_y_off = _local17;
- _arg1.cache_u_ = _arg1.cache_y_;
- _arg1.cache_u_off = ((_arg1.cache_y_off + ((16 * _local2) * _arg1.cache_y_stride_)) + _local18);
- _arg1.cache_v_ = _arg1.cache_u_;
- _arg1.cache_v_off = ((_arg1.cache_u_off + ((8 * _local2) * _arg1.cache_uv_stride_)) + _local18);
- _arg1.alpha_plane_ = ((_local12) ? this.Arr(_local12, this.uint8_t) : null);
- _arg1.mb_info_ = this.memset_wl(this.VP8MB, _local6);
- _arg1.intra_t_ = this.memset(this.B_DC_PRED, _local4);
- return (1);
- }
- public function ResetSegmentHeader(_arg1){
- var _local2:int;
- this.assert(_arg1);
- _arg1.use_segment_ = 0;
- _arg1.update_map_ = 0;
- _arg1.absolute_delta_ = 1;
- _local2 = 0;
- while (_local2 < _arg1.quantizer_.length) {
- _arg1.quantizer_[_local2] = 0;
- _local2++;
- };
- _local2 = 0;
- while (_local2 < _arg1.filter_strength_.length) {
- _arg1.filter_strength_[_local2] = 0;
- _local2++;
- };
- }
- public function HE8uv(_arg1, _arg2){
- var _local3:*;
- _local3 = 0;
- while (_local3 < 8) {
- this.memset_(_arg1, (_arg2 + 0), _arg1[(_arg2 - 1)], 8);
- _arg2 = (_arg2 + this.BPS);
- _local3++;
- };
- }
- public function EmitSampledRGB(_arg1, _arg2){
- var _local16:*;
- var _local3:* = _arg2.output;
- var _local4:* = _local3.u.RGBA;
- var _local5:* = _local4.rgba;
- var _local6:* = (_local4.rgba_off + (_arg1.mb_y * _local4.stride));
- var _local7:* = _arg1.y;
- var _local8:* = _arg1.y_off;
- var _local9:* = _arg1.u;
- var _local10:* = _arg1.u_off;
- var _local11:* = _arg1.v;
- var _local12:* = _arg1.v_off;
- var _local13:* = this.kSamplers[_local3.colorspace];
- var _local14:* = _arg1.mb_w;
- var _local15:* = (_arg1.mb_h - 1);
- _local16 = 0;
- while (_local16 < _local15) {
- _local13(_local7, _local8, _local7, (_local8 + _arg1.y_stride), _local9, _local10, _local11, _local12, _local5, _local6, _local5, (_local6 + _local4.stride), _local14);
- _local8 = (_local8 + (2 * _arg1.y_stride));
- _local10 = (_local10 + _arg1.uv_stride);
- _local12 = (_local12 + _arg1.uv_stride);
- _local6 = (_local6 + (2 * _local4.stride));
- _local16 = (_local16 + 2);
- };
- if (_local16 == _local15){
- _local13(_local7, _local8, _local7, _local8, _local9, _local10, _local11, _local12, _local5, _local6, _local5, _local6, _local14);
- };
- return (_arg1.mb_h);
- }
- public function HE4(_arg1, _arg2){
- var _local3:* = _arg1[((_arg2 - 1) - this.BPS)];
- var _local4:* = _arg1[(_arg2 - 1)];
- var _local5:* = _arg1[((_arg2 - 1) + this.BPS)];
- var _local6:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
- var _local7:* = _arg1[((_arg2 - 1) + (3 * this.BPS))];
- _arg1[((_arg2 + 0) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 3) + (0 * this.BPS))] = this.AVG3(_local3, _local4, _local5))));
- _arg1[((_arg2 + 0) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 3) + (1 * this.BPS))] = this.AVG3(_local4, _local5, _local6))));
- _arg1[((_arg2 + 0) + (2 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = (_arg1[((_arg2 + 3) + (2 * this.BPS))] = this.AVG3(_local5, _local6, _local7))));
- _arg1[((_arg2 + 0) + (3 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = (_arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local6, _local7, _local7))));
- }
- public function VP8YuvToArgbKeepA(_arg1, _arg2, _arg3, _arg4, _arg5){
- this.VP8YuvToRgb(_arg1, _arg2, _arg3, _arg4, (_arg5 + 1));
- }
- public function CheckDecBuffer(_arg1){
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local2:* = 1;
- var _local3:* = _arg1.colorspace;
- var _local4:* = _arg1.width;
- var _local5:* = _arg1.height;
- if (_local3 >= this.MODE_YUV){
- _local6 = _arg1.u.YUVA;
- _local7 = (_local6.y_stride * _local5);
- _local8 = (_local6.u_stride * parseInt(String(((_local5 + 1) / 2))));
- _local9 = (_local6.v_stride * parseInt(String(((_local5 + 1) / 2))));
- _local10 = (_local6.a_stride * _local5);
- _local2 = (_local2 & ((_local7 <= _local6.y_size) + 0));
- _local2 = (_local2 & ((_local8 <= _local6.u_size) + 0));
- _local2 = (_local2 & ((_local9 <= _local6.v_size) + 0));
- _local2 = (_local2 & ((_local10 <= _local6.a_size) + 0));
- _local2 = (_local2 & ((_local6.y_stride >= _local4) + 0));
- _local2 = (_local2 & ((_local6.u_stride >= (parseInt(String((_local4 + 1))) / 2)) + 0));
- _local2 = (_local2 & ((_local6.v_stride >= (parseInt(String((_local4 + 1))) / 2)) + 0));
- if (_local6.a){
- _local2 = (_local2 & ((_local6.a_stride >= _local4) + 0));
- };
- } else {
- _local6 = _arg1.u.RGBA;
- _local2 = (_local2 & (((_local6.stride * _local5) <= _local6.size) + 0));
- _local2 = (_local2 & ((_local6.stride >= (_local4 * this.kModeBpp[_local3])) + 0));
- };
- return (((_local2) ? this.VP8_STATUS_OK : this.VP8_STATUS_INVALID_PARAM));
- }
- public function VP8GetSignedValue(_arg1, _arg2){
- var _local3:* = this.VP8GetValue(_arg1, _arg2);
- return (((this.VP8Get(_arg1)) ? -(_local3) : _local3));
- }
- public function VP8GetByte(_arg1){
- this.assert(_arg1);
- if (_arg1.buf_off < _arg1.buf_end_){
- this.assert(_arg1.buf_);
- return (_arg1.buf_[_arg1.buf_off++]);
- };
- _arg1.eof_ = 1;
- return (0xFF);
- }
- public function Rescale(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:*;
- _local6 = 0;
- while (_arg4-- > 0) {
- this.ImportRow(_arg1, _arg2, _arg5);
- _arg2 = (_arg2 + _arg3);
- _arg5.y_accum = (_arg5.y_accum - _arg5.y_sub);
- while (_arg5.y_accum <= 0) {
- this.ExportRow(_arg5);
- _local6++;
- };
- };
- return (_local6);
- }
- public function malloc(_arg1, _arg2){
- var _local4:int;
- var _local3:* = new Array();
- _local4 = 0;
- while (_local4 < _arg1) {
- _local3.push(_arg2);
- _local4++;
- };
- _local3.push(0);
- return (_local3);
- }
- public function DC16(_arg1, _arg2){
- var _local4:*;
- var _local3:* = 16;
- _local4 = 0;
- while (_local4 < 16) {
- _local3 = (_local3 + (_arg1[((_arg2 - 1) + (_local4 * this.BPS))] + _arg1[((_arg2 + _local4) - this.BPS)]));
- _local4++;
- };
- this.Put16((_local3 >> 5), _arg1, _arg2);
- }
- public function hev_thresh_from_level(_arg1, _arg2){
- if (_arg2){
- return (((_arg1)>=40) ? 2 : ((_arg1)>=15) ? 1 : 0);
- };
- return (((_arg1)>=40) ? 3 : ((_arg1)>=20) ? 2 : ((_arg1)>=15) ? 1 : 0);
- }
- public function TransformUV(_arg1, _arg2, _arg3, _arg4){
- this.VP8Transform(_arg1, (_arg2 + (0 * 16)), _arg3, (_arg4 + 0), 1);
- this.VP8Transform(_arg1, (_arg2 + (2 * 16)), _arg3, (_arg4 + (4 * this.BPS)), 1);
- }
- public function VP8DecodeMB(_arg1, _arg2){
- var _local3:* = _arg1.br_;
- var _local4:* = _arg1.mb_info_[(1 - 1)];
- var _local5:* = _arg1.mb_info_[(1 + _arg1.mb_x_)];
- if (_arg1.segment_hdr_.update_map_){
- _arg1.segment_ = ((this.VP8GetBit(_local3, _arg1.proba_.segments_[0])) ? (2 + this.VP8GetBit(_local3, _arg1.proba_.segments_[2])) : (0 + this.VP8GetBit(_local3, _arg1.proba_.segments_[1])));
- };
- _local5.skip_ = ((_arg1.use_skip_proba_) ? this.VP8GetBit(_local3, _arg1.skip_p_) : 0);
- this.VP8ParseIntraMode(_local3, _arg1);
- if (_local3.eof_){
- return (0);
- };
- if (!_local5.skip_){
- this.ParseResiduals(_arg1, _local5, _arg2);
- } else {
- _local4.nz_ = (_local5.nz_ = 0);
- if (!_arg1.is_i4x4_){
- _local4.dc_nz_ = (_local5.dc_nz_ = 0);
- };
- _arg1.non_zero_ = 0;
- _arg1.non_zero_ac_ = 0;
- };
- return (!(_arg2.eof_));
- }
- public function VP8GetSigned(_arg1, _arg2){
- var _local3:* = (_arg1.range_ >> 1);
- var _local4:* = this.VP8BitUpdate(_arg1, _local3);
- this.VP8Shift(_arg1);
- return (((_local4) ? -(_arg2) : _arg2));
- }
- public function VP8ResetProba(_arg1){
- var _local2:int;
- _local2 = 0;
- while (_local2 < _arg1.segments_.length) {
- _arg1.segments_[_local2] = 0xFF;
- _local2++;
- };
- _arg1.coeffs_ = this.newObjectIt(this.CoeffsProba0);
- }
- public function int64BitLeft(_arg1, _arg2){
- var _local4:*;
- var _local3:* = new Array();
- _local4 = 0;
- while (_local4 < _arg2) {
- _local3[_local4] = "0";
- _local4++;
- };
- var _local5:* = ((_arg1.toString(2) + "") + _local3.join(""));
- return (parseInt(_local5, 2));
- }
- public function TrueMotion(_arg1, _arg2, _arg3){
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local4:* = _arg1;
- var _local5:* = (_arg2 - this.BPS);
- var _local6:* = this.clip1;
- var _local7:* = (0xFF - _local4[(_local5 - 1)]);
- _local8 = 0;
- while (_local8 < _arg3) {
- _local9 = _local6;
- _local10 = (_local7 + _arg1[(_arg2 - 1)]);
- _local11 = 0;
- while (_local11 < _arg3) {
- _arg1[(_arg2 + _local11)] = _local9[(_local10 + _local4[(_local5 + _local11)])];
- _local11++;
- };
- _arg2 = (_arg2 + this.BPS);
- _local8++;
- };
- }
- public function hev(_arg1, _arg2, _arg3, _arg4){
- var _local5:* = _arg1[(_arg2 - (2 * _arg3))];
- var _local6:* = _arg1[(_arg2 - _arg3)];
- var _local7:* = _arg1[(_arg2 + 0)];
- var _local8:* = _arg1[(_arg2 + _arg3)];
- return ((((this.abs0[((0xFF + _local5) - _local6)] > _arg4)) || ((this.abs0[((0xFF + _local8) - _local7)] > _arg4))));
- }
- public function membuild_wl(_arg1, _arg2){
- var _local4:int;
- var _local3:* = new Array();
- _local3.push(this.newObjectIt(_arg1));
- _local4 = 0;
- while (_local4 < _arg2) {
- _local3.push(this.newObjectIt(_arg1));
- _local4++;
- };
- _local3.push(0);
- return (_local3);
- }
- public function VFilter8i(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
- this.FilterLoop24(_arg1, (_arg2 + (4 * _arg5)), _arg5, 1, 8, _arg6, _arg7, _arg8);
- this.FilterLoop24(_arg3, (_arg4 + (4 * _arg5)), _arg5, 1, 8, _arg6, _arg7, _arg8);
- }
- public function DC8uvNoTopLeft(_arg1, _arg2){
- this.Put8x8uv(128, _arg1, _arg2);
- }
- public function FilterRow(_arg1){
- var _local2:* = this.int_;
- var _local3:* = _arg1.thread_ctx_.mb_y_;
- this.assert(_arg1.thread_ctx_.filter_row_);
- _local2 = _arg1.tl_mb_x_;
- while (_local2 < _arg1.br_mb_x_) {
- this.DoFilter(_arg1, _local2, _local3);
- _local2++;
- };
- }
- public function VP8DecompressAlphaRows(_arg1, _arg2, _arg3){
- var data:* = undefined;
- var data_off:* = undefined;
- var data_size:* = undefined;
- var output_size:* = undefined;
- var barray:* = null;
- var dec:* = _arg1;
- var row:* = _arg2;
- var num_rows:* = _arg3;
- var output:* = dec.alpha_plane_;
- var stride:* = dec.pic_hdr_.width_;
- if ((((row < 0)) || (((row + num_rows) > dec.pic_hdr_.height_)))){
- return (null);
- };
- if (row == 0){
- data = dec.alpha_data_;
- data_off = dec.alpha_data_off;
- data_size = dec.alpha_data_size_;
- output_size = (stride * dec.pic_hdr_.height_);
- barray = new ByteArray();
- barray.writeBytes(data, data_off, (data_off + data_size));
- barray.position = 0;
- try {
- barray.uncompress();
- } catch(e) {
- alert("Error:");
- };
- output = barray;
- };
- return ((((row == 0)) ? output : (row * stride)));
- }
- public function VP8InitFrame(_arg1, _arg2){
- if (!this.InitThreadContext(_arg1)){
- return (0);
- };
- if (!this.AllocateMemory(_arg1)){
- return (0);
- };
- this.InitIo(_arg1, _arg2);
- this.VP8DspInitTables(this.void_);
- this.VP8DspInit(this.void_);
- return (1);
- }
- public function UpsampleRgbaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgba, 4);
- }
- public function SampleRgba4444LinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
- this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToRgba4444, 2);
- }
- public function FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, _arg18, _arg19){
- var _local20:*;
- var _local24:*;
- var _local25:*;
- var _local26:*;
- var _local27:*;
- var _local28:*;
- var _local29:*;
- var _local30:*;
- var _local21:* = ((_arg17 - 1) >> 1);
- var _local22:* = this.LOAD_UV(_arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)]);
- var _local23:* = this.LOAD_UV(_arg9[(_arg10 + 0)], _arg11[(_arg12 + 0)]);
- if (_arg1){
- _local24 = ((((3 * _local22) + _local23) + 131074) >> 2);
- _arg18(_arg1[(_arg2 + 0)], (_local24 & 0xFF), (_local24 >> 16), _arg13, _arg14);
- };
- if (_arg3){
- _local24 = ((((3 * _local23) + _local22) + 131074) >> 2);
- _arg18(_arg3[(_arg4 + 0)], (_local24 & 0xFF), (_local24 >> 16), _arg15, _arg16);
- };
- _local20 = 1;
- while (_local20 <= _local21) {
- _local25 = this.LOAD_UV(_arg5[(_arg6 + _local20)], _arg7[(_arg8 + _local20)]);
- _local26 = this.LOAD_UV(_arg9[(_arg10 + _local20)], _arg11[(_arg12 + _local20)]);
- _local27 = ((((_local22 + _local25) + _local23) + _local26) + 524296);
- _local28 = ((_local27 + (2 * (_local25 + _local23))) >> 3);
- _local29 = ((_local27 + (2 * (_local22 + _local26))) >> 3);
- if (_arg1){
- _local24 = ((_local28 + _local22) >> 1);
- _local30 = ((_local29 + _local25) >> 1);
- _arg18(_arg1[((_arg2 + (2 * _local20)) - 1)], (_local24 & 0xFF), (_local24 >> 16), _arg13, (_arg14 + (((2 * _local20) - 1) * _arg19)));
- _arg18(_arg1[((_arg2 + (2 * _local20)) - 0)], (_local30 & 0xFF), (_local30 >> 16), _arg13, (_arg14 + (((2 * _local20) - 0) * _arg19)));
- };
- if (_arg3){
- _local24 = ((_local29 + _local23) >> 1);
- _local30 = ((_local28 + _local26) >> 1);
- _arg18(_arg3[((_arg4 + (2 * _local20)) - 1)], (_local24 & 0xFF), (_local24 >> 16), _arg15, (_arg16 + (((2 * _local20) - 1) * _arg19)));
- _arg18(_arg3[((_arg4 + (2 * _local20)) + 0)], (_local30 & 0xFF), (_local30 >> 16), _arg15, (_arg16 + (((2 * _local20) + 0) * _arg19)));
- };
- _local22 = _local25;
- _local23 = _local26;
- _local20++;
- };
- if (!(_arg17 & 1)){
- if (_arg1){
- _local24 = ((((3 * _local22) + _local23) + 131074) >> 2);
- _arg18(_arg1[((_arg2 + _arg17) - 1)], (_local24 & 0xFF), (_local24 >> 16), _arg13, (_arg14 + ((_arg17 - 1) * _arg19)));
- };
- if (_arg3){
- _local24 = ((((3 * _local23) + _local22) + 131074) >> 2);
- _arg18(_arg3[((_arg4 + _arg17) - 1)], (_local24 & 0xFF), (_local24 >> 16), _arg15, (_arg16 + ((_arg17 - 1) * _arg19)));
- };
- };
- }
- public function UpsampleBgraLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToBgra, 4);
- }
- public function assert(_arg1){
- if (!_arg1){
- throw (new Error("assert :P"));
- };
- }
- public function DC16NoTop(_arg1, _arg2){
- var _local4:*;
- var _local3:* = 8;
- _local4 = 0;
- while (_local4 < 16) {
- _local3 = (_local3 + _arg1[((_arg2 - 1) + (_local4 * this.BPS))]);
- _local4++;
- };
- this.Put16((_local3 >> 4), _arg1, _arg2);
- }
- public function memcmp(_arg1, _arg2, _arg3, _arg4){
- var _local6:int;
- var _local5:* = "";
- _local6 = 0;
- while (_local6 < _arg4) {
- _local5 = (_local5 + String.fromCharCode(_arg1[(_arg2 + _local6)]));
- _local6++;
- };
- if (_arg3 == _local5){
- return (0);
- };
- return (1);
- }
- public function EmitRescaledRGB(_arg1, _arg2){
- var _local3:*;
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- _local3 = _arg1.mb_h;
- _local4 = ((_local3 + 1) >> 1);
- _local5 = 0;
- _local6 = 0;
- _local7 = 0;
- while (_local5 < _local3) {
- _local8 = this.Import(_arg1.y, (_arg1.y_off + (_local5 * _arg1.y_stride)), _arg1.y_stride, (_local3 - _local5), _arg2.scaler_y);
- _local9 = this.Import(_arg1.u, (_arg1.u_off + (_local6 * _arg1.uv_stride)), _arg1.uv_stride, (_local4 - _local6), _arg2.scaler_u);
- _local10 = this.Import(_arg1.v, (_arg1.v_off + (_local6 * _arg1.uv_stride)), _arg1.uv_stride, (_local4 - _local6), _arg2.scaler_v);
- this.assert((_local9 == _local10));
- _local5 = (_local5 + _local8);
- _local6 = (_local6 + _local9);
- _local7 = (_local7 + this.ExportRGB(_arg2, _local7));
- };
- return (_local7);
- }
- public function clip(_arg1, _arg2){
- return ((((_arg1 < 0)) ? 0 : (((_arg1 > _arg2)) ? _arg2 : _arg1)));
- }
- public function needs_filter(_arg1, _arg2, _arg3, _arg4){
- var _local5:* = _arg1[(_arg2 - (2 * _arg3))];
- var _local6:* = _arg1[(_arg2 - _arg3)];
- var _local7:* = _arg1[(_arg2 + 0)];
- var _local8:* = _arg1[(_arg2 + _arg3)];
- return ((((2 * this.abs0[((0xFF + _local6) - _local7)]) + this.abs1[((0xFF + _local5) - _local8)]) <= _arg4));
- }
- public function memcpy2(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:* = _arg3.slice(0, _arg4);
- var _local7:* = _arg3.slice(_arg4, (_arg4 + _arg5));
- var _local8:* = _arg3.slice((_arg4 + _arg5));
- _arg1.splice(0);
- _arg1.concat(_local6, _local7, _local8);
- }
- public function UpsampleRgbKeepAlphaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgb, 4);
- }
- public function UpsampleRgb565LinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgb565, 2);
- }
- public function MACROBLOCK_VPOS(_arg1){
- return ((_arg1 * 16));
- }
- public function VE4(_arg1, _arg2){
- var _local6:*;
- var _local3:* = _arg1;
- var _local4:* = (_arg2 - this.BPS);
- var _local5:* = new Array();
- _local5.push(this.AVG3(_local3[(_local4 - 1)], _local3[(_local4 + 0)], _local3[(_local4 + 1)]));
- _local5.push(this.AVG3(_local3[(_local4 + 0)], _local3[(_local4 + 1)], _local3[(_local4 + 2)]));
- _local5.push(this.AVG3(_local3[(_local4 + 1)], _local3[(_local4 + 2)], _local3[(_local4 + 3)]));
- _local5.push(this.AVG3(_local3[(_local4 + 2)], _local3[(_local4 + 3)], _local3[(_local4 + 4)]));
- _local6 = 0;
- while (_local6 < 4) {
- this.memcpy(_arg1, (_arg2 + (_local6 * this.BPS)), _local5, 0, (4 * this.sizeof(_local5)));
- _local6++;
- };
- }
- public function UpsampleBgrKeepAlphaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToBgr, 4);
- }
- public function TransformTwo(_arg1, _arg2, _arg3, _arg4, _arg5){
- this.TransformOne(_arg1, _arg2, _arg3, _arg4);
- if (_arg5){
- this.TransformOne(_arg1, (_arg2 + 16), _arg3, (_arg4 + 4));
- };
- }
- public function VP8CheckAndSkipHeader(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
- if (((((((!(_arg1)) || (!(_arg3)))) || (!(_arg4)))) || (!(_arg5)))){
- return (0);
- };
- if (_arg3.value >= 8){
- if (!this.memcmp(_arg1, _arg2.value, "VP8 ", 4)){
- _arg4.value = 1;
- _arg5.value = this.get_le32(_arg1, (_arg2.value + 4));
- if ((((_arg6.value >= this.RIFF_HEADER_SIZE)) && ((_arg5.value > (_arg6.value - this.RIFF_HEADER_SIZE))))){
- return (0);
- };
- _arg2.value = (_arg2.value + 8);
- _arg3.value = (_arg3.value - 8);
- } else {
- _arg4.value = 0;
- _arg5.value = 0;
- };
- } else {
- _arg4.value = -1;
- _arg5.value = 0;
- };
- return (1);
- }
- public function EmitRescaledYUV(_arg1, _arg2){
- var _local3:*;
- var _local4:*;
- var _local5:*;
- _local3 = _arg1.mb_h;
- _local4 = ((_local3 + 1) >> 1);
- _local5 = this.Rescale(_arg1.y, _arg1.y_off, _arg1.y_stride, _local3, _arg2.scaler_y);
- this.Rescale(_arg1.u, _arg1.u_off, _arg1.uv_stride, _local4, _arg2.scaler_u);
- this.Rescale(_arg1.v, _arg1.v_off, _arg1.uv_stride, _local4, _arg2.scaler_v);
- return (_local5);
- }
- public function WebPInitCustomIo(_arg1, _arg2){
- var params:* = _arg1;
- var io:* = _arg2;
- io.put = function (_arg1){
- return (CustomPut(_arg1));
- };
- io.setup = function (_arg1){
- return (CustomSetup(_arg1));
- };
- io.teardown = function (_arg1){
- return (CustomTeardown(_arg1));
- };
- io.opaque = params;
- }
- public function UpsampleRgbLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgb, 3);
- }
- public function DC16NoTopLeft(_arg1, _arg2){
- this.Put16(128, _arg1, _arg2);
- }
- public function TransformOne(_arg1, _arg2, _arg3, _arg4){
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local12:*;
- var _local13:*;
- var _local5:* = this.Arr((4 * 4), 0);
- _local7 = 0;
- _local6 = _local5;
- _local8 = 0;
- while (_local8 < 4) {
- _local9 = (_arg1[(_arg2 + 0)] + _arg1[(_arg2 + 8)]);
- _local10 = (_arg1[(_arg2 + 0)] - _arg1[(_arg2 + 8)]);
- _local11 = (this.MUL(_arg1[(_arg2 + 4)], this.kC2) - this.MUL(_arg1[(_arg2 + 12)], this.kC1));
- _local12 = (this.MUL(_arg1[(_arg2 + 4)], this.kC1) + this.MUL(_arg1[(_arg2 + 12)], this.kC2));
- _local6[(_local7 + 0)] = (_local9 + _local12);
- _local6[(_local7 + 1)] = (_local10 + _local11);
- _local6[(_local7 + 2)] = (_local10 - _local11);
- _local6[(_local7 + 3)] = (_local9 - _local12);
- _local7 = (_local7 + 4);
- _arg2++;
- _local8++;
- };
- _local7 = 0;
- _local8 = 0;
- while (_local8 < 4) {
- _local13 = (_local6[(_local7 + 0)] + 4);
- _local9 = (_local13 + _local6[(_local7 + 8)]);
- _local10 = (_local13 - _local6[(_local7 + 8)]);
- _local11 = (this.MUL(_local6[(_local7 + 4)], this.kC2) - this.MUL(_local6[(_local7 + 12)], this.kC1));
- _local12 = (this.MUL(_local6[(_local7 + 4)], this.kC1) + this.MUL(_local6[(_local7 + 12)], this.kC2));
- _arg3[((_arg4 + 0) + (0 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + 0) + (0 * this.BPS))] + ((_local9 + _local12) >> 3)));
- _arg3[((_arg4 + 1) + (0 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + 1) + (0 * this.BPS))] + ((_local10 + _local11) >> 3)));
- _arg3[((_arg4 + 2) + (0 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + 2) + (0 * this.BPS))] + ((_local10 - _local11) >> 3)));
- _arg3[((_arg4 + 3) + (0 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + 3) + (0 * this.BPS))] + ((_local9 - _local12) >> 3)));
- _local7++;
- _arg4 = (_arg4 + this.BPS);
- _local8++;
- };
- }
- public function UpsampleBgrLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToBgr, 3);
- }
- public function VP8YuvToRgb565(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:* = this.VP8kVToR[_arg3];
- var _local7:* = ((this.VP8kVToG[_arg3] + this.VP8kUToG[_arg2]) >> this.YUV_FIX);
- var _local8:* = this.VP8kUToB[_arg2];
- _arg4[(_arg5 + 0)] = ((this.VP8kClip[((_arg1 + _local6) - this.YUV_RANGE_MIN)] & 248) | (this.VP8kClip[((_arg1 + _local7) - this.YUV_RANGE_MIN)] >> 5));
- _arg4[(_arg5 + 1)] = (((this.VP8kClip[((_arg1 + _local7) - this.YUV_RANGE_MIN)] << 3) & 224) | (this.VP8kClip[((_arg1 + _local8) - this.YUV_RANGE_MIN)] >> 3));
- }
- public function WebPResize(_arg1:Event):void{
- this.WebPChange();
- }
- public function UpsampleRgba4444LinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
- this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgba4444, 2);
- }
- public function VP8StoreBlock(_arg1){
- var _local2:*;
- var _local11:*;
- var _local12:*;
- var _local13:*;
- if (_arg1.filter_type_ > 0){
- _local11 = _arg1.f_info_[(1 + _arg1.mb_x_)];
- _local12 = _arg1.mb_info_[(1 + _arg1.mb_x_)].skip_;
- _local13 = _arg1.filter_levels_[_arg1.segment_];
- if (_arg1.filter_hdr_.use_lf_delta_){
- _local13 = (_local13 + _arg1.filter_hdr_.ref_lf_delta_[0]);
- if (_arg1.is_i4x4_){
- _local13 = (_local13 + _arg1.filter_hdr_.mode_lf_delta_[0]);
- };
- };
- _local13 = ((_local13)<0) ? 0 : ((_local13)>63) ? 63 : _local13;
- _local11.f_level_ = _local13;
- if (_arg1.filter_hdr_.sharpness_ > 0){
- if (_arg1.filter_hdr_.sharpness_ > 4){
- _local13 = (_local13 >> 2);
- } else {
- _local13 = (_local13 >> 1);
- };
- if (_local13 > (9 - _arg1.filter_hdr_.sharpness_)){
- _local13 = (9 - _arg1.filter_hdr_.sharpness_);
- };
- };
- _local11.f_ilevel_ = ((_local13)<1) ? 1 : _local13;
- _local11.f_inner_ = (((!(_local12)) || (_arg1.is_i4x4_)) + 0);
- };
- var _local3:* = ((_arg1.cache_id_ * 16) * _arg1.cache_y_stride_);
- var _local4:* = ((_arg1.cache_id_ * 8) * _arg1.cache_uv_stride_);
- var _local5:* = _arg1.cache_y_;
- var _local6:* = ((_arg1.cache_y_off + (_arg1.mb_x_ * 16)) + _local3);
- var _local7:* = _arg1.cache_u_;
- var _local8:* = ((_arg1.cache_u_off + (_arg1.mb_x_ * 8)) + _local4);
- var _local9:* = _arg1.cache_v_;
- var _local10:* = ((_arg1.cache_v_off + (_arg1.mb_x_ * 8)) + _local4);
- _local2 = 0;
- while (_local2 < 16) {
- this.memcpy(_local5, (_local6 + (_local2 * _arg1.cache_y_stride_)), _arg1.yuv_b_, (this.Y_OFF + (_local2 * this.BPS)), 16);
- _local2++;
- };
- _local2 = 0;
- while (_local2 < 8) {
- this.memcpy(_local7, (_local8 + (_local2 * _arg1.cache_uv_stride_)), _arg1.yuv_b_, (this.U_OFF + (_local2 * this.BPS)), 8);
- this.memcpy(_local9, (_local10 + (_local2 * _arg1.cache_uv_stride_)), _arg1.yuv_b_, (this.V_OFF + (_local2 * this.BPS)), 8);
- _local2++;
- };
- }
- public function memset_(_arg1, _arg2, _arg3, _arg4){
- var _local5:int;
- _local5 = 0;
- while (_local5 < _arg4) {
- _arg1[(_arg2 + _local5)] = _arg3;
- _local5++;
- };
- }
- public function DC4(_arg1, _arg2){
- var _local4:*;
- var _local3:* = 4;
- _local4 = 0;
- while (_local4 < 4) {
- _local3 = (_local3 + (_arg1[((_arg2 + _local4) - this.BPS)] + _arg1[((_arg2 - 1) + (_local4 * this.BPS))]));
- _local4++;
- };
- _local3 = (_local3 >> 3);
- _local4 = 0;
- while (_local4 < 4) {
- this.memset_(_arg1, (_arg2 + (_local4 * this.BPS)), _local3, 4);
- _local4++;
- };
- }
- public function VP8InitIoInternal(_arg1, _arg2){
- if (_arg2 != this.WEBP_DECODER_ABI_VERSION){
- this.alert("mismatch error");
- return (0);
- };
- if (_arg1){
- };
- return (1);
- }
- public function MUL(_arg1, _arg2){
- return (((_arg1 * _arg2) >> 16));
- }
- public function convertURLLoaderBinaryToArray(_arg1){
- var _local2:*;
- var _local3:*;
- var _local4:int;
- _local2 = new Array();
- _local3 = _arg1.length;
- _local4 = 0;
- while (_local4 < _local3) {
- _local2.push(_arg1[_local4]);
- _local4++;
- };
- return (_local2);
- }
- public function EmitAlphaYUV(_arg1, _arg2){
- var _local5:*;
- var _local3:* = _arg1.mb_w;
- var _local4:* = _arg1.mb_h;
- var _local6:* = _arg2.output.u.YUVA;
- var _local7:* = _local6.a;
- var _local8:* = (_local6.a_off + (_arg1.mb_y * _local6.a_stride));
- var _local9:* = _arg1.a;
- var _local10:* = _arg1.a_off;
- if (_local9 != null){
- _local5 = 0;
- while (_local5 < _local4) {
- this.memcpy(_local7, _local8, _local9, _local10, (_local3 * this.sizeof(_local7)));
- _local10 = (_local10 + _arg1.width);
- _local8 = (_local8 + _local6.a_stride);
- _local5++;
- };
- };
- return (0);
- }
- public function memcpy(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:int;
- if (typeof(_arg1) != "string"){
- _local6 = 0;
- while (_local6 < _arg5) {
- _arg1[(_arg2 + _local6)] = _arg3[(_arg4 + _local6)];
- _local6++;
- };
- } else {
- if (_arg2 > 0){
- this.alert("string offset is over 0");
- };
- _arg1 = _arg3.slice(_arg4, _arg5);
- return (_arg1);
- };
- }
- public function WebPGrabDecBuffer(_arg1, _arg2){
- this.alert("todo: WebPGrabDecBuffer");
- }
- public function TM8uv(_arg1, _arg2){
- this.TrueMotion(_arg1, _arg2, 8);
- }
- public function AVG3(_arg1, _arg2, _arg3){
- return (((((_arg1 + (2 * _arg2)) + _arg3) + 2) >> 2));
- }
- public function EmitAlphaRGB(_arg1, _arg2){
- var _local8:*;
- var _local9:*;
- var _local3:* = _arg2.output.colorspace;
- var _local4:* = (((_local3 == this.MODE_ARGB)) ? 0 : (((_local3 == this.MODE_RGBA_4444)) ? 1 : 3));
- var _local5:* = (((_local3 == this.MODE_RGBA_4444)) ? 2 : 4);
- var _local6:* = _arg1.mb_w;
- var _local7:* = _arg1.mb_h;
- var _local10:* = _arg2.output.u.RGBA;
- var _local11:* = _local10.rgba;
- var _local12:* = (_local10.rgba_off + (_arg1.mb_y * _local10.stride));
- var _local13:* = _arg1.a;
- var _local14:* = _arg1.a_off;
- if (_local13 != null){
- _local9 = 0;
- while (_local9 < _local7) {
- _local8 = 0;
- while (_local8 < _local6) {
- _local11[((_local12 + (_local5 * _local8)) + _local4)] = _local13[(_local14 + _local8)];
- _local8++;
- };
- _local14 = (_local14 + _arg1.width);
- _local12 = (_local12 + _local10.stride);
- _local9++;
- };
- };
- return (0);
- }
- public function Import(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:*;
- _local6 = 0;
- while ((((_local6 < _arg4)) && ((_arg5.y_accum > 0)))) {
- this.ImportRow(_arg1, _arg2, _arg5);
- _arg2 = (_arg2 + _arg3);
- _local6++;
- _arg5.y_accum = (_arg5.y_accum - _arg5.y_sub);
- };
- return (_local6);
- }
- public function AVG2(_arg1, _arg2){
- return ((((_arg1 + _arg2) + 1) >> 1));
- }
- public function Arr_nOI(_arg1, _arg2){
- var _local4:int;
- var _local3:* = new Array();
- _local4 = 0;
- while (_local4 < _arg1) {
- _local3.push(this.newObjectIt(_arg2));
- _local4++;
- };
- return (_local3);
- }
- public function ParseSegmentHeader(_arg1, _arg2, _arg3){
- var _local4:*;
- this.assert(_arg1);
- this.assert(_arg2);
- _arg2.use_segment_ = this.VP8Get(_arg1);
- if (_arg2.use_segment_){
- _arg2.update_map_ = this.VP8Get(_arg1);
- if (this.VP8Get(_arg1)){
- _arg2.absolute_delta_ = this.VP8Get(_arg1);
- _local4 = 0;
- while (_local4 < this.NUM_MB_SEGMENTS) {
- _arg2.quantizer_[_local4] = ((this.VP8Get(_arg1)) ? this.VP8GetSignedValue(_arg1, 7) : 0);
- _local4++;
- };
- _local4 = 0;
- while (_local4 < this.NUM_MB_SEGMENTS) {
- _arg2.filter_strength_[_local4] = ((this.VP8Get(_arg1)) ? this.VP8GetSignedValue(_arg1, 6) : 0);
- _local4++;
- };
- };
- if (_arg2.update_map_){
- _local4 = 0;
- while (_local4 < this.MB_FEATURE_TREE_PROBS) {
- _arg3.segments_[_local4] = ((this.VP8Get(_arg1)) ? this.VP8GetValue(_arg1, 8) : 0xFF);
- _local4++;
- };
- };
- } else {
- _arg2.update_map_ = 0;
- };
- return (!(_arg1.eof_));
- }
- public function VP8DspInit(_arg1){
- this.VP8Transform = this.TransformTwo;
- this.VP8TransformUV = this.TransformUV;
- this.VP8TransformDC = this.TransformDC;
- this.VP8TransformDCUV = this.TransformDCUV;
- this.VP8VFilter16 = this.VFilter16;
- this.VP8HFilter16 = this.HFilter16;
- this.VP8VFilter8 = this.VFilter8;
- this.VP8HFilter8 = this.HFilter8;
- this.VP8VFilter16i = this.VFilter16i;
- this.VP8HFilter16i = this.HFilter16i;
- this.VP8VFilter8i = this.VFilter8i;
- this.VP8HFilter8i = this.HFilter8i;
- this.VP8SimpleVFilter16 = this.SimpleVFilter16;
- this.VP8SimpleHFilter16 = this.SimpleHFilter16;
- this.VP8SimpleVFilter16i = this.SimpleVFilter16i;
- this.VP8SimpleHFilter16i = this.SimpleHFilter16i;
- }
- public function completeHandler(_arg1:Event):void{
- var _local2:URLLoader;
- var _local3:ByteArray;
- var _local4:*;
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local12:BitmapData;
- var _local13:Rectangle;
- var _local14:Bitmap;
- if (!this.stopAction){
- _local2 = URLLoader(_arg1.target);
- _local3 = new ByteArray();
- _local3 = _local2.data;
- _local4 = this.WebPDecoderConfig;
- _local5 = _local4.output;
- _local6 = _local4.input;
- if (!this.WebPInitDecoderConfig(_local4)){
- this.alert("Library version mismatch!\n");
- };
- _local4.options.no_fancy_upsampling = 0;
- _local4.options.bypass_filtering = 0;
- _local4.options.use_cropping = 0;
- _local4.options.use_scaling = 0;
- _local7 = this.VP8StatusCode;
- _local8 = this.WebPGetFeatures(_local3, _local3.length, _local6);
- if (_local8 != _local7.VP8_STATUS_OK){
- this.alert("error");
- };
- _local9 = this.WEBP_CSP_MODE;
- _local5.colorspace = _local9.MODE_ARGB;
- _local8 = this.WebPDecode(_local3, _local3.length, _local4);
- _local10 = (_local8 == _local7.VP8_STATUS_OK);
- if (!_local10){
- this.alert("Decoding of %s failed.\n");
- };
- _local11 = _local5.u.RGBA.rgba;
- this.WebPImage.width.value = _local5.width;
- this.WebPImage.height.value = _local5.height;
- _local12 = new BitmapData(this.WebPImage.width.value, this.WebPImage.height.value, true, 0xFFFF0000);
- _local13 = new Rectangle(0, 0, this.WebPImage.width.value, this.WebPImage.height.value);
- _local12.setPixels(_local13, _local11);
- _local14 = new Bitmap(_local12);
- if (this.my_mode == "bg"){
- this.bmData = _local14.bitmapData;
- } else {
- _local14.smoothing = true;
- this.pic.addChild(_local14);
- };
- this.WebPChange();
- };
- gotoAndStop(2);
- stage.addEventListener(Event.RESIZE, this.stageResize);
- this.firstTime = false;
- }
- public function HE16(_arg1, _arg2){
- var _local3:*;
- _local3 = 16;
- while (_local3 > 0) {
- this.memset_(_arg1, (_arg2 + 0), _arg1[(_arg2 - 1)], 16);
- _arg2 = (_arg2 + this.BPS);
- _local3--;
- };
- }
- public function ImportRow(_arg1, _arg2, _arg3){
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- var _local9:*;
- var _local10:*;
- var _local11:*;
- var _local4:* = 0;
- _local5 = this.int_;
- _local6 = 0;
- if (!_arg3.x_expand){
- _local7 = 0;
- _local5 = 0;
- while (_local5 < _arg3.dst_width) {
- _local6 = (_local6 + _arg3.x_add);
- while (_local6 > 0) {
- var _temp1 = _local4;
- _local4 = (_local4 + 1);
- _local7 = (_local7 + _arg1[(_arg2 + _temp1)]);
- _local6 = (_local6 - _arg3.x_sub);
- };
- var _temp2 = _local4;
- _local4 = (_local4 + 1);
- _local8 = _arg1[(_arg2 + _temp2)];
- _local9 = (_local8 * -(_local6));
- this.write32BitIn4Bytes(_arg3.frow, (_arg3.frow_off + (_local5 * 4)), (((_local7 + _local8) * _arg3.x_sub) - _local9));
- _local7 = this.MULT(_local9, _arg3.fx_scale);
- _local5++;
- };
- } else {
- _local10 = _arg1[(_arg2 + 0)];
- _local11 = _arg1[(_arg2 + 0)];
- _local5 = 0;
- while (_local5 < _arg3.dst_width) {
- if (_local6 < 0){
- _local10 = _local11;
- ++_local4;
- _local11 = _arg1[(_arg2 + _local4)];
- _local6 = (_local6 + _arg3.x_add);
- };
- this.write32BitIn4Bytes(_arg3.frow, (_arg3.frow_off + (_local5 * 4)), ((_local11 * _arg3.x_add) + ((_local10 - _local11) * _local6)));
- _local6 = (_local6 - _arg3.x_sub);
- _local5++;
- };
- };
- _local5 = 0;
- while (_local5 < _arg3.dst_width) {
- this.write32BitIn4Bytes(_arg3.irow, (_arg3.irow_off + (_local5 * 4)), (this.write4BytesIn32Bit(_arg3.frow, (_arg3.frow_off + (_local5 * 4))) + this.write4BytesIn32Bit(_arg3.irow, (_arg3.irow_off + (_local5 * 4)))));
- _local5++;
- };
- }
- public function EmitYUV(_arg1, _arg2){
- var _local14:*;
- var _local3:* = _arg2.output;
- var _local4:* = _local3.u.YUVA;
- var _local5:* = _local4.y;
- var _local6:* = (_local4.y_off + (_arg1.mb_y * _local4.y_stride));
- var _local7:* = _local4.u;
- var _local8:* = (_local4.u_off + ((_arg1.mb_y >> 1) * _local4.u_stride));
- var _local9:* = _local4.v;
- var _local10:* = (_local4.v_off + ((_arg1.mb_y >> 1) * _local4.v_stride));
- var _local11:* = _arg1.mb_w;
- var _local12:* = _arg1.mb_h;
- var _local13:* = parseInt(String(((_local11 + 1) / 2)));
- _local14 = 0;
- while (_local14 < _local12) {
- this.memcpy(_local5, (_local6 + (_local14 * _local4.y_stride)), _arg1.y, (_arg1.y_off + (_local14 * _arg1.y_stride)), _local11);
- _local14++;
- };
- _local14 = 0;
- while (_local14 < ((_local12 + 1) / 2)) {
- this.memcpy(_local7, (_local8 + (_local14 * _local4.u_stride)), _arg1.u, (_arg1.u_off + (_local14 * _arg1.uv_stride)), _local13);
- this.memcpy(_local9, (_local10 + (_local14 * _local4.v_stride)), _arg1.v, (_arg1.v_off + (_local14 * _arg1.uv_stride)), _local13);
- _local14++;
- };
- return (_arg1.mb_h);
- }
- public function WebPAllocateDecBuffer(_arg1, _arg2, _arg3, _arg4){
- var _local5:*;
- var _local6:*;
- var _local7:*;
- var _local8:*;
- if ((((((_arg4 == null)) || ((_arg1 <= 0)))) || ((_arg2 <= 0)))){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- if (_arg3 != null){
- if (_arg3.use_cropping){
- _local5 = _arg3.crop_width;
- _local6 = _arg3.crop_height;
- _local7 = (_arg3.crop_left & ~(1));
- _local8 = (_arg3.crop_top & ~(1));
- if ((((((((((((_local7 < 0)) || ((_local8 < 0)))) || ((_local5 <= 0)))) || ((_local6 <= 0)))) || (((_local7 + _local5) > _arg1)))) || (((_local8 + _local6) > _arg2)))){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- _arg1 = _local5;
- _arg2 = _local6;
- };
- if (_arg3.use_scaling){
- if ((((_arg3.scaled_width <= 0)) || ((_arg3.scaled_height <= 0)))){
- return (this.VP8_STATUS_INVALID_PARAM);
- };
- _arg1 = _arg3.scaled_width;
- _arg2 = _arg3.scaled_height;
- };
- };
- _arg4.width = _arg1;
- _arg4.height = _arg2;
- return (this.AllocateBuffer(_arg4));
- }
- public function VP8YuvToRgba4444KeepA(_arg1, _arg2, _arg3, _arg4, _arg5){
- var _local6:* = this.VP8kVToR[_arg3];
- var _local7:* = ((this.VP8kVToG[_arg3] + this.VP8kUToG[_arg2]) >> this.YUV_FIX);
- var _local8:* = this.VP8kUToB[_arg2];
- _arg4[(_arg5 + 0)] = ((this.VP8kClip4Bits[((_arg1 + _local6) - this.YUV_RANGE_MIN)] << 4) | this.VP8kClip4Bits[((_arg1 + _local7) - this.YUV_RANGE_MIN)]);
- _arg4[(_arg5 + 1)] = ((_arg4[(_arg5 + 1)] << 44) | (this.VP8kClip4Bits[((_arg1 + _local8) - this.YUV_RANGE_MIN)] << 4));
- }
- public function WebPDecodeARGBInto(_arg1, _arg2, _arg3, _arg4, _arg5){
- return (this.DecodeIntoRGBABuffer(this.MODE_ARGB, _arg1, _arg2, _arg3, _arg5, _arg4));
- }
- public function VE8uv(_arg1, _arg2){
- var _local3:*;
- _local3 = 0;
- while (_local3 < 8) {
- this.memcpy(_arg1, (_arg2 + (_local3 * this.BPS)), _arg1, (_arg2 - this.BPS), 8);
- _local3++;
- };
- }
- public function DC8uv(_arg1, _arg2){
- var _local4:*;
- var _local3:* = 8;
- _local4 = 0;
- while (_local4 < 8) {
- _local3 = (_local3 + (_arg1[((_arg2 + _local4) - this.BPS)] + _arg1[((_arg2 - 1) + (_local4 * this.BPS))]));
- _local4++;
- };
- this.Put8x8uv(((_local3 >> 4) * 1), _arg1, _arg2);
- }
- }
- }//package webpjs_fla
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement