Advertisement
Guest User

webp encoder/decoder in actionscript; webpjs.appspot.com

a guest
Nov 20th, 2011
771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package webpjs_fla {
  2.     import com.adobe.serialization.json.*;
  3.     import flash.events.*;
  4.     import flash.display.*;
  5.     import flash.net.*;
  6.     import flash.text.*;
  7.     import flash.utils.*;
  8.     import adobe.utils.*;
  9.     import flash.accessibility.*;
  10.     import flash.desktop.*;
  11.     import flash.errors.*;
  12.     import flash.external.*;
  13.     import flash.filters.*;
  14.     import flash.geom.*;
  15.     import flash.media.*;
  16.     import flash.printing.*;
  17.     import flash.profiler.*;
  18.     import flash.sampler.*;
  19.     import flash.system.*;
  20.     import flash.text.engine.*;
  21.     import flash.ui.*;
  22.     import flash.xml.*;
  23.  
  24.     public dynamic class MainTimeline extends MovieClip {
  25.  
  26.         public var VP8FilterHeader;
  27.         public var NUM_MV_PROBAS;
  28.         public var MODE_RGB;
  29.         public var VP8SimpleVFilter16;
  30.         public var VP8FInfo;
  31.         public var WebPRescaler;
  32.         public var MODE_BGR;
  33.         public var loader:URLLoader;
  34.         public var MODE_YUV;
  35.         public var DEC_REV_VERSION;
  36.         public var VP8VFilter8i;
  37.         public var my_imgHeight;
  38.         public var TM_PRED;
  39.         public var ALIGN_MASK;
  40.         public var VP8_STATUS_BITSTREAM_ERROR;
  41.         public var B_PRED;
  42.         public var my_styleHeight;
  43.         public var Y_SIZE;
  44.         public var NUM_REF_LF_DELTAS;
  45.         public var VP8ThreadContext;
  46.         public var VP8HFilter16i;
  47.         public var kZigzag;
  48.         public var CoeffsUpdateProba;
  49.         public var my_url;
  50.         public var VP8StatusCode;
  51.         public var VP8kClip;
  52.         public var YUV_SIZE;
  53.         public var Y_OFF;
  54.         public var V_PRED;
  55.         public var WebPDecoderOptions;
  56.         public var token_br;
  57.         public var VP8Transform;
  58.         public var short;
  59.         public var NUM_MODE_LF_DELTAS;
  60.         public var my_mode;
  61.         public var MODE_RGB_565;
  62.         public var B_HD_PRED;
  63.         public var PackedNz;
  64.         public var param;
  65.         public var WebPDecodeARGB;
  66.         public var uint8_t;
  67.         public var YUV_HALF;
  68.         public var my_id;
  69.         public var VP8PredLuma16;
  70.         public var VP8TransformDCUV;
  71.         public var WebPGetDecoderVersion;
  72.         public var info;
  73.         public var VP8SimpleVFilter16i;
  74.         public var stopAction:Boolean;
  75.         public var WebPDecodeRGBA;
  76.         public var WebPDecodeBGRA;
  77.         public var uint32_t;
  78.         public var my_imgWidth;
  79.         public var VP8HFilter16;
  80.         public var VP8PictureHeader;
  81.         public var kVP8NewRange;
  82.         public var B_RD_PRED;
  83.         public var VP8BitReader;
  84.         public var VP8X_HEADER_SIZE;
  85.         public var VP8HFilter8;
  86.         public var VP8SimpleHFilter16i;
  87.         public var VP8kClip4Bits;
  88.         public var B_TM_PRED;
  89.         public var B_HE_PRED;
  90.         public var MT_CACHE_LINES;
  91.         public var NUM_B_DC_MODES;
  92.         public var WebPUpsamplersKeepAlpha;
  93.         public var kVP8Log2Range;
  94.         public var NUM_PROBAS;
  95.         public var VP8VFilter8;
  96.         public var int16_t;
  97.         public var void_;
  98.         public var VP8TransformDC;
  99.         public var VP8kUToB;
  100.         public var VP8kUToG;
  101.         public var kFilterExtraRows;
  102.         public var kScan;
  103.         public var pic:MovieClip;
  104.         public var B_LD_PRED;
  105.         public var uint64_t;
  106.         public var MODE_RGBA_4444;
  107.         public var VP8Proba;
  108.         public var MAX_NUM_PARTITIONS;
  109.         public var firstTime;
  110.         public var VP8Decoder;
  111.         public var NUM_CTX;
  112.         public var BPS;
  113.         public var WebPUpsamplers;
  114.         public var DEC_MAJ_VERSION;
  115.         public var kUnpackTab;
  116.         public var YUV_RANGE_MAX;
  117.         public var kAcTable;
  118.         public var VP8kVToG;
  119.         public var WEBP_CSP_MODE;
  120.         public var V_OFF;
  121.         public var MODE_ARGB;
  122.         public var WebPBitstreamFeatures;
  123.         public var DC_PRED;
  124.         public var VP8SimpleHFilter16;
  125.         public var tables_ok;
  126.         public var kC1;
  127.         public var kC2;
  128.         public var abs0;
  129.         public var abs1;
  130.         public var score_t;
  131.         public var VP8kVToR;
  132.         public var myText_txt:TextField;
  133.         public var ProbaArray;
  134.         public var kCat3;
  135.         public var kCat4;
  136.         public var kCat6;
  137.         public var VP8HFilter8i;
  138.         public var VP8PredLuma4;
  139.         public var kCat5;
  140.         public var B_DC_PRED_NOTOPLEFT;
  141.         public var NUM_TYPES;
  142.         public var sclip1;
  143.         public var sclip2;
  144.         public var int_;
  145.         public var MODE_RGBA;
  146.         public var kModeBpp;
  147.         public var float;
  148.         public var MODE_BGRA;
  149.         public var U_OFF;
  150.         public var WebPDecoderConfig;
  151.         public var RFIX;
  152.         public var long;
  153.         public var WebPYUVABuffer;
  154.         public var VP8Io;
  155.         public var CoeffsProba0;
  156.         public var bmData:BitmapData;
  157.         public var NUM_BANDS;
  158.         public var WebPDecBuffer;
  159.         public var kCat3456;
  160.         public var B_VE_PRED;
  161.         public var B_DC_PRED_NOTOP;
  162.         public var VP8FrameHeader;
  163.         public var kYModesIntra4;
  164.         public var PACK_CST;
  165.         public var B_VR_PRED;
  166.         public var VP8_STATUS_USER_ABORT;
  167.         public var YUV_RANGE_MIN;
  168.         public var DEC_MIN_VERSION;
  169.         public var VP8MB;
  170.         public var clip1;
  171.         public var B_DC_PRED;
  172.         public var ST_CACHE_LINES;
  173.         public var kSamplers;
  174.         public var YUV_FIX;
  175.         public var kBModesProba;
  176.         public var VP8_STATUS_UNSUPPORTED_FEATURE;
  177.         public var int32_t;
  178.         public var VP8_STATUS_OK;
  179.         public var WEBP_DECODER_ABI_VERSION;
  180.         public var B_VL_PRED;
  181.         public var NUM_BMODES;
  182.         public var VP8_STATUS_SUSPENDED;
  183.         public var B_DC_PRED_NOLEFT;
  184.         public var VP8VFilter16;
  185.         public var B_HU_PRED;
  186.         public var my_styleWidth;
  187.         public var WebPImage;
  188.         public var WebPRGBABuffer;
  189.         public var kBands;
  190.         public var uint16_t;
  191.         public var VP8QuantMatrix;
  192.         public var char;
  193.         public var VP8_STATUS_INVALID_PARAM;
  194.         public var RIFF_HEADER_SIZE;
  195.         public var VP8TransformUV;
  196.         public var my_bgRepeat;
  197.         public var VP8SegmentHeader;
  198.         public var VP8PredChroma8;
  199.         public var done;
  200.         public var WebPFreeDecBuffer;
  201.         public var my_bgpos;
  202.         public var kYUV444Converters;
  203.         public var int64_t;
  204.         public var MB_FEATURE_TREE_PROBS;
  205.         public var NUM_MB_SEGMENTS;
  206.         public var MODE_LAST;
  207.         public var kDcTable;
  208.         public var size_t;
  209.         public var H_PRED;
  210.         public var WebPDecodeRGB;
  211.         public var WebPDecodeRGBA_4444;
  212.         public var double;
  213.         public var WebPDecodeBGR;
  214.         public var int8_t;
  215.         public var VP8_STATUS_NOT_ENOUGH_DATA;
  216.         public var MODE_YUVA;
  217.         public var VP8_STATUS_OUT_OF_MEMORY;
  218.         public var WebPDecParams;
  219.         public var VP8VFilter16i;
  220.  
  221.         public function MainTimeline(){
  222.             addFrameScript(0, this.frame1);
  223.         }
  224.         public function DC8uvNoTop(_arg1, _arg2){
  225.             var _local4:*;
  226.             var _local3:* = 4;
  227.             _local4 = 0;
  228.             while (_local4 < 8) {
  229.                 _local3 = (_local3 + _arg1[((_arg2 - 1) + (_local4 * this.BPS))]);
  230.                 _local4++;
  231.             };
  232.             this.Put8x8uv(((_local3 >> 3) * 1), _arg1, _arg2);
  233.         }
  234.         public function VP8New(_arg1){
  235.             var _local2:* = this.newObjectIt(this.VP8Decoder);
  236.             if (_local2){
  237.                 this.SetOk(_local2);
  238.                 _local2.ready_ = 0;
  239.             };
  240.             return (_local2);
  241.         }
  242.         public function HFilter16(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
  243.             this.FilterLoop26(_arg1, (_arg2 + 0), 1, _arg3, 16, _arg4, _arg5, _arg6);
  244.         }
  245.         public function VP8Delete(_arg1){
  246.             if (_arg1){
  247.                 this.VP8Clear(_arg1);
  248.                 _arg1 = 0;
  249.             };
  250.         }
  251.         public function Put8x8uv(_arg1, _arg2, _arg3){
  252.             var _local4:*;
  253.             var _local5:*;
  254.             _local4 = 0;
  255.             while (_local4 < 8) {
  256.                 _local5 = 0;
  257.                 while (_local5 < 8) {
  258.                     _arg2[((_arg3 + _local5) + (_local4 * this.BPS))] = _arg1;
  259.                     _local5++;
  260.                 };
  261.                 _local4++;
  262.             };
  263.         }
  264.         public function do_filter2(_arg1, _arg2, _arg3){
  265.             var _local4:* = _arg1[(_arg2 - (2 * _arg3))];
  266.             var _local5:* = _arg1[(_arg2 - _arg3)];
  267.             var _local6:* = _arg1[(_arg2 + 0)];
  268.             var _local7:* = _arg1[(_arg2 + _arg3)];
  269.             var _local8:* = ((3 * (_local6 - _local5)) + this.sclip1[((1020 + _local4) - _local7)]);
  270.             var _local9:* = this.sclip2[(112 + ((_local8 + 4) >> 3))];
  271.             var _local10:* = this.sclip2[(112 + ((_local8 + 3) >> 3))];
  272.             _arg1[(_arg2 - _arg3)] = this.clip1[((0xFF + _local5) + _local10)];
  273.             _arg1[(_arg2 + 0)] = this.clip1[((0xFF + _local6) - _local9)];
  274.         }
  275.         public function do_filter4(_arg1, _arg2, _arg3){
  276.             var _local4:* = _arg1[(_arg2 - (2 * _arg3))];
  277.             var _local5:* = _arg1[(_arg2 - _arg3)];
  278.             var _local6:* = _arg1[(_arg2 + 0)];
  279.             var _local7:* = _arg1[(_arg2 + _arg3)];
  280.             var _local8:* = (3 * (_local6 - _local5));
  281.             var _local9:* = this.sclip2[(112 + ((_local8 + 4) >> 3))];
  282.             var _local10:* = this.sclip2[(112 + ((_local8 + 3) >> 3))];
  283.             var _local11:* = ((_local9 + 1) >> 1);
  284.             _arg1[(_arg2 - (2 * _arg3))] = this.clip1[((0xFF + _local4) + _local11)];
  285.             _arg1[(_arg2 - _arg3)] = this.clip1[((0xFF + _local5) + _local10)];
  286.             _arg1[(_arg2 + 0)] = this.clip1[((0xFF + _local6) - _local9)];
  287.             _arg1[(_arg2 + _arg3)] = this.clip1[((0xFF + _local7) - _local11)];
  288.         }
  289.         public function VP8ParseIntraMode(_arg1, _arg2){
  290.             var _local5:*;
  291.             var _local6:*;
  292.             var _local7:*;
  293.             var _local8:*;
  294.             var _local9:*;
  295.             var _local10:*;
  296.             var _local11:*;
  297.             var _local3:* = _arg2.intra_t_;
  298.             _local3[(_local3.length - 1)] = (0 + (4 * _arg2.mb_x_));
  299.             var _local4:* = _arg2.intra_l_;
  300.             _arg2.is_i4x4_ = !(this.VP8GetBit(_arg1, 145));
  301.             if (!_arg2.is_i4x4_){
  302.                 _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));
  303.                 _arg2.imodes_[0] = _local5;
  304.                 _local11 = 0;
  305.                 while (_local11 < 4) {
  306.                     _local3[(_local11 + _local3[(_local3.length - 1)])] = _local5;
  307.                     _local11++;
  308.                 };
  309.                 _local11 = 0;
  310.                 while (_local11 < 4) {
  311.                     _local4[_local11] = _local5;
  312.                     _local11++;
  313.                 };
  314.             } else {
  315.                 _local6 = _arg2.imodes_;
  316.                 _local7 = 0;
  317.                 _local8 = 0;
  318.                 while (_local8 < 4) {
  319.                     _local5 = _local4[_local8];
  320.                     _local9 = 0;
  321.                     while (_local9 < 4) {
  322.                         _local10 = this.kBModesProba[_local3[(_local3[(_local3.length - 1)] + _local9)]][_local5];
  323.                         _local11 = 0;
  324.                         do  {
  325.                             _local11 = this.kYModesIntra4[((2 * _local11) + this.VP8GetBit(_arg1, _local10[_local11]))];
  326.                         } while (_local11 > 0);
  327.                         _local5 = -(_local11);
  328.                         _local3[(_local3[(_local3.length - 1)] + _local9)] = _local5;
  329.                         _local6[_local7] = _local5;
  330.                         _local7++;
  331.                         _local9++;
  332.                     };
  333.                     _local4[_local8] = _local5;
  334.                     _local8++;
  335.                 };
  336.             };
  337.             _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);
  338.         }
  339.         public function InitYUVRescaler(_arg1, _arg2){
  340.             var _local3:*;
  341.             var _local4:*;
  342.             var _local5:*;
  343.             var _local6:*;
  344.             var _local7:*;
  345.             var _local8:*;
  346.             var _local9:*;
  347.             var _local10:*;
  348.             var _local11:*;
  349.             var _local12:*;
  350.             var _local13:*;
  351.             var _local14:*;
  352.             var _local15:*;
  353.             _local3 = this.IsAlphaMode(_arg2.output.colorspace);
  354.             _local4 = _arg2.output.u.YUVA;
  355.             _local5 = _arg1.scaled_width;
  356.             _local6 = _arg1.scaled_height;
  357.             _local7 = ((_local5 + 1) >> 1);
  358.             _local8 = ((_local6 + 1) >> 1);
  359.             _local9 = ((_arg1.mb_w + 1) >> 1);
  360.             _local10 = ((_arg1.mb_h + 1) >> 1);
  361.             _local11 = (2 * _local5);
  362.             _local12 = (2 * _local7);
  363.             _local13 = this.size_t;
  364.             _local14 = this.int32_t;
  365.             _local15 = 0;
  366.             _local13 = (_local11 + (2 * _local12));
  367.             if (_local3){
  368.                 _local13 = (_local13 + _local11);
  369.             };
  370.             _arg2.memory = this.malloc(((_local13 * this.sizeof(_local14)) * 4), 0);
  371.             if (_arg2.memory == null){
  372.                 return (0);
  373.             };
  374.             _local14 = _arg2.memory;
  375.             _local15 = 0;
  376.             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);
  377.             this.InitRescaler(_arg2.scaler_u, _local9, _local10, _local4.u, _local4.u_off, _local7, _local8, _local4.u_stride, _local9, _local7, _local10, _local8, _local14, (_local15 + _local11));
  378.             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));
  379.             _arg2.emit = this.EmitRescaledYUV;
  380.             if (_local3){
  381.                 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)));
  382.                 _arg2.emit_alpha = this.EmitRescaledAlphaYUV;
  383.             };
  384.             return (1);
  385.         }
  386.         public function do_filter6(_arg1, _arg2, _arg3){
  387.             var _local4:* = _arg1[(_arg2 - (3 * _arg3))];
  388.             var _local5:* = _arg1[(_arg2 - (2 * _arg3))];
  389.             var _local6:* = _arg1[(_arg2 - _arg3)];
  390.             var _local7:* = _arg1[(_arg2 + 0)];
  391.             var _local8:* = _arg1[(_arg2 + _arg3)];
  392.             var _local9:* = _arg1[(_arg2 + (2 * _arg3))];
  393.             var _local10:* = this.sclip1[((1020 + (3 * (_local7 - _local6))) + this.sclip1[((1020 + _local5) - _local8)])];
  394.             var _local11:* = (((27 * _local10) + 63) >> 7);
  395.             var _local12:* = (((18 * _local10) + 63) >> 7);
  396.             var _local13:* = (((9 * _local10) + 63) >> 7);
  397.             _arg1[(_arg2 - (3 * _arg3))] = this.clip1[((0xFF + _local4) + _local13)];
  398.             _arg1[(_arg2 - (2 * _arg3))] = this.clip1[((0xFF + _local5) + _local12)];
  399.             _arg1[(_arg2 - _arg3)] = this.clip1[((0xFF + _local6) + _local11)];
  400.             _arg1[(_arg2 + 0)] = this.clip1[((0xFF + _local7) - _local11)];
  401.             _arg1[(_arg2 + _arg3)] = this.clip1[((0xFF + _local8) - _local12)];
  402.             _arg1[(_arg2 + (2 * _arg3))] = this.clip1[((0xFF + _local9) - _local13)];
  403.         }
  404.         public function DoFilter(_arg1, _arg2, _arg3){
  405.             var _local12:*;
  406.             var _local13:*;
  407.             var _local14:*;
  408.             var _local15:*;
  409.             var _local16:*;
  410.             var _local17:*;
  411.             var _local4:* = _arg1.thread_ctx_;
  412.             var _local5:* = _arg1.cache_y_stride_;
  413.             var _local6:* = _local4.f_info_[(1 + _arg2)];
  414.             var _local7:* = _arg1.cache_y_;
  415.             var _local8:* = ((_arg1.cache_y_off + ((_local4.id_ * 16) * _local5)) + (_arg2 * 16));
  416.             var _local9:* = _local6.f_level_;
  417.             var _local10:* = _local6.f_ilevel_;
  418.             var _local11:* = ((2 * _local9) + _local10);
  419.             if (_local9 == 0){
  420.                 return;
  421.             };
  422.             if (_arg1.filter_type_ == 1){
  423.                 if (_arg2 > 0){
  424.                     this.VP8SimpleHFilter16(_local7, _local8, _local5, (_local11 + 4));
  425.                 };
  426.                 if (_local6.f_inner_){
  427.                     this.VP8SimpleHFilter16i(_local7, _local8, _local5, _local11);
  428.                 };
  429.                 if (_arg3 > 0){
  430.                     this.VP8SimpleVFilter16(_local7, _local8, _local5, (_local11 + 4));
  431.                 };
  432.                 if (_local6.f_inner_){
  433.                     this.VP8SimpleVFilter16i(_local7, _local8, _local5, _local11);
  434.                 };
  435.             } else {
  436.                 _local12 = _arg1.cache_uv_stride_;
  437.                 _local13 = _arg1.cache_u_;
  438.                 _local14 = ((_arg1.cache_u_off + ((_local4.id_ * 8) * _local12)) + (_arg2 * 8));
  439.                 _local15 = _arg1.cache_v_;
  440.                 _local16 = ((_arg1.cache_v_off + ((_local4.id_ * 8) * _local12)) + (_arg2 * 8));
  441.                 _local17 = this.hev_thresh_from_level(_local9, _arg1.frm_hdr_.key_frame_);
  442.                 if (_arg2 > 0){
  443.                     this.VP8HFilter16(_local7, _local8, _local5, (_local11 + 4), _local10, _local17);
  444.                     this.VP8HFilter8(_local13, _local14, _local15, _local16, _local12, (_local11 + 4), _local10, _local17);
  445.                 };
  446.                 if (_local6.f_inner_){
  447.                     this.VP8HFilter16i(_local7, _local8, _local5, _local11, _local10, _local17);
  448.                     this.VP8HFilter8i(_local13, _local14, _local15, _local16, _local12, _local11, _local10, _local17);
  449.                 };
  450.                 if (_arg3 > 0){
  451.                     this.VP8VFilter16(_local7, _local8, _local5, (_local11 + 4), _local10, _local17);
  452.                     this.VP8VFilter8(_local13, _local14, _local15, _local16, _local12, (_local11 + 4), _local10, _local17);
  453.                 };
  454.                 if (_local6.f_inner_){
  455.                     this.VP8VFilter16i(_local7, _local8, _local5, _local11, _local10, _local17);
  456.                     this.VP8VFilter8i(_local13, _local14, _local15, _local16, _local12, _local11, _local10, _local17);
  457.                 };
  458.             };
  459.         }
  460.         public function EmitRescaledAlphaYUV(_arg1, _arg2){
  461.             if (_arg1.a != null){
  462.                 this.Rescale(_arg1.a, _arg1.a_off, _arg1.width, _arg1.mb_h, _arg2.scaler_a);
  463.             };
  464.             return (0);
  465.         }
  466.         public function ParseResiduals(_arg1, _arg2, _arg3){
  467.             var _local4:*;
  468.             var _local5:*;
  469.             var _local6:*;
  470.             var _local17:*;
  471.             var _local18:*;
  472.             var _local19:*;
  473.             var _local20:*;
  474.             var _local21:*;
  475.             var _local22:*;
  476.             var _local23:*;
  477.             var _local7:* = this.ProbaArray;
  478.             var _local8:* = _arg1.dqm_[_arg1.segment_];
  479.             var _local9:* = _arg1.coeffs_;
  480.             var _local10:* = _arg1.mb_info_[(1 - 1)];
  481.             var _local11:* = this.Arr(4, 0);
  482.             var _local12:* = this.Arr(4, 0);
  483.             var _local13:* = this.Arr(4, 0);
  484.             var _local14:* = this.Arr(4, 0);
  485.             var _local15:* = 0;
  486.             var _local16:* = 0;
  487.             _local9 = this.memset(0, (384 * this.sizeof(_local9)));
  488.             if (!_arg1.is_i4x4_){
  489.                 _local20 = this.Arr(16, 0);
  490.                 _local21 = (_arg2.dc_nz_ + _local10.dc_nz_);
  491.                 _arg2.dc_nz_ = (_local10.dc_nz_ = ((this.GetCoeffs(_arg3, _arg1.proba_.coeffs_[1], _local21, _local8.y2_mat_, 0, _local20) > 0) + 0));
  492.                 _local6 = 1;
  493.                 _local7 = _arg1.proba_.coeffs_[0];
  494.                 this.VP8TransformWHT(_local20, _local9);
  495.                 _local9[(_local9.length - 1)] = 0;
  496.             } else {
  497.                 _local6 = 0;
  498.                 _local7 = _arg1.proba_.coeffs_[3];
  499.             };
  500.             _local13 = this.ArrCopy(this.kUnpackTab[(_arg2.nz_ & 15)]);
  501.             _local14 = this.ArrCopy(this.kUnpackTab[(_local10.nz_ & 15)]);
  502.             _local18 = 0;
  503.             while (_local18 < 4) {
  504.                 _local22 = _local14[_local18];
  505.                 _local17 = 0;
  506.                 while (_local17 < 4) {
  507.                     _local21 = (_local22 + _local13[_local17]);
  508.                     _local23 = this.GetCoeffs(_arg3, _local7, _local21, _local8.y1_mat_, _local6, _local9);
  509.                     _local22 = ((_local23 > 0) + 0);
  510.                     _local13[_local17] = _local22;
  511.                     _local12[_local17] = (!((_local9[(_local9[(_local9.length - 1)] + 0)] == 0)) + 0);
  512.                     _local11[_local17] = ((_local23 > 1) + 0);
  513.                     _local9[(_local9.length - 1)] = (_local9[(_local9.length - 1)] + 16);
  514.                     _local17++;
  515.                 };
  516.                 _local14[_local18] = _local22;
  517.                 _local16 = (_local16 | this.PACK(_local12, (24 - (_local18 * 4))));
  518.                 _local15 = (_local15 | this.PACK(_local11, (24 - (_local18 * 4))));
  519.                 _local18++;
  520.             };
  521.             _local4 = this.PACK(_local13, 24);
  522.             _local5 = this.PACK(_local14, 24);
  523.             _local13 = this.ArrCopy(this.kUnpackTab[(_arg2.nz_ >> 4)]);
  524.             _local14 = this.ArrCopy(this.kUnpackTab[(_local10.nz_ >> 4)]);
  525.             _local19 = 0;
  526.             while (_local19 < 4) {
  527.                 _local18 = 0;
  528.                 while (_local18 < 2) {
  529.                     _local22 = _local14[(_local19 + _local18)];
  530.                     _local17 = 0;
  531.                     while (_local17 < 2) {
  532.                         _local21 = (_local22 + _local13[(_local19 + _local17)]);
  533.                         _local23 = this.GetCoeffs(_arg3, _arg1.proba_.coeffs_[2], _local21, _local8.uv_mat_, 0, _local9);
  534.                         _local22 = ((_local23 > 0) + 0);
  535.                         _local13[(_local19 + _local17)] = _local22;
  536.                         _local12[((_local18 * 2) + _local17)] = (!((_local9[(_local9[(_local9.length - 1)] + 0)] == 0)) + 0);
  537.                         _local11[((_local18 * 2) + _local17)] = ((_local23 > 1) + 0);
  538.                         _local9[(_local9.length - 1)] = (_local9[(_local9.length - 1)] + 16);
  539.                         _local17++;
  540.                     };
  541.                     _local14[(_local19 + _local18)] = _local22;
  542.                     _local18++;
  543.                 };
  544.                 _local16 = (_local16 | this.PACK(_local12, (8 - (_local19 * 2))));
  545.                 _local15 = (_local15 | this.PACK(_local11, (8 - (_local19 * 2))));
  546.                 _local19 = (_local19 + 2);
  547.             };
  548.             _local4 = (_local4 | this.PACK(_local13, 20));
  549.             _local5 = (_local5 | this.PACK(_local14, 20));
  550.             _arg2.nz_ = _local4;
  551.             _local10.nz_ = _local5;
  552.             _arg1.coeffs_ = _local9;
  553.             _arg1.non_zero_ac_ = (_local15 + 0);
  554.             _arg1.non_zero_ = (_local15 | _local16);
  555.             _arg2.skip_ = (!(_arg1.non_zero_) + 0);
  556.         }
  557.         public function SimpleVFilter16i(_arg1, _arg2, _arg3, _arg4){
  558.             var _local5:*;
  559.             _local5 = 3;
  560.             while (_local5 > 0) {
  561.                 _arg2 = (_arg2 + (4 * _arg3));
  562.                 this.SimpleVFilter16(_arg1, (_arg2 + 0), _arg3, _arg4);
  563.                 _local5--;
  564.             };
  565.         }
  566.         public function VP8ParseProba(_arg1, _arg2){
  567.             var _local4:*;
  568.             var _local5:*;
  569.             var _local6:*;
  570.             var _local7:*;
  571.             var _local3:* = _arg2.proba_;
  572.             _local4 = 0;
  573.             while (_local4 < this.NUM_TYPES) {
  574.                 _local5 = 0;
  575.                 while (_local5 < this.NUM_BANDS) {
  576.                     _local6 = 0;
  577.                     while (_local6 < this.NUM_CTX) {
  578.                         _local7 = 0;
  579.                         while (_local7 < this.NUM_PROBAS) {
  580.                             if (this.VP8GetBit(_arg1, this.CoeffsUpdateProba[_local4][_local5][_local6][_local7])){
  581.                                 _local3.coeffs_[_local4][_local5][_local6][_local7] = this.VP8GetValue(_arg1, 8);
  582.                             };
  583.                             _local7++;
  584.                         };
  585.                         _local6++;
  586.                     };
  587.                     _local5++;
  588.                 };
  589.                 _local4++;
  590.             };
  591.             _arg2.use_skip_proba_ = this.VP8Get(_arg1);
  592.             if (_arg2.use_skip_proba_){
  593.                 _arg2.skip_p_ = this.VP8GetValue(_arg1, 8);
  594.             };
  595.         }
  596.         public function VP8DspInitTables(_arg1){
  597.             var _local2:*;
  598.             if (!this.tables_ok){
  599.                 _local2 = -255;
  600.                 while (_local2 <= 0xFF) {
  601.                     this.abs0[(0xFF + _local2)] = ((_local2)<0) ? -(_local2) : _local2;
  602.                     this.abs1[(0xFF + _local2)] = (this.abs0[(0xFF + _local2)] >> 1);
  603.                     _local2++;
  604.                 };
  605.                 _local2 = -1020;
  606.                 while (_local2 <= 1020) {
  607.                     this.sclip1[(1020 + _local2)] = ((_local2)<-128) ? -128 : ((_local2)>127) ? 127 : _local2;
  608.                     _local2++;
  609.                 };
  610.                 _local2 = -112;
  611.                 while (_local2 <= 112) {
  612.                     this.sclip2[(112 + _local2)] = ((_local2)<-16) ? -16 : ((_local2)>15) ? 15 : _local2;
  613.                     _local2++;
  614.                 };
  615.                 _local2 = -255;
  616.                 while (_local2 <= (0xFF + 0xFF)) {
  617.                     this.clip1[(0xFF + _local2)] = ((_local2)<0) ? 0 : ((_local2)>0xFF) ? 0xFF : _local2;
  618.                     _local2++;
  619.                 };
  620.                 this.tables_ok = 1;
  621.             };
  622.         }
  623.         public function EmitRescaledAlphaRGB(_arg1, _arg2){
  624.             var _local3:*;
  625.             var _local4:*;
  626.             if (_arg1.a != null){
  627.                 _local3 = 0;
  628.                 _local4 = 0;
  629.                 while (_local3 < _arg1.mb_h) {
  630.                     _local3 = (_local3 + this.Import(_arg1.a, (_arg1.a_off + (_local3 * _arg1.width)), _arg1.width, (_arg1.mb_h - _local3), _arg2.scaler_a));
  631.                     _local4 = (_local4 + this.ExportAlpha(_arg2, _local4));
  632.                 };
  633.             };
  634.             return (0);
  635.         }
  636.         public function VP8YuvToRgba4444(_arg1, _arg2, _arg3, _arg4, _arg5){
  637.             _arg4[(_arg5 + 1)] = 15;
  638.             this.VP8YuvToRgba4444KeepA(_arg1, _arg2, _arg3, _arg4, _arg5);
  639.         }
  640.         public function VP8GetBit(_arg1, _arg2){
  641.             var _local3:* = ((_arg1.range_ * _arg2) >> 8);
  642.             var _local4:* = this.VP8BitUpdate(_arg1, _local3);
  643.             if (_arg1.range_ < 127){
  644.                 this.VP8Shift(_arg1);
  645.             };
  646.             return (_local4);
  647.         }
  648.         public function needs_filter2(_arg1, _arg2, _arg3, _arg4, _arg5){
  649.             var _local6:* = _arg1[(_arg2 - (4 * _arg3))];
  650.             var _local7:* = _arg1[(_arg2 - (3 * _arg3))];
  651.             var _local8:* = _arg1[(_arg2 - (2 * _arg3))];
  652.             var _local9:* = _arg1[(_arg2 - _arg3)];
  653.             var _local10:* = _arg1[(_arg2 + 0)];
  654.             var _local11:* = _arg1[(_arg2 + _arg3)];
  655.             var _local12:* = _arg1[(_arg2 + (2 * _arg3))];
  656.             var _local13:* = _arg1[(_arg2 + (3 * _arg3))];
  657.             if (((2 * this.abs0[((0xFF + _local9) - _local10)]) + this.abs1[((0xFF + _local8) - _local11)]) > _arg4){
  658.                 return (0);
  659.             };
  660.             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))));
  661.         }
  662.         public function RD4(_arg1, _arg2){
  663.             var _local3:* = _arg1[((_arg2 - 1) + (0 * this.BPS))];
  664.             var _local4:* = _arg1[((_arg2 - 1) + (1 * this.BPS))];
  665.             var _local5:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
  666.             var _local6:* = _arg1[((_arg2 - 1) + (3 * this.BPS))];
  667.             var _local7:* = _arg1[((_arg2 - 1) - this.BPS)];
  668.             var _local8:* = _arg1[((_arg2 + 0) - this.BPS)];
  669.             var _local9:* = _arg1[((_arg2 + 1) - this.BPS)];
  670.             var _local10:* = _arg1[((_arg2 + 2) - this.BPS)];
  671.             var _local11:* = _arg1[((_arg2 + 3) - this.BPS)];
  672.             _arg1[((_arg2 + 0) + (3 * this.BPS))] = this.AVG3(_local4, _local5, _local6);
  673.             _arg1[((_arg2 + 0) + (2 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local3, _local4, _local5));
  674.             _arg1[((_arg2 + 0) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG3(_local7, _local3, _local4)));
  675.             _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))));
  676.             _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 3) + (2 * this.BPS))] = this.AVG3(_local9, _local8, _local7)));
  677.             _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 3) + (1 * this.BPS))] = this.AVG3(_local10, _local9, _local8));
  678.             _arg1[((_arg2 + 3) + (0 * this.BPS))] = this.AVG3(_local11, _local10, _local9);
  679.         }
  680.         public function VP8YuvToArgb(_arg1, _arg2, _arg3, _arg4, _arg5){
  681.             _arg4[(_arg5 + 0)] = 0xFF;
  682.             this.VP8YuvToArgbKeepA(_arg1, _arg2, _arg3, _arg4, _arg5);
  683.         }
  684.         public function InitFromOptions(_arg1, _arg2){
  685.             var _local3:*;
  686.             var _local4:*;
  687.             var _local5:*;
  688.             var _local6:*;
  689.             var _local7:*;
  690.             var _local8:*;
  691.             _local3 = _arg2.width;
  692.             _local4 = _arg2.height;
  693.             _local5 = 0;
  694.             _local6 = 0;
  695.             _local7 = _local3;
  696.             _local8 = _local4;
  697.             _arg2.use_cropping = ((!((_arg1 == null))) && ((_arg1.use_cropping > 0)));
  698.             if (_arg2.use_cropping){
  699.                 _local7 = _arg1.crop_width;
  700.                 _local8 = _arg1.crop_height;
  701.                 _local5 = (_arg1.crop_left & ~(1));
  702.                 _local6 = (_arg1.crop_top & ~(1));
  703.                 if ((((((((((((_local5 < 0)) || ((_local6 < 0)))) || ((_local7 <= 0)))) || ((_local8 <= 0)))) || (((_local5 + _local7) > _local3)))) || (((_local6 + _local8) > _local4)))){
  704.                     return (0);
  705.                 };
  706.             };
  707.             _arg2.crop_left = _local5;
  708.             _arg2.crop_top = _local6;
  709.             _arg2.crop_right = (_local5 + _local7);
  710.             _arg2.crop_bottom = (_local6 + _local8);
  711.             _arg2.mb_w = _local7;
  712.             _arg2.mb_h = _local8;
  713.             _arg2.use_scaling = (((!((_arg1 == null))) && ((_arg1.use_scaling > 0))) + 0);
  714.             if (_arg2.use_scaling){
  715.                 if ((((_arg1.scaled_width <= 0)) || ((_arg1.scaled_height <= 0)))){
  716.                     return (0);
  717.                 };
  718.                 _arg2.scaled_width = _arg1.scaled_width;
  719.                 _arg2.scaled_height = _arg1.scaled_height;
  720.             };
  721.             _arg2.bypass_filtering = ((_arg1) && (_arg1.bypass_filtering));
  722.             _arg2.fancy_upsampling = ((((_arg1 == null)) || (!(_arg1.no_fancy_upsampling))) + 0);
  723.             if (_arg2.use_scaling){
  724.                 _arg2.bypass_filtering = ((((_arg2.scaled_width < parseInt(String(((_local3 * 3) / 4)))) + 0)) && (((_arg2.scaled_height < parseInt(String(((_local4 * 3) / 4)))) + 0)));
  725.                 _arg2.fancy_upsampling = 0;
  726.             };
  727.             return (1);
  728.         }
  729.         public function VL4(_arg1, _arg2){
  730.             var _local3:* = _arg1[((_arg2 + 0) - this.BPS)];
  731.             var _local4:* = _arg1[((_arg2 + 1) - this.BPS)];
  732.             var _local5:* = _arg1[((_arg2 + 2) - this.BPS)];
  733.             var _local6:* = _arg1[((_arg2 + 3) - this.BPS)];
  734.             var _local7:* = _arg1[((_arg2 + 4) - this.BPS)];
  735.             var _local8:* = _arg1[((_arg2 + 5) - this.BPS)];
  736.             var _local9:* = _arg1[((_arg2 + 6) - this.BPS)];
  737.             var _local10:* = _arg1[((_arg2 + 7) - this.BPS)];
  738.             _arg1[((_arg2 + 0) + (0 * this.BPS))] = this.AVG2(_local3, _local4);
  739.             _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 0) + (2 * this.BPS))] = this.AVG2(_local4, _local5));
  740.             _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = this.AVG2(_local5, _local6));
  741.             _arg1[((_arg2 + 3) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = this.AVG2(_local6, _local7));
  742.             _arg1[((_arg2 + 0) + (1 * this.BPS))] = this.AVG3(_local3, _local4, _local5);
  743.             _arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 0) + (3 * this.BPS))] = this.AVG3(_local4, _local5, _local6));
  744.             _arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local5, _local6, _local7));
  745.             _arg1[((_arg2 + 3) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG3(_local6, _local7, _local8));
  746.             _arg1[((_arg2 + 3) + (2 * this.BPS))] = this.AVG3(_local7, _local8, _local9);
  747.             _arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local8, _local9, _local10);
  748.         }
  749.         public function SampleRgb565LinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
  750.             this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToRgb565, 2);
  751.         }
  752.         public function VP8Clear(_arg1){
  753.             if (_arg1 == null){
  754.                 return;
  755.             };
  756.             if (_arg1.use_threads_){
  757.             };
  758.             if (_arg1.mem_){
  759.                 _arg1.mem_ = 0;
  760.             };
  761.             _arg1.mem_ = null;
  762.             _arg1.mem_size_ = 0;
  763.             _arg1.ready_ = 0;
  764.         }
  765.         public function VP8Decode(_arg1, _arg2){
  766.             var _local3:* = 0;
  767.             if (_arg1 == null){
  768.                 return (0);
  769.             };
  770.             if (_arg2 == null){
  771.                 return (this.VP8SetError(_arg1, "VP8_STATUS_INVALID_PARAM", "NULL VP8Io parameter in VP8Decode()."));
  772.             };
  773.             if (!_arg1.ready_){
  774.                 if (!this.VP8GetHeaders(_arg1, _arg2)){
  775.                     return (0);
  776.                 };
  777.             };
  778.             this.assert(_arg1.ready_);
  779.             _local3 = (this.VP8EnterCritical(_arg1, _arg2) == this.VP8_STATUS_OK);
  780.             if (_local3){
  781.                 if (_local3){
  782.                     _local3 = this.VP8InitFrame(_arg1, _arg2);
  783.                 };
  784.                 if (_local3){
  785.                     _local3 = this.ParseFrame(_arg1, _arg2);
  786.                 };
  787.                 _local3 = (_local3 & this.VP8ExitCritical(_arg1, _arg2));
  788.             };
  789.             if (!_local3){
  790.                 this.VP8Clear(_arg1);
  791.                 return (0);
  792.             };
  793.             _arg1.ready_ = 0;
  794.             return (1);
  795.         }
  796.         public function VP8ProcessRow(_arg1, _arg2){
  797.             var _local5:*;
  798.             var _local6:*;
  799.             var _local3:* = 1;
  800.             var _local4:* = _arg1.thread_ctx_;
  801.             if (!_arg1.use_threads_){
  802.                 _local4.mb_y_ = _arg1.mb_y_;
  803.                 _local4.filter_row_ = _arg1.filter_row_;
  804.                 _local3 = this.VP8FinishRow(_arg1, _arg2);
  805.             } else {
  806.                 _local5 = _arg1.worker_;
  807.                 if (_local3){
  808.                     _local4.io_ = _arg2;
  809.                     _local4.id_ = _arg1.cache_id_;
  810.                     _local4.mb_y_ = _arg1.mb_y_;
  811.                     _local4.filter_row_ = _arg1.filter_row_;
  812.                     if (_local4.filter_row_){
  813.                         _local6 = _local4.f_info_;
  814.                         _local4.f_info_ = _arg1.f_info_;
  815.                         _arg1.f_info_ = _local6;
  816.                     };
  817.                     if (++_arg1.cache_id_ == _arg1.num_caches_){
  818.                         _arg1.cache_id_ = 0;
  819.                     };
  820.                 };
  821.             };
  822.             return (_local3);
  823.         }
  824.         public function SimpleHFilter16i(_arg1, _arg2, _arg3, _arg4){
  825.             var _local5:*;
  826.             _local5 = 3;
  827.             while (_local5 > 0) {
  828.                 _arg2 = (_arg2 + 4);
  829.                 this.SimpleHFilter16(_arg1, (_arg2 + 0), _arg3, _arg4);
  830.                 _local5--;
  831.             };
  832.         }
  833.         public function ExportRGB(_arg1, _arg2){
  834.             var _local4:*;
  835.             var _local5:*;
  836.             var _local6:*;
  837.             var _local7:*;
  838.             var _local3:* = this.kYUV444Converters[_arg1.output.colorspace];
  839.             _local4 = _arg1.output.u.RGBA;
  840.             _local5 = _local4.rgba;
  841.             _local6 = (_local4.rgba_off + ((_arg1.last_y + _arg2) * _local4.stride));
  842.             _local7 = 0;
  843.             while ((((_arg1.scaler_y.y_accum <= 0)) && ((_arg1.scaler_u.y_accum <= 0)))) {
  844.                 this.assert((((_arg1.last_y + _arg2) + _local7) < _arg1.output.height));
  845.                 this.assert((_arg1.scaler_u.y_accum == _arg1.scaler_v.y_accum));
  846.                 this.ExportRow(_arg1.scaler_y);
  847.                 this.ExportRow(_arg1.scaler_u);
  848.                 this.ExportRow(_arg1.scaler_v);
  849.                 _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);
  850.                 _local6 = (_local6 + _local4.stride);
  851.                 _local7++;
  852.             };
  853.             return (_local7);
  854.         }
  855.         public function WebPDecodeRGBAInto(_arg1, _arg2, _arg3, _arg4, _arg5){
  856.             return (this.DecodeIntoRGBABuffer(this.MODE_RGBA, _arg1, _arg2, _arg3, _arg5, _arg4));
  857.         }
  858.         public function VP8DecodeLayer(_arg1){
  859.             this.assert(_arg1);
  860.             this.assert((_arg1.layer_data_size_ > 0));
  861.             return (1);
  862.         }
  863.         public function ioErrorHandler(_arg1:IOErrorEvent):void{
  864.             this.alert("#2: no valid url");
  865.         }
  866.         function frame1(){
  867.             this.char = 0;
  868.             this.short = 0;
  869.             this.int_ = 0;
  870.             this.long = 0;
  871.             this.void_ = 0;
  872.             this.int8_t = this.char;
  873.             this.uint8_t = this.char;
  874.             this.int16_t = this.short;
  875.             this.uint16_t = this.short;
  876.             this.int32_t = this.int_;
  877.             this.uint32_t = this.int_;
  878.             this.uint64_t = this.long;
  879.             this.int64_t = this.long;
  880.             this.float = 0;
  881.             this.size_t = 0;
  882.             this.double = 0;
  883.             this.score_t = this.int64_t;
  884.             this.WEBP_DECODER_ABI_VERSION = 2;
  885.             this.MODE_RGB = 0;
  886.             this.MODE_RGBA = 1;
  887.             this.MODE_BGR = 2;
  888.             this.MODE_BGRA = 3;
  889.             this.MODE_ARGB = 4;
  890.             this.MODE_RGBA_4444 = 5;
  891.             this.MODE_RGB_565 = 6;
  892.             this.MODE_YUV = 7;
  893.             this.MODE_YUVA = 8;
  894.             this.MODE_LAST = 9;
  895.             this.WEBP_CSP_MODE = {
  896.                 MODE_RGB:0,
  897.                 MODE_RGBA:1,
  898.                 MODE_BGR:2,
  899.                 MODE_BGRA:3,
  900.                 MODE_ARGB:4,
  901.                 MODE_RGBA_4444:5,
  902.                 MODE_RGB_565:6,
  903.                 MODE_YUV:7,
  904.                 MODE_YUVA:8,
  905.                 MODE_LAST:9
  906.             };
  907.             this.WebPRGBABuffer = {
  908.                 rgba:this.uint8_t,
  909.                 rgba_off:0,
  910.                 stride:this.int_,
  911.                 size:this.int_
  912.             };
  913.             this.WebPYUVABuffer = {
  914.                 y:this.uint8_t,
  915.                 u:this.uint8_t,
  916.                 v:this.uint8_t,
  917.                 a:this.uint8_t,
  918.                 y_off:this.uint8_t,
  919.                 u_off:this.uint8_t,
  920.                 v_off:this.uint8_t,
  921.                 a_off:this.uint8_t,
  922.                 y_stride:this.int_,
  923.                 u_stride:this.int_,
  924.                 v_stride:this.int_,
  925.                 a_stride:this.int_,
  926.                 y_size:this.int_,
  927.                 u_size:this.int_,
  928.                 v_size:this.int_,
  929.                 a_size:this.int_
  930.             };
  931.             this.WebPDecBuffer = {
  932.                 colorspace:"WEBP_CSP_MODE",
  933.                 width:this.int_,
  934.                 height:this.int_,
  935.                 is_external_memory:this.int_,
  936.                 u:{
  937.                     RGBA:this.WebPRGBABuffer,
  938.                     YUVA:this.WebPYUVABuffer
  939.                 },
  940.                 private_memory:null,
  941.                 private_memory_off:this.uint8_t
  942.             };
  943.             this.VP8_STATUS_OK = 0;
  944.             this.VP8_STATUS_OUT_OF_MEMORY = 1;
  945.             this.VP8_STATUS_INVALID_PARAM = 2;
  946.             this.VP8_STATUS_BITSTREAM_ERROR = 3;
  947.             this.VP8_STATUS_UNSUPPORTED_FEATURE = 4;
  948.             this.VP8_STATUS_SUSPENDED = 5;
  949.             this.VP8_STATUS_USER_ABORT = 6;
  950.             this.VP8_STATUS_NOT_ENOUGH_DATA = 7;
  951.             this.VP8StatusCode = {
  952.                 VP8_STATUS_OK:0,
  953.                 VP8_STATUS_OUT_OF_MEMORY:1,
  954.                 VP8_STATUS_INVALID_PARAM:2,
  955.                 VP8_STATUS_BITSTREAM_ERROR:3,
  956.                 VP8_STATUS_UNSUPPORTED_FEATURE:4,
  957.                 VP8_STATUS_SUSPENDED:5,
  958.                 VP8_STATUS_USER_ABORT:6,
  959.                 VP8_STATUS_NOT_ENOUGH_DATA:7
  960.             };
  961.             this.WebPBitstreamFeatures = {
  962.                 width:{value:this.int_},
  963.                 height:{value:this.int_},
  964.                 has_alpha:{value:this.int_},
  965.                 no_incremental_decoding:this.int_,
  966.                 rotate:this.int_,
  967.                 uv_sampling:this.int_,
  968.                 bitstream_version:this.int_
  969.             };
  970.             this.WebPDecoderOptions = {
  971.                 bypass_filtering:this.int_,
  972.                 no_fancy_upsampling:this.int_,
  973.                 use_cropping:this.int_,
  974.                 crop_left:this.int_,
  975.                 crop_top:this.int_,
  976.                 crop_width:this.int_,
  977.                 crop_height:this.int_,
  978.                 use_scaling:this.int_,
  979.                 scaled_width:this.int_,
  980.                 scaled_height:this.int_,
  981.                 force_rotation:this.int_,
  982.                 no_enhancement:this.int_,
  983.                 use_threads:this.int_
  984.             };
  985.             this.WebPDecoderConfig = {
  986.                 input:this.newObjectIt(this.WebPBitstreamFeatures),
  987.                 output:this.newObjectIt(this.WebPDecBuffer),
  988.                 options:this.newObjectIt(this.WebPDecoderOptions)
  989.             };
  990.             this.VP8Io = {
  991.                 width:this.int_,
  992.                 height:this.int_,
  993.                 mb_y:this.int_,
  994.                 mb_w:this.int_,
  995.                 mb_h:this.int_,
  996.                 y:this.uint8_t,
  997.                 u:this.uint8_t,
  998.                 v:this.uint8_t,
  999.                 y_off:0,
  1000.                 u_off:0,
  1001.                 v_off:0,
  1002.                 y_stride:this.int_,
  1003.                 uv_stride:this.int_,
  1004.                 opaque:this.void_,
  1005.                 put:0,
  1006.                 setup:0,
  1007.                 teardown:0,
  1008.                 fancy_upsampling:this.int_,
  1009.                 data_size:this.uint32_t,
  1010.                 data:this.uint8_t,
  1011.                 data_off:0,
  1012.                 bypass_filtering:this.int_,
  1013.                 use_cropping:this.int_,
  1014.                 crop_left:this.int_,
  1015.                 crop_right:this.int_,
  1016.                 crop_top:this.int_,
  1017.                 crop_bottom:this.int_,
  1018.                 use_scaling:this.int_,
  1019.                 scaled_width:this.int_,
  1020.                 scaled_height:this.int_,
  1021.                 a:this.uint8_t,
  1022.                 a_off:0
  1023.             };
  1024.             this.WebPRescaler = {
  1025.                 x_expand:this.int_,
  1026.                 fy_scale:this.int_,
  1027.                 fx_scale:this.int_,
  1028.                 fxy_scale:this.int64_t,
  1029.                 y_accum:this.int_,
  1030.                 y_add:this.int_,
  1031.                 y_sub:this.int_,
  1032.                 x_add:this.int_,
  1033.                 x_sub:this.int_,
  1034.                 src_width:this.int_,
  1035.                 src_height:this.int_,
  1036.                 dst_width:this.int_,
  1037.                 dst_height:this.int_,
  1038.                 dst:this.uint8_t,
  1039.                 dst_off:0,
  1040.                 dst_stride:this.int_,
  1041.                 irow:this.int32_t,
  1042.                 irow_off:0,
  1043.                 frow:this.int32_t,
  1044.                 frow_off:0
  1045.             };
  1046.             this.WebPDecParams = {
  1047.                 output:this.newObjectIt(this.WebPDecBuffer),
  1048.                 tmp_y:this.uint8_t,
  1049.                 tmp_u:this.uint8_t,
  1050.                 tmp_v:this.uint8_t,
  1051.                 tmp_y_off:0,
  1052.                 tmp_u_off:0,
  1053.                 tmp_v_off:0,
  1054.                 last_y:this.int_,
  1055.                 options_:this.newObjectIt(this.WebPDecoderOptions),
  1056.                 scaler_y:this.newObjectIt(this.WebPRescaler),
  1057.                 scaler_u:this.newObjectIt(this.WebPRescaler),
  1058.                 scaler_v:this.newObjectIt(this.WebPRescaler),
  1059.                 scaler_a:this.newObjectIt(this.WebPRescaler),
  1060.                 memory:this.void_,
  1061.                 emit:"(OutputFunc)",
  1062.                 emit_alpha:"(OutputFunc)"
  1063.             };
  1064.             this.VP8BitReader = {
  1065.                 buf_:this.uint8_t,
  1066.                 buf_off:null,
  1067.                 buf_end_:this.uint8_t,
  1068.                 eof_:this.int_,
  1069.                 range_:this.uint32_t,
  1070.                 value_:this.uint32_t,
  1071.                 missing_:this.int_
  1072.             };
  1073.             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);
  1074.             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);
  1075.             this.DEC_MAJ_VERSION = 0;
  1076.             this.DEC_MIN_VERSION = 1;
  1077.             this.DEC_REV_VERSION = 2;
  1078.             this.B_DC_PRED = 0;
  1079.             this.B_TM_PRED = 1;
  1080.             this.B_VE_PRED = 2;
  1081.             this.B_HE_PRED = 3;
  1082.             this.B_RD_PRED = 4;
  1083.             this.B_VR_PRED = 5;
  1084.             this.B_LD_PRED = 6;
  1085.             this.B_VL_PRED = 7;
  1086.             this.B_HD_PRED = 8;
  1087.             this.B_HU_PRED = 9;
  1088.             this.NUM_BMODES = ((this.B_HU_PRED + 1) - this.B_DC_PRED);
  1089.             this.DC_PRED = this.B_DC_PRED;
  1090.             this.V_PRED = this.B_VE_PRED;
  1091.             this.H_PRED = this.B_HE_PRED;
  1092.             this.TM_PRED = this.B_TM_PRED;
  1093.             this.B_PRED = this.NUM_BMODES;
  1094.             this.B_DC_PRED_NOTOP = 4;
  1095.             this.B_DC_PRED_NOLEFT = 5;
  1096.             this.B_DC_PRED_NOTOPLEFT = 6;
  1097.             this.NUM_B_DC_MODES = 7;
  1098.             this.MB_FEATURE_TREE_PROBS = 3;
  1099.             this.NUM_MB_SEGMENTS = 4;
  1100.             this.NUM_REF_LF_DELTAS = 4;
  1101.             this.NUM_MODE_LF_DELTAS = 4;
  1102.             this.MAX_NUM_PARTITIONS = 8;
  1103.             this.NUM_TYPES = 4;
  1104.             this.NUM_BANDS = 8;
  1105.             this.NUM_CTX = 3;
  1106.             this.NUM_PROBAS = 11;
  1107.             this.NUM_MV_PROBAS = 19;
  1108.             this.BPS = 32;
  1109.             this.YUV_SIZE = ((this.BPS * 17) + (this.BPS * 9));
  1110.             this.Y_SIZE = (this.BPS * 17);
  1111.             this.Y_OFF = ((this.BPS * 1) + 8);
  1112.             this.U_OFF = ((this.Y_OFF + (this.BPS * 16)) + this.BPS);
  1113.             this.V_OFF = (this.U_OFF + 16);
  1114.             this.VP8FrameHeader = {
  1115.                 key_frame_:this.uint8_t,
  1116.                 profile_:this.uint8_t,
  1117.                 show_:this.uint8_t,
  1118.                 partition_length_:this.uint32_t
  1119.             };
  1120.             this.VP8PictureHeader = {
  1121.                 width_:this.uint16_t,
  1122.                 height_:this.uint16_t,
  1123.                 xscale_:this.uint8_t,
  1124.                 yscale_:this.uint8_t,
  1125.                 colorspace_:this.uint8_t,
  1126.                 clamp_type_:this.uint8_t
  1127.             };
  1128.             this.VP8SegmentHeader = {
  1129.                 use_segment_:this.int_,
  1130.                 update_map_:this.int_,
  1131.                 absolute_delta_:this.int_,
  1132.                 quantizer_:this.Arr(this.NUM_MB_SEGMENTS, this.int8_t),
  1133.                 filter_strength_:this.Arr(this.NUM_MB_SEGMENTS, this.int8_t)
  1134.             };
  1135.             this.VP8Proba = {
  1136.                 segments_:this.Arr(this.MB_FEATURE_TREE_PROBS, this.uint8_t),
  1137.                 coeffs_:this.ArrM(new Array(this.NUM_TYPES, this.NUM_BANDS, this.NUM_CTX, this.NUM_PROBAS), this.uint8_t)
  1138.             };
  1139.             this.VP8FilterHeader = {
  1140.                 simple_:this.int_,
  1141.                 level_:this.int_,
  1142.                 sharpness_:this.int_,
  1143.                 use_lf_delta_:this.int_,
  1144.                 ref_lf_delta_:this.Arr(this.NUM_REF_LF_DELTAS, this.int_),
  1145.                 mode_lf_delta_:this.Arr(this.NUM_REF_LF_DELTAS, this.int_)
  1146.             };
  1147.             this.VP8FInfo = {
  1148.                 f_level_:this.int_,
  1149.                 f_ilevel_:this.int_,
  1150.                 f_inner_:this.int_
  1151.             };
  1152.             this.VP8MB = {
  1153.                 nz_:this.int_,
  1154.                 dc_nz_:this.int_,
  1155.                 skip_:this.int_
  1156.             };
  1157.             this.VP8QuantMatrix = {
  1158.                 y1_mat_:this.Arr(2, this.uint16_t),
  1159.                 y2_mat_:this.Arr(2, this.uint16_t),
  1160.                 uv_mat_:this.Arr(2, this.uint16_t)
  1161.             };
  1162.             this.VP8ThreadContext = {
  1163.                 id_:this.int_,
  1164.                 mb_y_:this.int_,
  1165.                 filter_row_:this.int_,
  1166.                 f_info_:this.VP8FInfo,
  1167.                 io_:this.VP8Io
  1168.             };
  1169.             this.VP8Decoder = {
  1170.                 status_:"VP8StatusCode",
  1171.                 ready_:this.int_,
  1172.                 error_msg_:this.char,
  1173.                 br_:this.newObjectIt(this.VP8BitReader),
  1174.                 frm_hdr_:this.newObjectIt(this.VP8FrameHeader),
  1175.                 pic_hdr_:this.newObjectIt(this.VP8PictureHeader),
  1176.                 filter_hdr_:this.newObjectIt(this.VP8FilterHeader),
  1177.                 segment_hdr_:this.newObjectIt(this.VP8SegmentHeader),
  1178.                 worker_:"WebPWorker",
  1179.                 use_threads_:this.int_,
  1180.                 cache_id_:this.int_,
  1181.                 num_caches_:this.int_,
  1182.                 thread_ctx_:this.VP8ThreadContext,
  1183.                 mb_w_:this.int_,
  1184.                 mb_h_:this.int_,
  1185.                 tl_mb_x_:this.int_,
  1186.                 tl_mb_y_:this.int_,
  1187.                 br_mb_x_:this.int_,
  1188.                 br_mb_y_:this.int_,
  1189.                 num_parts_:this.int_,
  1190.                 parts_:this.Arr_nOI(this.MAX_NUM_PARTITIONS, this.VP8BitReader),
  1191.                 buffer_flags_:this.uint32_t,
  1192.                 dqm_:this.Arr_nOI(this.NUM_MB_SEGMENTS, this.VP8QuantMatrix),
  1193.                 proba_:this.newObjectIt(this.VP8Proba),
  1194.                 use_skip_proba_:this.int_,
  1195.                 skip_p_:this.uint8_t,
  1196.                 intra_t_:this.uint8_t,
  1197.                 intra_l_:this.Arr(4, this.uint8_t),
  1198.                 y_t_:this.uint8_t,
  1199.                 u_t_:this.uint8_t,
  1200.                 v_t_:this.uint8_t,
  1201.                 mb_info_:this.newObjectIt(this.VP8MB),
  1202.                 f_info_:this.newObjectIt(this.VP8FInfo),
  1203.                 yuv_b_:this.uint8_t,
  1204.                 coeffs_:this.int16_t,
  1205.                 cache_y_:this.uint8_t,
  1206.                 cache_u_:this.uint8_t,
  1207.                 cache_v_:this.uint8_t,
  1208.                 cache_y_off:this.int_,
  1209.                 cache_u_off:this.int_,
  1210.                 cache_v_off:this.int_,
  1211.                 cache_y_stride_:this.int_,
  1212.                 cache_uv_stride_:this.int_,
  1213.                 mem_:this.void_,
  1214.                 mem_size_:this.int_,
  1215.                 mb_x_:this.int_,
  1216.                 mb_y_:this.int_,
  1217.                 is_i4x4_:this.uint8_t,
  1218.                 imodes_:this.Arr(16, this.uint8_t),
  1219.                 imodes_offset_:0,
  1220.                 uvmode_:this.uint8_t,
  1221.                 segment_:this.uint8_t,
  1222.                 non_zero_:this.uint32_t,
  1223.                 non_zero_ac_:this.uint32_t,
  1224.                 filter_type_:this.int_,
  1225.                 filter_row_:this.int_,
  1226.                 filter_levels_:this.Arr(this.NUM_MB_SEGMENTS, this.uint8_t),
  1227.                 alpha_data_:this.uint8_t,
  1228.                 alpha_data_off:0,
  1229.                 alpha_data_size_:this.size_t,
  1230.                 alpha_plane_:this.uint8_t,
  1231.                 alpha_plane_off:0,
  1232.                 layer_colorspace_:this.int_,
  1233.                 layer_data_:this.uint8_t,
  1234.                 layer_data_off:0,
  1235.                 layer_data_size_:this.size_t
  1236.             };
  1237.             this.kModeBpp = new Array(3, 4, 3, 4, 4, 2, 2, 1, 1);
  1238.             this.WebPFreeDecBuffer = function (_arg1){
  1239.                 if (_arg1){
  1240.                     if (!_arg1.is_external_memory){
  1241.                         _arg1.private_memory = "";
  1242.                     };
  1243.                     _arg1.private_memory_off = 0;
  1244.                     _arg1.private_memory = (_arg1.private_memory_off = null);
  1245.                 };
  1246.             };
  1247.             this.abs0 = this.Arr(((0xFF + 0xFF) + 1), this.uint8_t);
  1248.             this.abs1 = this.Arr(((0xFF + 0xFF) + 1), this.uint8_t);
  1249.             this.sclip1 = this.Arr(((1020 + 1020) + 1), this.int8_t);
  1250.             this.sclip2 = this.Arr(((112 + 112) + 1), this.int8_t);
  1251.             this.clip1 = this.Arr(((0xFF + 510) + 1), this.uint8_t);
  1252.             this.tables_ok = 0;
  1253.             this.kC1 = (20091 + (1 << 16));
  1254.             this.kC2 = 35468;
  1255.             this.VP8PredLuma4 = new Array(function (_arg1, _arg2){
  1256.                 DC4(_arg1, _arg2);
  1257.             }, function (_arg1, _arg2){
  1258.                 TM4(_arg1, _arg2);
  1259.             }, function (_arg1, _arg2){
  1260.                 VE4(_arg1, _arg2);
  1261.             }, function (_arg1, _arg2){
  1262.                 HE4(_arg1, _arg2);
  1263.             }, function (_arg1, _arg2){
  1264.                 RD4(_arg1, _arg2);
  1265.             }, function (_arg1, _arg2){
  1266.                 VR4(_arg1, _arg2);
  1267.             }, function (_arg1, _arg2){
  1268.                 LD4(_arg1, _arg2);
  1269.             }, function (_arg1, _arg2){
  1270.                 VL4(_arg1, _arg2);
  1271.             }, function (_arg1, _arg2){
  1272.                 HD4(_arg1, _arg2);
  1273.             }, function (_arg1, _arg2){
  1274.                 HU4(_arg1, _arg2);
  1275.             });
  1276.             this.VP8PredLuma16 = new Array(function (_arg1, _arg2){
  1277.                 DC16(_arg1, _arg2);
  1278.             }, function (_arg1, _arg2){
  1279.                 TM16(_arg1, _arg2);
  1280.             }, function (_arg1, _arg2){
  1281.                 VE16(_arg1, _arg2);
  1282.             }, function (_arg1, _arg2){
  1283.                 HE16(_arg1, _arg2);
  1284.             }, function (_arg1, _arg2){
  1285.                 DC16NoTop(_arg1, _arg2);
  1286.             }, function (_arg1, _arg2){
  1287.                 DC16NoLeft(_arg1, _arg2);
  1288.             }, function (_arg1, _arg2){
  1289.                 DC16NoTopLeft(_arg1, _arg2);
  1290.             });
  1291.             this.VP8PredChroma8 = new Array(function (_arg1, _arg2){
  1292.                 DC8uv(_arg1, _arg2);
  1293.             }, function (_arg1, _arg2){
  1294.                 TM8uv(_arg1, _arg2);
  1295.             }, function (_arg1, _arg2){
  1296.                 VE8uv(_arg1, _arg2);
  1297.             }, function (_arg1, _arg2){
  1298.                 HE8uv(_arg1, _arg2);
  1299.             }, function (_arg1, _arg2){
  1300.                 DC8uvNoTop(_arg1, _arg2);
  1301.             }, function (_arg1, _arg2){
  1302.                 DC8uvNoLeft(_arg1, _arg2);
  1303.             }, function (_arg1, _arg2){
  1304.                 DC8uvNoTopLeft(_arg1, _arg2);
  1305.             });
  1306.             this.ALIGN_MASK = (32 - 1);
  1307.             this.MT_CACHE_LINES = 3;
  1308.             this.ST_CACHE_LINES = 1;
  1309.             this.kFilterExtraRows = new Array(0, 2, 8);
  1310.             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)));
  1311.             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);
  1312.             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);
  1313.             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));
  1314.             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))));
  1315.             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)));
  1316.             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))));
  1317.             this.RIFF_HEADER_SIZE = 12;
  1318.             this.VP8X_HEADER_SIZE = 20;
  1319.             this.WebPGetDecoderVersion = function (_arg1){
  1320.                 return ((((DEC_MAJ_VERSION << 16) | (DEC_MIN_VERSION << 8)) | DEC_REV_VERSION));
  1321.             };
  1322.             this.kBands = new Array(0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0);
  1323.             this.kCat3 = new Array(173, 148, 140, 0);
  1324.             this.kCat4 = new Array(176, 155, 140, 135, 0);
  1325.             this.kCat5 = new Array(180, 157, 141, 134, 130, 0);
  1326.             this.kCat6 = new Array(254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0);
  1327.             this.kCat3456 = new Array(this.kCat3, this.kCat4, this.kCat5, this.kCat6);
  1328.             this.kZigzag = new Array(0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15);
  1329.             this.ProbaArray = this.ArrM(new Array(this.NUM_CTX, this.NUM_PROBAS), "");
  1330.             this.PackedNz = {
  1331.                 i8:this.Arr(4, this.uint8_t),
  1332.                 i32:this.uint32_t
  1333.             };
  1334.             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));
  1335.             this.PACK_CST = 134480385;
  1336.             this.YUV_FIX = 16;
  1337.             this.YUV_RANGE_MIN = -227;
  1338.             this.YUV_RANGE_MAX = (0x0100 + 226);
  1339.             this.YUV_HALF = (1 << (this.YUV_FIX - 1));
  1340.             this.VP8kVToR = this.Arr(0x0100, this.int16_t);
  1341.             this.VP8kUToB = this.Arr(0x0100, this.int16_t);
  1342.             this.VP8kVToG = this.Arr(0x0100, this.int32_t);
  1343.             this.VP8kUToG = this.Arr(0x0100, this.int32_t);
  1344.             this.VP8kClip = this.Arr((this.YUV_RANGE_MAX - this.YUV_RANGE_MIN), this.uint8_t);
  1345.             this.VP8kClip4Bits = this.Arr((this.YUV_RANGE_MAX - this.YUV_RANGE_MIN), this.uint8_t);
  1346.             this.done = 0;
  1347.             this.WebPUpsamplers = new Array(this.MODE_LAST);
  1348.             this.WebPUpsamplersKeepAlpha = new Array(this.MODE_LAST);
  1349.             this.kSamplers = new Array(this.SampleRgbLinePair, this.SampleRgbaLinePair, this.SampleBgrLinePair, this.SampleBgraLinePair, this.SampleArgbLinePair, this.SampleRgba4444LinePair, this.SampleRgb565LinePair);
  1350.             this.kYUV444Converters = new Array(this.Yuv444ToRgb, this.Yuv444ToRgba, this.Yuv444ToBgr, this.Yuv444ToBgra, this.Yuv444ToArgb, this.Yuv444ToRgba4444, this.Yuv444ToRgb565);
  1351.             this.RFIX = 30;
  1352.             this.WebPDecodeRGB = function (_arg1, _arg2, _arg3, _arg4){
  1353.                 return (Decode(MODE_RGB, _arg1, _arg2, _arg3, _arg4, null));
  1354.             };
  1355.             this.WebPDecodeRGBA = function (_arg1, _arg2, _arg3, _arg4){
  1356.                 return (Decode(MODE_RGBA, _arg1, _arg2, _arg3, _arg4, null));
  1357.             };
  1358.             this.WebPDecodeRGBA_4444 = function (_arg1, _arg2, _arg3, _arg4){
  1359.                 return (Decode(MODE_RGBA_4444, _arg1, _arg2, _arg3, _arg4, null));
  1360.             };
  1361.             this.WebPDecodeARGB = function (_arg1, _arg2, _arg3, _arg4){
  1362.                 return (Decode(MODE_ARGB, _arg1, _arg2, _arg3, _arg4, null));
  1363.             };
  1364.             this.WebPDecodeBGR = function (_arg1, _arg2, _arg3, _arg4){
  1365.                 return (Decode(MODE_BGR, _arg1, _arg2, _arg3, _arg4, null));
  1366.             };
  1367.             this.WebPDecodeBGRA = function (_arg1, _arg2, _arg3, _arg4){
  1368.                 return (Decode(MODE_BGRA, _arg1, _arg2, _arg3, _arg4, null));
  1369.             };
  1370.             this.pic = new MovieClip();
  1371.             addChild(this.pic);
  1372.             stage.align = StageAlign.TOP_LEFT;
  1373.             stage.scaleMode = StageScaleMode.NO_SCALE;
  1374.             if (root.loaderInfo.parameters.url){
  1375.                 this.param = root.loaderInfo.parameters;
  1376.                 this.my_mode = this.param.mode;
  1377.                 this.my_id = this.param.id;
  1378.                 if (this.my_mode){
  1379.                     if (this.my_mode == "bg"){
  1380.                         this.my_bgRepeat = this.param.backgroundRepeat;
  1381.                         this.my_bgpos = this.param.backgroundPosition.replace("left", "0%").replace("right", "100%").replace("top", "0%").replace("bottom", "100%").replace("center", "50%").split(" ");
  1382.                     } else {
  1383.                         if (this.my_mode == "img"){
  1384.                             this.my_imgWidth = this.param.imgWidth;
  1385.                             this.my_imgHeight = this.param.imgHeight;
  1386.                             this.my_styleWidth = this.param.styleWidth;
  1387.                             this.my_styleHeight = this.param.styleHeight;
  1388.                         };
  1389.                     };
  1390.                 };
  1391.             };
  1392.             this.firstTime = true;
  1393.             if (root.loaderInfo.parameters.url){
  1394.                 this.loader = new URLLoader();
  1395.                 this.loader.dataFormat = URLLoaderDataFormat.BINARY;
  1396.                 this.my_url = root.loaderInfo.parameters.url;
  1397.                 if (this.my_url == null){
  1398.                     this.alert("#1: no valid url");
  1399.                 };
  1400.                 if (this.my_url.lastIndexOf("http:") != 0){
  1401.                     this.alert("#3: no valid url");
  1402.                 };
  1403.                 if (this.my_url.length <= 3){
  1404.                     this.alert("#4: no valid url");
  1405.                 };
  1406.                 if (((!((this.my_url.indexOf("../") == -1))) || (!((this.my_url.indexOf("./") == -1))))){
  1407.                     this.alert("#5: no valid url");
  1408.                 };
  1409.                 this.loader.load(new URLRequest(this.my_url));
  1410.                 this.loader.addEventListener(Event.COMPLETE, this.completeHandler);
  1411.                 this.loader.addEventListener(IOErrorEvent.IO_ERROR, this.ioErrorHandler);
  1412.                 this.loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.ioSecurityErrorHandler);
  1413.             };
  1414.             this.WebPImage = {
  1415.                 bitmap:{value:[0]},
  1416.                 width:{value:0},
  1417.                 height:{value:0}
  1418.             };
  1419.         }
  1420.         public function WebPGetFeaturesInternal(_arg1, _arg2, _arg3, _arg4){
  1421.             var _local5:*;
  1422.             if (_arg4 != this.WEBP_DECODER_ABI_VERSION){
  1423.                 return (this.VP8_STATUS_INVALID_PARAM);
  1424.             };
  1425.             if (_arg3 == null){
  1426.                 return (this.VP8_STATUS_INVALID_PARAM);
  1427.             };
  1428.             _local5 = {value:0};
  1429.             _arg2 = {value:_arg2};
  1430.             return (this.GetFeatures(_arg1, _local5, _arg2, _arg3));
  1431.         }
  1432.         public function WebPDecodeBGRAInto(_arg1, _arg2, _arg3, _arg4, _arg5){
  1433.             return (this.DecodeIntoRGBABuffer(this.MODE_BGRA, _arg1, _arg2, _arg3, _arg5, _arg4));
  1434.         }
  1435.         public function VP8XGetInfo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
  1436.             var _local8:*;
  1437.             if (((((!(_arg1)) || (!(_arg3)))) || (!(_arg4)))){
  1438.                 return (0);
  1439.             };
  1440.             if (_arg3.value >= this.VP8X_HEADER_SIZE){
  1441.                 if (!this.memcmp(_arg1, _arg2.value, "VP8X", 4)){
  1442.                     _local8 = this.get_le32(_arg1, (_arg2.value + 4));
  1443.                     _arg4.value = 1;
  1444.                     if (_local8.value != (this.VP8X_HEADER_SIZE - 8)){
  1445.                         return (0);
  1446.                     };
  1447.                     if (_arg7){
  1448.                         _arg7.value = this.get_le32(_arg1, (_arg2.value + 8));
  1449.                     };
  1450.                     if (_arg5){
  1451.                         _arg5.value = this.get_le32(_arg1, (_arg2.value + 12));
  1452.                     };
  1453.                     if (_arg6){
  1454.                         _arg6.value = this.get_le32(_arg1, (_arg2.value + 16));
  1455.                     };
  1456.                     _arg2.value = (_arg2.value + this.VP8X_HEADER_SIZE);
  1457.                     _arg3.value = (_arg3.value - this.VP8X_HEADER_SIZE);
  1458.                 } else {
  1459.                     _arg4.value = 0;
  1460.                 };
  1461.             } else {
  1462.                 _arg4.value = -1;
  1463.             };
  1464.             return (1);
  1465.         }
  1466.         public function WebPGetFeatures(_arg1, _arg2, _arg3){
  1467.             return (this.WebPGetFeaturesInternal(_arg1, _arg2, _arg3, this.WEBP_DECODER_ABI_VERSION));
  1468.         }
  1469.         public function SimpleVFilter16(_arg1, _arg2, _arg3, _arg4){
  1470.             var _local5:*;
  1471.             _local5 = 0;
  1472.             while (_local5 < 16) {
  1473.                 if (this.needs_filter(_arg1, (_arg2 + _local5), _arg3, _arg4)){
  1474.                     this.do_filter2(_arg1, (_arg2 + _local5), _arg3);
  1475.                 };
  1476.                 _local5++;
  1477.             };
  1478.         }
  1479.         public function VP8TransformWHT(_arg1, _arg2){
  1480.             this.TransformWHT(_arg1, _arg2);
  1481.         }
  1482.         public function LOAD_UV(_arg1, _arg2){
  1483.             return ((_arg1 | (_arg2 << 16)));
  1484.         }
  1485.         public function WebPDecode(_arg1, _arg2, _arg3){
  1486.             var _local4:*;
  1487.             var _local5:*;
  1488.             var _local6:*;
  1489.             _local4 = this.newObjectIt(this.WebPDecParams);
  1490.             _local5 = "VP8StatusCode";
  1491.             if (!_arg3){
  1492.                 return (this.VP8_STATUS_INVALID_PARAM);
  1493.             };
  1494.             _local6 = {value:0};
  1495.             _arg2 = {value:_arg2};
  1496.             _local5 = this.GetFeatures(_arg1, _local6, _arg2, _arg3.input);
  1497.             if (_local5 != this.VP8_STATUS_OK){
  1498.                 return (_local5);
  1499.             };
  1500.             this.WebPResetDecParams(_local4);
  1501.             _local4.output = _arg3.output;
  1502.             _local4.options_ = _arg3.options;
  1503.             _local5 = this.DecodeInto(_arg1, _local6.value, _arg2.value, _local4);
  1504.             return (_local5);
  1505.         }
  1506.         public function VP8YuvToBgra(_arg1, _arg2, _arg3, _arg4, _arg5){
  1507.             this.VP8YuvToBgr(_arg1, _arg2, _arg3, _arg4, _arg5);
  1508.             _arg4[(_arg5 + 3)] = 0xFF;
  1509.         }
  1510.         public function TransformDCUV(_arg1, _arg2, _arg3, _arg4){
  1511.             if (_arg1[(_arg2 + (0 * 16))]){
  1512.                 this.TransformDC(_arg1, (_arg2 + (0 * 16)), _arg3, (_arg4 + 0));
  1513.             };
  1514.             if (_arg1[(_arg2 + (1 * 16))]){
  1515.                 this.TransformDC(_arg1, (_arg2 + (1 * 16)), _arg3, (_arg4 + 4));
  1516.             };
  1517.             if (_arg1[(_arg2 + (2 * 16))]){
  1518.                 this.TransformDC(_arg1, (_arg2 + (2 * 16)), _arg3, (_arg4 + (4 * this.BPS)));
  1519.             };
  1520.             if (_arg1[(_arg2 + (3 * 16))]){
  1521.                 this.TransformDC(_arg1, (_arg2 + (3 * 16)), _arg3, ((_arg4 + (4 * this.BPS)) + 4));
  1522.             };
  1523.         }
  1524.         public function WebPCopyDecBuffer(_arg1, _arg2){
  1525.             this.alert("todo: WebPCopyDecBuffer");
  1526.         }
  1527.         public function VP8YuvToRgba(_arg1, _arg2, _arg3, _arg4, _arg5){
  1528.             this.VP8YuvToRgb(_arg1, _arg2, _arg3, _arg4, _arg5);
  1529.             _arg4[(_arg5 + 3)] = 0xFF;
  1530.         }
  1531.         public function VP8InitIo(_arg1){
  1532.             return (this.VP8InitIoInternal(_arg1, this.WEBP_DECODER_ABI_VERSION));
  1533.         }
  1534.         public function VFilter16i(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
  1535.             var _local7:*;
  1536.             _local7 = 3;
  1537.             while (_local7 > 0) {
  1538.                 _arg2 = (_arg2 + (4 * _arg3));
  1539.                 this.FilterLoop24(_arg1, (_arg2 + 0), _arg3, 1, 16, _arg4, _arg5, _arg6);
  1540.                 _local7--;
  1541.             };
  1542.         }
  1543.         public function SampleRgbLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
  1544.             this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToRgb, 3);
  1545.         }
  1546.         public function WebPDecodeRGBInto(_arg1, _arg2, _arg3, _arg4, _arg5){
  1547.             return (this.DecodeIntoRGBABuffer(this.MODE_RGB, _arg1, _arg2, _arg3, _arg5, _arg4));
  1548.         }
  1549.         public function SampleArgbLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
  1550.             this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToArgb, 4);
  1551.         }
  1552.         public function HU4(_arg1, _arg2){
  1553.             var _local3:* = _arg1[((_arg2 - 1) + (0 * this.BPS))];
  1554.             var _local4:* = _arg1[((_arg2 - 1) + (1 * this.BPS))];
  1555.             var _local5:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
  1556.             var _local6:* = _arg1[((_arg2 - 1) + (3 * this.BPS))];
  1557.             _arg1[((_arg2 + 0) + (0 * this.BPS))] = this.AVG2(_local3, _local4);
  1558.             _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 0) + (1 * this.BPS))] = this.AVG2(_local4, _local5));
  1559.             _arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 0) + (2 * this.BPS))] = this.AVG2(_local5, _local6));
  1560.             _arg1[((_arg2 + 1) + (0 * this.BPS))] = this.AVG3(_local3, _local4, _local5);
  1561.             _arg1[((_arg2 + 3) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (1 * this.BPS))] = this.AVG3(_local4, _local5, _local6));
  1562.             _arg1[((_arg2 + 3) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = this.AVG3(_local5, _local6, _local6));
  1563.             _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)))));
  1564.         }
  1565.         public function SampleBgrLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
  1566.             this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToBgr, 3);
  1567.         }
  1568.         public function write32BitIn4Bytes(_arg1, _arg2, _arg3){
  1569.             var _local4:int;
  1570.             _local4 = 3;
  1571.             while (_local4 >= 0) {
  1572.                 _arg1[(_arg2 + (3 - _local4))] = ((_arg3 >> (8 * _local4)) & 0xFF);
  1573.                 _local4--;
  1574.             };
  1575.         }
  1576.         public function VP8ReconstructBlock(_arg1){
  1577.             var _local15:*;
  1578.             var _local16:*;
  1579.             var _local17:*;
  1580.             var _local18:int;
  1581.             var _local19:*;
  1582.             var _local20:*;
  1583.             var _local21:int;
  1584.             var _local22:*;
  1585.             var _local23:*;
  1586.             var _local24:*;
  1587.             var _local25:*;
  1588.             var _local26:*;
  1589.             var _local2:* = _arg1.yuv_b_;
  1590.             var _local3:* = this.Y_OFF;
  1591.             var _local4:* = _arg1.yuv_b_;
  1592.             var _local5:* = this.U_OFF;
  1593.             var _local6:* = _arg1.yuv_b_;
  1594.             var _local7:* = this.V_OFF;
  1595.             if (_arg1.mb_x_ > 0){
  1596.                 _local17 = -1;
  1597.                 while (_local17 < 16) {
  1598.                     this.Copy32b(_local2, ((_local3 + (_local17 * this.BPS)) - 4), _local2, ((_local3 + (_local17 * this.BPS)) + 12));
  1599.                     _local17++;
  1600.                 };
  1601.                 _local17 = -1;
  1602.                 while (_local17 < 8) {
  1603.                     this.Copy32b(_local4, ((_local5 + (_local17 * this.BPS)) - 4), _local4, ((_local5 + (_local17 * this.BPS)) + 4));
  1604.                     this.Copy32b(_local6, ((_local7 + (_local17 * this.BPS)) - 4), _local6, ((_local7 + (_local17 * this.BPS)) + 4));
  1605.                     _local17++;
  1606.                 };
  1607.             } else {
  1608.                 _local17 = 0;
  1609.                 while (_local17 < 16) {
  1610.                     _local2[((_local3 + (_local17 * this.BPS)) - 1)] = 129;
  1611.                     _local17++;
  1612.                 };
  1613.                 _local17 = 0;
  1614.                 while (_local17 < 8) {
  1615.                     _local4[((_local5 + (_local17 * this.BPS)) - 1)] = 129;
  1616.                     _local6[((_local7 + (_local17 * this.BPS)) - 1)] = 129;
  1617.                     _local17++;
  1618.                 };
  1619.                 if (_arg1.mb_y_ > 0){
  1620.                     _local2[((_local3 - 1) - this.BPS)] = (_local4[((_local5 - 1) - this.BPS)] = (_local6[((_local7 - 1) - this.BPS)] = 129));
  1621.                 };
  1622.             };
  1623.             var _local8:* = _arg1.y_t_;
  1624.             var _local9:* = (_arg1.mb_x_ * 16);
  1625.             var _local10:* = _arg1.u_t_;
  1626.             var _local11:* = (_arg1.mb_x_ * 8);
  1627.             var _local12:* = _arg1.v_t_;
  1628.             var _local13:* = (_arg1.mb_x_ * 8);
  1629.             var _local14:* = _arg1.coeffs_;
  1630.             if (_arg1.mb_y_ > 0){
  1631.                 this.memcpy(_local2, (_local3 - this.BPS), _local8, _local9, 16);
  1632.                 this.memcpy(_local4, (_local5 - this.BPS), _local10, _local11, 8);
  1633.                 this.memcpy(_local6, (_local7 - this.BPS), _local12, _local13, 8);
  1634.             } else {
  1635.                 if (_arg1.mb_x_ == 0){
  1636.                     _local18 = 0;
  1637.                     while (_local18 < ((16 + 4) + 1)) {
  1638.                         _local2[(((_local3 - this.BPS) - 1) + _local18)] = 127;
  1639.                         _local18++;
  1640.                     };
  1641.                     _local18 = 0;
  1642.                     while (_local18 < (8 + 1)) {
  1643.                         _local4[(((_local5 - this.BPS) - 1) + _local18)] = 127;
  1644.                         _local18++;
  1645.                     };
  1646.                     _local18 = 0;
  1647.                     while (_local18 < (8 + 1)) {
  1648.                         _local6[(((_local7 - this.BPS) - 1) + _local18)] = 127;
  1649.                         _local18++;
  1650.                     };
  1651.                 };
  1652.             };
  1653.             if (_arg1.is_i4x4_){
  1654.                 _local19 = _local2;
  1655.                 _local20 = ((_local3 - this.BPS) + 16);
  1656.                 if (_arg1.mb_y_ > 0){
  1657.                     if (_arg1.mb_x_ >= (_arg1.mb_w_ - 1)){
  1658.                         _local19[(_local20 + 0)] = (_local19[(_local20 + 1)] = (_local19[(_local20 + 2)] = (_local19[(_local20 + 3)] = _local8[(_local9 + 15)])));
  1659.                     } else {
  1660.                         this.memcpy(_local19, (_local20 + 0), _local8, (_local9 + 16), 4);
  1661.                     };
  1662.                 };
  1663.                 _local21 = 0;
  1664.                 while (_local21 < 4) {
  1665.                     _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))])));
  1666.                     _local21++;
  1667.                 };
  1668.                 _local15 = 0;
  1669.                 while (_local15 < 16) {
  1670.                     _local22 = _local2;
  1671.                     _local23 = (_local3 + this.kScan[_local15]);
  1672.                     var _local27 = this.VP8PredLuma4;
  1673.                     _local27[_arg1.imodes_[_local15]](_local22, _local23);
  1674.                     if ((_arg1.non_zero_ac_ & (1 << _local15))){
  1675.                         this.VP8Transform(_local14, (_local15 * 16), _local22, _local23, 0);
  1676.                     } else {
  1677.                         if ((_arg1.non_zero_ & (1 << _local15))){
  1678.                             this.VP8TransformDC(_local14, (_local15 * 16), _local22, _local23);
  1679.                         };
  1680.                     };
  1681.                     _local15++;
  1682.                 };
  1683.             } else {
  1684.                 _local16 = this.CheckMode(_arg1, _arg1.imodes_[0]);
  1685.                 _local27 = this.VP8PredLuma16;
  1686.                 _local27[_local16](_local2, _local3);
  1687.                 if (_arg1.non_zero_){
  1688.                     _local15 = 0;
  1689.                     while (_local15 < 16) {
  1690.                         _local22 = _local2;
  1691.                         _local23 = (_local3 + this.kScan[_local15]);
  1692.                         if ((_arg1.non_zero_ac_ & (1 << _local15))){
  1693.                             this.VP8Transform(_local14, (_local15 * 16), _local22, _local23, 0);
  1694.                         } else {
  1695.                             if ((_arg1.non_zero_ & (1 << _local15))){
  1696.                                 this.VP8TransformDC(_local14, (_local15 * 16), _local22, _local23);
  1697.                             };
  1698.                         };
  1699.                         _local15++;
  1700.                     };
  1701.                 };
  1702.             };
  1703.             _local16 = this.CheckMode(_arg1, _arg1.uvmode_);
  1704.             _local27 = this.VP8PredChroma8;
  1705.             _local27[_local16](_local4, _local5);
  1706.             _local27 = this.VP8PredChroma8;
  1707.             _local27[_local16](_local6, _local7);
  1708.             if ((_arg1.non_zero_ & 983040)){
  1709.                 _local24 = _arg1.coeffs_;
  1710.                 _local25 = (16 * 16);
  1711.                 if ((_arg1.non_zero_ac_ & 983040)){
  1712.                     this.VP8TransformUV(_local24, _local25, _local4, _local5);
  1713.                 } else {
  1714.                     this.VP8TransformDCUV(_local24, _local25, _local4, _local5);
  1715.                 };
  1716.             };
  1717.             if ((_arg1.non_zero_ & 0xF00000)){
  1718.                 _local26 = _arg1.coeffs_;
  1719.                 _local25 = (20 * 16);
  1720.                 if ((_arg1.non_zero_ac_ & 0xF00000)){
  1721.                     this.VP8TransformUV(_local26, _local25, _local6, _local7);
  1722.                 } else {
  1723.                     this.VP8TransformDCUV(_local26, _local25, _local6, _local7);
  1724.                 };
  1725.             };
  1726.             if (_arg1.mb_y_ < (_arg1.mb_h_ - 1)){
  1727.                 this.memcpy(_local8, _local9, _local2, (_local3 + (15 * this.BPS)), 16);
  1728.                 this.memcpy(_local10, _local11, _local4, (_local5 + (7 * this.BPS)), 8);
  1729.                 this.memcpy(_local12, _local13, _local6, (_local7 + (7 * this.BPS)), 8);
  1730.             };
  1731.         }
  1732.         public function TransformWHT(_arg1, _arg2){
  1733.             var _local5:*;
  1734.             var _local6:*;
  1735.             var _local7:*;
  1736.             var _local8:*;
  1737.             var _local9:*;
  1738.             var _local10:*;
  1739.             var _local3:* = this.Arr(16, this.int_);
  1740.             var _local4:* = this.int_;
  1741.             _local4 = 0;
  1742.             while (_local4 < 4) {
  1743.                 _local5 = (_arg1[(0 + _local4)] + _arg1[(12 + _local4)]);
  1744.                 _local6 = (_arg1[(4 + _local4)] + _arg1[(8 + _local4)]);
  1745.                 _local7 = (_arg1[(4 + _local4)] - _arg1[(8 + _local4)]);
  1746.                 _local8 = (_arg1[(0 + _local4)] - _arg1[(12 + _local4)]);
  1747.                 _local3[(0 + _local4)] = (_local5 + _local6);
  1748.                 _local3[(8 + _local4)] = (_local5 - _local6);
  1749.                 _local3[(4 + _local4)] = (_local8 + _local7);
  1750.                 _local3[(12 + _local4)] = (_local8 - _local7);
  1751.                 _local4++;
  1752.             };
  1753.             _local4 = 0;
  1754.             while (_local4 < 4) {
  1755.                 _local9 = _arg2[(_arg2.length - 1)];
  1756.                 _local10 = (_local3[(0 + (_local4 * 4))] + 3);
  1757.                 _local5 = (_local10 + _local3[(3 + (_local4 * 4))]);
  1758.                 _local6 = (_local3[(1 + (_local4 * 4))] + _local3[(2 + (_local4 * 4))]);
  1759.                 _local7 = (_local3[(1 + (_local4 * 4))] - _local3[(2 + (_local4 * 4))]);
  1760.                 _local8 = (_local10 - _local3[(3 + (_local4 * 4))]);
  1761.                 _arg2[(_local9 + 0)] = ((_local5 + _local6) >> 3);
  1762.                 _arg2[(_local9 + 16)] = ((_local8 + _local7) >> 3);
  1763.                 _arg2[(_local9 + 32)] = ((_local5 - _local6) >> 3);
  1764.                 _arg2[(_local9 + 48)] = ((_local8 - _local7) >> 3);
  1765.                 _arg2[(_arg2.length - 1)] = (_arg2[(_arg2.length - 1)] + 64);
  1766.                 _local4++;
  1767.             };
  1768.         }
  1769.         public function TransformDC(_arg1, _arg2, _arg3, _arg4){
  1770.             var _local6:*;
  1771.             var _local7:*;
  1772.             var _local8:*;
  1773.             var _local5:* = (_arg1[(_arg2 + 0)] + 4);
  1774.             _local7 = 0;
  1775.             while (_local7 < 4) {
  1776.                 _local6 = 0;
  1777.                 while (_local6 < 4) {
  1778.                     _local8 = _arg3[((_arg4 + _local6) + (_local7 * this.BPS))];
  1779.                     _arg3[((_arg4 + _local6) + (_local7 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + _local6) + (_local7 * this.BPS))] + (_local5 >> 3)));
  1780.                     _local6++;
  1781.                 };
  1782.                 _local7++;
  1783.             };
  1784.         }
  1785.         public function get_le32(_arg1, _arg2){
  1786.             return ((((_arg1[(_arg2 + 0)] | (_arg1[(_arg2 + 1)] << 8)) | (_arg1[(_arg2 + 2)] << 16)) | (_arg1[(_arg2 + 3)] << 24)));
  1787.         }
  1788.         public function VP8InitBitReader(_arg1, _arg2, _arg3, _arg4){
  1789.             this.assert(_arg1);
  1790.             this.assert(_arg2);
  1791.             this.assert(_arg4);
  1792.             _arg1.range_ = (0xFF - 1);
  1793.             _arg1.buf_ = _arg2;
  1794.             _arg1.buf_off = _arg3;
  1795.             _arg1.buf_end_ = _arg4;
  1796.             _arg1.value_ = 0;
  1797.             _arg1.missing_ = 8;
  1798.             _arg1.eof_ = 0;
  1799.         }
  1800.         public function FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15){
  1801.             var _local16:*;
  1802.             _local16 = 0;
  1803.             while (_local16 < (_arg13 - 1)) {
  1804.                 _arg14(_arg1[(_arg2 + 0)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg9, _arg10);
  1805.                 _arg14(_arg1[(_arg2 + 1)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg9, (_arg10 + _arg15));
  1806.                 _arg14(_arg3[(_arg4 + 0)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg11, _arg12);
  1807.                 _arg14(_arg3[(_arg4 + 1)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg11, (_arg12 + _arg15));
  1808.                 _arg2 = (_arg2 + 2);
  1809.                 _arg4 = (_arg4 + 2);
  1810.                 _arg6++;
  1811.                 _arg8++;
  1812.                 _arg10 = (_arg10 + (2 * _arg15));
  1813.                 _arg12 = (_arg12 + (2 * _arg15));
  1814.                 _local16 = (_local16 + 2);
  1815.             };
  1816.             if (_local16 == (_arg13 - 1)){
  1817.                 _arg14(_arg1[(_arg2 + 0)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg9, _arg10);
  1818.                 _arg14(_arg3[(_arg4 + 0)], _arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)], _arg11, _arg12);
  1819.             };
  1820.         }
  1821.         public function WebPDecodeBGRInto(_arg1, _arg2, _arg3, _arg4, _arg5){
  1822.             return (this.DecodeIntoRGBABuffer(this.MODE_BGR, _arg1, _arg2, _arg3, _arg5, _arg4));
  1823.         }
  1824.         public function TM4(_arg1, _arg2){
  1825.             this.TrueMotion(_arg1, _arg2, 4);
  1826.         }
  1827.         public function InitThreadContext(_arg1){
  1828.             var _local2:*;
  1829.             _arg1.cache_id_ = 0;
  1830.             if (_arg1.use_threads_){
  1831.                 _local2 = _arg1.worker_;
  1832.                 _local2.data1 = _arg1;
  1833.                 _local2.data2 = _arg1.thread_ctx_.io_;
  1834.                 _local2.hook = this.VP8FinishRow;
  1835.                 _arg1.num_caches_ = ((_arg1.filter_type_)>0) ? this.MT_CACHE_LINES : (this.MT_CACHE_LINES - 1);
  1836.             } else {
  1837.                 _arg1.num_caches_ = this.ST_CACHE_LINES;
  1838.             };
  1839.             return (1);
  1840.         }
  1841.         public function CustomTeardown(_arg1){
  1842.             var _local2:*;
  1843.             _local2 = _arg1.opaque;
  1844.             _local2.memory = "";
  1845.             _local2.memory = null;
  1846.         }
  1847.         public function Yuv444ToRgb565(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
  1848.             this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToRgb565, 2);
  1849.         }
  1850.         public function HFilter16i(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
  1851.             var _local7:*;
  1852.             _local7 = 3;
  1853.             while (_local7 > 0) {
  1854.                 _arg2 = (_arg2 + 4);
  1855.                 this.FilterLoop24(_arg1, (_arg2 + 0), 1, _arg3, 16, _arg4, _arg5, _arg6);
  1856.                 _local7--;
  1857.             };
  1858.         }
  1859.         public function VE16(_arg1, _arg2){
  1860.             var _local3:*;
  1861.             _local3 = 0;
  1862.             while (_local3 < 16) {
  1863.                 this.memcpy(_arg1, (_arg2 + (_local3 * this.BPS)), _arg1, (_arg2 - this.BPS), 16);
  1864.                 _local3++;
  1865.             };
  1866.         }
  1867.         public function VP8InitScanline(_arg1){
  1868.             var _local2:* = _arg1.mb_info_[(1 - 1)];
  1869.             _local2.nz_ = 0;
  1870.             _local2.dc_nz_ = 0;
  1871.             this.memset_(_arg1.intra_l_, 0, this.B_DC_PRED, _arg1.intra_l_.length);
  1872.             _arg1.filter_row_ = ((((((_arg1.filter_type_ > 0)) && ((_arg1.mb_y_ >= _arg1.tl_mb_y_)))) && ((_arg1.mb_y_ <= _arg1.br_mb_y_))) + 0);
  1873.         }
  1874.         public function VP8BitUpdate(_arg1, _arg2){
  1875.             var _local3:* = this.uint32_t;
  1876.             var _local4:* = ((_arg2 + 1) << 8);
  1877.             if (_arg1.missing_ > 0){
  1878.                 _arg1.value_ = (_arg1.value_ | (this.VP8GetByte(_arg1) << _arg1.missing_));
  1879.                 _arg1.missing_ = (_arg1.missing_ - 8);
  1880.             };
  1881.             _local3 = ((_arg1.value_ >= _local4) + 0);
  1882.             if (_local3){
  1883.                 _arg1.range_ = (_arg1.range_ - (_arg2 + 1));
  1884.                 _arg1.value_ = (_arg1.value_ - _local4);
  1885.             } else {
  1886.                 _arg1.range_ = _arg2;
  1887.             };
  1888.             return (_local3);
  1889.         }
  1890.         public function VR4(_arg1, _arg2){
  1891.             var _local3:* = _arg1[((_arg2 - 1) + (0 * this.BPS))];
  1892.             var _local4:* = _arg1[((_arg2 - 1) + (1 * this.BPS))];
  1893.             var _local5:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
  1894.             var _local6:* = _arg1[((_arg2 - 1) - this.BPS)];
  1895.             var _local7:* = _arg1[((_arg2 + 0) - this.BPS)];
  1896.             var _local8:* = _arg1[((_arg2 + 1) - this.BPS)];
  1897.             var _local9:* = _arg1[((_arg2 + 2) - this.BPS)];
  1898.             var _local10:* = _arg1[((_arg2 + 3) - this.BPS)];
  1899.             _arg1[((_arg2 + 0) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (2 * this.BPS))] = this.AVG2(_local6, _local7));
  1900.             _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = this.AVG2(_local7, _local8));
  1901.             _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 3) + (2 * this.BPS))] = this.AVG2(_local8, _local9));
  1902.             _arg1[((_arg2 + 3) + (0 * this.BPS))] = this.AVG2(_local9, _local10);
  1903.             _arg1[((_arg2 + 0) + (3 * this.BPS))] = this.AVG3(_local5, _local4, _local3);
  1904.             _arg1[((_arg2 + 0) + (2 * this.BPS))] = this.AVG3(_local4, _local3, _local6);
  1905.             _arg1[((_arg2 + 0) + (1 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local3, _local6, _local7));
  1906.             _arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG3(_local6, _local7, _local8));
  1907.             _arg1[((_arg2 + 2) + (1 * this.BPS))] = (_arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local7, _local8, _local9));
  1908.             _arg1[((_arg2 + 3) + (1 * this.BPS))] = this.AVG3(_local8, _local9, _local10);
  1909.         }
  1910.         public function HFilter8i(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
  1911.             this.FilterLoop24(_arg1, (_arg2 + 4), 1, _arg5, 8, _arg6, _arg7, _arg8);
  1912.             this.FilterLoop24(_arg3, (_arg4 + 4), 1, _arg5, 8, _arg6, _arg7, _arg8);
  1913.         }
  1914.         public function InitRGBRescaler(_arg1, _arg2){
  1915.             var _local3:*;
  1916.             var _local4:*;
  1917.             var _local5:*;
  1918.             var _local6:*;
  1919.             var _local7:*;
  1920.             var _local8:*;
  1921.             var _local9:*;
  1922.             var _local10:*;
  1923.             var _local11:*;
  1924.             var _local12:*;
  1925.             var _local13:*;
  1926.             var _local14:*;
  1927.             _local3 = this.IsAlphaMode(_arg2.output.colorspace);
  1928.             _local4 = _arg1.scaled_width;
  1929.             _local5 = _arg1.scaled_height;
  1930.             _local6 = ((_arg1.mb_w + 1) >> 1);
  1931.             _local7 = ((_arg1.mb_h + 1) >> 1);
  1932.             _local8 = (2 * _local4);
  1933.             _local9 = this.int32_t;
  1934.             _local10 = 0;
  1935.             _local11 = this.uint8_t;
  1936.             _local12 = 0;
  1937.             _local13 = this.size_t;
  1938.             _local14 = this.size_t;
  1939.             _local13 = (3 * _local8);
  1940.             _local14 = (3 * _local4);
  1941.             if (_local3){
  1942.                 _local13 = (_local13 + _local8);
  1943.                 _local14 = (_local14 + _local4);
  1944.             };
  1945.             _arg2.memory = this.malloc((((_local13 * this.sizeof(_local9)) * 4) + ((_local14 * this.sizeof(_local11)) * 1)), 0);
  1946.             _arg2.memory_off = 0;
  1947.             if (_arg2.memory == null){
  1948.                 this.alert("memory error");
  1949.                 return (0);
  1950.             };
  1951.             _local9 = _arg2.memory;
  1952.             _local10 = _arg2.memory_off;
  1953.             _local11 = _local9;
  1954.             _local12 = (_local10 + (_local13 * 1));
  1955.             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)));
  1956.             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)));
  1957.             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)));
  1958.             _arg2.emit = this.EmitRescaledRGB;
  1959.             if (_local3){
  1960.                 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)));
  1961.                 _arg2.emit_alpha = this.EmitRescaledAlphaRGB;
  1962.             };
  1963.             return (1);
  1964.         }
  1965.         public function VP8FinishRow(_arg1, _arg2){
  1966.             var _local20:*;
  1967.             var _local3:* = 1;
  1968.             var _local4:* = _arg1.thread_ctx_;
  1969.             var _local5:* = this.kFilterExtraRows[_arg1.filter_type_];
  1970.             var _local6:* = (_local5 * _arg1.cache_y_stride_);
  1971.             var _local7:* = (parseInt(String((_local5 / 2))) * _arg1.cache_uv_stride_);
  1972.             var _local8:* = ((_local4.id_ * 16) * _arg1.cache_y_stride_);
  1973.             var _local9:* = ((_local4.id_ * 8) * _arg1.cache_uv_stride_);
  1974.             var _local10:* = _arg1.cache_y_;
  1975.             var _local11:* = ((_arg1.cache_y_off - _local6) + _local8);
  1976.             var _local12:* = _arg1.cache_u_;
  1977.             var _local13:* = ((_arg1.cache_u_off - _local7) + _local9);
  1978.             var _local14:* = _arg1.cache_v_;
  1979.             var _local15:* = ((_arg1.cache_v_off - _local7) + _local9);
  1980.             var _local16:* = (_local4.mb_y_ == 0);
  1981.             var _local17:* = ((_local4.mb_y_ >= (_arg1.mb_h_ - 1)) + 0);
  1982.             var _local18:* = this.MACROBLOCK_VPOS(_local4.mb_y_);
  1983.             var _local19:* = this.MACROBLOCK_VPOS((_local4.mb_y_ + 1));
  1984.             if (_local4.filter_row_){
  1985.                 this.FilterRow(_arg1);
  1986.             };
  1987.             if (_arg2.put){
  1988.                 if (!_local16){
  1989.                     _local18 = (_local18 - _local5);
  1990.                     _arg2.y = _local10;
  1991.                     _arg2.y_off = _local11;
  1992.                     _arg2.u = _local12;
  1993.                     _arg2.u_off = _local13;
  1994.                     _arg2.v = _local14;
  1995.                     _arg2.v_off = _local15;
  1996.                 } else {
  1997.                     _arg2.y = _arg1.cache_y_;
  1998.                     _arg2.y_off = (_arg1.cache_y_off + _local8);
  1999.                     _arg2.u = _arg1.cache_u_;
  2000.                     _arg2.u_off = (_arg1.cache_u_off + _local9);
  2001.                     _arg2.v = _arg1.cache_v_;
  2002.                     _arg2.v_off = (_arg1.cache_v_off + _local9);
  2003.                 };
  2004.                 if (!_local17){
  2005.                     _local19 = (_local19 - _local5);
  2006.                 };
  2007.                 if (_local19 > _arg2.crop_bottom){
  2008.                     _local19 = _arg2.crop_bottom;
  2009.                 };
  2010.                 if (_arg1.alpha_data_){
  2011.                     if (_local18 == 0){
  2012.                         _arg2.a = this.VP8DecompressAlphaRows(_arg1, _local18, (_local19 - _local18));
  2013.                         _arg2.a_off = 0;
  2014.                     } else {
  2015.                         _arg2.a_off = this.VP8DecompressAlphaRows(_arg1, _local18, (_local19 - _local18));
  2016.                     };
  2017.                     if (_arg2.a == null){
  2018.                         return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "Could not decode alpha data."));
  2019.                     };
  2020.                 };
  2021.                 if (_local18 < _arg2.crop_top){
  2022.                     _local20 = (_arg2.crop_top - _local18);
  2023.                     _local18 = _arg2.crop_top;
  2024.                     this.assert(!((_local20 & 1)));
  2025.                     _arg2.y_off = (_arg2.y_off + (_arg1.cache_y_stride_ * _local20));
  2026.                     _arg2.u_off = (_arg2.u_off + (_arg1.cache_uv_stride_ * (_local20 >> 1)));
  2027.                     _arg2.v_off = (_arg2.v_off + (_arg1.cache_uv_stride_ * (_local20 >> 1)));
  2028.                     if (_arg2.a){
  2029.                         _arg2.a_off = (_arg2.a_off + (_arg2.width * _local20));
  2030.                     };
  2031.                 };
  2032.                 if (_local18 < _local19){
  2033.                     _arg2.y_off = (_arg2.y_off + _arg2.crop_left);
  2034.                     _arg2.u_off = (_arg2.u_off + (_arg2.crop_left >> 1));
  2035.                     _arg2.v_off = (_arg2.v_off + (_arg2.crop_left >> 1));
  2036.                     if (_arg2.a){
  2037.                         _arg2.a_off = (_arg2.a_off + _arg2.crop_left);
  2038.                     };
  2039.                     _arg2.mb_y = (_local18 - _arg2.crop_top);
  2040.                     _arg2.mb_w = (_arg2.crop_right - _arg2.crop_left);
  2041.                     _arg2.mb_h = (_local19 - _local18);
  2042.                     _local3 = _arg2.put(_arg2);
  2043.                 };
  2044.             };
  2045.             if ((_local4.id_ + 1) == _arg1.num_caches_){
  2046.                 if (!_local17){
  2047.                     this.memcpy(_arg1.cache_y_, (_arg1.cache_y_off - _local6), _local10, (_local11 + (16 * _arg1.cache_y_stride_)), _local6);
  2048.                     this.memcpy(_arg1.cache_u_, (_arg1.cache_u_off - _local7), _local12, (_local13 + (8 * _arg1.cache_uv_stride_)), _local7);
  2049.                     this.memcpy(_arg1.cache_v_, (_arg1.cache_v_off - _local7), _local14, (_local15 + (8 * _arg1.cache_uv_stride_)), _local7);
  2050.                 };
  2051.             };
  2052.             return (_local3);
  2053.         }
  2054.         public function SampleRgbaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
  2055.             this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToRgba, 4);
  2056.         }
  2057.         public function SampleBgraLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
  2058.             this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToBgra, 4);
  2059.         }
  2060.         public function WebPInitDecoderConfig(_arg1){
  2061.             return (this.WebPInitDecoderConfigInternal(_arg1, this.WEBP_DECODER_ABI_VERSION));
  2062.         }
  2063.         public function MULT(_arg1, _arg2){
  2064.             return ((((_arg1 * _arg2) + (1 << (this.RFIX - 1))) >> this.RFIX));
  2065.         }
  2066.         public function Yuv444ToArgb(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
  2067.             this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToArgb, 4);
  2068.         }
  2069.         public function stageResize(_arg1:Event=null):void{
  2070.             this.WebPChange();
  2071.         }
  2072.         public function Put16(_arg1, _arg2, _arg3){
  2073.             var _local4:*;
  2074.             var _local5:*;
  2075.             _local4 = 0;
  2076.             while (_local4 < 16) {
  2077.                 _local5 = 0;
  2078.                 while (_local5 < 16) {
  2079.                     _arg2[((_arg3 + (_local4 * this.BPS)) + _local5)] = _arg1;
  2080.                     _local5++;
  2081.                 };
  2082.                 _local4++;
  2083.             };
  2084.         }
  2085.         public function ArrCopy(_arg1){
  2086.             var _local4:int;
  2087.             var _local2:* = new Array();
  2088.             var _local3:* = _arg1.length;
  2089.             _local4 = 0;
  2090.             while (_local4 < _local3) {
  2091.                 _local2.push(_arg1[_local4]);
  2092.                 _local4++;
  2093.             };
  2094.             return (_local2);
  2095.         }
  2096.         public function ExportRow(_arg1){
  2097.             var _local2:*;
  2098.             var _local3:*;
  2099.             var _local4:*;
  2100.             var _local5:*;
  2101.             _local2 = this.int_;
  2102.             _local3 = (_arg1.fy_scale * -(_arg1.y_accum));
  2103.             this.assert((_arg1.y_accum <= 0));
  2104.             _local2 = 0;
  2105.             while (_local2 < _arg1.dst_width) {
  2106.                 _local4 = this.MULT(this.write4BytesIn32Bit(_arg1.frow, (_arg1.frow_off + (_local2 * 4))), _local3);
  2107.                 _local5 = this.MULT((this.write4BytesIn32Bit(_arg1.irow, (_arg1.irow_off + (_local2 * 4))) - _local4), _arg1.fxy_scale);
  2108.                 _arg1.dst[(_arg1.dst_off + _local2)] = (((_local5 & ~(0xFF))) ? ((_local5)<0) ? 0 : 0xFF : _local5);
  2109.                 this.write32BitIn4Bytes(_arg1.irow, (_arg1.irow_off + (_local2 * 4)), _local4);
  2110.                 _local2++;
  2111.             };
  2112.             _arg1.y_accum = (_arg1.y_accum + _arg1.y_add);
  2113.             _arg1.dst_off = (_arg1.dst_off + _arg1.dst_stride);
  2114.         }
  2115.         public function DC16NoLeft(_arg1, _arg2){
  2116.             var _local4:*;
  2117.             var _local3:* = 8;
  2118.             _local4 = 0;
  2119.             while (_local4 < 16) {
  2120.                 _local3 = (_local3 + _arg1[((_arg2 + _local4) - this.BPS)]);
  2121.                 _local4++;
  2122.             };
  2123.             this.Put16((_local3 >> 4), _arg1, _arg2);
  2124.         }
  2125.         public function CustomSetup(_arg1){
  2126.             var _local2:*;
  2127.             var _local3:*;
  2128.             var _local4:*;
  2129.             var _local5:*;
  2130.             _local2 = _arg1.opaque;
  2131.             _local3 = (_local2.output.colorspace < this.MODE_YUV);
  2132.             _local2.memory = null;
  2133.             _local2.emit = null;
  2134.             _local2.emit_alpha = null;
  2135.             if (!this.InitFromOptions(_local2.options_, _arg1)){
  2136.                 return (0);
  2137.             };
  2138.             if (_arg1.use_scaling){
  2139.                 _local4 = ((_local3) ? this.InitRGBRescaler(_arg1, _local2) : this.InitYUVRescaler(_arg1, _local2));
  2140.                 if (!_local4){
  2141.                     this.alert("memory error #1");
  2142.                     return (0);
  2143.                 };
  2144.             } else {
  2145.                 if (_local3){
  2146.                     _local2.emit = this.EmitSampledRGB;
  2147.                     if (_arg1.fancy_upsampling){
  2148.                         _local5 = ((_arg1.mb_w + 1) >> 1);
  2149.                         _local2.memory = this.malloc((_arg1.mb_w + (2 * _local5)), 205);
  2150.                         if (_local2.memory == null){
  2151.                             this.alert("memory error #2");
  2152.                             return (0);
  2153.                         };
  2154.                         _local2.tmp_y = _local2.memory;
  2155.                         _local2.tmp_y_off = 0;
  2156.                         _local2.tmp_u = _local2.tmp_y;
  2157.                         _local2.tmp_u_off = (_local2.tmp_y_off + _arg1.mb_w);
  2158.                         _local2.tmp_v = _local2.tmp_u;
  2159.                         _local2.tmp_v_off = (_local2.tmp_u_off + _local5);
  2160.                         _local2.emit = this.EmitFancyRGB;
  2161.                         this.InitUpsamplers(this.void_);
  2162.                     };
  2163.                 } else {
  2164.                     _local2.emit = this.EmitYUV;
  2165.                 };
  2166.                 if (this.IsAlphaMode(_local2.output.colorspace)){
  2167.                     _local2.emit_alpha = ((_local3) ? this.EmitAlphaRGB : this.EmitAlphaYUV);
  2168.                 };
  2169.             };
  2170.             if (_local3){
  2171.                 this.VP8YUVInit(this.void_);
  2172.             };
  2173.             return (1);
  2174.         }
  2175.         public function alert(_arg1){
  2176.             if (this.firstTime){
  2177.                 ExternalInterface.call("webpFSCommand", "status", (((("" + this.my_id) + "|error|") + _arg1) + ""));
  2178.             };
  2179.             this.myText_txt.text = _arg1;
  2180.             this.stopAction = true;
  2181.             gotoAndStop(2);
  2182.         }
  2183.         public function WebPInitDecBuffer(_arg1){
  2184.             return (this.WebPInitDecBufferInternal(_arg1, this.WEBP_DECODER_ABI_VERSION));
  2185.         }
  2186.         public function DefaultFeatures(_arg1){
  2187.             this.assert(_arg1);
  2188.             _arg1.bitstream_version = 0;
  2189.         }
  2190.         public function GetFeatures(_arg1, _arg2, _arg3, _arg4){
  2191.             var _local5:*;
  2192.             var _local6:*;
  2193.             var _local7:*;
  2194.             var _local8:*;
  2195.             var _local9:*;
  2196.             _local5 = {value:0};
  2197.             _local6 = {value:0};
  2198.             _local7 = {value:0};
  2199.             _local8 = {value:0};
  2200.             _local9 = {value:0};
  2201.             if (_arg4 == null){
  2202.                 return (this.VP8_STATUS_INVALID_PARAM);
  2203.             };
  2204.             this.DefaultFeatures(_arg4);
  2205.             if ((((((_arg1 == null)) || ((_arg2 == null)))) || ((_arg3.value == 0)))){
  2206.                 return (this.VP8_STATUS_INVALID_PARAM);
  2207.             };
  2208.             if (!this.WebPCheckAndSkipRIFFHeader(_arg1, _arg2, _arg3, _local6)){
  2209.                 return (this.VP8_STATUS_BITSTREAM_ERROR);
  2210.             };
  2211.             if (!this.VP8XGetInfo(_arg1, _arg2, _arg3, _local8, _arg4.width, _arg4.height, _local7)){
  2212.                 return (this.VP8_STATUS_BITSTREAM_ERROR);
  2213.             };
  2214.             if (_local8.value > 0){
  2215.                 return (this.VP8_STATUS_OK);
  2216.             };
  2217.             if (!this.VP8CheckAndSkipHeader(_arg1, _arg2, _arg3, _local9, _local5, _local6)){
  2218.                 return (this.VP8_STATUS_BITSTREAM_ERROR);
  2219.             };
  2220.             if (_local9.value == -1){
  2221.                 return (this.VP8_STATUS_BITSTREAM_ERROR);
  2222.             };
  2223.             if (!_local9.value){
  2224.                 _local5.value = _arg3.value;
  2225.             };
  2226.             if (!this.VP8GetInfo(_arg1, _arg2, _arg3, _local5, _arg4.width, _arg4.height, _arg4.has_alpha)){
  2227.                 return (this.VP8_STATUS_BITSTREAM_ERROR);
  2228.             };
  2229.             return (this.VP8_STATUS_OK);
  2230.         }
  2231.         public function sizeof(_arg1){
  2232.             return (1);
  2233.         }
  2234.         public function FilterLoop24(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
  2235.             while (_arg5-- > 0) {
  2236.                 if (this.needs_filter2(_arg1, (_arg2 + 0), _arg3, _arg6, _arg7)){
  2237.                     if (this.hev(_arg1, (_arg2 + 0), _arg3, _arg8)){
  2238.                         this.do_filter2(_arg1, (_arg2 + 0), _arg3);
  2239.                     } else {
  2240.                         this.do_filter4(_arg1, (_arg2 + 0), _arg3);
  2241.                     };
  2242.                 };
  2243.                 _arg2 = (_arg2 + _arg4);
  2244.             };
  2245.         }
  2246.         public function FilterLoop26(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
  2247.             while (_arg5-- > 0) {
  2248.                 if (this.needs_filter2(_arg1, (_arg2 + 0), _arg3, _arg6, _arg7)){
  2249.                     if (this.hev(_arg1, (_arg2 + 0), _arg3, _arg8)){
  2250.                         this.do_filter2(_arg1, (_arg2 + 0), _arg3);
  2251.                     } else {
  2252.                         this.do_filter6(_arg1, (_arg2 + 0), _arg3);
  2253.                     };
  2254.                 };
  2255.                 _arg2 = (_arg2 + _arg4);
  2256.             };
  2257.         }
  2258.         public function VP8SetError(_arg1, _arg2, _arg3){
  2259.             _arg1.status_ = _arg2;
  2260.             _arg1.error_msg_ = _arg3;
  2261.             _arg1.ready_ = 0;
  2262.             this.alert(((_arg2 + ": ") + _arg3));
  2263.             return (0);
  2264.         }
  2265.         public function Yuv444ToRgba(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
  2266.             this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToRgba, 4);
  2267.         }
  2268.         public function InitRescaler(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14){
  2269.             _arg1.x_expand = ((_arg2 < _arg6) + 0);
  2270.             _arg1.src_width = _arg2;
  2271.             _arg1.src_height = _arg3;
  2272.             _arg1.dst_width = _arg6;
  2273.             _arg1.dst_height = _arg7;
  2274.             _arg1.dst = _arg4;
  2275.             _arg1.dst_off = _arg5;
  2276.             _arg1.dst_stride = _arg8;
  2277.             _arg1.x_add = ((_arg1.x_expand) ? (_arg10 - 1) : (_arg9 - _arg10));
  2278.             _arg1.x_sub = ((_arg1.x_expand) ? (_arg9 - 1) : _arg10);
  2279.             _arg1.y_accum = _arg11;
  2280.             _arg1.y_add = _arg11;
  2281.             _arg1.y_sub = _arg12;
  2282.             _arg1.fx_scale = parseInt(String(((1 << this.RFIX) / _arg10)));
  2283.             _arg1.fy_scale = parseInt(String(((1 << this.RFIX) / _arg12)));
  2284.             _arg1.fxy_scale = ((_arg1.x_expand) ? (parseInt(String(this.int64BitLeft(_arg7, this.RFIX))) / (_arg10 * _arg3)) : (parseInt(String(this.int64BitLeft(_arg7, this.RFIX))) / (_arg9 * _arg3)));
  2285.             _arg1.irow = _arg13;
  2286.             _arg1.irow_off = (0 * 4);
  2287.             _arg1.frow = _arg13;
  2288.             _arg1.frow_off = (_arg14 + (_arg6 * 4));
  2289.         }
  2290.         public function Yuv444ToBgra(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
  2291.             this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToBgra, 4);
  2292.         }
  2293.         public function VP8ParseQuant(_arg1){
  2294.             var _local11:*;
  2295.             var _local12:*;
  2296.             var _local2:* = _arg1.br_;
  2297.             var _local3:* = this.VP8GetValue(_local2, 7);
  2298.             var _local4:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
  2299.             var _local5:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
  2300.             var _local6:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
  2301.             var _local7:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
  2302.             var _local8:* = ((this.VP8Get(_local2)) ? this.VP8GetSignedValue(_local2, 4) : 0);
  2303.             var _local9:* = _arg1.segment_hdr_;
  2304.             var _local10:* = this.int_;
  2305.             _local10 = 0;
  2306.             for (;_local10 < this.NUM_MB_SEGMENTS;_local10++) {
  2307.                 _local11 = this.int_;
  2308.                 if (_local9.use_segment_){
  2309.                     _local11 = _local9.quantizer_[_local10];
  2310.                     if (!_local9.absolute_delta_){
  2311.                         _local11 = (_local11 + _local3);
  2312.                     };
  2313.                 } else {
  2314.                     if (_local10 > 0){
  2315.                         _arg1.dqm_[_local10] = _arg1.dqm_[0];
  2316.                         continue;
  2317.                     };
  2318.                     _local11 = _local3;
  2319.                 };
  2320.                 _local12 = _arg1.dqm_[_local10];
  2321.                 _local12.y1_mat_[0] = this.kDcTable[this.clip((_local11 + _local4), 127)];
  2322.                 _local12.y1_mat_[1] = this.kAcTable[this.clip((_local11 + 0), 127)];
  2323.                 _local12.y2_mat_[0] = (this.kDcTable[this.clip((_local11 + _local5), 127)] * 2);
  2324.                 _local12.y2_mat_[1] = parseInt(String(((this.kAcTable[this.clip((_local11 + _local6), 127)] * 155) / 100)));
  2325.                 if (_local12.y2_mat_[1] < 8){
  2326.                     _local12.y2_mat_[1] = 8;
  2327.                 };
  2328.                 _local12.uv_mat_[0] = this.kDcTable[this.clip((_local11 + _local7), 117)];
  2329.                 _local12.uv_mat_[1] = this.kAcTable[this.clip((_local11 + _local8), 127)];
  2330.             };
  2331.         }
  2332.         public function VP8Get(_arg1){
  2333.             return (this.VP8GetValue(_arg1, 1));
  2334.         }
  2335.         public function membuild(_arg1, _arg2){
  2336.             var _local4:int;
  2337.             var _local3:* = new Array();
  2338.             _local4 = 0;
  2339.             while (_local4 < _arg2) {
  2340.                 _local3.push(_arg1);
  2341.                 _local4++;
  2342.             };
  2343.             _local3.push(0);
  2344.             return (_local3);
  2345.         }
  2346.         public function DecodeInto(_arg1, _arg2, _arg3, _arg4){
  2347.             var _local5:*;
  2348.             var _local6:*;
  2349.             var _local7:*;
  2350.             _local5 = this.VP8New(this.void_);
  2351.             _local6 = this.VP8_STATUS_OK;
  2352.             _local7 = this.newObjectIt(this.VP8Io);
  2353.             var _local8:* = 1;
  2354.             this.assert(_arg4);
  2355.             if (_local5 == null){
  2356.                 return (this.VP8_STATUS_INVALID_PARAM);
  2357.             };
  2358.             this.VP8InitIo(_local7);
  2359.             _local7.data = _arg1;
  2360.             _local7.data_off = _arg2;
  2361.             _local7.data_size = _arg3;
  2362.             this.WebPInitCustomIo(_arg4, _local7);
  2363.             _local5.use_threads_ = 0;
  2364.             if (!this.VP8GetHeaders(_local5, _local7)){
  2365.                 _local6 = this.VP8_STATUS_BITSTREAM_ERROR;
  2366.             } else {
  2367.                 _local6 = this.WebPAllocateDecBuffer(_local7.width, _local7.height, _arg4.options_, _arg4.output);
  2368.                 if (_local6 == this.VP8_STATUS_OK){
  2369.                     if (!this.VP8Decode(_local5, _local7)){
  2370.                         _local6 = _local5.status_;
  2371.                     };
  2372.                 };
  2373.             };
  2374.             this.VP8Delete(_local5);
  2375.             if (_local6 != this.VP8_STATUS_OK){
  2376.                 this.WebPFreeDecBuffer(_arg4.output);
  2377.             };
  2378.             return (_local6);
  2379.         }
  2380.         public function LD4(_arg1, _arg2){
  2381.             var _local3:* = _arg1[((_arg2 + 0) - this.BPS)];
  2382.             var _local4:* = _arg1[((_arg2 + 1) - this.BPS)];
  2383.             var _local5:* = _arg1[((_arg2 + 2) - this.BPS)];
  2384.             var _local6:* = _arg1[((_arg2 + 3) - this.BPS)];
  2385.             var _local7:* = _arg1[((_arg2 + 4) - this.BPS)];
  2386.             var _local8:* = _arg1[((_arg2 + 5) - this.BPS)];
  2387.             var _local9:* = _arg1[((_arg2 + 6) - this.BPS)];
  2388.             var _local10:* = _arg1[((_arg2 + 7) - this.BPS)];
  2389.             _arg1[((_arg2 + 0) + (0 * this.BPS))] = this.AVG3(_local3, _local4, _local5);
  2390.             _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 0) + (1 * this.BPS))] = this.AVG3(_local4, _local5, _local6));
  2391.             _arg1[((_arg2 + 2) + (0 * this.BPS))] = (_arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 0) + (2 * this.BPS))] = this.AVG3(_local5, _local6, _local7)));
  2392.             _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))));
  2393.             _arg1[((_arg2 + 3) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = (_arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local7, _local8, _local9)));
  2394.             _arg1[((_arg2 + 3) + (2 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG3(_local8, _local9, _local10));
  2395.             _arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local9, _local10, _local10);
  2396.         }
  2397.         public function WebPCheckAndSkipRIFFHeader(_arg1, _arg2, _arg3, _arg4){
  2398.             if ((((_arg3.value >= this.RIFF_HEADER_SIZE)) && (!(this.memcmp(_arg1, _arg2.value, "RIFF", 4))))){
  2399.                 if (this.memcmp(_arg1, (_arg2.value + 8), "WEBP", 4)){
  2400.                     return (0);
  2401.                 };
  2402.                 _arg4.value = this.get_le32(_arg1, (_arg2.value + 4));
  2403.                 if (_arg4.value < this.RIFF_HEADER_SIZE){
  2404.                     return (0);
  2405.                 };
  2406.                 _arg2.value = (_arg2.value + this.RIFF_HEADER_SIZE);
  2407.                 _arg3.value = (_arg3.value - this.RIFF_HEADER_SIZE);
  2408.             } else {
  2409.                 _arg4.value = 0;
  2410.             };
  2411.             return (1);
  2412.         }
  2413.         public function SetOk(_arg1){
  2414.             _arg1.status_ = "VP8_STATUS_OK";
  2415.             _arg1.error_msg_ = "OK";
  2416.         }
  2417.         public function Yuv444ToRgb(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
  2418.             this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToRgb, 3);
  2419.         }
  2420.         public function ParsePartitions(_arg1, _arg2, _arg3, _arg4){
  2421.             var _local10:*;
  2422.             var _local11:*;
  2423.             var _local14:*;
  2424.             var _local15:*;
  2425.             var _local16:*;
  2426.             var _local5:* = _arg1.br_;
  2427.             var _local6:* = _arg2;
  2428.             var _local7:* = _arg3;
  2429.             var _local8:* = _arg2;
  2430.             var _local9:* = (_arg3 + _arg4);
  2431.             _local11 = 0;
  2432.             var _local12:* = this.int_;
  2433.             var _local13:* = this.int_;
  2434.             _arg1.num_parts_ = (1 << this.VP8GetValue(_local5, 2));
  2435.             _local12 = (_arg1.num_parts_ - 1);
  2436.             _local10 = _arg2;
  2437.             _local11 = (_arg3 + (_local12 * 3));
  2438.             if (_local9 < _local11){
  2439.                 return ("VP8_STATUS_NOT_ENOUGH_DATA");
  2440.             };
  2441.             _local13 = 0;
  2442.             while (_local13 < _local12) {
  2443.                 _local14 = ((_local6[(_local7 + 0)] | (_local6[(_local7 + 1)] << 8)) | (_local6[(_local7 + 2)] << 16));
  2444.                 _local15 = _local10;
  2445.                 _local16 = (_local11 + _local14);
  2446.                 if (_local16 > _local9){
  2447.                     _local15 = _local8;
  2448.                 };
  2449.                 this.VP8InitBitReader(_arg1.parts_[_local13], _local10, _local11, _local16);
  2450.                 _local10 = _local15;
  2451.                 _local11 = _local16;
  2452.                 _local7 = (_local7 + 3);
  2453.                 _local13++;
  2454.             };
  2455.             this.VP8InitBitReader(_arg1.parts_[_local12], _local10, _local11, _local9);
  2456.             return (((_local11)<_local9) ? "VP8_STATUS_OK" : "VP8_STATUS_SUSPENDED");
  2457.         }
  2458.         public function Yuv444ToBgr(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
  2459.             this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToBgr, 3);
  2460.         }
  2461.         public function CustomPut(_arg1){
  2462.             var _local2:*;
  2463.             var _local3:*;
  2464.             var _local4:*;
  2465.             var _local5:*;
  2466.             _local2 = _arg1.opaque;
  2467.             _local3 = _arg1.mb_w;
  2468.             _local4 = _arg1.mb_h;
  2469.             this.assert(!((_arg1.mb_y & 1)));
  2470.             if ((((_local3 <= 0)) || ((_local4 <= 0)))){
  2471.                 return (0);
  2472.             };
  2473.             _local5 = _local2.emit(_arg1, _local2);
  2474.             _local2.last_y = (_local2.last_y + _local5);
  2475.             if (_local2.emit_alpha){
  2476.                 _local2.emit_alpha(_arg1, _local2);
  2477.             };
  2478.             return (1);
  2479.         }
  2480.         public function ioSecurityErrorHandler(_arg1:SecurityErrorEvent):void{
  2481.             this.alert("#2.1: security error");
  2482.         }
  2483.         public function memset_wl(_arg1, _arg2){
  2484.             var _local4:int;
  2485.             var _local3:* = new Array();
  2486.             _local3.push(this.newObjectIt(_arg1));
  2487.             _local4 = 0;
  2488.             while (_local4 < _arg2) {
  2489.                 _local3.push(this.newObjectIt(_arg1));
  2490.                 _local4++;
  2491.             };
  2492.             _local3.push(0);
  2493.             return (_local3);
  2494.         }
  2495.         public function ExportAlpha(_arg1, _arg2){
  2496.             var _local3:*;
  2497.             var _local4:*;
  2498.             var _local5:*;
  2499.             var _local6:*;
  2500.             var _local7:*;
  2501.             _local3 = _arg1.output.u.RGBA;
  2502.             _local4 = _local3.rgba;
  2503.             _local5 = (_local3.rgba_off + ((_arg1.last_y + _arg2) * _local3.stride));
  2504.             _local6 = 0;
  2505.             while (_arg1.scaler_a.y_accum <= 0) {
  2506.                 this.assert((((_arg1.last_y + _arg2) + _local6) < _arg1.output.height));
  2507.                 this.ExportRow(_arg1.scaler_a);
  2508.                 _local7 = 0;
  2509.                 while (_local7 < _arg1.scaler_a.dst_width) {
  2510.                     _local4[((_local5 + (4 * _local7)) + 3)] = _arg1.scaler_a.dst[(_arg1.scaler_a.dst_off + _local7)];
  2511.                     _local7++;
  2512.                 };
  2513.                 _local5 = (_local5 + _local3.stride);
  2514.                 _local6++;
  2515.             };
  2516.             return (_local6);
  2517.         }
  2518.         public function WebPGetInfo(_arg1, _arg2, _arg3, _arg4, _arg5){
  2519.             var _local6:*;
  2520.             _local6 = this.newObjectIt(this.WebPBitstreamFeatures);
  2521.             if (this.GetFeatures(_arg1, _arg2, _arg3, _local6) != this.VP8_STATUS_OK){
  2522.                 return (0);
  2523.             };
  2524.             if (_arg4){
  2525.                 _arg4.value = _local6.width;
  2526.             };
  2527.             if (_arg5){
  2528.                 _arg5.value = _local6.height;
  2529.             };
  2530.             return (1);
  2531.         }
  2532.         public function FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11){
  2533.             var _local12:*;
  2534.             _local12 = 0;
  2535.             while (_local12 < _arg9) {
  2536.                 _arg10(_arg1[(_arg2 + _local12)], _arg3[(_arg4 + _local12)], _arg5[(_arg6 + _local12)], _arg7[(_arg8 + (_local12 * _arg11))], 0);
  2537.                 _local12++;
  2538.             };
  2539.         }
  2540.         public function IsAlphaMode(_arg1){
  2541.             return ((((((((((_arg1 == this.MODE_RGBA)) || ((_arg1 == this.MODE_BGRA)))) || ((_arg1 == this.MODE_ARGB)))) || ((_arg1 == this.MODE_RGBA_4444)))) || ((_arg1 == this.MODE_YUVA))));
  2542.         }
  2543.         public function AllocateBuffer(_arg1){
  2544.             var _local4:*;
  2545.             var _local5:*;
  2546.             var _local6:*;
  2547.             var _local7:*;
  2548.             var _local8:*;
  2549.             var _local9:*;
  2550.             var _local10:*;
  2551.             var _local11:*;
  2552.             var _local12:*;
  2553.             var _local13:*;
  2554.             var _local14:*;
  2555.             var _local2:* = _arg1.width;
  2556.             var _local3:* = _arg1.height;
  2557.             if ((((_local2 <= 0)) || ((_local3 <= 0)))){
  2558.                 return (this.VP8_STATUS_INVALID_PARAM);
  2559.             };
  2560.             if (((!(_arg1.is_external_memory)) && ((_arg1.private_memory == null)))){
  2561.                 _local4 = this.uint8_t;
  2562.                 _local5 = 0;
  2563.                 _local6 = _arg1.colorspace;
  2564.                 _local7 = this.int_;
  2565.                 _local8 = 0;
  2566.                 _local9 = 0;
  2567.                 _local10 = 0;
  2568.                 _local11 = this.uint64_t;
  2569.                 _local12 = 0;
  2570.                 _local13 = this.uint64_t;
  2571.                 _local7 = (_local2 * this.kModeBpp[_local6]);
  2572.                 _local11 = (_local7 * _local3);
  2573.                 if (_local6 >= this.MODE_YUV){
  2574.                     _local8 = parseInt(String(((_local2 + 1) / 2)));
  2575.                     _local10 = (_local8 * parseInt(String(((_local3 + 1) / 2))));
  2576.                     if (_local6 == this.MODE_YUVA){
  2577.                         _local9 = _local2;
  2578.                         _local12 = (_local9 * _local3);
  2579.                     };
  2580.                 };
  2581.                 _local13 = ((_local11 + (2 * _local10)) + _local12);
  2582.                 if (((_local11 + (2 * _local10)) + _local12) != _local13){
  2583.                     return (this.VP8_STATUS_INVALID_PARAM);
  2584.                 };
  2585.                 _local4 = new ByteArray();
  2586.                 _arg1.private_memory = _local4;
  2587.                 _local4.length = _local13;
  2588.                 _local5 = 0;
  2589.                 _arg1.private_memory_off = _local5;
  2590.                 if (_local4 == null){
  2591.                     return (this.VP8_STATUS_OUT_OF_MEMORY);
  2592.                 };
  2593.                 if (_local6 >= this.MODE_YUV){
  2594.                     _local14 = _arg1.u.YUVA;
  2595.                     _local14.y = _local4;
  2596.                     _local14.y_off = _local5;
  2597.                     _local14.y_stride = _local7;
  2598.                     _local14.y_size = _local11;
  2599.                     _local14.u = _local4;
  2600.                     _local14.u_off = (_local5 + _local11);
  2601.                     _local14.u_stride = _local8;
  2602.                     _local14.u_size = _local10;
  2603.                     _local14.v = _local4;
  2604.                     _local14.v_off = ((_local5 + _local11) + _local10);
  2605.                     _local14.v_stride = _local8;
  2606.                     _local14.v_size = _local10;
  2607.                     if (_local6 == this.MODE_YUVA){
  2608.                         _local14.a = _local4;
  2609.                         _local14.a_off = ((_local5 + _local11) + (2 * _local10));
  2610.                     };
  2611.                     _local14.a_size = _local12;
  2612.                     _local14.a_stride = _local9;
  2613.                 } else {
  2614.                     _local14 = _arg1.u.RGBA;
  2615.                     _local14.rgba = _local4;
  2616.                     _local14.rgba_off = _local5;
  2617.                     _local14.stride = _local7;
  2618.                     _local14.size = _local11;
  2619.                 };
  2620.             };
  2621.             return (this.CheckDecBuffer(_arg1));
  2622.         }
  2623.         public function DC8uvNoLeft(_arg1, _arg2){
  2624.             var _local4:*;
  2625.             var _local3:* = 4;
  2626.             _local4 = 0;
  2627.             while (_local4 < 8) {
  2628.                 _local3 = (_local3 + _arg1[((_arg2 + _local4) - this.BPS)]);
  2629.                 _local4++;
  2630.             };
  2631.             this.Put8x8uv(((_local3 >> 3) * 1), _arg1, _arg2);
  2632.         }
  2633.         public function write4BytesIn32Bit(_arg1, _arg2){
  2634.             return (((((_arg1[(_arg2 + 0)] << 24) | (_arg1[(_arg2 + 1)] << 16)) | (_arg1[(_arg2 + 2)] << 8)) | _arg1[(_arg2 + 3)]));
  2635.         }
  2636.         public function WebPInitDecoderConfigInternal(_arg1, _arg2){
  2637.             if (_arg2 != this.WEBP_DECODER_ABI_VERSION){
  2638.                 return (0);
  2639.             };
  2640.             if (_arg1 == null){
  2641.                 return (0);
  2642.             };
  2643.             this.DefaultFeatures(_arg1.input);
  2644.             this.WebPInitDecBuffer(_arg1.output);
  2645.             return (1);
  2646.         }
  2647.         public function PACK(_arg1, _arg2){
  2648.             return ((((((((_arg1[0] * 16777216) + (_arg1[1] * 65536)) + (_arg1[2] * 0x0100)) + (_arg1[3] * 1)) * this.PACK_CST) & 0xFF000000) >> _arg2));
  2649.         }
  2650.         public function Decode(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
  2651.             var _local7:*;
  2652.             var _local8:*;
  2653.             var _local9:*;
  2654.             var _local10:*;
  2655.             _local7 = {value:0};
  2656.             _arg3 = {value:_arg3};
  2657.             _local8 = this.newObjectIt(this.WebPDecParams);
  2658.             _local9 = this.newObjectIt(this.WebPDecBuffer);
  2659.             this.WebPInitDecBuffer(_local9);
  2660.             this.WebPResetDecParams(_local8);
  2661.             _local8.output = _local9;
  2662.             _local9.colorspace = _arg1;
  2663.             _local10 = {
  2664.                 data_off:{value:0},
  2665.                 width:{value:_local9.width},
  2666.                 height:{value:_local9.height}
  2667.             };
  2668.             if (!this.WebPGetInfo(_arg2, _local7, _arg3, _local10.width, _local10.height)){
  2669.                 return (null);
  2670.             };
  2671.             _local9.width = _local10.width.value;
  2672.             _local9.height = _local10.height.value;
  2673.             if (_arg4){
  2674.                 _arg4.value = _local9.width.value;
  2675.             };
  2676.             if (_arg5){
  2677.                 _arg5.value = _local9.height.value;
  2678.             };
  2679.             if (this.DecodeInto(_arg2, _local7.value, _arg3.value, _local8) != this.VP8_STATUS_OK){
  2680.                 return (null);
  2681.             };
  2682.             if (_arg6){
  2683.                 this.WebPCopyDecBuffer(_local9, _arg6);
  2684.             };
  2685.             return (((_arg1)>=this.MODE_YUV) ? _local9.u.YUVA.y : _local9.u.RGBA.rgba);
  2686.         }
  2687.         public function mallocStr(_arg1, _arg2){
  2688.             var _local4:int;
  2689.             var _local3:* = new Array();
  2690.             _local4 = 0;
  2691.             while (_local4 < _arg1) {
  2692.                 _local3.push(" ");
  2693.                 _local4++;
  2694.             };
  2695.             return (_local3.join(""));
  2696.         }
  2697.         public function VFilter16(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
  2698.             this.FilterLoop26(_arg1, (_arg2 + 0), _arg3, 1, 16, _arg4, _arg5, _arg6);
  2699.         }
  2700.         public function ArrM(_arg1, _arg2){
  2701.             var _local3:*;
  2702.             var _local5:int;
  2703.             var _local4:* = new Array();
  2704.             _local5 = (_arg1.length - 1);
  2705.             while (_local5 >= 0) {
  2706.                 _arg2 = this.newObjectIt(this.Arr(_arg1[_local5], _arg2));
  2707.                 _local5--;
  2708.             };
  2709.             return (_arg2);
  2710.         }
  2711.         public function Copy32b(_arg1, _arg2, _arg3, _arg4){
  2712.             var _local5:int;
  2713.             _local5 = 0;
  2714.             while (_local5 < 4) {
  2715.                 _arg1[(_arg2 + _local5)] = _arg3[(_arg4 + _local5)];
  2716.                 _local5++;
  2717.             };
  2718.         }
  2719.         public function Arr(_arg1, _arg2){
  2720.             var _local4:int;
  2721.             var _local3:* = new Array();
  2722.             _local4 = 0;
  2723.             while (_local4 < _arg1) {
  2724.                 _local3.push(_arg2);
  2725.                 _local4++;
  2726.             };
  2727.             return (_local3);
  2728.         }
  2729.         public function Yuv444ToRgba4444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
  2730.             this.FUNC_NAME_YUV444(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, this.VP8YuvToRgba4444, 2);
  2731.         }
  2732.         public function WebPResetDecParams(_arg1){
  2733.             if (_arg1){
  2734.             };
  2735.         }
  2736.         public function UpsampleArgbKeepAlphaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  2737.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToArgbKeepA, 4);
  2738.         }
  2739.         public function HFilter8(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
  2740.             this.FilterLoop26(_arg1, _arg2, 1, _arg5, 8, _arg6, _arg7, _arg8);
  2741.             this.FilterLoop26(_arg3, _arg4, 1, _arg5, 8, _arg6, _arg7, _arg8);
  2742.         }
  2743.         public function WebPInitDecBufferInternal(_arg1, _arg2){
  2744.             if (_arg2 != this.WEBP_DECODER_ABI_VERSION){
  2745.                 return (0);
  2746.             };
  2747.             if (!_arg1){
  2748.                 return (0);
  2749.             };
  2750.             this.memset_(_arg1, 0, 0, (this.sizeof(_arg1) * _arg1.length));
  2751.             return (1);
  2752.         }
  2753.         public function InitUpsamplers(_arg1){
  2754.             this.WebPUpsamplers[this.MODE_RGB] = this.UpsampleRgbLinePair;
  2755.             this.WebPUpsamplers[this.MODE_RGBA] = this.UpsampleRgbaLinePair;
  2756.             this.WebPUpsamplers[this.MODE_BGR] = this.UpsampleBgrLinePair;
  2757.             this.WebPUpsamplers[this.MODE_BGRA] = this.UpsampleBgraLinePair;
  2758.             this.WebPUpsamplers[this.MODE_ARGB] = this.UpsampleArgbLinePair;
  2759.             this.WebPUpsamplers[this.MODE_RGBA_4444] = this.UpsampleRgba4444LinePair;
  2760.             this.WebPUpsamplers[this.MODE_RGB_565] = this.UpsampleRgb565LinePair;
  2761.             this.WebPUpsamplersKeepAlpha[this.MODE_RGB] = this.UpsampleRgbLinePair;
  2762.             this.WebPUpsamplersKeepAlpha[this.MODE_RGBA] = this.UpsampleRgbKeepAlphaLinePair;
  2763.             this.WebPUpsamplersKeepAlpha[this.MODE_BGR] = this.UpsampleBgrLinePair;
  2764.             this.WebPUpsamplersKeepAlpha[this.MODE_BGRA] = this.UpsampleBgrKeepAlphaLinePair;
  2765.             this.WebPUpsamplersKeepAlpha[this.MODE_ARGB] = this.UpsampleArgbKeepAlphaLinePair;
  2766.             this.WebPUpsamplersKeepAlpha[this.MODE_RGBA_4444] = this.UpsampleRgba4444KeepAlphaLinePair;
  2767.             this.WebPUpsamplersKeepAlpha[this.MODE_RGB_565] = this.UpsampleRgb565LinePair;
  2768.         }
  2769.         public function TM16(_arg1, _arg2){
  2770.             this.TrueMotion(_arg1, _arg2, 16);
  2771.         }
  2772.         public function memcpyArrM(_arg1, _arg2, _arg3, _arg4, _arg5){
  2773.             var _local6:int;
  2774.             var _local7:*;
  2775.             var _local8:*;
  2776.             _local6 = 0;
  2777.             while (_local6 < _arg5) {
  2778.                 _local7 = _arg1[(_arg2 + _local6)].length;
  2779.                 _local8 = 0;
  2780.                 while (_local8 < _local7) {
  2781.                     _arg1[(_arg2 + _local6)][_local8] = _arg3[(_arg4 + _local6)][_local8];
  2782.                     _local8++;
  2783.                 };
  2784.                 _local6++;
  2785.             };
  2786.         }
  2787.         public function VP8Shift(_arg1){
  2788.             var _local2:* = this.kVP8Log2Range[_arg1.range_];
  2789.             _arg1.range_ = this.kVP8NewRange[_arg1.range_];
  2790.             _arg1.value_ = (_arg1.value_ << _local2);
  2791.             _arg1.missing_ = (_arg1.missing_ + _local2);
  2792.         }
  2793.         public function ParseFilterHeader(_arg1, _arg2){
  2794.             var _local4:*;
  2795.             var _local5:*;
  2796.             var _local6:*;
  2797.             var _local3:* = _arg2.filter_hdr_;
  2798.             _local3.simple_ = this.VP8Get(_arg1);
  2799.             _local3.level_ = this.VP8GetValue(_arg1, 6);
  2800.             _local3.sharpness_ = this.VP8GetValue(_arg1, 3);
  2801.             _local3.use_lf_delta_ = this.VP8Get(_arg1);
  2802.             if (_local3.use_lf_delta_){
  2803.                 if (this.VP8Get(_arg1)){
  2804.                     _local4 = 0;
  2805.                     while (_local4 < this.NUM_REF_LF_DELTAS) {
  2806.                         if (this.VP8Get(_arg1)){
  2807.                             _local3.ref_lf_delta_[_local4] = this.VP8GetSignedValue(_arg1, 6);
  2808.                         };
  2809.                         _local4++;
  2810.                     };
  2811.                     _local4 = 0;
  2812.                     while (_local4 < this.NUM_MODE_LF_DELTAS) {
  2813.                         if (this.VP8Get(_arg1)){
  2814.                             _local3.mode_lf_delta_[_local4] = this.VP8GetSignedValue(_arg1, 6);
  2815.                         };
  2816.                         _local4++;
  2817.                     };
  2818.                 };
  2819.             };
  2820.             _arg2.filter_type_ = ((_local3.level_)==0) ? 0 : ((_local3.simple_) ? 1 : 2);
  2821.             if (_arg2.filter_type_ > 0){
  2822.                 if (_arg2.segment_hdr_.use_segment_){
  2823.                     _local5 = 0;
  2824.                     while (_local5 < this.NUM_MB_SEGMENTS) {
  2825.                         _local6 = _arg2.segment_hdr_.filter_strength_[_local5];
  2826.                         if (!_arg2.segment_hdr_.absolute_delta_){
  2827.                             _local6 = (_local6 + _local3.level_);
  2828.                         };
  2829.                         _arg2.filter_levels_[_local5] = _local6;
  2830.                         _local5++;
  2831.                     };
  2832.                 } else {
  2833.                     _arg2.filter_levels_[0] = _local3.level_;
  2834.                 };
  2835.             };
  2836.             return (!(_arg1.eof_));
  2837.         }
  2838.         public function convertBinaryToArray(_arg1){
  2839.             var _local4:*;
  2840.             var _local2:* = new Array();
  2841.             var _local3:* = _arg1.length;
  2842.             _local4 = 0;
  2843.             while (_local4 < _local3) {
  2844.                 _local2.push(_arg1.charCodeAt(_local4));
  2845.                 _local4++;
  2846.             };
  2847.             return (_local2);
  2848.         }
  2849.         public function memset(_arg1, _arg2){
  2850.             var _local4:int;
  2851.             var _local3:* = new Array();
  2852.             _local4 = 0;
  2853.             while (_local4 < _arg2) {
  2854.                 _local3.push(_arg1);
  2855.                 _local4++;
  2856.             };
  2857.             _local3.push(0);
  2858.             return (_local3);
  2859.         }
  2860.         public function alert32BitIn4Bytes(_arg1){
  2861.             var _local2:int;
  2862.             var _local3:* = "";
  2863.             _local2 = 3;
  2864.             while (_local2 >= 0) {
  2865.                 _local3 = (_local3 + (" " + ((_arg1 >> (8 * _local2)) & 0xFF)));
  2866.                 _local2--;
  2867.             };
  2868.             this.alert(_local3);
  2869.         }
  2870.         public function EmitFancyRGB(_arg1, _arg2){
  2871.             var _local3:* = _arg1.mb_h;
  2872.             var _local4:* = _arg2.output.u.RGBA;
  2873.             var _local5:* = _local4.rgba;
  2874.             var _local6:* = (_local4.rgba_off + (_arg1.mb_y * _local4.stride));
  2875.             var _local7:* = ((_arg1.a) ? this.WebPUpsamplersKeepAlpha[_arg2.output.colorspace] : this.WebPUpsamplers[_arg2.output.colorspace]);
  2876.             var _local8:* = _arg1.y;
  2877.             var _local9:* = _arg1.y_off;
  2878.             var _local10:* = _arg1.u;
  2879.             var _local11:* = _arg1.u_off;
  2880.             var _local12:* = _arg1.v;
  2881.             var _local13:* = _arg1.v_off;
  2882.             var _local14:* = _arg2.tmp_u;
  2883.             var _local15:* = _arg2.tmp_u_off;
  2884.             var _local16:* = _arg2.tmp_v;
  2885.             var _local17:* = _arg2.tmp_v_off;
  2886.             var _local18:* = _arg1.mb_y;
  2887.             var _local19:* = (_arg1.mb_y + _arg1.mb_h);
  2888.             var _local20:* = _arg1.mb_w;
  2889.             var _local21:* = parseInt(String(((_local20 + 1) / 2)));
  2890.             if (_local18 == 0){
  2891.                 _local7(null, null, _local8, _local9, _local10, _local11, _local12, _local13, _local10, _local11, _local12, _local13, null, null, _local5, _local6, _local20);
  2892.             } else {
  2893.                 _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);
  2894.                 _local3++;
  2895.             };
  2896.             while ((_local18 + 2) < _local19) {
  2897.                 _local14 = _local10;
  2898.                 _local15 = _local11;
  2899.                 _local16 = _local12;
  2900.                 _local17 = _local13;
  2901.                 _local11 = (_local11 + _arg1.uv_stride);
  2902.                 _local13 = (_local13 + _arg1.uv_stride);
  2903.                 _local6 = (_local6 + (2 * _local4.stride));
  2904.                 _local9 = (_local9 + (2 * _arg1.y_stride));
  2905.                 _local7(_local8, (_local9 - _arg1.y_stride), _local8, _local9, _local14, _local15, _local16, _local17, _local10, _local11, _local12, _local13, _local5, (_local6 - _local4.stride), _local5, _local6, _local20);
  2906.                 _local18 = (_local18 + 2);
  2907.             };
  2908.             _local9 = (_local9 + _arg1.y_stride);
  2909.             if ((_arg1.crop_top + _local19) < _arg1.crop_bottom){
  2910.                 this.memcpy(_arg2.tmp_y, _arg2.tmp_y_off, _local8, _local9, (_local20 * this.sizeof(_arg2.tmp_y)));
  2911.                 this.memcpy(_arg2.tmp_u, _arg2.tmp_u_off, _local10, _local11, (_local21 * this.sizeof(_arg2.tmp_u)));
  2912.                 this.memcpy(_arg2.tmp_v, _arg2.tmp_v_off, _local12, _local13, (_local21 * this.sizeof(_arg2.tmp_v)));
  2913.                 _local3--;
  2914.             } else {
  2915.                 if (!(_local19 & 1)){
  2916.                     _local7(_local8, _local9, null, null, _local10, _local11, _local12, _local13, _local10, _local11, _local12, _local13, _local5, (_local6 + _local4.stride), null, null, _local20);
  2917.                 };
  2918.             };
  2919.             return (_local3);
  2920.         }
  2921.         public function GetCoeffs(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
  2922.             var _local8:*;
  2923.             var _local9:*;
  2924.             var _local10:*;
  2925.             var _local11:*;
  2926.             var _local12:*;
  2927.             var _local13:*;
  2928.             var _local14:*;
  2929.             var _local7:* = _arg2[this.kBands[_arg5]][_arg3];
  2930.             if (!this.VP8GetBit(_arg1, _local7[0])){
  2931.                 return (0);
  2932.             };
  2933.             while (1) {
  2934.                 _arg5++;
  2935.                 if (!this.VP8GetBit(_arg1, _local7[1])){
  2936.                     _local7 = _arg2[this.kBands[_arg5]][0];
  2937.                 } else {
  2938.                     if (!this.VP8GetBit(_arg1, _local7[2])){
  2939.                         _local7 = _arg2[this.kBands[_arg5]][1];
  2940.                         _local8 = 1;
  2941.                     } else {
  2942.                         if (!this.VP8GetBit(_arg1, _local7[3])){
  2943.                             if (!this.VP8GetBit(_arg1, _local7[4])){
  2944.                                 _local8 = 2;
  2945.                             } else {
  2946.                                 _local8 = (3 + this.VP8GetBit(_arg1, _local7[5]));
  2947.                             };
  2948.                         } else {
  2949.                             if (!this.VP8GetBit(_arg1, _local7[6])){
  2950.                                 if (!this.VP8GetBit(_arg1, _local7[7])){
  2951.                                     _local8 = (5 + this.VP8GetBit(_arg1, 159));
  2952.                                 } else {
  2953.                                     _local8 = (7 + (2 * this.VP8GetBit(_arg1, 165)));
  2954.                                     _local8 = (_local8 + this.VP8GetBit(_arg1, 145));
  2955.                                 };
  2956.                             } else {
  2957.                                 _local10 = this.uint8_t;
  2958.                                 _local11 = this.VP8GetBit(_arg1, _local7[8]);
  2959.                                 _local12 = this.VP8GetBit(_arg1, _local7[(9 + _local11)]);
  2960.                                 _local13 = ((2 * _local11) + _local12);
  2961.                                 _local8 = 0;
  2962.                                 _local10 = this.kCat3456[_local13];
  2963.                                 _local14 = 0;
  2964.                                 while (_local14 < (_local10.length - 1)) {
  2965.                                     _local8 = (_local8 + (_local8 + this.VP8GetBit(_arg1, _local10[_local14])));
  2966.                                     _local14++;
  2967.                                 };
  2968.                                 _local8 = (_local8 + (3 + (8 << _local13)));
  2969.                             };
  2970.                         };
  2971.                         _local7 = _arg2[this.kBands[_arg5]][2];
  2972.                     };
  2973.                     _local9 = this.kZigzag[(_arg5 - 1)];
  2974.                     _arg6[(_arg6[(_arg6.length - 1)] + _local9)] = (this.VP8GetSigned(_arg1, _local8) * _arg4[((_local9 > 0) + 0)]);
  2975.                     if ((((_arg5 == 16)) || (!(this.VP8GetBit(_arg1, _local7[0]))))){
  2976.                         return (_arg5);
  2977.                     };
  2978.                 };
  2979.                 if (_arg5 == 16){
  2980.                     return (16);
  2981.                 };
  2982.             };
  2983.         }
  2984.         public function SimpleHFilter16(_arg1, _arg2, _arg3, _arg4){
  2985.             var _local5:*;
  2986.             _local5 = 0;
  2987.             while (_local5 < 16) {
  2988.                 if (this.needs_filter(_arg1, (_arg2 + (_local5 * _arg3)), 1, _arg4)){
  2989.                     this.do_filter2(_arg1, (_arg2 + (_local5 * _arg3)), 1);
  2990.                 };
  2991.                 _local5++;
  2992.             };
  2993.         }
  2994.         public function UpsampleRgba4444KeepAlphaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  2995.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgba4444KeepA, 2);
  2996.         }
  2997.         public function InitIo(_arg1, _arg2){
  2998.             _arg2.width = _arg1.pic_hdr_.width_;
  2999.             _arg2.height = _arg1.pic_hdr_.height_;
  3000.             _arg2.mb_y = 0;
  3001.             _arg2.y = _arg1.cache_y_;
  3002.             _arg2.y_off = _arg1.cache_y_off;
  3003.             _arg2.u = _arg1.cache_u_;
  3004.             _arg2.u_off = _arg1.cache_u_off;
  3005.             _arg2.v = _arg1.cache_v_;
  3006.             _arg2.v_off = _arg1.cache_v_off;
  3007.             _arg2.y_stride = _arg1.cache_y_stride_;
  3008.             _arg2.uv_stride = _arg1.cache_uv_stride_;
  3009.             _arg2.fancy_upsampling = 0;
  3010.             _arg2.a = null;
  3011.             _arg2.a_off = null;
  3012.         }
  3013.         public function clip_8b(_arg1){
  3014.             return ((((_arg1 & ~(0xFF))) ? ((_arg1)<0) ? 0 : 0xFF : _arg1));
  3015.         }
  3016.         public function VP8YUVInit(_arg1){
  3017.             var _local2:*;
  3018.             var _local3:*;
  3019.             if (this.done){
  3020.                 return;
  3021.             };
  3022.             _local2 = 0;
  3023.             while (_local2 < 0x0100) {
  3024.                 this.VP8kVToR[_local2] = (((89858 * (_local2 - 128)) + this.YUV_HALF) >> this.YUV_FIX);
  3025.                 this.VP8kUToG[_local2] = ((-22014 * (_local2 - 128)) + this.YUV_HALF);
  3026.                 this.VP8kVToG[_local2] = (-45773 * (_local2 - 128));
  3027.                 this.VP8kUToB[_local2] = (((113618 * (_local2 - 128)) + this.YUV_HALF) >> this.YUV_FIX);
  3028.                 _local2++;
  3029.             };
  3030.             _local2 = this.YUV_RANGE_MIN;
  3031.             while (_local2 < this.YUV_RANGE_MAX) {
  3032.                 _local3 = ((((_local2 - 16) * 76283) + this.YUV_HALF) >> this.YUV_FIX);
  3033.                 this.VP8kClip[(_local2 - this.YUV_RANGE_MIN)] = this.clip(_local3, 0xFF);
  3034.                 this.VP8kClip4Bits[(_local2 - this.YUV_RANGE_MIN)] = this.clip(((_local3 + 8) >> 4), 15);
  3035.                 _local2++;
  3036.             };
  3037.             this.done = 1;
  3038.         }
  3039.         public function VP8YuvToRgb(_arg1, _arg2, _arg3, _arg4, _arg5){
  3040.             var _local6:* = this.VP8kVToR[_arg3];
  3041.             var _local7:* = ((this.VP8kVToG[_arg3] + this.VP8kUToG[_arg2]) >> this.YUV_FIX);
  3042.             var _local8:* = this.VP8kUToB[_arg2];
  3043.             _arg4[(_arg5 + 0)] = this.VP8kClip[((_arg1 + _local6) - this.YUV_RANGE_MIN)];
  3044.             _arg4[(_arg5 + 1)] = this.VP8kClip[((_arg1 + _local7) - this.YUV_RANGE_MIN)];
  3045.             _arg4[(_arg5 + 2)] = this.VP8kClip[((_arg1 + _local8) - this.YUV_RANGE_MIN)];
  3046.         }
  3047.         public function VP8YuvToBgr(_arg1, _arg2, _arg3, _arg4, _arg5){
  3048.             var _local6:* = this.VP8kVToR[_arg3];
  3049.             var _local7:* = ((this.VP8kVToG[_arg3] + this.VP8kUToG[_arg2]) >> this.YUV_FIX);
  3050.             var _local8:* = this.VP8kUToB[_arg2];
  3051.             _arg4[(_arg5 + 0)] = this.VP8kClip[((_arg1 + _local8) - this.YUV_RANGE_MIN)];
  3052.             _arg4[(_arg5 + 1)] = this.VP8kClip[((_arg1 + _local7) - this.YUV_RANGE_MIN)];
  3053.             _arg4[(_arg5 + 2)] = this.VP8kClip[((_arg1 + _local6) - this.YUV_RANGE_MIN)];
  3054.         }
  3055.         public function VP8GetInfo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
  3056.             var _local8:*;
  3057.             var _local9:*;
  3058.             var _local10:*;
  3059.             var _local11:*;
  3060.             if (_arg3.value < 10){
  3061.                 return (0);
  3062.             };
  3063.             if (((((!((_arg1[(_arg2.value + 3)] == 157))) || (!((_arg1[(_arg2.value + 4)] == 1))))) || (!((_arg1[(_arg2.value + 5)] == 42))))){
  3064.                 return (0);
  3065.             };
  3066.             _local8 = ((_arg1[(_arg2.value + 0)] | (_arg1[(_arg2.value + 1)] << 8)) | (_arg1[(_arg2.value + 2)] << 16));
  3067.             _local9 = (!((_local8 & 1)) + 0);
  3068.             _local10 = (((_arg1[(_arg2.value + 7)] << 8) | _arg1[(_arg2.value + 6)]) & 16383);
  3069.             _local11 = (((_arg1[(_arg2.value + 9)] << 8) | _arg1[(_arg2.value + 8)]) & 16383);
  3070.             if (_arg7){
  3071.                 if (_arg3.value < 11){
  3072.                     return (0);
  3073.                 };
  3074.                 _arg7.value = !(!((_arg1[(_arg2.value + 10)] & 128)));
  3075.             };
  3076.             if (!_local9){
  3077.                 return (0);
  3078.             };
  3079.             if (((_local8 >> 1) & 7) > 3){
  3080.                 return (0);
  3081.             };
  3082.             if (!((_local8 >> 4) & 1)){
  3083.                 return (0);
  3084.             };
  3085.             if ((_local8 >> 5) >= _arg4){
  3086.                 return (0);
  3087.             };
  3088.             if (_arg5){
  3089.                 _arg5.value = _local10;
  3090.             };
  3091.             if (_arg6){
  3092.                 _arg6.value = _local11;
  3093.             };
  3094.             return (1);
  3095.         }
  3096.         public function VP8EnterCritical(_arg1, _arg2){
  3097.             if (((_arg2.setup) && (!(_arg2.setup(_arg2))))){
  3098.                 this.VP8SetError(_arg1, this.VP8_STATUS_USER_ABORT, "Frame setup failed");
  3099.                 return (_arg1.status_);
  3100.             };
  3101.             if (_arg2.bypass_filtering){
  3102.                 _arg1.filter_type_ = 0;
  3103.             };
  3104.             var _local3:* = this.kFilterExtraRows[_arg1.filter_type_];
  3105.             if (_arg1.filter_type_ == 2){
  3106.                 _arg1.tl_mb_x_ = 0;
  3107.                 _arg1.tl_mb_y_ = 0;
  3108.             } else {
  3109.                 _arg1.tl_mb_y_ = (_arg2.crop_top >> 4);
  3110.                 _arg1.tl_mb_x_ = (_arg2.crop_left >> 4);
  3111.             };
  3112.             _arg1.br_mb_y_ = (((_arg2.crop_bottom + 15) + _local3) >> 4);
  3113.             _arg1.br_mb_x_ = (((_arg2.crop_right + 15) + _local3) >> 4);
  3114.             if (_arg1.br_mb_x_ > _arg1.mb_w_){
  3115.                 _arg1.br_mb_x_ = _arg1.mb_w_;
  3116.             };
  3117.             if (_arg1.br_mb_y_ > _arg1.mb_h_){
  3118.                 _arg1.br_mb_y_ = _arg1.mb_h_;
  3119.             };
  3120.             return (this.VP8_STATUS_OK);
  3121.         }
  3122.         public function WebPDecodeYUVInto(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14){
  3123.             var _local15:*;
  3124.             var _local16:*;
  3125.             _local15 = this.newObjectIt(this.WebPDecParams);
  3126.             _local16 = this.newObjectIt(this.WebPDecBuffer);
  3127.             if (_arg3 == null){
  3128.                 return (null);
  3129.             };
  3130.             this.WebPInitDecBuffer(_local16);
  3131.             this.WebPResetDecParams(_local15);
  3132.             _local15.output = _local16;
  3133.             _local16.colorspace = this.MODE_YUV;
  3134.             _local16.u.YUVA.y = _arg3;
  3135.             _local16.u.YUVA.y_off = _arg4;
  3136.             _local16.u.YUVA.y_stride = _arg6;
  3137.             _local16.u.YUVA.y_size = _arg5;
  3138.             _local16.u.YUVA.u = _arg7;
  3139.             _local16.u.YUVA.u_off = _arg8;
  3140.             _local16.u.YUVA.u_stride = _arg10;
  3141.             _local16.u.YUVA.u_size = _arg9;
  3142.             _local16.u.YUVA.v = _arg11;
  3143.             _local16.u.YUVA.v_off = _arg12;
  3144.             _local16.u.YUVA.v_stride = _arg14;
  3145.             _local16.u.YUVA.v_size = _arg13;
  3146.             _local16.is_external_memory = 1;
  3147.             if (this.DecodeInto(_arg1, 0, _arg2, _local15) != this.VP8_STATUS_OK){
  3148.                 return (null);
  3149.             };
  3150.             return (_arg3);
  3151.         }
  3152.         public function newObjectIt(_arg1){
  3153.             return (JSON.decode(JSON.encode(_arg1)));
  3154.         }
  3155.         public function WebPChange():void{
  3156.             var _local1:Boolean;
  3157.             var _local2:*;
  3158.             var _local3:*;
  3159.             var _local4:*;
  3160.             var _local5:*;
  3161.             var _local6:*;
  3162.             var _local7:*;
  3163.             var _local8:*;
  3164.             var _local9:*;
  3165.             var _local10:*;
  3166.             var _local11:*;
  3167.             var _local12:*;
  3168.             var _local13:*;
  3169.             var _local14:*;
  3170.             var _local15:*;
  3171.             var _local16:*;
  3172.             var _local17:*;
  3173.             var _local18:*;
  3174.             var _local19:*;
  3175.             var _local20:*;
  3176.             if (this.my_mode != "img"){
  3177.                 _local1 = (((this.my_bgRepeat == "no-repeat")) ? false : true);
  3178.                 _local2 = (((((this.my_bgRepeat == "repeat-x")) || ((this.my_bgRepeat == "repeat")))) ? (stage.stageWidth + this.WebPImage.width.value) : this.WebPImage.width.value);
  3179.                 _local3 = (((((this.my_bgRepeat == "repeat-y")) || ((this.my_bgRepeat == "repeat")))) ? (stage.stageHeight + this.WebPImage.height.value) : this.WebPImage.height.value);
  3180.                 _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)));
  3181.                 _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)));
  3182.                 _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));
  3183.                 _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));
  3184.                 _local6 = new Matrix();
  3185.                 this.pic.x = _local4;
  3186.                 this.pic.y = _local5;
  3187.                 this.pic.graphics.clear();
  3188.                 this.pic.graphics.beginBitmapFill(this.bmData, _local6, _local1, true);
  3189.                 this.pic.graphics.drawRect(0, 0, _local2, _local3);
  3190.                 if (this.firstTime){
  3191.                     ExternalInterface.call("webpFSCommand", "status", (("" + this.my_id) + "|finish"));
  3192.                 };
  3193.             } else {
  3194.                 this.pic.width = stage.stageWidth;
  3195.                 this.pic.height = stage.stageHeight;
  3196.                 _local7 = this.my_styleWidth;
  3197.                 _local8 = this.my_styleHeight;
  3198.                 _local9 = /([\+\-0-9]+)(([a-zA-Z%]+)?)/.exec(_local7);
  3199.                 _local10 = /([\+\-0-9]+)(([a-zA-Z%]+)?)/.exec(_local8);
  3200.                 _local11 = this.my_imgWidth;
  3201.                 _local12 = this.my_imgHeight;
  3202.                 _local13 = /([\+\-0-9]+)(([a-zA-Z%]+)?)/.exec(_local11);
  3203.                 _local14 = /([\+\-0-9]+)(([a-zA-Z%]+)?)/.exec(_local12);
  3204.                 _local15 = this.WebPImage.width.value;
  3205.                 _local16 = this.WebPImage.height.value;
  3206.                 _local17 = ((_local8)!="auto") ? _local10 : _local14;
  3207.                 _local18 = ((_local7)!="auto") ? _local9 : _local13;
  3208.                 _local19 = ((_local7)!="auto") ? _local7 : ((_local11)!="") ? _local11 : (((((_local8 == "auto")) && ((_local12 == "")))) ? (_local15 + "px") : (((((_local17[2])!="%") ? _local17[1] : stage.stageHeight / _local16) * _local15) + ((_local17[2])!="%") ? _local17[2] : "px"));
  3209.                 _local20 = ((_local8)!="auto") ? _local8 : ((_local12)!="") ? _local12 : (((((_local7 == "auto")) && ((_local11 == "")))) ? (_local16 + "px") : (((((_local18[2])!="%") ? _local18[1] : stage.stageWidth / _local15) * _local16) + ((_local18[2])!="%") ? _local18[2] : "px"));
  3210.                 _local19 = (_local19 + (((/([\+\-0-9.]+)(([a-zA-Z%]+)?)/.exec(_local19)[2] == "")) ? "px" : ""));
  3211.                 _local20 = (_local20 + (((/([\+\-0-9.]+)(([a-zA-Z%]+)?)/.exec(_local20)[2] == "")) ? "px" : ""));
  3212.                 if (this.firstTime){
  3213.                     ExternalInterface.call("webpFSCommand", "img", (((((("" + this.my_id) + "|") + _local19) + "|") + _local20) + ""));
  3214.                     ExternalInterface.call("webpFSCommand", "status", (("" + this.my_id) + "|finish"));
  3215.                 } else {
  3216.                     ExternalInterface.call("webpFSCommand", "imgresize", (((((("" + this.my_id) + "|") + _local19) + "|") + _local20) + ""));
  3217.                 };
  3218.             };
  3219.         }
  3220.         public function VFilter8(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
  3221.             this.FilterLoop26(_arg1, _arg2, _arg5, 1, 8, _arg6, _arg7, _arg8);
  3222.             this.FilterLoop26(_arg3, _arg4, _arg5, 1, 8, _arg6, _arg7, _arg8);
  3223.         }
  3224.         public function VP8GetValue(_arg1, _arg2){
  3225.             var _local3:* = 0;
  3226.             while (_arg2-- > 0) {
  3227.                 _local3 = (_local3 | (this.VP8GetBit(_arg1, 128) << _arg2));
  3228.             };
  3229.             return (_local3);
  3230.         }
  3231.         public function UpsampleArgbLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  3232.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToArgb, 4);
  3233.         }
  3234.         public function ParseFrame(_arg1, _arg2){
  3235.             _arg1.mb_y_ = 0;
  3236.             while (_arg1.mb_y_ < _arg1.br_mb_y_) {
  3237.                 this.token_br = _arg1.parts_[(_arg1.mb_y_ & (_arg1.num_parts_ - 1))];
  3238.                 this.VP8InitScanline(_arg1);
  3239.                 _arg1.mb_x_ = 0;
  3240.                 while (_arg1.mb_x_ < _arg1.mb_w_) {
  3241.                     if (!this.VP8DecodeMB(_arg1, this.token_br)){
  3242.                         return (this.VP8SetError(_arg1, "VP8_STATUS_NOT_ENOUGH_DATA", ((("Premature end-of-file encountered." + _arg1.mb_x_) + " ") + _arg1.mb_y_)));
  3243.                     };
  3244.                     this.VP8ReconstructBlock(_arg1);
  3245.                     this.VP8StoreBlock(_arg1);
  3246.                     _arg1.mb_x_++;
  3247.                 };
  3248.                 if (!this.VP8ProcessRow(_arg1, _arg2)){
  3249.                     return (this.VP8SetError(_arg1, "VP8_STATUS_USER_ABORT", "Output aborted."));
  3250.                 };
  3251.                 _arg1.mb_y_++;
  3252.             };
  3253.             if (_arg1.layer_data_size_ > 0){
  3254.                 if (!this.VP8DecodeLayer(_arg1)){
  3255.                     return (0);
  3256.                 };
  3257.             };
  3258.             return (1);
  3259.         }
  3260.         public function DecodeIntoRGBABuffer(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
  3261.             var _local7:*;
  3262.             var _local8:*;
  3263.             _local7 = this.newObjectIt(this.WebPDecParams);
  3264.             _local8 = this.newObjectIt(this.WebPDecBuffer);
  3265.             if (_arg4 == null){
  3266.                 return (null);
  3267.             };
  3268.             this.WebPInitDecBuffer(_local8);
  3269.             this.WebPResetDecParams(_local7);
  3270.             _local7.output = _local8;
  3271.             _local8.colorspace = _arg1;
  3272.             _local8.u.RGBA.rgba = _arg4;
  3273.             _local8.u.RGBA.rgba_off = 0;
  3274.             _local8.u.RGBA.stride = _arg5;
  3275.             _local8.u.RGBA.size = _arg6;
  3276.             _local8.is_external_memory = 1;
  3277.             if (this.DecodeInto(_arg2, 0, _arg3, _local7) != this.VP8_STATUS_OK){
  3278.                 return (null);
  3279.             };
  3280.             return (_arg4);
  3281.         }
  3282.         public function CheckMode(_arg1, _arg2){
  3283.             if (_arg2 == this.B_DC_PRED){
  3284.                 if (_arg1.mb_x_ == 0){
  3285.                     return (((_arg1.mb_y_)==0) ? this.B_DC_PRED_NOTOPLEFT : this.B_DC_PRED_NOLEFT);
  3286.                 };
  3287.                 return (((_arg1.mb_y_)==0) ? this.B_DC_PRED_NOTOP : this.B_DC_PRED);
  3288.             };
  3289.             return (_arg2);
  3290.         }
  3291.         public function VP8GetHeaders(_arg1, _arg2){
  3292.             var _local12:*;
  3293.             var _local15:*;
  3294.             var _local16:*;
  3295.             var _local17:*;
  3296.             var _local18:*;
  3297.             var _local19:*;
  3298.             var _local3:* = {value:0};
  3299.             var _local4:* = this.uint8_t;
  3300.             var _local5:* = {value:this.uint32_t};
  3301.             var _local6:* = {value:this.uint32_t};
  3302.             var _local7:* = {value:this.uint32_t};
  3303.             var _local8:* = {value:0};
  3304.             var _local9:* = {value:0};
  3305.             var _local10:* = this.newObjectIt(this.VP8FrameHeader);
  3306.             var _local11:* = this.newObjectIt(this.VP8PictureHeader);
  3307.             _local12 = this.newObjectIt(this.VP8BitReader);
  3308.             var _local13:* = "VP8StatusCode";
  3309.             if (_arg1 == null){
  3310.                 this.alert("(dec == null)");
  3311.                 return (0);
  3312.             };
  3313.             this.SetOk(_arg1);
  3314.             if (_arg2 == null){
  3315.                 return (this.VP8SetError(_arg1, "VP8_STATUS_INVALID_PARAM", "null VP8Io passed to VP8GetHeaders()"));
  3316.             };
  3317.             _local4 = _arg2.data;
  3318.             _local3.value = _arg2.data_off;
  3319.             _local5.value = _arg2.data_size;
  3320.             if ((((_local4 == null)) || ((_local5.value <= 4)))){
  3321.                 return (this.VP8SetError(_arg1, "VP8_STATUS_NOT_ENOUGH_DATA", "Not enough data to parse frame header"));
  3322.             };
  3323.             if (!this.WebPCheckAndSkipRIFFHeader(_local4, _local3, _local5, _local6)){
  3324.                 return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "RIFF: Invalid RIFF container"));
  3325.             };
  3326.             if (!this.VP8XGetInfo(_local4, _local3, _local5, _local8, null, null, null)){
  3327.                 return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "RIFF: Invalid VP8X container"));
  3328.             };
  3329.             if (!this.VP8CheckAndSkipHeader(_local4, _local3, _local5, _local9, _local7, _local6)){
  3330.                 return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "RIFF: Inconsistent size information."));
  3331.             };
  3332.             if (_local9.value == -1){
  3333.                 return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "RIFF: Inconsistent size information."));
  3334.             };
  3335.             if (_local5.value < 4){
  3336.                 return (this.VP8SetError(_arg1, this.VP8_STATUS_NOT_ENOUGH_DATA, "RIFF: Truncated header."));
  3337.             };
  3338.             _local3 = _local3.value;
  3339.             _local5 = _local5.value;
  3340.             var _local14:* = ((_local4[(_local3 + 0)] | (_local4[(_local3 + 1)] << 8)) | (_local4[(_local3 + 2)] << 16));
  3341.             _local10 = _arg1.frm_hdr_;
  3342.             _local10.key_frame_ = (!((_local14 & 1)) + 0);
  3343.             _local10.profile_ = ((_local14 >> 1) & 7);
  3344.             _local10.show_ = ((_local14 >> 4) & 1);
  3345.             _local10.partition_length_ = (_local14 >> 5);
  3346.             if (_local10.profile_ > 3){
  3347.                 return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "Incorrect keyframe parameters."));
  3348.             };
  3349.             if (!_local10.show_){
  3350.                 return (this.VP8SetError(_arg1, "VP8_STATUS_UNSUPPORTED_FEATURE", "Frame not displayable."));
  3351.             };
  3352.             _local3 = (_local3 + 3);
  3353.             _local5 = (_local5 - 3);
  3354.             _local11 = _arg1.pic_hdr_;
  3355.             if (_local10.key_frame_){
  3356.                 if (_local5 < 7){
  3357.                     return (this.VP8SetError(_arg1, "VP8_STATUS_NOT_ENOUGH_DATA", "cannot parse picture header"));
  3358.                 };
  3359.                 if (((((!((this.Byte2Hex(_local4[(_local3 + 0)]) == 157))) || (!((this.Byte2Hex(_local4[(_local3 + 1)]) == 1))))) || (!((this.Byte2Hex(_local4[(_local3 + 2)]) == 42))))){
  3360.                     return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "Bad code word"));
  3361.                 };
  3362.                 _local11.width_ = (((_local4[(_local3 + 4)] << 8) | _local4[(_local3 + 3)]) & 16383);
  3363.                 _local11.xscale_ = (_local4[(_local3 + 4)] >> 6);
  3364.                 _local11.height_ = (((_local4[(_local3 + 6)] << 8) | _local4[(_local3 + 5)]) & 16383);
  3365.                 _local11.yscale_ = (_local4[(_local3 + 6)] >> 6);
  3366.                 _local3 = (_local3 + 7);
  3367.                 _local5 = (_local5 - 7);
  3368.                 _arg1.mb_w_ = ((_local11.width_ + 15) >> 4);
  3369.                 _arg1.mb_h_ = ((_local11.height_ + 15) >> 4);
  3370.                 _arg2.width = _local11.width_;
  3371.                 _arg2.height = _local11.height_;
  3372.                 _arg2.use_scaling = 0;
  3373.                 _arg2.use_cropping = 0;
  3374.                 _arg2.crop_top = 0;
  3375.                 _arg2.crop_left = 0;
  3376.                 _arg2.crop_right = _arg2.width;
  3377.                 _arg2.crop_bottom = _arg2.height;
  3378.                 _arg2.mb_w = _arg2.width;
  3379.                 _arg2.mb_h = _arg2.height;
  3380.                 this.VP8ResetProba(_arg1.proba_);
  3381.                 this.ResetSegmentHeader(_arg1.segment_hdr_);
  3382.                 _arg1.segment_ = 0;
  3383.             };
  3384.             if (_local10.partition_length_ > _local5){
  3385.                 return (this.VP8SetError(_arg1, "VP8_STATUS_NOT_ENOUGH_DATA", "bad partition length"));
  3386.             };
  3387.             _arg1.alpha_data_ = null;
  3388.             _arg1.alpha_data_size_ = 0;
  3389.             _local12 = _arg1.br_;
  3390.             this.VP8InitBitReader(_local12, _local4, _local3, (_local3 + _local10.partition_length_));
  3391.             _local3 = (_local3 + _local10.partition_length_);
  3392.             _local5 = (_local5 - _local10.partition_length_);
  3393.             if (_local10.key_frame_){
  3394.                 _local11.colorspace_ = this.VP8Get(_local12);
  3395.                 _local11.clamp_type_ = this.VP8Get(_local12);
  3396.             };
  3397.             if (!this.ParseSegmentHeader(_local12, _arg1.segment_hdr_, _arg1.proba_)){
  3398.                 return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "cannot parse segment header"));
  3399.             };
  3400.             if (!this.ParseFilterHeader(_local12, _arg1)){
  3401.                 return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "cannot parse filter header"));
  3402.             };
  3403.             _local13 = this.ParsePartitions(_arg1, _local4, _local3, _local5);
  3404.             if (_local13 != "VP8_STATUS_OK"){
  3405.                 return (this.VP8SetError(_arg1, "VP8_STATUS_BITSTREAM_ERROR", "cannot parse partitions"));
  3406.             };
  3407.             this.VP8ParseQuant(_arg1);
  3408.             if (!_local10.key_frame_){
  3409.                 return (this.VP8SetError(_arg1, this.VP8_STATUS_UNSUPPORTED_FEATURE, "Not a key frame."));
  3410.             };
  3411.             _arg1.buffer_flags_ = (3 | 0x0100);
  3412.             this.VP8Get(_local12);
  3413.             this.VP8ParseProba(_local12, _arg1);
  3414.             if (_arg1.pic_hdr_.colorspace_){
  3415.                 _local15 = 8;
  3416.                 _local16 = 1;
  3417.                 _local17 = _local4;
  3418.                 _local18 = (_local3 - _local15);
  3419.                 _local19 = this.size_t;
  3420.                 if ((((_local10.partition_length_ < _local15)) || (!((_local17[((_local18 + _local15) - 1)] == _local16))))){
  3421.                 };
  3422.                 _local19 = (((_local17[(_local18 + 4)] << 0) | (_local17[(_local18 + 5)] << 8)) | (_local17[(_local18 + 6)] << 16));
  3423.                 if (_local10.partition_length_ < (_local19 + _local15)){
  3424.                     return (this.VP8SetError(_arg1, this.VP8_STATUS_BITSTREAM_ERROR, "RIFF: Inconsistent extra information."));
  3425.                 };
  3426.                 _arg1.alpha_data_ = ((_local19)>0) ? _local17 : null;
  3427.                 _arg1.alpha_data_off = ((_local19)>0) ? (_local18 - _local19) : null;
  3428.                 _arg1.alpha_data_size_ = _local19;
  3429.                 _local19 = (((_local17[(_local18 + 0)] << 0) | (_local17[(_local18 + 1)] << 8)) | (_local17[(_local18 + 2)] << 16));
  3430.                 _arg1.layer_data_size_ = _local19;
  3431.                 _arg1.layer_data_ = null;
  3432.                 _arg1.layer_colorspace_ = _local17[(_local18 + 3)];
  3433.             };
  3434.             _arg1.ready_ = 1;
  3435.             return (1);
  3436.         }
  3437.         public function Byte2Hex(_arg1){
  3438.             return (("0x" + _arg1.toString(16)));
  3439.         }
  3440.         public function HD4(_arg1, _arg2){
  3441.             var _local3:* = _arg1[((_arg2 - 1) + (0 * this.BPS))];
  3442.             var _local4:* = _arg1[((_arg2 - 1) + (1 * this.BPS))];
  3443.             var _local5:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
  3444.             var _local6:* = _arg1[((_arg2 - 1) + (3 * this.BPS))];
  3445.             var _local7:* = _arg1[((_arg2 - 1) - this.BPS)];
  3446.             var _local8:* = _arg1[((_arg2 + 0) - this.BPS)];
  3447.             var _local9:* = _arg1[((_arg2 + 1) - this.BPS)];
  3448.             var _local10:* = _arg1[((_arg2 + 2) - this.BPS)];
  3449.             _arg1[((_arg2 + 0) + (0 * this.BPS))] = (_arg1[((_arg2 + 2) + (1 * this.BPS))] = this.AVG2(_local3, _local7));
  3450.             _arg1[((_arg2 + 0) + (1 * this.BPS))] = (_arg1[((_arg2 + 2) + (2 * this.BPS))] = this.AVG2(_local4, _local3));
  3451.             _arg1[((_arg2 + 0) + (2 * this.BPS))] = (_arg1[((_arg2 + 2) + (3 * this.BPS))] = this.AVG2(_local5, _local4));
  3452.             _arg1[((_arg2 + 0) + (3 * this.BPS))] = this.AVG2(_local6, _local5);
  3453.             _arg1[((_arg2 + 3) + (0 * this.BPS))] = this.AVG3(_local8, _local9, _local10);
  3454.             _arg1[((_arg2 + 2) + (0 * this.BPS))] = this.AVG3(_local7, _local8, _local9);
  3455.             _arg1[((_arg2 + 1) + (0 * this.BPS))] = (_arg1[((_arg2 + 3) + (1 * this.BPS))] = this.AVG3(_local3, _local7, _local8));
  3456.             _arg1[((_arg2 + 1) + (1 * this.BPS))] = (_arg1[((_arg2 + 3) + (2 * this.BPS))] = this.AVG3(_local4, _local3, _local7));
  3457.             _arg1[((_arg2 + 1) + (2 * this.BPS))] = (_arg1[((_arg2 + 3) + (3 * this.BPS))] = this.AVG3(_local5, _local4, _local3));
  3458.             _arg1[((_arg2 + 1) + (3 * this.BPS))] = this.AVG3(_local6, _local5, _local4);
  3459.         }
  3460.         public function VP8ExitCritical(_arg1, _arg2){
  3461.             var _local3:* = 1;
  3462.             if (_arg1.use_threads_){
  3463.             };
  3464.             if (_arg2.teardown){
  3465.                 _arg2.teardown(_arg2);
  3466.             };
  3467.             return (_local3);
  3468.         }
  3469.         public function AllocateMemory(_arg1){
  3470.             var _local2:* = _arg1.num_caches_;
  3471.             var _local3:* = _arg1.mb_w_;
  3472.             var _local4:* = ((4 * _local3) * this.sizeof(this.uint8_t));
  3473.             var _local5:* = (((16 + 8) + 8) * _local3);
  3474.             var _local6:* = ((_local3 + 1) * this.sizeof(this.VP8MB));
  3475.             var _local7:* = ((_arg1.filter_type_)>0) ? ((_local3 * ((_arg1.use_threads_) ? 2 : 1)) * this.sizeof(this.VP8FInfo)) : 0;
  3476.             var _local8:* = (this.YUV_SIZE * this.sizeof(_arg1.yuv_b_));
  3477.             var _local9:* = (384 * this.sizeof(_arg1.coeffs_));
  3478.             var _local10:* = ((16 * _local2) + ((parseInt(this.kFilterExtraRows[_arg1.filter_type_]) * 3) / 2));
  3479.             var _local11:* = (_local5 * _local10);
  3480.             var _local12:* = ((_arg1.alpha_data_) ? (_arg1.pic_hdr_.width_ * _arg1.pic_hdr_.height_) : 0);
  3481.             var _local13:* = ((((((((_local4 + _local5) + _local6) + _local7) + _local8) + _local9) + _local11) + _local12) + this.ALIGN_MASK);
  3482.             var _local14:* = this.uint8_t;
  3483.             var _local15:* = 0;
  3484.             if (_local13 > _arg1.mem_size_){
  3485.                 _arg1.mem_ = 0;
  3486.                 _arg1.mem_size_ = 0;
  3487.                 if (_arg1.mem_ == null){
  3488.                     return (this.VP8SetError(_arg1, "VP8_STATUS_OUT_OF_MEMORY", "no memory during frame initialization."));
  3489.                 };
  3490.                 _arg1.mem_size_ = _local13;
  3491.             };
  3492.             _local14 = _arg1.mem_;
  3493.             _arg1.intra_t_ = 205;
  3494.             _arg1.y_t_ = this.memset(205, ((16 * _local3) * this.sizeof(_arg1.y_t_)));
  3495.             _arg1.u_t_ = this.memset(205, ((8 * _local3) * this.sizeof(_arg1.u_t_)));
  3496.             _arg1.v_t_ = this.memset(205, ((8 * _local3) * this.sizeof(_arg1.v_t_)));
  3497.             _arg1.f_info_ = ((_local7) ? this.memset_wl(this.VP8FInfo, _local7) : null);
  3498.             _arg1.f_info_off = ((_local7) ? 0 : null);
  3499.             _arg1.thread_ctx_.id_ = 0;
  3500.             _arg1.thread_ctx_.f_info_ = _arg1.f_info_;
  3501.             if (_arg1.use_threads_){
  3502.                 _arg1.thread_ctx_.f_info_off = (_arg1.thread_ctx_.f_info_off + _local3);
  3503.             };
  3504.             this.assert(((_local8 & this.ALIGN_MASK) == 0));
  3505.             _arg1.yuv_b_ = this.memset(205, (_local8 * this.sizeof(_arg1.yuv_b_)));
  3506.             _arg1.coeffs_ = this.memset(0, _local9);
  3507.             _arg1.cache_y_stride_ = (16 * _local3);
  3508.             _arg1.cache_uv_stride_ = (8 * _local3);
  3509.             var _local16:* = this.kFilterExtraRows[_arg1.filter_type_];
  3510.             var _local17:* = (_local16 * _arg1.cache_y_stride_);
  3511.             var _local18:* = ((_local16 / 2) * _arg1.cache_uv_stride_);
  3512.             _arg1.cache_y_ = this.Arr(_local11, 205);
  3513.             _arg1.cache_y_off = _local17;
  3514.             _arg1.cache_u_ = _arg1.cache_y_;
  3515.             _arg1.cache_u_off = ((_arg1.cache_y_off + ((16 * _local2) * _arg1.cache_y_stride_)) + _local18);
  3516.             _arg1.cache_v_ = _arg1.cache_u_;
  3517.             _arg1.cache_v_off = ((_arg1.cache_u_off + ((8 * _local2) * _arg1.cache_uv_stride_)) + _local18);
  3518.             _arg1.alpha_plane_ = ((_local12) ? this.Arr(_local12, this.uint8_t) : null);
  3519.             _arg1.mb_info_ = this.memset_wl(this.VP8MB, _local6);
  3520.             _arg1.intra_t_ = this.memset(this.B_DC_PRED, _local4);
  3521.             return (1);
  3522.         }
  3523.         public function ResetSegmentHeader(_arg1){
  3524.             var _local2:int;
  3525.             this.assert(_arg1);
  3526.             _arg1.use_segment_ = 0;
  3527.             _arg1.update_map_ = 0;
  3528.             _arg1.absolute_delta_ = 1;
  3529.             _local2 = 0;
  3530.             while (_local2 < _arg1.quantizer_.length) {
  3531.                 _arg1.quantizer_[_local2] = 0;
  3532.                 _local2++;
  3533.             };
  3534.             _local2 = 0;
  3535.             while (_local2 < _arg1.filter_strength_.length) {
  3536.                 _arg1.filter_strength_[_local2] = 0;
  3537.                 _local2++;
  3538.             };
  3539.         }
  3540.         public function HE8uv(_arg1, _arg2){
  3541.             var _local3:*;
  3542.             _local3 = 0;
  3543.             while (_local3 < 8) {
  3544.                 this.memset_(_arg1, (_arg2 + 0), _arg1[(_arg2 - 1)], 8);
  3545.                 _arg2 = (_arg2 + this.BPS);
  3546.                 _local3++;
  3547.             };
  3548.         }
  3549.         public function EmitSampledRGB(_arg1, _arg2){
  3550.             var _local16:*;
  3551.             var _local3:* = _arg2.output;
  3552.             var _local4:* = _local3.u.RGBA;
  3553.             var _local5:* = _local4.rgba;
  3554.             var _local6:* = (_local4.rgba_off + (_arg1.mb_y * _local4.stride));
  3555.             var _local7:* = _arg1.y;
  3556.             var _local8:* = _arg1.y_off;
  3557.             var _local9:* = _arg1.u;
  3558.             var _local10:* = _arg1.u_off;
  3559.             var _local11:* = _arg1.v;
  3560.             var _local12:* = _arg1.v_off;
  3561.             var _local13:* = this.kSamplers[_local3.colorspace];
  3562.             var _local14:* = _arg1.mb_w;
  3563.             var _local15:* = (_arg1.mb_h - 1);
  3564.             _local16 = 0;
  3565.             while (_local16 < _local15) {
  3566.                 _local13(_local7, _local8, _local7, (_local8 + _arg1.y_stride), _local9, _local10, _local11, _local12, _local5, _local6, _local5, (_local6 + _local4.stride), _local14);
  3567.                 _local8 = (_local8 + (2 * _arg1.y_stride));
  3568.                 _local10 = (_local10 + _arg1.uv_stride);
  3569.                 _local12 = (_local12 + _arg1.uv_stride);
  3570.                 _local6 = (_local6 + (2 * _local4.stride));
  3571.                 _local16 = (_local16 + 2);
  3572.             };
  3573.             if (_local16 == _local15){
  3574.                 _local13(_local7, _local8, _local7, _local8, _local9, _local10, _local11, _local12, _local5, _local6, _local5, _local6, _local14);
  3575.             };
  3576.             return (_arg1.mb_h);
  3577.         }
  3578.         public function HE4(_arg1, _arg2){
  3579.             var _local3:* = _arg1[((_arg2 - 1) - this.BPS)];
  3580.             var _local4:* = _arg1[(_arg2 - 1)];
  3581.             var _local5:* = _arg1[((_arg2 - 1) + this.BPS)];
  3582.             var _local6:* = _arg1[((_arg2 - 1) + (2 * this.BPS))];
  3583.             var _local7:* = _arg1[((_arg2 - 1) + (3 * this.BPS))];
  3584.             _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))));
  3585.             _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))));
  3586.             _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))));
  3587.             _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))));
  3588.         }
  3589.         public function VP8YuvToArgbKeepA(_arg1, _arg2, _arg3, _arg4, _arg5){
  3590.             this.VP8YuvToRgb(_arg1, _arg2, _arg3, _arg4, (_arg5 + 1));
  3591.         }
  3592.         public function CheckDecBuffer(_arg1){
  3593.             var _local6:*;
  3594.             var _local7:*;
  3595.             var _local8:*;
  3596.             var _local9:*;
  3597.             var _local10:*;
  3598.             var _local2:* = 1;
  3599.             var _local3:* = _arg1.colorspace;
  3600.             var _local4:* = _arg1.width;
  3601.             var _local5:* = _arg1.height;
  3602.             if (_local3 >= this.MODE_YUV){
  3603.                 _local6 = _arg1.u.YUVA;
  3604.                 _local7 = (_local6.y_stride * _local5);
  3605.                 _local8 = (_local6.u_stride * parseInt(String(((_local5 + 1) / 2))));
  3606.                 _local9 = (_local6.v_stride * parseInt(String(((_local5 + 1) / 2))));
  3607.                 _local10 = (_local6.a_stride * _local5);
  3608.                 _local2 = (_local2 & ((_local7 <= _local6.y_size) + 0));
  3609.                 _local2 = (_local2 & ((_local8 <= _local6.u_size) + 0));
  3610.                 _local2 = (_local2 & ((_local9 <= _local6.v_size) + 0));
  3611.                 _local2 = (_local2 & ((_local10 <= _local6.a_size) + 0));
  3612.                 _local2 = (_local2 & ((_local6.y_stride >= _local4) + 0));
  3613.                 _local2 = (_local2 & ((_local6.u_stride >= (parseInt(String((_local4 + 1))) / 2)) + 0));
  3614.                 _local2 = (_local2 & ((_local6.v_stride >= (parseInt(String((_local4 + 1))) / 2)) + 0));
  3615.                 if (_local6.a){
  3616.                     _local2 = (_local2 & ((_local6.a_stride >= _local4) + 0));
  3617.                 };
  3618.             } else {
  3619.                 _local6 = _arg1.u.RGBA;
  3620.                 _local2 = (_local2 & (((_local6.stride * _local5) <= _local6.size) + 0));
  3621.                 _local2 = (_local2 & ((_local6.stride >= (_local4 * this.kModeBpp[_local3])) + 0));
  3622.             };
  3623.             return (((_local2) ? this.VP8_STATUS_OK : this.VP8_STATUS_INVALID_PARAM));
  3624.         }
  3625.         public function VP8GetSignedValue(_arg1, _arg2){
  3626.             var _local3:* = this.VP8GetValue(_arg1, _arg2);
  3627.             return (((this.VP8Get(_arg1)) ? -(_local3) : _local3));
  3628.         }
  3629.         public function VP8GetByte(_arg1){
  3630.             this.assert(_arg1);
  3631.             if (_arg1.buf_off < _arg1.buf_end_){
  3632.                 this.assert(_arg1.buf_);
  3633.                 return (_arg1.buf_[_arg1.buf_off++]);
  3634.             };
  3635.             _arg1.eof_ = 1;
  3636.             return (0xFF);
  3637.         }
  3638.         public function Rescale(_arg1, _arg2, _arg3, _arg4, _arg5){
  3639.             var _local6:*;
  3640.             _local6 = 0;
  3641.             while (_arg4-- > 0) {
  3642.                 this.ImportRow(_arg1, _arg2, _arg5);
  3643.                 _arg2 = (_arg2 + _arg3);
  3644.                 _arg5.y_accum = (_arg5.y_accum - _arg5.y_sub);
  3645.                 while (_arg5.y_accum <= 0) {
  3646.                     this.ExportRow(_arg5);
  3647.                     _local6++;
  3648.                 };
  3649.             };
  3650.             return (_local6);
  3651.         }
  3652.         public function malloc(_arg1, _arg2){
  3653.             var _local4:int;
  3654.             var _local3:* = new Array();
  3655.             _local4 = 0;
  3656.             while (_local4 < _arg1) {
  3657.                 _local3.push(_arg2);
  3658.                 _local4++;
  3659.             };
  3660.             _local3.push(0);
  3661.             return (_local3);
  3662.         }
  3663.         public function DC16(_arg1, _arg2){
  3664.             var _local4:*;
  3665.             var _local3:* = 16;
  3666.             _local4 = 0;
  3667.             while (_local4 < 16) {
  3668.                 _local3 = (_local3 + (_arg1[((_arg2 - 1) + (_local4 * this.BPS))] + _arg1[((_arg2 + _local4) - this.BPS)]));
  3669.                 _local4++;
  3670.             };
  3671.             this.Put16((_local3 >> 5), _arg1, _arg2);
  3672.         }
  3673.         public function hev_thresh_from_level(_arg1, _arg2){
  3674.             if (_arg2){
  3675.                 return (((_arg1)>=40) ? 2 : ((_arg1)>=15) ? 1 : 0);
  3676.             };
  3677.             return (((_arg1)>=40) ? 3 : ((_arg1)>=20) ? 2 : ((_arg1)>=15) ? 1 : 0);
  3678.         }
  3679.         public function TransformUV(_arg1, _arg2, _arg3, _arg4){
  3680.             this.VP8Transform(_arg1, (_arg2 + (0 * 16)), _arg3, (_arg4 + 0), 1);
  3681.             this.VP8Transform(_arg1, (_arg2 + (2 * 16)), _arg3, (_arg4 + (4 * this.BPS)), 1);
  3682.         }
  3683.         public function VP8DecodeMB(_arg1, _arg2){
  3684.             var _local3:* = _arg1.br_;
  3685.             var _local4:* = _arg1.mb_info_[(1 - 1)];
  3686.             var _local5:* = _arg1.mb_info_[(1 + _arg1.mb_x_)];
  3687.             if (_arg1.segment_hdr_.update_map_){
  3688.                 _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])));
  3689.             };
  3690.             _local5.skip_ = ((_arg1.use_skip_proba_) ? this.VP8GetBit(_local3, _arg1.skip_p_) : 0);
  3691.             this.VP8ParseIntraMode(_local3, _arg1);
  3692.             if (_local3.eof_){
  3693.                 return (0);
  3694.             };
  3695.             if (!_local5.skip_){
  3696.                 this.ParseResiduals(_arg1, _local5, _arg2);
  3697.             } else {
  3698.                 _local4.nz_ = (_local5.nz_ = 0);
  3699.                 if (!_arg1.is_i4x4_){
  3700.                     _local4.dc_nz_ = (_local5.dc_nz_ = 0);
  3701.                 };
  3702.                 _arg1.non_zero_ = 0;
  3703.                 _arg1.non_zero_ac_ = 0;
  3704.             };
  3705.             return (!(_arg2.eof_));
  3706.         }
  3707.         public function VP8GetSigned(_arg1, _arg2){
  3708.             var _local3:* = (_arg1.range_ >> 1);
  3709.             var _local4:* = this.VP8BitUpdate(_arg1, _local3);
  3710.             this.VP8Shift(_arg1);
  3711.             return (((_local4) ? -(_arg2) : _arg2));
  3712.         }
  3713.         public function VP8ResetProba(_arg1){
  3714.             var _local2:int;
  3715.             _local2 = 0;
  3716.             while (_local2 < _arg1.segments_.length) {
  3717.                 _arg1.segments_[_local2] = 0xFF;
  3718.                 _local2++;
  3719.             };
  3720.             _arg1.coeffs_ = this.newObjectIt(this.CoeffsProba0);
  3721.         }
  3722.         public function int64BitLeft(_arg1, _arg2){
  3723.             var _local4:*;
  3724.             var _local3:* = new Array();
  3725.             _local4 = 0;
  3726.             while (_local4 < _arg2) {
  3727.                 _local3[_local4] = "0";
  3728.                 _local4++;
  3729.             };
  3730.             var _local5:* = ((_arg1.toString(2) + "") + _local3.join(""));
  3731.             return (parseInt(_local5, 2));
  3732.         }
  3733.         public function TrueMotion(_arg1, _arg2, _arg3){
  3734.             var _local8:*;
  3735.             var _local9:*;
  3736.             var _local10:*;
  3737.             var _local11:*;
  3738.             var _local4:* = _arg1;
  3739.             var _local5:* = (_arg2 - this.BPS);
  3740.             var _local6:* = this.clip1;
  3741.             var _local7:* = (0xFF - _local4[(_local5 - 1)]);
  3742.             _local8 = 0;
  3743.             while (_local8 < _arg3) {
  3744.                 _local9 = _local6;
  3745.                 _local10 = (_local7 + _arg1[(_arg2 - 1)]);
  3746.                 _local11 = 0;
  3747.                 while (_local11 < _arg3) {
  3748.                     _arg1[(_arg2 + _local11)] = _local9[(_local10 + _local4[(_local5 + _local11)])];
  3749.                     _local11++;
  3750.                 };
  3751.                 _arg2 = (_arg2 + this.BPS);
  3752.                 _local8++;
  3753.             };
  3754.         }
  3755.         public function hev(_arg1, _arg2, _arg3, _arg4){
  3756.             var _local5:* = _arg1[(_arg2 - (2 * _arg3))];
  3757.             var _local6:* = _arg1[(_arg2 - _arg3)];
  3758.             var _local7:* = _arg1[(_arg2 + 0)];
  3759.             var _local8:* = _arg1[(_arg2 + _arg3)];
  3760.             return ((((this.abs0[((0xFF + _local5) - _local6)] > _arg4)) || ((this.abs0[((0xFF + _local8) - _local7)] > _arg4))));
  3761.         }
  3762.         public function membuild_wl(_arg1, _arg2){
  3763.             var _local4:int;
  3764.             var _local3:* = new Array();
  3765.             _local3.push(this.newObjectIt(_arg1));
  3766.             _local4 = 0;
  3767.             while (_local4 < _arg2) {
  3768.                 _local3.push(this.newObjectIt(_arg1));
  3769.                 _local4++;
  3770.             };
  3771.             _local3.push(0);
  3772.             return (_local3);
  3773.         }
  3774.         public function VFilter8i(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
  3775.             this.FilterLoop24(_arg1, (_arg2 + (4 * _arg5)), _arg5, 1, 8, _arg6, _arg7, _arg8);
  3776.             this.FilterLoop24(_arg3, (_arg4 + (4 * _arg5)), _arg5, 1, 8, _arg6, _arg7, _arg8);
  3777.         }
  3778.         public function DC8uvNoTopLeft(_arg1, _arg2){
  3779.             this.Put8x8uv(128, _arg1, _arg2);
  3780.         }
  3781.         public function FilterRow(_arg1){
  3782.             var _local2:* = this.int_;
  3783.             var _local3:* = _arg1.thread_ctx_.mb_y_;
  3784.             this.assert(_arg1.thread_ctx_.filter_row_);
  3785.             _local2 = _arg1.tl_mb_x_;
  3786.             while (_local2 < _arg1.br_mb_x_) {
  3787.                 this.DoFilter(_arg1, _local2, _local3);
  3788.                 _local2++;
  3789.             };
  3790.         }
  3791.         public function VP8DecompressAlphaRows(_arg1, _arg2, _arg3){
  3792.             var data:* = undefined;
  3793.             var data_off:* = undefined;
  3794.             var data_size:* = undefined;
  3795.             var output_size:* = undefined;
  3796.             var barray:* = null;
  3797.             var dec:* = _arg1;
  3798.             var row:* = _arg2;
  3799.             var num_rows:* = _arg3;
  3800.             var output:* = dec.alpha_plane_;
  3801.             var stride:* = dec.pic_hdr_.width_;
  3802.             if ((((row < 0)) || (((row + num_rows) > dec.pic_hdr_.height_)))){
  3803.                 return (null);
  3804.             };
  3805.             if (row == 0){
  3806.                 data = dec.alpha_data_;
  3807.                 data_off = dec.alpha_data_off;
  3808.                 data_size = dec.alpha_data_size_;
  3809.                 output_size = (stride * dec.pic_hdr_.height_);
  3810.                 barray = new ByteArray();
  3811.                 barray.writeBytes(data, data_off, (data_off + data_size));
  3812.                 barray.position = 0;
  3813.                 try {
  3814.                     barray.uncompress();
  3815.                 } catch(e) {
  3816.                     alert("Error:");
  3817.                 };
  3818.                 output = barray;
  3819.             };
  3820.             return ((((row == 0)) ? output : (row * stride)));
  3821.         }
  3822.         public function VP8InitFrame(_arg1, _arg2){
  3823.             if (!this.InitThreadContext(_arg1)){
  3824.                 return (0);
  3825.             };
  3826.             if (!this.AllocateMemory(_arg1)){
  3827.                 return (0);
  3828.             };
  3829.             this.InitIo(_arg1, _arg2);
  3830.             this.VP8DspInitTables(this.void_);
  3831.             this.VP8DspInit(this.void_);
  3832.             return (1);
  3833.         }
  3834.         public function UpsampleRgbaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  3835.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgba, 4);
  3836.         }
  3837.         public function SampleRgba4444LinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
  3838.             this.FUNC_NAME_SAMPLE(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, this.VP8YuvToRgba4444, 2);
  3839.         }
  3840.         public function FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, _arg18, _arg19){
  3841.             var _local20:*;
  3842.             var _local24:*;
  3843.             var _local25:*;
  3844.             var _local26:*;
  3845.             var _local27:*;
  3846.             var _local28:*;
  3847.             var _local29:*;
  3848.             var _local30:*;
  3849.             var _local21:* = ((_arg17 - 1) >> 1);
  3850.             var _local22:* = this.LOAD_UV(_arg5[(_arg6 + 0)], _arg7[(_arg8 + 0)]);
  3851.             var _local23:* = this.LOAD_UV(_arg9[(_arg10 + 0)], _arg11[(_arg12 + 0)]);
  3852.             if (_arg1){
  3853.                 _local24 = ((((3 * _local22) + _local23) + 131074) >> 2);
  3854.                 _arg18(_arg1[(_arg2 + 0)], (_local24 & 0xFF), (_local24 >> 16), _arg13, _arg14);
  3855.             };
  3856.             if (_arg3){
  3857.                 _local24 = ((((3 * _local23) + _local22) + 131074) >> 2);
  3858.                 _arg18(_arg3[(_arg4 + 0)], (_local24 & 0xFF), (_local24 >> 16), _arg15, _arg16);
  3859.             };
  3860.             _local20 = 1;
  3861.             while (_local20 <= _local21) {
  3862.                 _local25 = this.LOAD_UV(_arg5[(_arg6 + _local20)], _arg7[(_arg8 + _local20)]);
  3863.                 _local26 = this.LOAD_UV(_arg9[(_arg10 + _local20)], _arg11[(_arg12 + _local20)]);
  3864.                 _local27 = ((((_local22 + _local25) + _local23) + _local26) + 524296);
  3865.                 _local28 = ((_local27 + (2 * (_local25 + _local23))) >> 3);
  3866.                 _local29 = ((_local27 + (2 * (_local22 + _local26))) >> 3);
  3867.                 if (_arg1){
  3868.                     _local24 = ((_local28 + _local22) >> 1);
  3869.                     _local30 = ((_local29 + _local25) >> 1);
  3870.                     _arg18(_arg1[((_arg2 + (2 * _local20)) - 1)], (_local24 & 0xFF), (_local24 >> 16), _arg13, (_arg14 + (((2 * _local20) - 1) * _arg19)));
  3871.                     _arg18(_arg1[((_arg2 + (2 * _local20)) - 0)], (_local30 & 0xFF), (_local30 >> 16), _arg13, (_arg14 + (((2 * _local20) - 0) * _arg19)));
  3872.                 };
  3873.                 if (_arg3){
  3874.                     _local24 = ((_local29 + _local23) >> 1);
  3875.                     _local30 = ((_local28 + _local26) >> 1);
  3876.                     _arg18(_arg3[((_arg4 + (2 * _local20)) - 1)], (_local24 & 0xFF), (_local24 >> 16), _arg15, (_arg16 + (((2 * _local20) - 1) * _arg19)));
  3877.                     _arg18(_arg3[((_arg4 + (2 * _local20)) + 0)], (_local30 & 0xFF), (_local30 >> 16), _arg15, (_arg16 + (((2 * _local20) + 0) * _arg19)));
  3878.                 };
  3879.                 _local22 = _local25;
  3880.                 _local23 = _local26;
  3881.                 _local20++;
  3882.             };
  3883.             if (!(_arg17 & 1)){
  3884.                 if (_arg1){
  3885.                     _local24 = ((((3 * _local22) + _local23) + 131074) >> 2);
  3886.                     _arg18(_arg1[((_arg2 + _arg17) - 1)], (_local24 & 0xFF), (_local24 >> 16), _arg13, (_arg14 + ((_arg17 - 1) * _arg19)));
  3887.                 };
  3888.                 if (_arg3){
  3889.                     _local24 = ((((3 * _local23) + _local22) + 131074) >> 2);
  3890.                     _arg18(_arg3[((_arg4 + _arg17) - 1)], (_local24 & 0xFF), (_local24 >> 16), _arg15, (_arg16 + ((_arg17 - 1) * _arg19)));
  3891.                 };
  3892.             };
  3893.         }
  3894.         public function UpsampleBgraLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  3895.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToBgra, 4);
  3896.         }
  3897.         public function assert(_arg1){
  3898.             if (!_arg1){
  3899.                 throw (new Error("assert :P"));
  3900.             };
  3901.         }
  3902.         public function DC16NoTop(_arg1, _arg2){
  3903.             var _local4:*;
  3904.             var _local3:* = 8;
  3905.             _local4 = 0;
  3906.             while (_local4 < 16) {
  3907.                 _local3 = (_local3 + _arg1[((_arg2 - 1) + (_local4 * this.BPS))]);
  3908.                 _local4++;
  3909.             };
  3910.             this.Put16((_local3 >> 4), _arg1, _arg2);
  3911.         }
  3912.         public function memcmp(_arg1, _arg2, _arg3, _arg4){
  3913.             var _local6:int;
  3914.             var _local5:* = "";
  3915.             _local6 = 0;
  3916.             while (_local6 < _arg4) {
  3917.                 _local5 = (_local5 + String.fromCharCode(_arg1[(_arg2 + _local6)]));
  3918.                 _local6++;
  3919.             };
  3920.             if (_arg3 == _local5){
  3921.                 return (0);
  3922.             };
  3923.             return (1);
  3924.         }
  3925.         public function EmitRescaledRGB(_arg1, _arg2){
  3926.             var _local3:*;
  3927.             var _local4:*;
  3928.             var _local5:*;
  3929.             var _local6:*;
  3930.             var _local7:*;
  3931.             var _local8:*;
  3932.             var _local9:*;
  3933.             var _local10:*;
  3934.             _local3 = _arg1.mb_h;
  3935.             _local4 = ((_local3 + 1) >> 1);
  3936.             _local5 = 0;
  3937.             _local6 = 0;
  3938.             _local7 = 0;
  3939.             while (_local5 < _local3) {
  3940.                 _local8 = this.Import(_arg1.y, (_arg1.y_off + (_local5 * _arg1.y_stride)), _arg1.y_stride, (_local3 - _local5), _arg2.scaler_y);
  3941.                 _local9 = this.Import(_arg1.u, (_arg1.u_off + (_local6 * _arg1.uv_stride)), _arg1.uv_stride, (_local4 - _local6), _arg2.scaler_u);
  3942.                 _local10 = this.Import(_arg1.v, (_arg1.v_off + (_local6 * _arg1.uv_stride)), _arg1.uv_stride, (_local4 - _local6), _arg2.scaler_v);
  3943.                 this.assert((_local9 == _local10));
  3944.                 _local5 = (_local5 + _local8);
  3945.                 _local6 = (_local6 + _local9);
  3946.                 _local7 = (_local7 + this.ExportRGB(_arg2, _local7));
  3947.             };
  3948.             return (_local7);
  3949.         }
  3950.         public function clip(_arg1, _arg2){
  3951.             return ((((_arg1 < 0)) ? 0 : (((_arg1 > _arg2)) ? _arg2 : _arg1)));
  3952.         }
  3953.         public function needs_filter(_arg1, _arg2, _arg3, _arg4){
  3954.             var _local5:* = _arg1[(_arg2 - (2 * _arg3))];
  3955.             var _local6:* = _arg1[(_arg2 - _arg3)];
  3956.             var _local7:* = _arg1[(_arg2 + 0)];
  3957.             var _local8:* = _arg1[(_arg2 + _arg3)];
  3958.             return ((((2 * this.abs0[((0xFF + _local6) - _local7)]) + this.abs1[((0xFF + _local5) - _local8)]) <= _arg4));
  3959.         }
  3960.         public function memcpy2(_arg1, _arg2, _arg3, _arg4, _arg5){
  3961.             var _local6:* = _arg3.slice(0, _arg4);
  3962.             var _local7:* = _arg3.slice(_arg4, (_arg4 + _arg5));
  3963.             var _local8:* = _arg3.slice((_arg4 + _arg5));
  3964.             _arg1.splice(0);
  3965.             _arg1.concat(_local6, _local7, _local8);
  3966.         }
  3967.         public function UpsampleRgbKeepAlphaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  3968.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgb, 4);
  3969.         }
  3970.         public function UpsampleRgb565LinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  3971.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgb565, 2);
  3972.         }
  3973.         public function MACROBLOCK_VPOS(_arg1){
  3974.             return ((_arg1 * 16));
  3975.         }
  3976.         public function VE4(_arg1, _arg2){
  3977.             var _local6:*;
  3978.             var _local3:* = _arg1;
  3979.             var _local4:* = (_arg2 - this.BPS);
  3980.             var _local5:* = new Array();
  3981.             _local5.push(this.AVG3(_local3[(_local4 - 1)], _local3[(_local4 + 0)], _local3[(_local4 + 1)]));
  3982.             _local5.push(this.AVG3(_local3[(_local4 + 0)], _local3[(_local4 + 1)], _local3[(_local4 + 2)]));
  3983.             _local5.push(this.AVG3(_local3[(_local4 + 1)], _local3[(_local4 + 2)], _local3[(_local4 + 3)]));
  3984.             _local5.push(this.AVG3(_local3[(_local4 + 2)], _local3[(_local4 + 3)], _local3[(_local4 + 4)]));
  3985.             _local6 = 0;
  3986.             while (_local6 < 4) {
  3987.                 this.memcpy(_arg1, (_arg2 + (_local6 * this.BPS)), _local5, 0, (4 * this.sizeof(_local5)));
  3988.                 _local6++;
  3989.             };
  3990.         }
  3991.         public function UpsampleBgrKeepAlphaLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  3992.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToBgr, 4);
  3993.         }
  3994.         public function TransformTwo(_arg1, _arg2, _arg3, _arg4, _arg5){
  3995.             this.TransformOne(_arg1, _arg2, _arg3, _arg4);
  3996.             if (_arg5){
  3997.                 this.TransformOne(_arg1, (_arg2 + 16), _arg3, (_arg4 + 4));
  3998.             };
  3999.         }
  4000.         public function VP8CheckAndSkipHeader(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
  4001.             if (((((((!(_arg1)) || (!(_arg3)))) || (!(_arg4)))) || (!(_arg5)))){
  4002.                 return (0);
  4003.             };
  4004.             if (_arg3.value >= 8){
  4005.                 if (!this.memcmp(_arg1, _arg2.value, "VP8 ", 4)){
  4006.                     _arg4.value = 1;
  4007.                     _arg5.value = this.get_le32(_arg1, (_arg2.value + 4));
  4008.                     if ((((_arg6.value >= this.RIFF_HEADER_SIZE)) && ((_arg5.value > (_arg6.value - this.RIFF_HEADER_SIZE))))){
  4009.                         return (0);
  4010.                     };
  4011.                     _arg2.value = (_arg2.value + 8);
  4012.                     _arg3.value = (_arg3.value - 8);
  4013.                 } else {
  4014.                     _arg4.value = 0;
  4015.                     _arg5.value = 0;
  4016.                 };
  4017.             } else {
  4018.                 _arg4.value = -1;
  4019.                 _arg5.value = 0;
  4020.             };
  4021.             return (1);
  4022.         }
  4023.         public function EmitRescaledYUV(_arg1, _arg2){
  4024.             var _local3:*;
  4025.             var _local4:*;
  4026.             var _local5:*;
  4027.             _local3 = _arg1.mb_h;
  4028.             _local4 = ((_local3 + 1) >> 1);
  4029.             _local5 = this.Rescale(_arg1.y, _arg1.y_off, _arg1.y_stride, _local3, _arg2.scaler_y);
  4030.             this.Rescale(_arg1.u, _arg1.u_off, _arg1.uv_stride, _local4, _arg2.scaler_u);
  4031.             this.Rescale(_arg1.v, _arg1.v_off, _arg1.uv_stride, _local4, _arg2.scaler_v);
  4032.             return (_local5);
  4033.         }
  4034.         public function WebPInitCustomIo(_arg1, _arg2){
  4035.             var params:* = _arg1;
  4036.             var io:* = _arg2;
  4037.             io.put = function (_arg1){
  4038.                 return (CustomPut(_arg1));
  4039.             };
  4040.             io.setup = function (_arg1){
  4041.                 return (CustomSetup(_arg1));
  4042.             };
  4043.             io.teardown = function (_arg1){
  4044.                 return (CustomTeardown(_arg1));
  4045.             };
  4046.             io.opaque = params;
  4047.         }
  4048.         public function UpsampleRgbLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  4049.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgb, 3);
  4050.         }
  4051.         public function DC16NoTopLeft(_arg1, _arg2){
  4052.             this.Put16(128, _arg1, _arg2);
  4053.         }
  4054.         public function TransformOne(_arg1, _arg2, _arg3, _arg4){
  4055.             var _local6:*;
  4056.             var _local7:*;
  4057.             var _local8:*;
  4058.             var _local9:*;
  4059.             var _local10:*;
  4060.             var _local11:*;
  4061.             var _local12:*;
  4062.             var _local13:*;
  4063.             var _local5:* = this.Arr((4 * 4), 0);
  4064.             _local7 = 0;
  4065.             _local6 = _local5;
  4066.             _local8 = 0;
  4067.             while (_local8 < 4) {
  4068.                 _local9 = (_arg1[(_arg2 + 0)] + _arg1[(_arg2 + 8)]);
  4069.                 _local10 = (_arg1[(_arg2 + 0)] - _arg1[(_arg2 + 8)]);
  4070.                 _local11 = (this.MUL(_arg1[(_arg2 + 4)], this.kC2) - this.MUL(_arg1[(_arg2 + 12)], this.kC1));
  4071.                 _local12 = (this.MUL(_arg1[(_arg2 + 4)], this.kC1) + this.MUL(_arg1[(_arg2 + 12)], this.kC2));
  4072.                 _local6[(_local7 + 0)] = (_local9 + _local12);
  4073.                 _local6[(_local7 + 1)] = (_local10 + _local11);
  4074.                 _local6[(_local7 + 2)] = (_local10 - _local11);
  4075.                 _local6[(_local7 + 3)] = (_local9 - _local12);
  4076.                 _local7 = (_local7 + 4);
  4077.                 _arg2++;
  4078.                 _local8++;
  4079.             };
  4080.             _local7 = 0;
  4081.             _local8 = 0;
  4082.             while (_local8 < 4) {
  4083.                 _local13 = (_local6[(_local7 + 0)] + 4);
  4084.                 _local9 = (_local13 + _local6[(_local7 + 8)]);
  4085.                 _local10 = (_local13 - _local6[(_local7 + 8)]);
  4086.                 _local11 = (this.MUL(_local6[(_local7 + 4)], this.kC2) - this.MUL(_local6[(_local7 + 12)], this.kC1));
  4087.                 _local12 = (this.MUL(_local6[(_local7 + 4)], this.kC1) + this.MUL(_local6[(_local7 + 12)], this.kC2));
  4088.                 _arg3[((_arg4 + 0) + (0 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + 0) + (0 * this.BPS))] + ((_local9 + _local12) >> 3)));
  4089.                 _arg3[((_arg4 + 1) + (0 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + 1) + (0 * this.BPS))] + ((_local10 + _local11) >> 3)));
  4090.                 _arg3[((_arg4 + 2) + (0 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + 2) + (0 * this.BPS))] + ((_local10 - _local11) >> 3)));
  4091.                 _arg3[((_arg4 + 3) + (0 * this.BPS))] = this.clip_8b((_arg3[((_arg4 + 3) + (0 * this.BPS))] + ((_local9 - _local12) >> 3)));
  4092.                 _local7++;
  4093.                 _arg4 = (_arg4 + this.BPS);
  4094.                 _local8++;
  4095.             };
  4096.         }
  4097.         public function UpsampleBgrLinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  4098.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToBgr, 3);
  4099.         }
  4100.         public function VP8YuvToRgb565(_arg1, _arg2, _arg3, _arg4, _arg5){
  4101.             var _local6:* = this.VP8kVToR[_arg3];
  4102.             var _local7:* = ((this.VP8kVToG[_arg3] + this.VP8kUToG[_arg2]) >> this.YUV_FIX);
  4103.             var _local8:* = this.VP8kUToB[_arg2];
  4104.             _arg4[(_arg5 + 0)] = ((this.VP8kClip[((_arg1 + _local6) - this.YUV_RANGE_MIN)] & 248) | (this.VP8kClip[((_arg1 + _local7) - this.YUV_RANGE_MIN)] >> 5));
  4105.             _arg4[(_arg5 + 1)] = (((this.VP8kClip[((_arg1 + _local7) - this.YUV_RANGE_MIN)] << 3) & 224) | (this.VP8kClip[((_arg1 + _local8) - this.YUV_RANGE_MIN)] >> 3));
  4106.         }
  4107.         public function WebPResize(_arg1:Event):void{
  4108.             this.WebPChange();
  4109.         }
  4110.         public function UpsampleRgba4444LinePair(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17){
  4111.             this.FUNC_NAME(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, this.VP8YuvToRgba4444, 2);
  4112.         }
  4113.         public function VP8StoreBlock(_arg1){
  4114.             var _local2:*;
  4115.             var _local11:*;
  4116.             var _local12:*;
  4117.             var _local13:*;
  4118.             if (_arg1.filter_type_ > 0){
  4119.                 _local11 = _arg1.f_info_[(1 + _arg1.mb_x_)];
  4120.                 _local12 = _arg1.mb_info_[(1 + _arg1.mb_x_)].skip_;
  4121.                 _local13 = _arg1.filter_levels_[_arg1.segment_];
  4122.                 if (_arg1.filter_hdr_.use_lf_delta_){
  4123.                     _local13 = (_local13 + _arg1.filter_hdr_.ref_lf_delta_[0]);
  4124.                     if (_arg1.is_i4x4_){
  4125.                         _local13 = (_local13 + _arg1.filter_hdr_.mode_lf_delta_[0]);
  4126.                     };
  4127.                 };
  4128.                 _local13 = ((_local13)<0) ? 0 : ((_local13)>63) ? 63 : _local13;
  4129.                 _local11.f_level_ = _local13;
  4130.                 if (_arg1.filter_hdr_.sharpness_ > 0){
  4131.                     if (_arg1.filter_hdr_.sharpness_ > 4){
  4132.                         _local13 = (_local13 >> 2);
  4133.                     } else {
  4134.                         _local13 = (_local13 >> 1);
  4135.                     };
  4136.                     if (_local13 > (9 - _arg1.filter_hdr_.sharpness_)){
  4137.                         _local13 = (9 - _arg1.filter_hdr_.sharpness_);
  4138.                     };
  4139.                 };
  4140.                 _local11.f_ilevel_ = ((_local13)<1) ? 1 : _local13;
  4141.                 _local11.f_inner_ = (((!(_local12)) || (_arg1.is_i4x4_)) + 0);
  4142.             };
  4143.             var _local3:* = ((_arg1.cache_id_ * 16) * _arg1.cache_y_stride_);
  4144.             var _local4:* = ((_arg1.cache_id_ * 8) * _arg1.cache_uv_stride_);
  4145.             var _local5:* = _arg1.cache_y_;
  4146.             var _local6:* = ((_arg1.cache_y_off + (_arg1.mb_x_ * 16)) + _local3);
  4147.             var _local7:* = _arg1.cache_u_;
  4148.             var _local8:* = ((_arg1.cache_u_off + (_arg1.mb_x_ * 8)) + _local4);
  4149.             var _local9:* = _arg1.cache_v_;
  4150.             var _local10:* = ((_arg1.cache_v_off + (_arg1.mb_x_ * 8)) + _local4);
  4151.             _local2 = 0;
  4152.             while (_local2 < 16) {
  4153.                 this.memcpy(_local5, (_local6 + (_local2 * _arg1.cache_y_stride_)), _arg1.yuv_b_, (this.Y_OFF + (_local2 * this.BPS)), 16);
  4154.                 _local2++;
  4155.             };
  4156.             _local2 = 0;
  4157.             while (_local2 < 8) {
  4158.                 this.memcpy(_local7, (_local8 + (_local2 * _arg1.cache_uv_stride_)), _arg1.yuv_b_, (this.U_OFF + (_local2 * this.BPS)), 8);
  4159.                 this.memcpy(_local9, (_local10 + (_local2 * _arg1.cache_uv_stride_)), _arg1.yuv_b_, (this.V_OFF + (_local2 * this.BPS)), 8);
  4160.                 _local2++;
  4161.             };
  4162.         }
  4163.         public function memset_(_arg1, _arg2, _arg3, _arg4){
  4164.             var _local5:int;
  4165.             _local5 = 0;
  4166.             while (_local5 < _arg4) {
  4167.                 _arg1[(_arg2 + _local5)] = _arg3;
  4168.                 _local5++;
  4169.             };
  4170.         }
  4171.         public function DC4(_arg1, _arg2){
  4172.             var _local4:*;
  4173.             var _local3:* = 4;
  4174.             _local4 = 0;
  4175.             while (_local4 < 4) {
  4176.                 _local3 = (_local3 + (_arg1[((_arg2 + _local4) - this.BPS)] + _arg1[((_arg2 - 1) + (_local4 * this.BPS))]));
  4177.                 _local4++;
  4178.             };
  4179.             _local3 = (_local3 >> 3);
  4180.             _local4 = 0;
  4181.             while (_local4 < 4) {
  4182.                 this.memset_(_arg1, (_arg2 + (_local4 * this.BPS)), _local3, 4);
  4183.                 _local4++;
  4184.             };
  4185.         }
  4186.         public function VP8InitIoInternal(_arg1, _arg2){
  4187.             if (_arg2 != this.WEBP_DECODER_ABI_VERSION){
  4188.                 this.alert("mismatch error");
  4189.                 return (0);
  4190.             };
  4191.             if (_arg1){
  4192.             };
  4193.             return (1);
  4194.         }
  4195.         public function MUL(_arg1, _arg2){
  4196.             return (((_arg1 * _arg2) >> 16));
  4197.         }
  4198.         public function convertURLLoaderBinaryToArray(_arg1){
  4199.             var _local2:*;
  4200.             var _local3:*;
  4201.             var _local4:int;
  4202.             _local2 = new Array();
  4203.             _local3 = _arg1.length;
  4204.             _local4 = 0;
  4205.             while (_local4 < _local3) {
  4206.                 _local2.push(_arg1[_local4]);
  4207.                 _local4++;
  4208.             };
  4209.             return (_local2);
  4210.         }
  4211.         public function EmitAlphaYUV(_arg1, _arg2){
  4212.             var _local5:*;
  4213.             var _local3:* = _arg1.mb_w;
  4214.             var _local4:* = _arg1.mb_h;
  4215.             var _local6:* = _arg2.output.u.YUVA;
  4216.             var _local7:* = _local6.a;
  4217.             var _local8:* = (_local6.a_off + (_arg1.mb_y * _local6.a_stride));
  4218.             var _local9:* = _arg1.a;
  4219.             var _local10:* = _arg1.a_off;
  4220.             if (_local9 != null){
  4221.                 _local5 = 0;
  4222.                 while (_local5 < _local4) {
  4223.                     this.memcpy(_local7, _local8, _local9, _local10, (_local3 * this.sizeof(_local7)));
  4224.                     _local10 = (_local10 + _arg1.width);
  4225.                     _local8 = (_local8 + _local6.a_stride);
  4226.                     _local5++;
  4227.                 };
  4228.             };
  4229.             return (0);
  4230.         }
  4231.         public function memcpy(_arg1, _arg2, _arg3, _arg4, _arg5){
  4232.             var _local6:int;
  4233.             if (typeof(_arg1) != "string"){
  4234.                 _local6 = 0;
  4235.                 while (_local6 < _arg5) {
  4236.                     _arg1[(_arg2 + _local6)] = _arg3[(_arg4 + _local6)];
  4237.                     _local6++;
  4238.                 };
  4239.             } else {
  4240.                 if (_arg2 > 0){
  4241.                     this.alert("string offset is over 0");
  4242.                 };
  4243.                 _arg1 = _arg3.slice(_arg4, _arg5);
  4244.                 return (_arg1);
  4245.             };
  4246.         }
  4247.         public function WebPGrabDecBuffer(_arg1, _arg2){
  4248.             this.alert("todo: WebPGrabDecBuffer");
  4249.         }
  4250.         public function TM8uv(_arg1, _arg2){
  4251.             this.TrueMotion(_arg1, _arg2, 8);
  4252.         }
  4253.         public function AVG3(_arg1, _arg2, _arg3){
  4254.             return (((((_arg1 + (2 * _arg2)) + _arg3) + 2) >> 2));
  4255.         }
  4256.         public function EmitAlphaRGB(_arg1, _arg2){
  4257.             var _local8:*;
  4258.             var _local9:*;
  4259.             var _local3:* = _arg2.output.colorspace;
  4260.             var _local4:* = (((_local3 == this.MODE_ARGB)) ? 0 : (((_local3 == this.MODE_RGBA_4444)) ? 1 : 3));
  4261.             var _local5:* = (((_local3 == this.MODE_RGBA_4444)) ? 2 : 4);
  4262.             var _local6:* = _arg1.mb_w;
  4263.             var _local7:* = _arg1.mb_h;
  4264.             var _local10:* = _arg2.output.u.RGBA;
  4265.             var _local11:* = _local10.rgba;
  4266.             var _local12:* = (_local10.rgba_off + (_arg1.mb_y * _local10.stride));
  4267.             var _local13:* = _arg1.a;
  4268.             var _local14:* = _arg1.a_off;
  4269.             if (_local13 != null){
  4270.                 _local9 = 0;
  4271.                 while (_local9 < _local7) {
  4272.                     _local8 = 0;
  4273.                     while (_local8 < _local6) {
  4274.                         _local11[((_local12 + (_local5 * _local8)) + _local4)] = _local13[(_local14 + _local8)];
  4275.                         _local8++;
  4276.                     };
  4277.                     _local14 = (_local14 + _arg1.width);
  4278.                     _local12 = (_local12 + _local10.stride);
  4279.                     _local9++;
  4280.                 };
  4281.             };
  4282.             return (0);
  4283.         }
  4284.         public function Import(_arg1, _arg2, _arg3, _arg4, _arg5){
  4285.             var _local6:*;
  4286.             _local6 = 0;
  4287.             while ((((_local6 < _arg4)) && ((_arg5.y_accum > 0)))) {
  4288.                 this.ImportRow(_arg1, _arg2, _arg5);
  4289.                 _arg2 = (_arg2 + _arg3);
  4290.                 _local6++;
  4291.                 _arg5.y_accum = (_arg5.y_accum - _arg5.y_sub);
  4292.             };
  4293.             return (_local6);
  4294.         }
  4295.         public function AVG2(_arg1, _arg2){
  4296.             return ((((_arg1 + _arg2) + 1) >> 1));
  4297.         }
  4298.         public function Arr_nOI(_arg1, _arg2){
  4299.             var _local4:int;
  4300.             var _local3:* = new Array();
  4301.             _local4 = 0;
  4302.             while (_local4 < _arg1) {
  4303.                 _local3.push(this.newObjectIt(_arg2));
  4304.                 _local4++;
  4305.             };
  4306.             return (_local3);
  4307.         }
  4308.         public function ParseSegmentHeader(_arg1, _arg2, _arg3){
  4309.             var _local4:*;
  4310.             this.assert(_arg1);
  4311.             this.assert(_arg2);
  4312.             _arg2.use_segment_ = this.VP8Get(_arg1);
  4313.             if (_arg2.use_segment_){
  4314.                 _arg2.update_map_ = this.VP8Get(_arg1);
  4315.                 if (this.VP8Get(_arg1)){
  4316.                     _arg2.absolute_delta_ = this.VP8Get(_arg1);
  4317.                     _local4 = 0;
  4318.                     while (_local4 < this.NUM_MB_SEGMENTS) {
  4319.                         _arg2.quantizer_[_local4] = ((this.VP8Get(_arg1)) ? this.VP8GetSignedValue(_arg1, 7) : 0);
  4320.                         _local4++;
  4321.                     };
  4322.                     _local4 = 0;
  4323.                     while (_local4 < this.NUM_MB_SEGMENTS) {
  4324.                         _arg2.filter_strength_[_local4] = ((this.VP8Get(_arg1)) ? this.VP8GetSignedValue(_arg1, 6) : 0);
  4325.                         _local4++;
  4326.                     };
  4327.                 };
  4328.                 if (_arg2.update_map_){
  4329.                     _local4 = 0;
  4330.                     while (_local4 < this.MB_FEATURE_TREE_PROBS) {
  4331.                         _arg3.segments_[_local4] = ((this.VP8Get(_arg1)) ? this.VP8GetValue(_arg1, 8) : 0xFF);
  4332.                         _local4++;
  4333.                     };
  4334.                 };
  4335.             } else {
  4336.                 _arg2.update_map_ = 0;
  4337.             };
  4338.             return (!(_arg1.eof_));
  4339.         }
  4340.         public function VP8DspInit(_arg1){
  4341.             this.VP8Transform = this.TransformTwo;
  4342.             this.VP8TransformUV = this.TransformUV;
  4343.             this.VP8TransformDC = this.TransformDC;
  4344.             this.VP8TransformDCUV = this.TransformDCUV;
  4345.             this.VP8VFilter16 = this.VFilter16;
  4346.             this.VP8HFilter16 = this.HFilter16;
  4347.             this.VP8VFilter8 = this.VFilter8;
  4348.             this.VP8HFilter8 = this.HFilter8;
  4349.             this.VP8VFilter16i = this.VFilter16i;
  4350.             this.VP8HFilter16i = this.HFilter16i;
  4351.             this.VP8VFilter8i = this.VFilter8i;
  4352.             this.VP8HFilter8i = this.HFilter8i;
  4353.             this.VP8SimpleVFilter16 = this.SimpleVFilter16;
  4354.             this.VP8SimpleHFilter16 = this.SimpleHFilter16;
  4355.             this.VP8SimpleVFilter16i = this.SimpleVFilter16i;
  4356.             this.VP8SimpleHFilter16i = this.SimpleHFilter16i;
  4357.         }
  4358.         public function completeHandler(_arg1:Event):void{
  4359.             var _local2:URLLoader;
  4360.             var _local3:ByteArray;
  4361.             var _local4:*;
  4362.             var _local5:*;
  4363.             var _local6:*;
  4364.             var _local7:*;
  4365.             var _local8:*;
  4366.             var _local9:*;
  4367.             var _local10:*;
  4368.             var _local11:*;
  4369.             var _local12:BitmapData;
  4370.             var _local13:Rectangle;
  4371.             var _local14:Bitmap;
  4372.             if (!this.stopAction){
  4373.                 _local2 = URLLoader(_arg1.target);
  4374.                 _local3 = new ByteArray();
  4375.                 _local3 = _local2.data;
  4376.                 _local4 = this.WebPDecoderConfig;
  4377.                 _local5 = _local4.output;
  4378.                 _local6 = _local4.input;
  4379.                 if (!this.WebPInitDecoderConfig(_local4)){
  4380.                     this.alert("Library version mismatch!\n");
  4381.                 };
  4382.                 _local4.options.no_fancy_upsampling = 0;
  4383.                 _local4.options.bypass_filtering = 0;
  4384.                 _local4.options.use_cropping = 0;
  4385.                 _local4.options.use_scaling = 0;
  4386.                 _local7 = this.VP8StatusCode;
  4387.                 _local8 = this.WebPGetFeatures(_local3, _local3.length, _local6);
  4388.                 if (_local8 != _local7.VP8_STATUS_OK){
  4389.                     this.alert("error");
  4390.                 };
  4391.                 _local9 = this.WEBP_CSP_MODE;
  4392.                 _local5.colorspace = _local9.MODE_ARGB;
  4393.                 _local8 = this.WebPDecode(_local3, _local3.length, _local4);
  4394.                 _local10 = (_local8 == _local7.VP8_STATUS_OK);
  4395.                 if (!_local10){
  4396.                     this.alert("Decoding of %s failed.\n");
  4397.                 };
  4398.                 _local11 = _local5.u.RGBA.rgba;
  4399.                 this.WebPImage.width.value = _local5.width;
  4400.                 this.WebPImage.height.value = _local5.height;
  4401.                 _local12 = new BitmapData(this.WebPImage.width.value, this.WebPImage.height.value, true, 0xFFFF0000);
  4402.                 _local13 = new Rectangle(0, 0, this.WebPImage.width.value, this.WebPImage.height.value);
  4403.                 _local12.setPixels(_local13, _local11);
  4404.                 _local14 = new Bitmap(_local12);
  4405.                 if (this.my_mode == "bg"){
  4406.                     this.bmData = _local14.bitmapData;
  4407.                 } else {
  4408.                     _local14.smoothing = true;
  4409.                     this.pic.addChild(_local14);
  4410.                 };
  4411.                 this.WebPChange();
  4412.             };
  4413.             gotoAndStop(2);
  4414.             stage.addEventListener(Event.RESIZE, this.stageResize);
  4415.             this.firstTime = false;
  4416.         }
  4417.         public function HE16(_arg1, _arg2){
  4418.             var _local3:*;
  4419.             _local3 = 16;
  4420.             while (_local3 > 0) {
  4421.                 this.memset_(_arg1, (_arg2 + 0), _arg1[(_arg2 - 1)], 16);
  4422.                 _arg2 = (_arg2 + this.BPS);
  4423.                 _local3--;
  4424.             };
  4425.         }
  4426.         public function ImportRow(_arg1, _arg2, _arg3){
  4427.             var _local5:*;
  4428.             var _local6:*;
  4429.             var _local7:*;
  4430.             var _local8:*;
  4431.             var _local9:*;
  4432.             var _local10:*;
  4433.             var _local11:*;
  4434.             var _local4:* = 0;
  4435.             _local5 = this.int_;
  4436.             _local6 = 0;
  4437.             if (!_arg3.x_expand){
  4438.                 _local7 = 0;
  4439.                 _local5 = 0;
  4440.                 while (_local5 < _arg3.dst_width) {
  4441.                     _local6 = (_local6 + _arg3.x_add);
  4442.                     while (_local6 > 0) {
  4443.                         var _temp1 = _local4;
  4444.                         _local4 = (_local4 + 1);
  4445.                         _local7 = (_local7 + _arg1[(_arg2 + _temp1)]);
  4446.                         _local6 = (_local6 - _arg3.x_sub);
  4447.                     };
  4448.                     var _temp2 = _local4;
  4449.                     _local4 = (_local4 + 1);
  4450.                     _local8 = _arg1[(_arg2 + _temp2)];
  4451.                     _local9 = (_local8 * -(_local6));
  4452.                     this.write32BitIn4Bytes(_arg3.frow, (_arg3.frow_off + (_local5 * 4)), (((_local7 + _local8) * _arg3.x_sub) - _local9));
  4453.                     _local7 = this.MULT(_local9, _arg3.fx_scale);
  4454.                     _local5++;
  4455.                 };
  4456.             } else {
  4457.                 _local10 = _arg1[(_arg2 + 0)];
  4458.                 _local11 = _arg1[(_arg2 + 0)];
  4459.                 _local5 = 0;
  4460.                 while (_local5 < _arg3.dst_width) {
  4461.                     if (_local6 < 0){
  4462.                         _local10 = _local11;
  4463.                         ++_local4;
  4464.                         _local11 = _arg1[(_arg2 + _local4)];
  4465.                         _local6 = (_local6 + _arg3.x_add);
  4466.                     };
  4467.                     this.write32BitIn4Bytes(_arg3.frow, (_arg3.frow_off + (_local5 * 4)), ((_local11 * _arg3.x_add) + ((_local10 - _local11) * _local6)));
  4468.                     _local6 = (_local6 - _arg3.x_sub);
  4469.                     _local5++;
  4470.                 };
  4471.             };
  4472.             _local5 = 0;
  4473.             while (_local5 < _arg3.dst_width) {
  4474.                 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)))));
  4475.                 _local5++;
  4476.             };
  4477.         }
  4478.         public function EmitYUV(_arg1, _arg2){
  4479.             var _local14:*;
  4480.             var _local3:* = _arg2.output;
  4481.             var _local4:* = _local3.u.YUVA;
  4482.             var _local5:* = _local4.y;
  4483.             var _local6:* = (_local4.y_off + (_arg1.mb_y * _local4.y_stride));
  4484.             var _local7:* = _local4.u;
  4485.             var _local8:* = (_local4.u_off + ((_arg1.mb_y >> 1) * _local4.u_stride));
  4486.             var _local9:* = _local4.v;
  4487.             var _local10:* = (_local4.v_off + ((_arg1.mb_y >> 1) * _local4.v_stride));
  4488.             var _local11:* = _arg1.mb_w;
  4489.             var _local12:* = _arg1.mb_h;
  4490.             var _local13:* = parseInt(String(((_local11 + 1) / 2)));
  4491.             _local14 = 0;
  4492.             while (_local14 < _local12) {
  4493.                 this.memcpy(_local5, (_local6 + (_local14 * _local4.y_stride)), _arg1.y, (_arg1.y_off + (_local14 * _arg1.y_stride)), _local11);
  4494.                 _local14++;
  4495.             };
  4496.             _local14 = 0;
  4497.             while (_local14 < ((_local12 + 1) / 2)) {
  4498.                 this.memcpy(_local7, (_local8 + (_local14 * _local4.u_stride)), _arg1.u, (_arg1.u_off + (_local14 * _arg1.uv_stride)), _local13);
  4499.                 this.memcpy(_local9, (_local10 + (_local14 * _local4.v_stride)), _arg1.v, (_arg1.v_off + (_local14 * _arg1.uv_stride)), _local13);
  4500.                 _local14++;
  4501.             };
  4502.             return (_arg1.mb_h);
  4503.         }
  4504.         public function WebPAllocateDecBuffer(_arg1, _arg2, _arg3, _arg4){
  4505.             var _local5:*;
  4506.             var _local6:*;
  4507.             var _local7:*;
  4508.             var _local8:*;
  4509.             if ((((((_arg4 == null)) || ((_arg1 <= 0)))) || ((_arg2 <= 0)))){
  4510.                 return (this.VP8_STATUS_INVALID_PARAM);
  4511.             };
  4512.             if (_arg3 != null){
  4513.                 if (_arg3.use_cropping){
  4514.                     _local5 = _arg3.crop_width;
  4515.                     _local6 = _arg3.crop_height;
  4516.                     _local7 = (_arg3.crop_left & ~(1));
  4517.                     _local8 = (_arg3.crop_top & ~(1));
  4518.                     if ((((((((((((_local7 < 0)) || ((_local8 < 0)))) || ((_local5 <= 0)))) || ((_local6 <= 0)))) || (((_local7 + _local5) > _arg1)))) || (((_local8 + _local6) > _arg2)))){
  4519.                         return (this.VP8_STATUS_INVALID_PARAM);
  4520.                     };
  4521.                     _arg1 = _local5;
  4522.                     _arg2 = _local6;
  4523.                 };
  4524.                 if (_arg3.use_scaling){
  4525.                     if ((((_arg3.scaled_width <= 0)) || ((_arg3.scaled_height <= 0)))){
  4526.                         return (this.VP8_STATUS_INVALID_PARAM);
  4527.                     };
  4528.                     _arg1 = _arg3.scaled_width;
  4529.                     _arg2 = _arg3.scaled_height;
  4530.                 };
  4531.             };
  4532.             _arg4.width = _arg1;
  4533.             _arg4.height = _arg2;
  4534.             return (this.AllocateBuffer(_arg4));
  4535.         }
  4536.         public function VP8YuvToRgba4444KeepA(_arg1, _arg2, _arg3, _arg4, _arg5){
  4537.             var _local6:* = this.VP8kVToR[_arg3];
  4538.             var _local7:* = ((this.VP8kVToG[_arg3] + this.VP8kUToG[_arg2]) >> this.YUV_FIX);
  4539.             var _local8:* = this.VP8kUToB[_arg2];
  4540.             _arg4[(_arg5 + 0)] = ((this.VP8kClip4Bits[((_arg1 + _local6) - this.YUV_RANGE_MIN)] << 4) | this.VP8kClip4Bits[((_arg1 + _local7) - this.YUV_RANGE_MIN)]);
  4541.             _arg4[(_arg5 + 1)] = ((_arg4[(_arg5 + 1)] << 44) | (this.VP8kClip4Bits[((_arg1 + _local8) - this.YUV_RANGE_MIN)] << 4));
  4542.         }
  4543.         public function WebPDecodeARGBInto(_arg1, _arg2, _arg3, _arg4, _arg5){
  4544.             return (this.DecodeIntoRGBABuffer(this.MODE_ARGB, _arg1, _arg2, _arg3, _arg5, _arg4));
  4545.         }
  4546.         public function VE8uv(_arg1, _arg2){
  4547.             var _local3:*;
  4548.             _local3 = 0;
  4549.             while (_local3 < 8) {
  4550.                 this.memcpy(_arg1, (_arg2 + (_local3 * this.BPS)), _arg1, (_arg2 - this.BPS), 8);
  4551.                 _local3++;
  4552.             };
  4553.         }
  4554.         public function DC8uv(_arg1, _arg2){
  4555.             var _local4:*;
  4556.             var _local3:* = 8;
  4557.             _local4 = 0;
  4558.             while (_local4 < 8) {
  4559.                 _local3 = (_local3 + (_arg1[((_arg2 + _local4) - this.BPS)] + _arg1[((_arg2 - 1) + (_local4 * this.BPS))]));
  4560.                 _local4++;
  4561.             };
  4562.             this.Put8x8uv(((_local3 >> 4) * 1), _arg1, _arg2);
  4563.         }
  4564.  
  4565.     }
  4566. }//package webpjs_fla
  4567.  
  4568.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement