text:
#include "mp4dec_lib.h"
#include "bitstream.h"
#include "vlc_decode.h"
#include "zigzag.h"

#define OSCL_DISABLE_WARNING_CONV_POSSIBLE_LOSS_OF_DATA

#ifdef PV_SUPPORT_MAIN_PROFILE
/* INTRA */
const static int mpeg_iqmat_def[NCOEFF_BLOCK] =
{
    8, 17, 18, 19, 21, 23, 25, 27,
    17, 18, 19, 21, 23, 25, 27, 28,
    20, 21, 22, 23, 24, 26, 28, 30,
    21, 22, 23, 24, 26, 28, 30, 32,
    22, 23, 24, 26, 28, 30, 32, 35,
    23, 24, 26, 28, 30, 32, 35, 38,
    25, 26, 28, 30, 32, 35, 38, 41,
    27, 28, 30, 32, 35, 38, 41, 45
};

/* INTER */
const static int mpeg_nqmat_def[64]  =
{
    16, 17, 18, 19, 20, 21, 22, 23,
    17, 18, 19, 20, 21, 22, 23, 24,
    18, 19, 20, 21, 22, 23, 24, 25,
    19, 20, 21, 22, 23, 24, 26, 27,
    20, 21, 22, 23, 25, 26, 27, 28,
    21, 22, 23, 24, 26, 27, 28, 30,
    22, 23, 24, 26, 27, 28, 30, 31,
    23, 24, 25, 27, 28, 30, 31, 33
};
#endif

/* ======================================================================== */
/*  Function : CalcNumBits()                                                */
/*  Purpose  :                                                              */
/*  In/out   :                                                              */
/*  Return   : Calculate the minimum number of bits required to             */
/*              represent x.                                                */
/*  Note     : This is an equivalent implementation of                      */
/*                      (long)ceil(log((double)x)/log(2.0))                 */
/*  Modified :                                                              */
/* ======================================================================== */
int CalcNumBits(uint x)
{
    int i = 1;
    while (x >>= 1) i++;
    return i;
}

/***********************************************************CommentBegin******
*
* -- DecodeVolHeader -- Decode the header of a VOL
*
*   04/10/2000 : initial modification to the new PV-Decoder Lib format.
*   10/12/2001 : reject non compliant bitstreams
*
***********************************************************CommentEnd********/
PV_STATUS DecodeVOLHeader(VideoDecData *video, int layer)
{
    PV_STATUS status;
    Vol *currVol;
    BitstreamDecVideo *stream;
    uint32 tmpvar, vol_shape;
    uint32 startCode;
#ifdef PV_SUPPORT_MAIN_PROFILE
    int *qmat, i, j;
#endif
    int version_id = 1;
#ifdef PV_TOLERATE_VOL_ERRORS
    uint32 profile = 0x01;
#endif
    /*  There's a "currLayer" variable inside videoDecData.          */
    /*   However, we don't maintain it until we decode frame data.  04/05/2000 */
    currVol = video->vol[layer];
    stream  = currVol->bitstream;
    currVol->moduloTimeBase = 0;

    /* Determine which start code for the decoder to begin with */
    status = BitstreamShowBits32HC(stream, &startCode);

    if (startCode == VISUAL_OBJECT_SEQUENCE_START_CODE)
    {   /*  Bitstream Exhchange Fix 9/99 */
        /* Bitstream Exchange requires we allow start with Video Object Sequence */
        /* visual_object_sequence_start_code            */
        (void) BitstreamReadBits32HC(stream);
        tmpvar = (uint32) BitstreamReadBits16(stream,  8); /* profile */
#ifndef PV_TOLERATE_VOL_ERRORS
        if (layer)                                                      /*    */
        {
            /* support SSPL0-2  */
            if (tmpvar != 0x10 && tmpvar != 0x11 && tmpvar != 0x12 &&
                    tmpvar != 0xA1 && tmpvar != 0xA2  && tmpvar != 0xA3/* Core SP@L1-L3 */)
                return PV_FAIL;
        }
        else
        {
            /* support SPL0-3 & SSPL0-2   */
            if (tmpvar != 0x01 && tmpvar != 0x02 && tmpvar != 0x03 && tmpvar != 0x08 &&
                    tmpvar != 0x10 && tmpvar != 0x11 && tmpvar != 0x12 &&
                    tmpvar != 0x21 && tmpvar != 0x22 &&  /* Core Profile Levels */
                    tmpvar != 0xA1 && tmpvar != 0xA2 && tmpvar != 0xA3 &&
                    tmpvar != 0xF0 && tmpvar != 0xF1 && /* Advanced Simple Profile Levels*/
                    tmpvar != 0xF2 && tmpvar != 0xF3 &&
                    tmpvar != 0xF4 && tmpvar != 0xF5)
                return PV_FAIL;
        }
#else
        profile = tmpvar;
#endif

        // save the profile and level for the query
        currVol->profile_level_id = (uint)tmpvar; //  6/10/04

        status = BitstreamShowBits32HC(stream, &tmpvar);
        if (tmpvar == USER_DATA_START_CODE)
        {
            /* Something has to be done with user data  11/11/99 */
            status = DecodeUserData(stream);
            if (status != PV_SUCCESS) return PV_FAIL;
        }
        /* visual_object_start_code                     */
        BitstreamShowBits32HC(stream, &tmpvar);
        if (tmpvar != VISUAL_OBJECT_START_CODE)
        {
            do
            {
                /* Search for VOL_HEADER */
                status = PVSearchNextM4VFrame(stream); /* search 0x00 0x00 0x01 */
                if (status != PV_SUCCESS) return PV_FAIL; /* breaks the loop */
                BitstreamShowBits32(stream, VOL_START_CODE_LENGTH, &tmpvar);
                PV_BitstreamFlushBits(stream, 8);
            }
            while (tmpvar != VOL_START_CODE);
            goto decode_vol;
        }
        else
        {
            BitstreamReadBits32HC(stream);
        }

        /*  is_visual_object_identifier            */
        tmpvar = (uint32) BitstreamRead1Bits(stream);
        if (tmpvar)
        {
            /* visual_object_verid                            */
            tmpvar = (uint32) BitstreamReadBits16(stream, 4);
            /* visual_object_priority                         */
            tmpvar = (uint32) BitstreamReadBits16(stream, 3);
        }
        /* visual_object_type                                 */
        BitstreamShowBits32(stream, 4, &tmpvar);
        if (tmpvar == 1)
        { /* video_signal_type */
            PV_BitstreamFlushBits(stream, 4);
            tmpvar = (uint32) BitstreamRead1Bits(stream);
            if (tmpvar == 1)
            {
                /* video_format */
                tmpvar = (uint32) BitstreamReadBits16(stream, 3);
                /* video_range  */
                tmpvar = (uint32) BitstreamRead1Bits(stream);
                /* color_description */
                tmpvar = (uint32) BitstreamRead1Bits(stream);
                if (tmpvar == 1)
                {
                    /* color_primaries */
                    tmpvar = (uint32) BitstreamReadBits16(stream, 8);
                    /* transfer_characteristics */
                    tmpvar = (uint32) BitstreamReadBits16(stream, 8);
                    /* matrix_coefficients */
                    tmpvar = (uint32) BitstreamReadBits16(stream, 8);
                }
            }
        }
        else
        {
            do
            {
                /* Search for VOL_HEADER */
                status = PVSearchNextM4VFrame(stream); /* search 0x00 0x00 0x01 */
                if (status != PV_SUCCESS) return PV_FAIL; /* breaks the loop */
                BitstreamShowBits32(stream, VOL_START_CODE_LENGTH, &tmpvar);
                PV_BitstreamFlushBits(stream, 8);
            }
            while (tmpvar != VOL_START_CODE);
            goto decode_vol;
        }

        /* next_start_code() */
        status = PV_BitstreamByteAlign(stream);                            /*  10/12/01 */
        status = BitstreamShowBits32HC(stream, &tmpvar);

        if (tmpvar == USER_DATA_START_CODE)
        {
            /* Something has to be done to deal with user data (parse it)  11/11/99 */
            status = DecodeUserData(stream);
            if (status != PV_SUCCESS) return PV_FAIL;
        }
        status = BitstreamShowBits32(stream, 27, &tmpvar);   /*  10/12/01 */
    }
    else
    {
        /*      tmpvar = 0;   */                                             /*  10/12/01 */
        status = BitstreamShowBits32(stream, 27, &tmpvar);     /* uncomment this line if you want
                                                                     to start decoding with a
                                                                     video_object_start_code */
    }

    if (tmpvar == VO_START_CODE)
    {
        /*****
        *
        *   Read the VOL header entries from the bitstream
        *
        *****/
        /* video_object_start_code                         */
        tmpvar = BitstreamReadBits32(stream, 27);
        tmpvar = (uint32) BitstreamReadBits16(stream, 5);

        /* video_object_layer_start_code                   */
        BitstreamShowBits32(stream, VOL_START_CODE_LENGTH, &tmpvar);
        if (tmpvar != VOL_START_CODE)
        {
            status = BitstreamCheckEndBuffer(stream);
            if (status == PV_END_OF_VOP)
            {
                video->shortVideoHeader = TRUE;
                return PV_SUCCESS;
            }
            else
            {
                do
                {
                    /* Search for VOL_HEADER */
                    status = PVSearchNextM4VFrame(stream);/* search 0x00 0x00 0x01 */
                    if (status != PV_SUCCESS) return PV_FAIL; /* breaks the loop */
                    BitstreamShowBits32(stream, VOL_START_CODE_LENGTH, &tmpvar);
                    PV_BitstreamFlushBits(stream, 8); /* advance the byte ptr */
                }
                while (tmpvar != VOL_START_CODE);
            }
        }
        else
        {
            PV_BitstreamFlushBits(stream, 8);
        }

decode_vol:
        PV_BitstreamFlushBits(stream, VOL_START_CODE_LENGTH - 8);
        video->shortVideoHeader = 0;

        /* vol_id (4 bits) */
        currVol->volID = (int) BitstreamReadBits16(stream, 4);

        /* RandomAccessible flag */
        tmpvar = (uint32) BitstreamRead1Bits(stream);

        /* object type */
        tmpvar = (uint32) BitstreamReadBits16(stream, 8);                /*  */

#ifdef PV_TOLERATE_VOL_ERRORS
        if (tmpvar == 0)
        {
            if (layer)                                                      /*    */
            {
                /* support SSPL0-2  */
                if (profile != 0x10 && profile != 0x11 && profile != 0x12)
                    return PV_FAIL;
                tmpvar = 0x02;
            }
            else
            {
                /* support SPL0-3 & SSPL0-2   */
                if (profile != 0x01 && profile != 0x02 && profile != 0x03 && profile != 0x08 &&
                        profile != 0x10 && profile != 0x11 && profile != 0x12)
                    return PV_FAIL;
                tmpvar = 0x01;
            }
            profile |= 0x0100;
        }
#endif

        if (layer)
        {
            if (tmpvar != 0x02) return PV_FAIL;
        }
        else
        {
            if (tmpvar != 0x01) return PV_FAIL;
        }

        /* version id specified? */
        tmpvar = (uint32) BitstreamRead1Bits(stream);
        if (tmpvar == 1)
        {
            /* version ID */
            version_id = (uint32) BitstreamReadBits16(stream, 4);
            /* priority */
            tmpvar = (uint32) BitstreamReadBits16(stream, 3);

        }

        /* aspect ratio info */
        tmpvar = (uint32) BitstreamReadBits16(stream, 4);
        if (tmpvar == 0) return PV_FAIL;
        if (tmpvar == 0xf /* extended_par */)
        {
            /* width */
            tmpvar = (uint32) BitstreamReadBits16(stream, 8);
            /* height */
            tmpvar = (uint32) BitstreamReadBits16(stream, 8);
        }

        /* control parameters present? */
        tmpvar = (uint32) BitstreamRead1Bits(stream);

        /*  Get the parameters (skipped) */
        /*  03/10/99 */
        if (tmpvar)
        {
            /* chroma_format                    */
            tmpvar = BitstreamReadBits16(stream, 2);
            if (tmpvar != 1) return PV_FAIL;
            /* low_delay  */
            tmpvar = BitstreamRead1Bits(stream);

            /* vbv_parameters present? */
            tmpvar = (uint32) BitstreamRead1Bits(stream);
            if (tmpvar)
            {
                /* first_half_bit_rate    */
                BitstreamReadBits16(stream, 15);
                if (!BitstreamRead1Bits(stream)) return PV_FAIL;
                /* latter_half_bit_rate   */
                BitstreamReadBits16(stream, 15);
                if (!BitstreamRead1Bits(stream)) return PV_FAIL;
                /* first_half_vbv_buffer_size   */
                BitstreamReadBits16(stream, 15);
                if (!BitstreamRead1Bits(stream)) return PV_FAIL;
                /* latter_half_vbv_buffer_size   */
                BitstreamReadBits16(stream,  3);
                /* first_half_vbv_occupancy     */
                BitstreamReadBits16(stream, 11);
                if (!BitstreamRead1Bits(stream)) return PV_FAIL;
                /* latter_half_vbv_occupancy  */
                BitstreamReadBits16(stream, 15);
                if (!BitstreamRead1Bits(stream)) return PV_FAIL;
            }
        }

        /* video_object_layer_shape (2 bits), only 00 (rect) is supported for now */
        vol_shape = (uint32) BitstreamReadBits16(stream, 2);
        if (vol_shape) return PV_FAIL;

        /* marker bit,  03/10/99 */
        if (!BitstreamRead1Bits(stream)) return PV_FAIL;

        /* vop_time_increment_resolution   */
        currVol->timeIncrementResolution = BitstreamReadBits16(stream, 16);
        if (currVol->timeIncrementResolution == 0) return PV_FAIL;

        /* . since nbitsTimeIncRes will be used over and over again, */
        /*    we should put it in Vol structure.  04/12/2000.          */
        currVol->nbitsTimeIncRes = CalcNumBits((uint)currVol->timeIncrementResolution - 1);

        if (!BitstreamRead1Bits(stream)) return PV_FAIL;

        /* fixed_vop_rate */
        currVol->fixedVopRate = (int) BitstreamRead1Bits(stream);
        if (currVol->fixedVopRate)
        {
            /* fixed_vop_time_increment */
            tmpvar = BitstreamReadBits16(stream, currVol->nbitsTimeIncRes);
        }

        /* marker bit */
        if (!BitstreamRead1Bits(stream)) return PV_FAIL;

        /* video_object_layer_width (13 bits) */
        video->displayWidth = video->width = (int) BitstreamReadBits16(stream, 13);

        /* round up to a multiple of MB_SIZE.   08/09/2000 */
        video->width = (video->width + 15) & -16;
//      video->displayWidth += (video->displayWidth & 0x1);  /* displayed image should be even size */

        /* marker bit */
        if (!BitstreamRead1Bits(stream)) return PV_FAIL;

        /* video_object_layer_height (13 bits) */
        video->displayHeight = video->height = (int) BitstreamReadBits16(stream, 13);

        /* round up to a multiple of MB_SIZE.   08/09/2000 */
        video->height = (video->height + 15) & -16;
//      video->displayHeight += (video->displayHeight & 0x1); /* displayed image should be even size */
        if (!BitstreamRead1Bits(stream)) return PV_FAIL;

        /*  03/10/99 */
        /* interlaced */
        tmpvar = (uint32) BitstreamRead1Bits(stream);
        if (tmpvar != 0)
        {
            mp4dec_log("DecodeVOLHeader(): Interlaced video is not supported.\n");
            return PV_FAIL;
        }

        /* obmc_disable */
        tmpvar = (uint32) BitstreamRead1Bits(stream);
        if (tmpvar == 0) return PV_FAIL;

        if (version_id == 1)
        {
            /*  sprite_enable (1 bits) */
            tmpvar = (uint32) BitstreamRead1Bits(stream);
            if (tmpvar)
            {
                mp4dec_log("DecodeVOLHeader(): Sprite is not supported.\n");
                return PV_FAIL;
            }
        }
        else
        {
            /* For version 2, vol_sprite_usage has two bits. */
            /* sprite_enable */
            tmpvar = (uint32) BitstreamReadBits16(stream, 2);
            if (tmpvar)
            {
                mp4dec_log("DecodeVOLHeader(): Sprite is not supported.\n");
                return PV_FAIL;
            }
        }

        /* not_8_bit */
        if (BitstreamRead1Bits(stream))
        {
            /* quant_precision */
            currVol->quantPrecision = BitstreamReadBits16(stream, 4);
            /* bits_per_pixel  */
            currVol->bitsPerPixel = BitstreamReadBits16(stream, 4);
            mp4dec_log("DecodeVOLHeader(): not an 8-bit stream.\n");    // For the time being we do not support != 8 bits

            return PV_FAIL;
        }
        else
        {
            currVol->quantPrecision = 5;
            currVol->bitsPerPixel = 8;
        }

        /* quant_type (1 bit) */
        currVol->quantType = BitstreamRead1Bits(stream);
        if (currVol->quantType)
        {
#ifdef PV_SUPPORT_MAIN_PROFILE
            /* load quantization matrices.   5/22/2000 */
            /* load_intra_quant_mat (1 bit) */
            qmat = currVol->iqmat;
            currVol->loadIntraQuantMat = BitstreamRead1Bits(stream);
            if (currVol->loadIntraQuantMat)
            {
                /* intra_quant_mat (8*64 bits) */
                i = 0;
                do
                {
                    qmat[*(zigzag_inv+i)] = (int) BitstreamReadBits16(stream, 8);
                }
                while ((qmat[*(zigzag_inv+i)] != 0) && (++i < 64));

                for (j = i; j < 64; j++)
                    qmat[*(zigzag_inv+j)] = qmat[*(zigzag_inv+i-1)];
            }
            else
            {
                oscl_memcpy(qmat, mpeg_iqmat_def, 64*sizeof(int));
            }

            qmat[0] = 0;             /* necessary for switched && MPEG quant  07/09/01 */

            /* load_nonintra_quant_mat (1 bit) */
            qmat = currVol->niqmat;
            currVol->loadNonIntraQuantMat = BitstreamRead1Bits(stream);
            if (currVol->loadNonIntraQuantMat)
            {
                /* nonintra_quant_mat (8*64 bits) */
                i = 0;
                do
                {
                    qmat[*(zigzag_inv+i)] = (int) BitstreamReadBits16(stream, 8);
                }
                while ((qmat[*(zigzag_inv+i)] != 0) && (++i < 64));

                for (j = i; j < 64; j++)
                    qmat[*(zigzag_inv+j)] = qmat[*(zigzag_inv+i-1)];
            }
            else
            {
                oscl_memcpy(qmat, mpeg_nqmat_def, 64*sizeof(int));
            }
#else
            return PV_FAIL;
#endif
        }

        if (version_id != 1)
        {
            /* quarter_sample enabled */
            tmpvar = BitstreamRead1Bits(stream);
            if (tmpvar) return PV_FAIL;
        }

        /* complexity_estimation_disable */
        currVol->complexity_estDisable = BitstreamRead1Bits(stream);
        if (currVol->complexity_estDisable == 0)
        {
            currVol->complexity_estMethod = BitstreamReadBits16(stream, 2);

            if (currVol->complexity_estMethod < 2)
            {
                /* shape_complexity_estimation_disable */
                tmpvar = BitstreamRead1Bits(stream);
                if (tmpvar == 0)
                {
                    mp4dec_log("DecodeVOLHeader(): Shape Complexity estimation is not supported.\n");
                    return PV_FAIL;
                }
                /* texture_complexity_estimation_set_1_disable */
                tmpvar = BitstreamRead1Bits(stream);
                if (tmpvar == 0)
                {
                    currVol->complexity.text_1 = BitstreamReadBits16(stream, 4);
                }
                /* marker bit */
                if (!BitstreamRead1Bits(stream)) return PV_FAIL;
                /* texture_complexity_estimation_set_2_disable */
                tmpvar = BitstreamRead1Bits(stream);
                if (tmpvar == 0)
                {
                    currVol->complexity.text_2 = BitstreamReadBits16(stream, 4);
                }
                /* motion_compensation_complexity_disable */
                tmpvar = BitstreamRead1Bits(stream);
                if (tmpvar == 0)
                {
                    currVol->complexity.mc = BitstreamReadBits16(stream, 6);
                }
                /* marker bit */
                if (!BitstreamRead1Bits(stream)) return PV_FAIL;

                if (currVol->complexity_estMethod == 1)
                {   /* version2_complexity_estimation_disable */
                    tmpvar = BitstreamRead1Bits(stream);
                    if (tmpvar == 0)
                    {
                        mp4dec_log("DecodeVOLHeader(): sadct, quarter pel not supported.\n");
                        return PV_FAIL;
                    }
                }
            }
        }

        /*  03/10/99 */
        /* resync_marker_disable */
        currVol->errorResDisable = (int) BitstreamRead1Bits(stream);
        /* data_partititioned    */
        currVol->dataPartitioning = (int) BitstreamRead1Bits(stream);

        video->vlcDecCoeffIntra = &VlcDecTCOEFIntra;
        video->vlcDecCoeffInter = &VlcDecTCOEFInter;

        if (currVol->dataPartitioning)
        {
            if (layer) return PV_FAIL;                              /*  */
            /* reversible_vlc */
            currVol->useReverseVLC = (int)BitstreamRead1Bits(stream);
            if (currVol->useReverseVLC)
            {
                video->vlcDecCoeffIntra = &RvlcDecTCOEFIntra;
                video->vlcDecCoeffInter = &RvlcDecTCOEFInter;
            }
            currVol->errorResDisable = 0;
        }
        else
        {
            currVol->useReverseVLC = 0;
        }

        if (version_id != 1)
        {
            /* newpred_enable */
            tmpvar = BitstreamRead1Bits(stream);
            if (tmpvar) return PV_FAIL;

            /* reduced_resolution_vop */
            tmpvar = BitstreamRead1Bits(stream);
            if (tmpvar) return PV_FAIL;

        }

        /* Intra AC/DC prediction is always true */
        video->intra_acdcPredDisable = 0;
        /* scalability */
        currVol->scalability = (int) BitstreamRead1Bits(stream);

        if (currVol->scalability)
        {
            if (layer == 0)  return PV_FAIL;                     /*  */
            /* hierarchy_type: 1 : temporal, 0 : spatial */
            /*  03/10/99 */
            currVol->scalType = (int) BitstreamRead1Bits(stream);              /*  */
            if (!currVol->scalType) return PV_FAIL;

            /* ref_layer_id (4 bits) */
            currVol->refVolID = (int) BitstreamReadBits16(stream, 4);
            if (layer)                                                      /*  */
            {
                if (currVol->refVolID != video->vol[0]->volID) return PV_FAIL;
            }
            /* ref_layer_sampling_direc (1 bits)              */
            /*   1 : ref. layer has higher resolution         */
            /*   0 : ref. layer has equal or lower resolution */
            currVol->refSampDir = (int) BitstreamRead1Bits(stream);
            if (currVol->refSampDir) return PV_FAIL;

            /* hor_sampling_factor_n (5 bits) */
            currVol->horSamp_n = (int) BitstreamReadBits16(stream, 5);

            /* hor_sampling_factor_m (5 bits) */
            currVol->horSamp_m = (int) BitstreamReadBits16(stream, 5);

            if (currVol->horSamp_m == 0) return PV_FAIL;
            if (currVol->horSamp_n != currVol->horSamp_m) return PV_FAIL;

            /* ver_sampling_factor_n (5 bits) */
            currVol->verSamp_n = (int) BitstreamReadBits16(stream, 5);

            /* ver_sampling_factor_m (5 bits) */
            currVol->verSamp_m = (int) BitstreamReadBits16(stream, 5);

            if (currVol->verSamp_m == 0) return PV_FAIL;
            if (currVol->verSamp_n != currVol->verSamp_m) return PV_FAIL;

            /* enhancement_type: 1 : partial region, 0 : full region */
            /* 04/10/2000: we only support full region enhancement layer. */
            if (BitstreamRead1Bits(stream)) return PV_FAIL;
        }

        PV_BitstreamByteAlign(stream);

        status = BitstreamShowBits32HC(stream, &tmpvar);

        /* if we hit the end of buffer, tmpvar == 0.   08/30/2000 */
        if (tmpvar == USER_DATA_START_CODE)
        {
            status = DecodeUserData(stream);
            /* you should not check for status here  03/19/2002 */
            status = PV_SUCCESS;
        }

        /* Compute some convenience variables:   04/13/2000 */
        video->nMBPerRow = video->width / MB_SIZE;
        video->nMBPerCol = video->height / MB_SIZE;
        video->nTotalMB = video->nMBPerRow * video->nMBPerCol;
        video->nBitsForMBID = CalcNumBits((uint)video->nTotalMB - 1);
#ifdef PV_ANNEX_IJKT_SUPPORT
        video->modified_quant = 0;
        video->advanced_INTRA = 0;
        video->deblocking = 0;
        video->slice_structure = 0;
#endif
    }
    else
    {
        /* SHORT_HEADER */
        status = BitstreamShowBits32(stream, SHORT_VIDEO_START_MARKER_LENGTH, &tmpvar);

        if (tmpvar == SHORT_VIDEO_START_MARKER)
        {
            video->shortVideoHeader = TRUE;
        }
        else
        {
            do
            {
                /* Search for VOL_HEADER */
                status = PVSearchNextM4VFrame(stream); /* search 0x00 0x00 0x01 */
                if (status != PV_SUCCESS) return PV_FAIL; /* breaks the loop */
                BitstreamShowBits32(stream, VOL_START_CODE_LENGTH, &tmpvar);
                PV_BitstreamFlushBits(stream, 8);
            }
            while (tmpvar != VOL_START_CODE);
            goto decode_vol;
        }
    }
#ifdef PV_TOLERATE_VOL_ERRORS
    if (profile > 0xFF || profile == 0)
    {
        return PV_BAD_VOLHEADER;
    }
#endif

    return status;
}

/***********************************************************CommentBegin******
*
* -- DecodeGOV -- Decodes the Group of VOPs from bitstream
*
*   04/20/2000  initial modification to the new PV-Decoder Lib format.
*
***********************************************************CommentEnd********/
PV_STATUS DecodeGOVHeader(BitstreamDecVideo *stream, uint32 *time_base)
{
    uint32 tmpvar, time_s;
    int closed_gov, broken_link;

    /* group_start_code (32 bits) */
//   tmpvar = BitstreamReadBits32(stream, 32);

    /* hours */
    tmpvar = (uint32) BitstreamReadBits16(stream, 5);
    time_s = tmpvar * 3600;

    /* minutes */
    tmpvar = (uint32) BitstreamReadBits16(stream, 6);
    time_s += tmpvar * 60;

    /* marker bit */
    tmpvar = (uint32) BitstreamRead1Bits(stream);

    /* seconds */
    tmpvar = (uint32) BitstreamReadBits16(stream, 6);
    time_s += tmpvar;

    /* We have to check the timestamp here.  If the sync timestamp is */
    /*    earlier than the previous timestamp or longer than 60 sec.  */
    /*    after the previous timestamp, assume the GOV header is      */
    /*    corrupted.                                 05/12/2000     */
    *time_base = time_s;   /*  02/27/2002 */
//  *time_base = *time_base/1000;
//  tmpvar = time_s - *time_base;
//  if (tmpvar <= 60) *time_base = time_s;
//  else return PV_FAIL;

    tmpvar = (uint32) BitstreamRead1Bits(stream);
    closed_gov = tmpvar;
    tmpvar = (uint32) BitstreamRead1Bits(stream);
    broken_link = tmpvar;

    if ((closed_gov == 0) && (broken_link == 1))
    {
        return PV_SUCCESS;        /*  03/15/2002  you can also return PV_FAIL */
    }

    PV_BitstreamByteAlign(stream);

    BitstreamShowBits32HC(stream, &tmpvar);

    while (tmpvar == USER_DATA_START_CODE)       /*  03/15/2002 */
    {
        DecodeUserData(stream);
        BitstreamShowBits32HC(stream, &tmpvar);
    }

    return PV_SUCCESS;
}

/***********************************************************CommentBegin******
*
* -- DecodeVopHeader -- Decodes the VOPheader information from the bitstream
*
*   04/12/2000  Initial port to the new PV decoder library format.
*   05/10/2000  Error resilient decoding of vop header.
*
***********************************************************CommentEnd********/
PV_STATUS DecodeVOPHeader(VideoDecData *video, Vop *currVop, Bool use_ext_timestamp)
{
    PV_STATUS status = PV_SUCCESS;
    Vol *currVol = video->vol[video->currLayer];
    BitstreamDecVideo *stream = currVol->bitstream;
    uint32 tmpvar;
    int time_base;

    /*****
    *   Read the VOP header from the bitstream (No shortVideoHeader Mode here!)
    *****/
    BitstreamShowBits32HC(stream, &tmpvar);

    /* check if we have a GOV header here.   08/30/2000 */
    if (tmpvar == GROUP_START_CODE)
    {
        tmpvar = BitstreamReadBits32HC(stream);
//      rewindBitstream(stream, START_CODE_LENGTH); /* for backward compatibility */
        status = DecodeGOVHeader(stream, &tmpvar);
        if (status != PV_SUCCESS)
        {
            return status;
        }
//      use_ext_timestamp = TRUE;   /*  02/08/2002 */
        /* We should have a VOP header following the GOV header.  03/15/2001 */
        BitstreamShowBits32HC(stream, &tmpvar);
    }
#ifdef PV_SUPPORT_TEMPORAL_SCALABILITY
    currVop->timeStamp = -1;
#endif
    if (tmpvar == VOP_START_CODE)
    {
        tmpvar = BitstreamReadBits32HC(stream);
    }
    else
    {
        PV_BitstreamFlushBits(stream, 8); // advance by a byte
        status = PV_FAIL;
        goto return_point;
    }

    /* vop_prediction_type (2 bits) */
    currVop->predictionType = (int) BitstreamReadBits16(stream, 2);

    /* modulo_time_base (? bits) */
    time_base = -1;
    do
    {
        time_base++;
        tmpvar = (uint32) BitstreamRead1Bits(stream);
    }
    while (tmpvar == 1);

    if (!use_ext_timestamp)
    {
        currVol->moduloTimeBase += 1000 * time_base; /* milliseconds based MTB  11/12/01 */
    }

    /* marker_bit (1 bit) */
    if (!BitstreamRead1Bits(stream))
    {
        status = PV_FAIL;
        goto return_point;
    }

    /* vop_time_increment (1-15 bits) in Nov_Compliant (1-16 bits) */
    /*    we always assumes fixed vop rate here */
    currVop->timeInc = BitstreamReadBits16(stream, currVol->nbitsTimeIncRes);

    /* marker_bit (1 bit) */
    if (!BitstreamRead1Bits(stream))
    {
        status = PV_FAIL;
        goto return_point;
    }

    /* vop_coded */
    currVop->vopCoded = (int) BitstreamRead1Bits(stream);

    if (currVop->vopCoded == 0)
    {
        status = PV_SUCCESS;
        goto return_point;
    }

    /* read vop_rounding_type */
    if (currVop->predictionType == P_VOP)
    {
        currVop->roundingType = (int) BitstreamRead1Bits(stream);
    }
    else
    {
        currVop->roundingType = 0;
    }

    if (currVol->complexity_estDisable == 0)
    {
        if (currVol->complexity_estMethod < 2)   /*   OCT 2002 */
        {
            if ((currVol->complexity.text_1 >> 3) & 0x1)    /* intra        */
                BitstreamReadBits16(stream, 8);
            if (currVol->complexity.text_1 & 0x1)           /* not_coded    */
                BitstreamReadBits16(stream, 8);
            if ((currVol->complexity.text_2 >> 3) & 0x1)    /* dct_coefs    */
                BitstreamReadBits16(stream, 8);
            if ((currVol->complexity.text_2 >> 2) & 0x1)    /* dct_lines    */
                BitstreamReadBits16(stream, 8);
            if ((currVol->complexity.text_2 >> 1) & 0x1)    /* vlc_symbols  */
                BitstreamReadBits16(stream, 8);
            if (currVol->complexity.text_2 & 0x1)           /* vlc_bits     */
                BitstreamReadBits16(stream, 4);

            if (currVop->predictionType != I_VOP)
            {
                if ((currVol->complexity.text_1 >> 2) & 0x1)    /* inter    */
                    BitstreamReadBits16(stream, 8);
                if ((currVol->complexity.text_1 >> 1) & 0x1)    /* inter_4v */
                    BitstreamReadBits16(stream, 8);
                if ((currVol->complexity.mc >> 5) & 0x1)        /* apm      */
                    BitstreamReadBits16(stream, 8);
                if ((currVol->complexity.mc >> 4) & 0x1)        /* npm      */
                    BitstreamReadBits16(stream, 8);
                /* interpolate_mc_q */
                if ((currVol->complexity.mc >> 2) & 0x1)        /* forw_back_mc_q */
                    BitstreamReadBits16(stream, 8);
                if ((currVol->complexity.mc >> 1) & 0x1)        /* halfpel2 */
                    BitstreamReadBits16(stream, 8);
                if (currVol->complexity.mc & 0x1)               /* halfpel4 */
                    BitstreamReadBits16(stream, 8);
            }
            if (currVop->predictionType == B_VOP)
            {
                if ((currVol->complexity.mc >> 3) & 0x1)        /* interpolate_mc_q */
                    BitstreamReadBits16(stream, 8);
            }
        }
    }

    /* read intra_dc_vlc_thr */
    currVop->intraDCVlcThr = (int) BitstreamReadBits16(stream, 3);

    /* read vop_quant (currVol->quantPrecision bits) */
    currVop->quantizer = (int16) BitstreamReadBits16(stream, currVol->quantPrecision);
    if (currVop->quantizer == 0)
    {
        currVop->quantizer = video->prevVop->quantizer;
        status = PV_FAIL;
        goto return_point;
    }

    /* read vop_fcode_forward */
    if (currVop->predictionType != I_VOP)
    {
        tmpvar = (uint32) BitstreamReadBits16(stream, 3);
        if (tmpvar < 1)
        {
            currVop->fcodeForward = 1;
            status = PV_FAIL;
            goto return_point;
        }
        currVop->fcodeForward = tmpvar;
    }
    else
    {
        currVop->fcodeForward = 0;
    }

    /* read vop_fcode_backward */
    if (currVop->predictionType == B_VOP)
    {
        tmpvar = (uint32) BitstreamReadBits16(stream, 3);
        if (tmpvar < 1)
        {
            currVop->fcodeBackward = 1;
            status = PV_FAIL;
            goto return_point;
        }
        currVop->fcodeBackward = tmpvar;
    }
    else
    {
        currVop->fcodeBackward = 0;
    }

    if (currVol->scalability)
    {
        currVop->refSelectCode = (int) BitstreamReadBits16(stream, 2);
    }

return_point:
    return status;
}

/***********************************************************CommentBegin******
*
* -- VideoPlaneWithShortHeader -- Decodes the short_video_header information from the bitstream
* Modified :
             04/23/2001.  Remove the codes related to the
                 "first pass" decoding.  We use a different function
                 to set up the decoder now.
***********************************************************CommentEnd********/
PV_STATUS DecodeShortHeader(VideoDecData *video, Vop *currVop)
{
    PV_STATUS status = PV_SUCCESS;
    Vol *currVol = video->vol[0];
    BitstreamDecVideo *stream = currVol->bitstream;
    uint32 tmpvar;
    int32 size;

    int extended_PTYPE = FALSE;
    int UFEP = 0, custom_PFMT = 0, custom_PCF = 0;

    status = BitstreamShowBits32(stream, SHORT_VIDEO_START_MARKER_LENGTH, &tmpvar);

    if (tmpvar !=  SHORT_VIDEO_START_MARKER)
    {
        status = PV_FAIL;
        goto return_point;
    }

    PV_BitstreamFlushBits(stream, SHORT_VIDEO_START_MARKER_LENGTH);

    /* Temporal reference. Using vop_time_increment_resolution = 30000 */
    tmpvar = (uint32) BitstreamReadBits16(stream, 8);
    currVop->temporalRef = (int) tmpvar;

    currVop->timeInc = 0xff & (256 + currVop->temporalRef - video->prevVop->temporalRef);
    currVol->moduloTimeBase += currVop->timeInc; /* mseconds   11/12/01 */
    /* Marker Bit */
    if (!BitstreamRead1Bits(stream))
    {
        mp4dec_log("DecodeShortHeader(): Marker bit wrong.\n");
        status = PV_FAIL;
        goto return_point;
    }

    /* Zero Bit */
    if (BitstreamRead1Bits(stream))
    {
        mp4dec_log("DecodeShortHeader(): Zero bit wrong.\n");
        status = PV_FAIL;
        goto return_point;
    }

    /*split_screen_indicator*/
    if (BitstreamRead1Bits(stream))
    {
        mp4dec_log("DecodeShortHeader(): Split Screen not supported.\n");
        VideoDecoderErrorDetected(video);
    }

    /*document_freeze_camera*/
    if (BitstreamRead1Bits(stream))
    {
        mp4dec_log("DecodeShortHeader(): Freeze Camera not supported.\n");
        VideoDecoderErrorDetected(video);
    }

    /*freeze_picture_release*/
    if (BitstreamRead1Bits(stream))
    {
        mp4dec_log("DecodeShortHeader(): Freeze Release not supported.\n");
        VideoDecoderErrorDetected(video);
    }
    /* source format */
    switch (BitstreamReadBits16(stream, 3))
    {
        case 1:
            if (video->size < 128*96)
            {
                status = PV_FAIL;
                goto return_point;
            }
            video->displayWidth = video->width =  128;
            video->displayHeight = video->height  = 96;
            break;

        case 2:
            if (video->size < 176*144)
            {
                status = PV_FAIL;
                goto return_point;
            }
            video->displayWidth = video->width  = 176;
            video->displayHeight = video->height  = 144;
            break;

        case 3:
            if (video->size < 352*288)
            {
                status = PV_FAIL;
                goto return_point;
            }
            video->displayWidth = video->width = 352;
            video->displayHeight = video->height = 288;
            break;

        case 4:
            if (video->size < 704*576)
            {
                status = PV_FAIL;
                goto return_point;
            }
            video->displayWidth = video->width = 704;
            video->displayHeight = video->height = 576;
            break;

        case 5:
            if (video->size < 1408*1152)
            {
                status = PV_FAIL;
                goto return_point;
            }
            video->displayWidth = video->width = 1408;
            video->displayHeight = video->height = 1152;
            break;

        case 7:
            extended_PTYPE = TRUE;
            break;

        default:
            /* Msg("H.263 source format not legal\n"); */
            status = PV_FAIL;
            goto return_point;
    }

    currVop->roundingType = 0;

    if (extended_PTYPE == FALSE)
    {
        currVop->predictionType = (int) BitstreamRead1Bits(stream);

        /* four_reserved_zero_bits */
        if (BitstreamReadBits16(stream, 4))
        {
            mp4dec_log("DecodeShortHeader(): Reserved bits wrong.\n");
            status = PV_FAIL;
            goto return_point;
        }
    }
    else
    {
        UFEP = BitstreamReadBits16(stream, 3);
        if (UFEP == 1)
        {
            /* source format */
            switch (BitstreamReadBits16(stream, 3))
            {
                case 1:
                    if (video->size < 128*96)
                    {
                        status = PV_FAIL;
                        goto return_point;
                    }
                    video->displayWidth = video->width =  128;
                    video->displayHeight = video->height  = 96;
                    break;

                case 2:
                    if (video->size < 176*144)
                    {
                        status = PV_FAIL;
                        goto return_point;
                    }
                    video->displayWidth = video->width  = 176;
                    video->displayHeight = video->height  = 144;
                    break;

                case 3:
                    if (video->size < 352*288)
                    {
                        status = PV_FAIL;
                        goto return_point;
                    }
                    video->displayWidth = video->width = 352;
                    video->displayHeight = video->height = 288;
                    break;

                case 4:
                    if (video->size < 704*576)
                    {
                        status = PV_FAIL;
                        goto return_point;
                    }
                    video->displayWidth = video->width = 704;
                    video->displayHeight = video->height = 576;
                    break;

                case 5:
                    if (video->size < 1408*1152)
                    {
                        status = PV_FAIL;
                        goto return_point;
                    }
                    video->displayWidth = video->width = 1408;
                    video->displayHeight = video->height = 1152;
                    break;

                case 6:
                    custom_PFMT = TRUE;
                    break;

                default:
                    /* Msg("H.263 source format not legal\n"); */
                    status = PV_FAIL;
                    goto return_point;
            }

            custom_PCF = BitstreamRead1Bits(stream);
            /* unrestricted MV */
            if (BitstreamRead1Bits(stream))
            {
                status = PV_FAIL;
                goto return_point;
            }
            /* SAC */
            if (BitstreamRead1Bits(stream))
            {
                status = PV_FAIL;
                goto return_point;
            }

            /* AP */
            if (BitstreamRead1Bits(stream))
            {
                status = PV_FAIL;
                goto return_point;
            }

            video->advanced_INTRA = BitstreamRead1Bits(stream);

            video->deblocking = BitstreamRead1Bits(stream);

            video->slice_structure = BitstreamRead1Bits(stream);

            /* RPS, ISD, AIV */
            if (BitstreamReadBits16(stream, 3))
            {
                status = PV_FAIL;
                goto return_point;
            }
            video->modified_quant = BitstreamRead1Bits(stream);

            /* Marker Bit and reserved*/
            if (BitstreamReadBits16(stream, 4) != 8)
            {
                status = PV_FAIL;
                goto return_point;
            }
        }
#ifndef PV_ANNEX_IJKT_SUPPORT
        if (video->advanced_INTRA | video->deblocking | video->modified_quant | video->modified_quant)
        {
            status = PV_FAIL;
            goto return_point;
        }
#endif

        if (UFEP == 0 || UFEP == 1)
        {
            tmpvar = BitstreamReadBits16(stream, 3);
            if (tmpvar > 1)
            {
                status = PV_FAIL;
                goto return_point;
            }
            currVop->predictionType = tmpvar;
            /* RPR */
            if (BitstreamRead1Bits(stream))
            {
                status = PV_FAIL;
                goto return_point;
            }

            /* RRU */
            if (BitstreamRead1Bits(stream))
            {
                status = PV_FAIL;
                goto return_point;
            }
            currVop->roundingType = (int) BitstreamRead1Bits(stream);
            if (BitstreamReadBits16(stream, 3) != 1)
            {
                status = PV_FAIL;
                goto return_point;
            }
        }
        else
        {
            status = PV_FAIL;
            goto return_point;
        }
        /* CPM */
        if (BitstreamRead1Bits(stream))
        {
            status = PV_FAIL;
            goto return_point;
        }
        /* CPFMT */
        if (custom_PFMT == 1 && UFEP == 1)
        {
            /* aspect ratio */
            tmpvar = BitstreamReadBits16(stream, 4);
            if (tmpvar == 0)
            {
                status = PV_FAIL;
                goto return_point;
            }
            /* Extended PAR */
            if (tmpvar == 0xF)
            {
                /* Read par_width and par_height but do nothing */
                /* par_width */
                tmpvar = BitstreamReadBits16(stream, 8);

                /* par_height */
                tmpvar = BitstreamReadBits16(stream, 8);
            }
            tmpvar = BitstreamReadBits16(stream, 9);

            video->displayWidth = (tmpvar + 1) << 2;
            video->width = (video->displayWidth + 15) & -16;
            /* marker bit */
            if (!BitstreamRead1Bits(stream))
            {
                status = PV_FAIL;
                goto return_point;
            }
            tmpvar = BitstreamReadBits16(stream, 9);
            if (tmpvar == 0)
            {
                status = PV_FAIL;
                goto return_point;
            }
            video->displayHeight = tmpvar << 2;
            video->height = (video->displayHeight + 15) & -16;

            if (video->height * video->width > video->size)
            {
                status = PV_FAIL;
                goto return_point;
            }

            video->nTotalMB = video->width / MB_SIZE * video->height / MB_SIZE;

            if (video->nTotalMB <= 48)
            {
                video->nBitsForMBID = 6;
            }
            else if (video->nTotalMB <= 99)
            {
                video->nBitsForMBID = 7;
            }
            else if (video->nTotalMB <= 396)
            {
                video->nBitsForMBID = 9;
            }
            else if (video->nTotalMB <= 1584)
            {
                video->nBitsForMBID = 11;
            }
            else if (video->nTotalMB <= 6336)
            {
                video->nBitsForMBID = 13 ;
            }
            else if (video->nTotalMB <= 9216)
            {
                video->nBitsForMBID = 14 ;
            }
            else
            {
                status = PV_FAIL;
                goto return_point;
            }
        }
        if (UFEP == 1 && custom_PCF == 1)
        {
            BitstreamRead1Bits(stream);

            tmpvar = BitstreamReadBits16(stream, 7);
            if (tmpvar == 0)
            {
                status = PV_FAIL;
                goto return_point;
            }
        }

        if (custom_PCF == 1)
        {
            currVop->ETR = BitstreamReadBits16(stream, 2);
        }

        if (UFEP == 1 && video->slice_structure == 1)
        {
            /* SSS */
            tmpvar = BitstreamReadBits16(stream, 2);
            if (tmpvar != 0)
            {
                status = PV_FAIL;
                goto return_point;
            }
        }
    }

    /* Recalculate number of macroblocks per row & col since */
    /*  the frame size can change.           04/23/2001.   */
    video->nMBinGOB = video->nMBPerRow = video->width / MB_SIZE;
    video->nGOBinVop = video->nMBPerCol = video->height / MB_SIZE;
    video->nTotalMB = video->nMBPerRow * video->nMBPerCol;
    if (custom_PFMT == 0  || UFEP == 0)
    {
        video->nBitsForMBID = CalcNumBits((uint)video->nTotalMB - 1); /* otherwise calculate above */
    }
    size = (int32)video->width * video->height;
    if (video->currVop->predictionType == P_VOP && size > video->videoDecControls->size)
    {
        status = PV_FAIL;
        goto return_point;
    }
    video->videoDecControls->size = size;
    video->currVop->uChan = video->currVop->yChan + size;
    video->currVop->vChan = video->currVop->uChan + (size >> 2);
    video->prevVop->uChan = video->prevVop->yChan + size;
    video->prevVop->vChan = video->prevVop->uChan + (size >> 2);

    currVop->quantizer = (int16) BitstreamReadBits16(stream, 5);

    if (currVop->quantizer == 0)                          /*  04/03/01 */
    {
        currVop->quantizer = video->prevVop->quantizer;
        status = PV_FAIL;
        goto return_point;
    }

    /* Zero bit */
    if (extended_PTYPE == FALSE)
    {
        if (BitstreamRead1Bits(stream))
        {
            mp4dec_log("DecodeShortHeader(): Zero bit wrong.\n");
            status = PV_FAIL;
            goto return_point;
        }
    }
    /* pei */
    tmpvar = (uint32) BitstreamRead1Bits(stream);

    while (tmpvar)
    {
        tmpvar = (uint32) BitstreamReadBits16(stream, 8); /* "PSPARE" */
        tmpvar = (uint32) BitstreamRead1Bits(stream); /* "PEI" */
    }

    if (video->slice_structure)  /* ANNEX_K */
    {
        if (!BitstreamRead1Bits(stream))  /* SEPB1 */
        {
            status = PV_FAIL;
            goto return_point;
        }

        //  if (currVol->nBitsForMBID //
        if (BitstreamReadBits16(stream, video->nBitsForMBID))
        {
            status = PV_FAIL;             /* no ASO, RS support for Annex K */
            goto return_point;
        }

        if (!BitstreamRead1Bits(stream))  /*SEPB3 */
        {
            status = PV_FAIL;
            goto return_point;
        }

    }
    /* Setting of other VOP-header parameters */
    currVop->gobNumber = 0;
    currVop->vopCoded = 1;

    currVop->intraDCVlcThr = 0;
    currVop->gobFrameID = 0; /* initial value,  05/22/00 */
    currVol->errorResDisable = 0;
    /*PutVopInterlaced(0,curr_vop); no implemented yet */
    if (currVop->predictionType != I_VOP)
        currVop->fcodeForward = 1;
    else
        currVop->fcodeForward = 0;

return_point:

    return status;
}
/***********************************************************CommentBegin******
*
* -- PV_DecodeVop -- Decodes the VOP information from the bitstream
*
*   04/12/2000
*                   Initial port to the new PV decoder library format.
*                   This function is different from the one in MoMuSys MPEG-4
*                   visual decoder.  We handle combined mode with or withput
*                   error resilience and H.263 mode through the sam path now.
*
*   05/04/2000
*                   Added temporal scalability to the decoder.
*
***********************************************************CommentEnd********/
PV_STATUS PV_DecodeVop(VideoDecData *video)
{
    Vol *currVol = video->vol[video->currLayer];
    PV_STATUS status;
    uint32 tmpvar;

    /*****
    *   Do scalable or non-scalable decoding of the current VOP
    *****/

    if (!currVol->scalability)
    {
        if (currVol->dataPartitioning)
        {
            /* Data partitioning mode comes here */
            status = DecodeFrameDataPartMode(video);
        }
        else
        {
            /* Combined mode with or without error resilience */
            /*    and short video header comes here.          */
            status = DecodeFrameCombinedMode(video);
        }
    }
    else
    {
#ifdef DO_NOT_FOLLOW_STANDARD
        /* according to the standard, only combined mode is allowed */
        /*    in the enhancement layer.          06/01/2000.        */
        if (currVol->dataPartitioning)
        {
            /* Data partitioning mode comes here */
            status = DecodeFrameDataPartMode(video);
        }
        else
        {
            /* Combined mode with or without error resilience */
            /*    and short video header comes here.          */
            status = DecodeFrameCombinedMode(video);
        }
#else
        status = DecodeFrameCombinedMode(video);
#endif
    }

    /* This part is for consuming Visual_object_sequence_end_code and EOS Code */   /*  10/15/01 */
    if (!video->shortVideoHeader)
    {
        /* at this point bitstream is expected to be byte aligned */
        BitstreamByteAlignNoForceStuffing(currVol->bitstream);

        status = BitstreamShowBits32HC(currVol->bitstream, &tmpvar);  /*  07/07/01 */
        if (tmpvar == VISUAL_OBJECT_SEQUENCE_END_CODE)/* VOS_END_CODE */
        {
            PV_BitstreamFlushBits(currVol->bitstream, 16);
            PV_BitstreamFlushBits(currVol->bitstream, 16);
        }

    }
    else
    {
#ifdef PV_ANNEX_IJKT_SUPPORT
        if (video->deblocking)
        {
            H263_Deblock(video->currVop->yChan, video->width, video->height, video->QPMB, video->headerInfo.Mode, 0, 0);
            H263_Deblock(video->currVop->uChan, video->width >> 1, video->height >> 1, video->QPMB, video->headerInfo.Mode, 1, video->modified_quant);
            H263_Deblock(video->currVop->vChan, video->width >> 1, video->height >> 1, video->QPMB, video->headerInfo.Mode, 1, video->modified_quant);
        }
#endif
        /* Read EOS code for shortheader bitstreams    */
        status = BitstreamShowBits32(currVol->bitstream, 22, &tmpvar);
        if (tmpvar == SHORT_VIDEO_END_MARKER)
        {
            PV_BitstreamFlushBits(currVol->bitstream, 22);
        }
        else
        {
            status = PV_BitstreamShowBitsByteAlign(currVol->bitstream, 22, &tmpvar);
            if (tmpvar == SHORT_VIDEO_END_MARKER)
            {
                PV_BitstreamByteAlign(currVol->bitstream);
                PV_BitstreamFlushBits(currVol->bitstream, 22);
            }
        }
    }
    return status;
}

/***********************************************************CommentBegin******
*
* -- CalcVopDisplayTime -- calculate absolute time when VOP is to be displayed
*
*   04/12/2000 Initial port to the new PV decoder library format.
*
***********************************************************CommentEnd********/
uint32 CalcVopDisplayTime(Vol *currVol, Vop *currVop, int shortVideoHeader)
{
    uint32 display_time;

    /*****
    *   Calculate the time when the VOP is to be displayed next
    *****/

    if (!shortVideoHeader)
    {
        display_time = (uint32)(currVol->moduloTimeBase + (((int32)currVop->timeInc - (int32)currVol->timeInc_offset) * 1000) / ((int32)currVol->timeIncrementResolution));  /*  11/12/2001 */
        if (currVop->timeStamp >= display_time)
        {
            display_time += 1000;  /* this case is valid if GOVHeader timestamp is ignored */
        }
    }
    else
    {
        display_time = (uint32)(currVol->moduloTimeBase * 33 + (currVol->moduloTimeBase * 11) / 30); /*  11/12/2001 */
    }

    return(display_time);
}


50 WORDS or LESS...: The Death of Superman Lives: What Happened?
Jon Schnepp's in-depth autopsy of Tim Burton's aborted 1990s Superman film actually plumbs some merit (mostly visual) from the fanboy-maligned project. Burton seems typically adrift, while producer Jon Peters' illiterate douchebag rep remains intact and Kevin Smith gets more mileage from oft-told tales. A well-crafted, thoroughly entertaining (if softball-lobbing) effort.


text:
#include "BehaviorMark.h"
#include "Agent.h"
#include "BasicCommand.h"
#include "BehaviorPosition.h"
#include "Dasher.h"
#include "Evaluation.h"
#include "Formation.h"
#include "Logger.h"
#include "PositionInfo.h"
#include "VisualSystem.h"

const BehaviorType BehaviorMarkExecuter::BEHAVIOR_TYPE = BT_Mark;

namespace {
bool ret = BehaviorExecutable::AutoRegister<BehaviorMarkExecuter>();
}

BehaviorMarkExecuter::BehaviorMarkExecuter(Agent &agent)
    : BehaviorExecuterBase<BehaviorDefenseData>(agent) {
  Assert(ret);
}

BehaviorMarkExecuter::~BehaviorMarkExecuter(void) {}

bool BehaviorMarkExecuter::Execute(const ActiveBehavior &beh) {
  Logger::instance().LogGoToPoint(mSelfState.GetPos(), beh.mTarget, "@Mark");

  return Dasher::instance().GoToPoint(mAgent, beh.mTarget, beh.mBuffer,
                                      beh.mPower, false, false);
}

BehaviorMarkPlanner::BehaviorMarkPlanner(Agent &agent)
    : BehaviorPlannerBase<BehaviorDefenseData>(agent) {}

BehaviorMarkPlanner::~BehaviorMarkPlanner() {}

void BehaviorMarkPlanner::Plan(std::list<ActiveBehavior> &behavior_list) {
  Unum closest_opp =
      mPositionInfo.GetClosestOpponentToTeammate(mSelfState.GetUnum());
  Unum closest_tm = mPositionInfo.GetClosestTeammateToOpponent(closest_opp);

  if (closest_opp && closest_tm && closest_tm == mSelfState.GetUnum()) {
    ActiveBehavior mark(mAgent, BT_Mark);

    Vector ballPos = mBallState.GetPos();
    AngleDeg b2o =
        (mBallState.GetPos() - mWorldState.GetOpponent(closest_opp).GetPos())
            .Dir();
    mark.mBuffer = mSelfState.GetKickableArea();
    mark.mPower = mSelfState.CorrectDashPowerForStamina(
        ServerParam::instance().maxDashPower());
    mark.mTarget = mWorldState.GetOpponent(closest_opp).GetPos() +
                   Polar2Vector(mark.mBuffer, b2o);
    mark.mEvaluation =
        Evaluation::instance().EvaluatePosition(mark.mTarget, false);
    if (mAgent.GetFormation().GetMyRole().mLineType == LT_Defender) {
      mark.mEvaluation =
          Evaluation::instance().EvaluatePosition(mark.mTarget, true);
    }

    behavior_list.push_back(mark);
  }
}

redpajama_set_name: RedPajamaGithub


Richhill Raiders Volleyball Club is a newly formed club with exciting ambitions and ideas. The club is made up of locals from all around Richhill and the Armagh District and is aiming to be a community club that will successfully build partnerships with the local businesses within the Richhill Village.
Although this will only be the first year that the Richhill Club will compete in the Northern Ireland League, it has already attracted an impressive 5 out of the starting 6 Senior Northern Ireland Men's Volleyball Players as well as 4 U19 Northern Ireland Men's Players.


text:
Il Gepard è un semovente antiaereo tedesco con una torretta armata di 2 cannoni da 35 mm Oerlikon svizzeri, un radar sul tetto per la ricerca ed uno anteriore per il tiro. La torretta è stata in larga parte progettata in Svizzera dagli arsenali di Thun, in quanto avrebbe dovuto equipaggiare la versione antiaereo del Pz-68 Svizzero (versione realizzata solo a livello di prototipo). Lo scafo è quello del Leopard 1, non si sa se con una leggera diminuzione della corazzatura o meno, ma la torretta può essere adattata anche a carri come l'OF-40.

Sviluppo
Negli anni cinquanta ben 500 M42 Duster vennero forniti all'esercito della Germania Occidentale. Sebbene queste armi fossero molto potenti, esse non avevano un sistema di tiro sofisticato, non avevano che alimentazione in forma di 'clip' di 5 colpi; non davano inoltre alcuna capacità di difesa NBC, mancando inoltre di luci IR notturne e di protezione balistica per il mezzo. Oltretutto avevano un motore dal grande consumo di benzina, che nonostante l'ottima efficienza meccanica non consentiva autonomia elevata (praticamente 2 ore di moto alla massima velocità).

L'esercito tedesco ebbe l'esigenza di nuovi mezzi antiaerei; la gara iniziò nel 1966, prendendo in considerazione veicoli con cannoni da 30 e 35 mm. Alla fine, negli anni 70', venne approvato il progetto del Gepard, con torretta ed armi svizzere su carro Leopard 1 (per le armi da 30 si era forse pensato al Marder).

I primi mezzi vennero approntati nel 1976 e dimostravano già tutte le caratteristiche definitive del veicolo, chiamato ufficialmente flakpanzer Gepard.

Tecnica

Il nuovo veicolo è basato su scafo del Leopard 1, a cui si rimanda il lettore per i dettagli. Esso ha comunque una corazza in acciaio saldato e un potente motore Diesel.

La torretta, nonostante la minore protezione rispetto a quella del Leopard, è talmente grande che ne aumenta il peso di circa 5 tonnellate. In essa prendono posto il capocarro e l'artigliere. Una coppia di cannoni ad alta velocità KDA sono sistemati ai lati, in una sorta di 'pod' corazzati, e sono dotati di sensore per la rivelazione della effettiva velocità iniziale, mentre sul davanti vi è il radar di tiro e sopra la torre quello di sorveglianza. La cadenza di tiro è di 550 colpi per minuto per arma, e la gittata è di 3500 metri. Le munizioni sono di calibro troppo piccolo per avere spolette  VT (prossimità radar).

Il Gepard acquisisce il bersaglio con il radar per la ricerca, poi lo passa a quello di inseguimento e infine può aprire il fuoco grazie alla punteria automatica del computer di bordo. Vi sono 330 proiettili per arma tra HE e perforanti decalibrati (solo una piccola quantità, 80 mm a 1000 metri), con alimentazione a nastro continuo che non richiede ricariche manuali.

Operatività

I primi Gepard entrarono in produzione nel 1976, ma la velocità all'epoca era tale che entro 4 anni ne vennero prodotti ben 570.
420 mezzi sono stati ordinati dalla Germania Ovest, quasi sostituendo in rapporto 1:1 i precedenti M42 Duster, 95 per i Paesi Bassi (con elettronica olandese), e 55 per il Belgio. Anche l'Italia era interessata, ma si ritirò giudicandolo troppo costoso.

A tutt'oggi i Gepard vengono aggiornati con limitate modifiche ai computer e agli apparati di mira ottici.
In Germania dal 2010 sostituito dal Wiesel 2 Ozelot.

Nel luglio 2022 la Germania ha donato 3 Gepard a l'Ucraina allo scopo di usarli come difesa antiaerea nella Crisi russo-ucraina.

Utilizzatori
 : 55; ritirati dal servizio.
 : 30 veicoli acquistati da surplus dell'esercito tedesco.
 : 377 costruiti, 94 rimasti in servizio fino alla completa introduzione del sistema SysFla
 : 60 veicoli, la maggior parte dei quali sono in riserva.
 : 36, processo di ricezione
 : 43, tutti acquistati dall'esercito tedesco.

 : 50 veicoli donati dalla Germania durante l'Invasione russa dell'Ucraina del 2022. A metà di luglio 2022 i primi 15 semoventi corazzati saranno consegnati, dopo aver addestrato il personale ucraino e consegnato 60 mila munizioni per i cannoni KDA da 35 mm.

Note

Altri progetti

Veicoli militari tedeschi del dopoguerra
Semoventi d'artiglieria antiaerea

redpajama_set_name: RedPajamaWikipedia


As mentioned in the previous post 'What we learned at Pixel Pioneers Belfast' we covered speakers such as Chris Murphy @fehler and Harry Roberts @csswizardry. Chris taught us the value of 'retaining a beginner's mind' so that we are constantly learning every day in this industry. Harry expressed the importance of efficient speed and performance considerations by developing for legacy devices to ensure our products function at lightning speed on modern devices.
After the midday break, we attended a fantastic talk by Eva-Lotta Lamm @evalottchen, a user experience designer, illustrator and visual thinker. Besides her UX work, is found doing sketchnotes at hundreds of talks and conferences and has self-published her notes in several books.
Her talk for Pixel Pioneers was to encourage us as designers to express our thoughts more visually through sketch noting as opposed to simply taking standard notes. My initial thought after seeing her work was 'how does someone get the time to sketch that fast, that good an get a coherent message across"? It's not about how well your sketches are drawn, but rather how recognisable they are to you and how open-minded you are to being creative.
Concept recognition happens in a split second. And with this in mind, we can create patterns to make things more memorable. For example, sketching a truck for delivery, a ball for sports, a light bulb for an idea or a book for further reading instantaneously acts as a trigger. While these sketches may not paint the entire picture, they act as a trigger mechanism to invoke a memory or cognitive action.
Using this method can illustrate emotions to add context to situations. For example, sketch noting during a user interview could be much more in depth due to the ability to not only write down the person's direct answers but in addition include sketches of 'smiley faces' to illustrate a happy experience. While maybe a 'lightening bolt' could be an indication that the user was frustrated by the product at this point.
Remember not to be too critical of your sketches, and just get stuck in. They may appear messy to others in your team, but you are able to follow the story or scenario it will fall into place. This new visual method of note taking will help us become greater visual thinkers and soon we will be able to illustrate relationships between content and context with greater ease.
Another astounding speaker on the day was Sharon Steed @sharonsteed with her talk on Cultivating Community: Building Powerful Relationships by Communicating with Empathy. Sharon is an empathy and communications consultant, a position I personally would aspire to achieve in my career. She's spoken at companies on improving team communication and collaboration; at tech conferences on vulnerability as an asset; and has given a TEDx talk on empowering insecurities.
Everything about this talk was inspiring, especially after the surprising revelation that Sharon is a lifelong stutterer. Yes, this person on stage speaking in front of hundreds of people has a stutter, yet she uses her speech impediment to teach us both what empathy is and how to be empathetic. Personally, I was blown away by her story and how she had grown to overcome this barrier. Astounding!
Sharon explained how everyday communication is chaotic, which hinders building a community. It takes real effort to instil real empathy into our scenarios and conversations. How do you communicate with empathy you might think? It all stems from how you approach your conversations. To do this effectively we must not only speak our user's language but above all listen to their language. Using this knowledge we can better communicate on the same wavelength, and understand user frustrations or their positives experiences, with less confusion.
A great explanation of Empathy was to compare it to love.
Empathy is also an extremely powerful tool to have when working with your team. To fully understand those you collaborate with, we must create transparency. This allows greater ease for people to join the conversation and even those who maybe don't have the loudest voice in the room.
To wrap up this quick addition to our fantastic day at Pixel Pioneers Belfast, we at i3 Digital would just like to thank all those who put a great deal of work into bringing the event here. Huge thanks have to be given to all speakers for divulging and bestowing their knowledge and experience on us all. And in addition, I must give extra thanks (and apologies) to the speakers and fellow designers who I personally 'interrogated' over a pint at the after party. I do love an old yarn about this stuff.
Finally to those who I may not have had a chance to chat with this time around, roll on Pixel Pioneers 2018. The first pint is on me.


I understand you can make this as easy or as hard as you want ,but it seems simple is better .I have a 1997 ford f-150 with 280000 miles ,engine is strong ,gets oil changed every 3000 ,and I get 14-18 mpg depending on the weight of my foot ,what can I expect to get with an HHO system( not that 1 mpg better is still better) Thanks for any and all info and for this group with all your trials and errors.
Sounds like your friend is building a hydrostar, very hard for a novice builder. He would have been better of to build a HyZor unit. That is what i would suggest you do for your truck.


The church is also the house of God (1 Pet. 2:5). By this we do not mean merely that the church is the dwelling of God. This Greek word oikos means not only the house, the dwelling, but also the household. Oikos means both house and also the folks, the family, that make up the household; thus, it may also be translated household (Eph. 2:19).
God's dwelling place today on earth is the church, and God, as such a great Father, has a family, which is the church. For our family life we have a house, and inside the house we have the family. To us the house is one thing, and the family another; the house is the building, and the family is the people who live there. God's house and God's family, however, are the same. The house is the family, and the family is the house.
We as the church are God's house, God's dwelling place. At the same time, we are God's family. Both the house of God and the family of God are one entity, that is, a group of regenerated, called ones, indwelt by God Himself. These called ones, who have been regenerated by God with His life and who are being indwelt by this living God with all that He is, are both God's dwelling place and His family. This is more than an assembly. This is different from a group or organization of people. This is something organic—organic in the divine life, organic in the divine nature, and organic in the Triune God.
Some stressed the ekklesia very much, but they did not pay much attention to the organic aspect of the church. They did not say much about the church as God's family. We must realize, though, that the church is organic; it is the living house of God. Paul says the church is the house of the living God (1 Tim. 3:15) and that this house grows (Eph. 2:21). Does your house grow? Our houses do not grow. They depreciate. But God's house grows! For something to grow it must be living. Anything without life cannot grow. Anything which grows is organic, with life. Hallelujah, we are growing!
In 1964 I went to Plainview, Texas, to visit a small group of saints. Then in 1965 I went to Waco, Texas, to visit another small group. Without faith I would have been fully disappointed. When the news went to New York, a dear brother with whom I had been co-working for a number of years said to another brother that he did not believe these small groups in Texas would last. In 1968 I went to Lubbock. I did not see a big church; rather I saw something which needed much faith. By His mercy I did have that faith. Then the saints in Texas moved to Houston in 1969, and I went to visit them. The situation there was somewhat encouraging, but not entirely so. My visits to Irving, however, in 1982 and 1983 made me excited. There has been much growth among the churches in Texas because the church is something living. It is the living house of the living God. It is not something of organization, but of life; thus, its growth is by life.


text:
2 posts categorized "single tax unlimited"
The milk in our coconut
This is an editorial from the Leavenworth (KS) Labor News of February 10, 1893. This newspaper is available on Newspapers.com, and it, along with the Fairhope (AL) Courier, is a wonderful resource.
The Galveston News has an editorial on the "Public Landlord" in which it attempts to show that the figures used by Mr. Thomas G. Shearman as to the total annual land values of the United States are incorrect, and then it proceeds to demolish the single tax idea. That's the trouble with figure-mongers. What difference does it make whether Mr. Shearman's figures are correct or not? The milk in our cocoanut lies in the statement that land does not possess in itself those qualities which enable it to be owned by an individual. It is not property, any more than the air, sunlight, or winds of heaven are property and subject to individual ownership.
Mr. Shearman is one of the most valued adherents to the single tax cause. We call him a "Single Taxer Limited." He favors the single tax because of its simplicity as a fiscal measure.
We have all kinds of people in our camp; one highly valued Single Taxer is Billy Radcliff of Ohio, who goes around with a banjo singing our doctrine. Another is Rabbi Samuel Sale, of St. Louis, an orator whose words and figures of speech remind one of the lofty imagery of the prophet Isaiah. Then there is "Uncle Tom," the poor workman, who writes with the eloquence, which, as Webster said, "was not taught in schools, but belongs to tho cause, the time and the occasion."
Henry George, the philosopher; Judge Maguire and Louis F. Post, the lawyers; Dr. McGlynn, the religious teacher, and a countless number of professional men, artisans and common laborers make up our following, and run the entire gamut of human thought and endeavor.
If Thomas G. Shearman, the fiscal advocate of single tax, or Dr. McGlynn, the ethical advocate, or Louis F. Post, the legal advocate, or any other special pleader for our cause raises questions which, to men uninitiated in their special branches of learning seem to be untenable, what matters it?
The men who stand firmly upon the statement that individual ownership in land is the breeder of poverty, of sin and crime, and all the brood of evils which spring from an unjust and unrighteous act, care little whether the annual land values of the United States are seven hundred millions a year, or one million a year, or seven billions a year.
The point is that the annual value of land belongs to the creators of it, namely, to society in the aggregate—to the generation of men now living. The men who are dead have no part or lot in it; neither they nor their heirs who base their claims upon the fact that their ancestors claimed to own the land. When we die our interest in the land ceases and we do not believe that we can pass our title to our children as against the children of landless men who are living in the same generation with us.
If the annual land value be more or less than enough to support the state, what matters it? The value of land, be it great or small, belongs to all men who live on the land. That's all there is to it.
If this contention can be sustained we need have no fears about other truths not being in harmony with our position. The first thing to do is to establish the truth that land cannot be owned by an individual — is not of a nature which permits it to be owned. After this is done, then the fiscal, ethical, legal, sentimental and utilitarian phases of the situation may be profitably considered and worked out. If our contention can be sustained, then there is a way to harmonize the details. This must be true, or else truth itself is a lie.
If you have time available, consider digging into those two newspapers. They have a wealth of fascinating material and wisdom.
Posted on March 28, 2020 at 03:20 PM in commons, economic justice, equal opportunity, equity, Henry George, Jefferson, land different from capital, land value created by community, landlordism, Louis F Post, make land common property, no coherent arguments against it, pay for what you take, private property in land, rent-seeking, single tax, single tax unlimited, sufficiency of land rent, Thomas G. Shearman, usufruct | Permalink | Comments (0)
John Farrell, The Philosophy of the Single Tax, Part IX: The Method of Reform
The Daily Telegraph (Sydney, NSW: 1883-1930) Sat 1 Feb 1890 Page 5
THE PHILOSOPHY OF THE SINGLE TAX.
By J. Farrell.
IX. — THE METHOD OF REFORM.
We propose to do nothing whatever beyond changing the basis of taxation from industry, production, exchange or incomes to land values. We propose to exempt everything else from taxation and derive not only the whole necessary revenue for governmental purposes from land values, but if there is more than enough for such purposes to divide the remainder equally among the members of the community in the form of annuities, or in any tray that may he determined upon. Land value belongs to the entire community by right, and neither individual nor communal justice is being done while any part of it is being diverted from the true owners. I have already shown that the State recognizes that the value of land results from the presence and needs of the whole people by paying the proceeds of the sale or lease of Crown land into the public Treasury. But, in selling, it gives to a private owner the power to take to himself, without further payment, all future increment of value arising from precisely the same source as the first value, for which he paid, had arisen. And in leasing a similar wrong may be done when the duration of the lease is a long one. Before it falls in the growth of population, the expenditure of public money and other causes may make the land leased worth much more than the lessee pays annually to the State, in which case he secures an unfair advantage over others.
The single tax, unlike any other, is simply a payment by the individual for value received from the State. All other forms of taxation are appropriations by the State, for public use, of individual earnings. The doctor, the lawyer, the merchant, as well as the industrial producer of every class fulfill necessary functions — in some cases, no doubt, functions made necessary only by an entirely false condition of society. But for every shilling of income they may receive through the exercise of their various callings they have given in return a value of service or of some tangible thing which these who paid them
Continue reading "John Farrell, The Philosophy of the Single Tax, Part IX: The Method of Reform" »
Posted on July 09, 2018 at 05:50 PM in benefits received, citizens' dividend, compensation, equity, fines, fruits of one's labors, land value created by community, landlordism, leased land, monopoly -- not the game, natural monopolies, natural opportunities, pay for what you take, privatization, robbery, single tax unlimited, social service, tariffs, transition, unearned increment, untaxing buildings, untaxing imports and sales, untaxing production, widow's skirts | Permalink | Comments (0)

redpajama_set_name: RedPajamaCommonCrawl


text:
MCKENZIE BROTHERS
NETFLIX SCTV REUNION
SECOND CITY STAGE
Orso's, New York City, January 2017
SCTV Reunion 4
Backstage at the Elgin Theater May 13 2018
The four lads
Marty Jimmy Dave 2
SCTV Cast with Scorsese
Andrea Dave Catherine
Backstage with Jimmy
I don't remember whose idea it was to do this show. It may have come from Andrew Alexander, the CEO of Second City. But I do remember that, pretty quickly, we had an offer from Bell Media (CTV) in Canada. And then Andrew set about looking for a U.S. partner to fund the show. That led to Netflix. And Martin Short got involved here because he was already doing a Netflix special with Steve Martin - a video taping of one of their live concert shows that they have been taking to different cities around the country for the past couple of years. Marty had become friends with Ted Sarandos in the process of doing that special for Netflix and so when he broached the idea to Ted, suddenly Netflix was in the game.
Creatively, where we couldn't all agree on what specifically the SCTV Reunion should look like (like one of the early ideas based, in part, because SNL had just celebrated being on the air for 40 years, we thought maybe it would be funny for SCTV to celebrate being off the air for 34 years), we did agree that we needed a director. Pretty quickly, Martin Scorsese's name came up. Catherine had done a film with Marty Scorsese and he had told her that he was a big SCTV fan. Martin Short had a connection to Scorsese through a mutual friend, and within a couple of weeks the two Martys got together to discuss the show. Next thing we all know, Marty Scorsese was "in".
In January of 2017 we all met with Martin Scorsese in New York. Before the Scorsese meeting, the cast got together for a dinner at Orso's in New York City. It was the first time the entire cast had been together in some time. There are some photos here of that meeting. The next day we met Scorsese and discussed what exactly we would do.
The idea of a stage show where we would all be interviewed in front of an audience came out of that meeting. There would also be old clips, maybe some new stuff - we weren't all in agreement about that. But we all agreed that Jimmy Kimmel was the best choice to interview us. So planning that part of the show went into high gear and soon, we had a date - May 13, 2018 - and a venue, the Elgin Theater in Toronto.
There are some photos here taken backstage at the Elgin Theater on May 13, 2018. There is also a photo of the crane Scorsese's crew used to mount one of the 14 cameras that covered the live event. The camera crane operator was the same guy who operated the crane in the infamous Street Beef Christmas Show scene with John Candy as Johnny LaRue back in 1982 and he painted "Johnny LaRue" on the crane for the event in memory of John.
(MORE TO COME)
© 2019 DAVE THOMAS | Designed by LA Web Design LLC
ACTOR / COMEDIAN / WRITER / PRODUCER / DIRECTOR


text:
class ParamController extends ModelController {

    /*constructor(model, parent) {
        super(model, parent);
    }*/

    getActions() {
        return [
            {'action': 'delete', 'caption': 'Delete'}
        ];
    }

    async doAction(name) {
        switch (name) {
            case 'delete':
                await this.delete();
                break;
        }
    }

    static async getView(view) {
        return await FrontHostApp.doHttpRequest({
            controller: 'Param',
            action    : 'getView',
            params    : {
                view: view
            }
        });
    }
    async delete() {
        await this.model.delete();
        this.parent.removeParam(this);
        EditorFrontHostApp.editorApp.treeWidget2.select(null);
        EditorFrontHostApp.editorApp.treeWidget2.rerender();
    }
}


You may have heard of them, you may even used them: Safelists. Some professionals swear by safelists, some warn against them. Learn more with this insider's guide to Marketing with Safelists. Plus, this comes with a license that allows you to resell the product and earn a profit.


text:
Camping Rates and Amenities
RV Site Rates (full hookups)
$7.00 Reserve America Reservation Fee will be assessed in addition to the fees below. The fee is non-refundable and one reservation fee is charged for each site.
TIER ONE: HORSESHOE LOOP, UPPER LOOP, & PECAN ORCHARD PULL-THRU SITES:
$52.00/day
$312.00/week
$607.00/month valid September 1 - March 31 only. No portion of a monthly rate will roll over past March 31
TIER TWO: SITES #1-56 & #62 IN PECAN ORCHARD & SITES #71-72 IN UPPER LOOP:
RV Reservation Cancellation Policy
Cancellations made 72 hours prior to arrival date will receive a full refund minus the reservation fee of $7.00 and cancellation fee of $3.50. Cancellations made within 72 hours of arrival date will be charged the first night payment plus the cancellation fee. Cancellations can be made online or by calling our office. For reservations paid via cash or check, refunds will be mailed in the form of a check within 30 days
Primitive Tent Camping
$10/night; reservations cannot be made in advance. Visit Park Headquarters when you arrive. There is no electricity, no ground fires are allowed, and you must camp in the designated tent camping area.
The RV Park and Tent Camping field are adjacent to Lady Bird Municipal Park. The 150 acre Lady Bird Johnson Municipal Park is available to campers from 8 am to 10 pm. The park is a place for recreation or to rest, relax and enjoy nature.
Live Oak Creek runs through the center and is home to a variety of ducks and geese and is available for fishing. Non-motorized boats are permitted.
Lady Bird Johnson Municipal Park Pool is open during the summer months.
Tennis and Pickleball courts are adjacent to the swimming pool.
Five pavilions with barbecue pits can serve as the spot for birthday parties, class and family reunions, school field trips, weddings and more. Reservations required for exclusive use.
Baseball/softball fields are available for a casual game or can be reserved.
A sand volleyball court and outdoor basketball courts are open to the public if Pavilion #5 is not reserved.
Several playgrounds and nature trails are also located within Lady Bird Park.
Pioneer Pavilion and Tatsch House can be reserved for social gatherings.
Lady Bird Johnson Park Map
Lady Bird Johnson Golf Course is just a few miles away inside the park.
For questions about reservations or other park-related matters please call Park Headquarters at 830-997-4202 or email us at ladybirdpark@fbgtx.org
Map of campground
Pet Rules


text:
Import-Module -Name (Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) `
                               -ChildPath (Join-Path -Path 'StorageDsc.ResourceHelper' `
                                                     -ChildPath 'StorageDsc.ResourceHelper.psm1'))

# Import Localization Strings
$localizedData = Get-LocalizedData `
    -ResourceName 'StorageDsc.Common' `
    -ResourcePath $PSScriptRoot

<#
    .SYNOPSIS
    Validates a Drive Letter, removing or adding the trailing colon if required.

    .PARAMETER DriveLetter
    The Drive Letter string to validate.

    .PARAMETER Colon
    Will ensure the returned string will include or exclude a colon.
#>
function Assert-DriveLetterValid
{
    [CmdletBinding()]
    [OutputType([System.String])]
    param
    (
        [Parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [System.String]
        $DriveLetter,

        [Parameter()]
        [Switch]
        $Colon
    )

    $matches = @([regex]::matches($DriveLetter, '^([A-Za-z]):?$', 'IgnoreCase'))

    if (-not $matches)
    {
        # DriveLetter format is invalid
        New-InvalidArgumentException `
            -Message $($LocalizedData.InvalidDriveLetterFormatError -f $DriveLetter) `
            -ArgumentName 'DriveLetter'
    }

    # This is the drive letter without a colon
    $DriveLetter = $matches.Groups[1].Value

    if ($Colon)
    {
        $DriveLetter = $DriveLetter + ':'
    } # if

    return $DriveLetter
} # end function Assert-DriveLetterValid

<#
    .SYNOPSIS
    Validates an Access Path, removing or adding the trailing slash if required.
    If the Access Path does not exist or is not a folder then an exception will
    be thrown.

    .PARAMETER AccessPath
    The Access Path string to validate.

    .PARAMETER Slash
    Will ensure the returned path will include or exclude a slash.
#>
function Assert-AccessPathValid
{
    [CmdletBinding()]
    [OutputType([System.String])]
    param
    (
        [Parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [System.String]
        $AccessPath,

        [Parameter()]
        [Switch]
        $Slash
    )

    if (-not (Test-Path -Path $AccessPath -PathType Container))
    {
        # AccessPath is invalid
        New-InvalidArgumentException `
            -Message $($LocalizedData.InvalidAccessPathError -f $AccessPath) `
            -ArgumentName 'AccessPath'
    } # if

    # Remove or Add the trailing slash
    if($AccessPath.EndsWith('\'))
    {
        if (-not $Slash)
        {
            $AccessPath = $AccessPath.TrimEnd('\')
        } # if
    }
    else
    {
        if ($Slash)
        {
            $AccessPath = "$AccessPath\"
        } # if
    } # if

    return $AccessPath
} # end function Assert-AccessPathValid

<#
    .SYNOPSIS
    Retrieves a Disk object matching the disk Id and Id type
    provided.

    .PARAMETER DiskId
    Specifies the disk identifier for the disk to retrieve.

    .PARAMETER DiskIdType
    Specifies the identifier type the DiskId contains. Defaults to Number.
#>
function Get-DiskByIdentifier
{
    [CmdletBinding()]
    [OutputType([Microsoft.Management.Infrastructure.CimInstance])]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $DiskId,

        [Parameter()]
        [ValidateSet('Number','UniqueId','Guid')]
        [System.String]
        $DiskIdType = 'Number'
    )

    if ($DiskIdType -eq 'Guid')
    {
        # The Disk Id requested uses a Guid so have to get all disks and filter
        $disk = Get-Disk -ErrorAction SilentlyContinue |
            Where-Object -Property Guid -EQ $DiskId
    }
    else
    {
        $diskIdParameter = @{
            $DiskIdType = $DiskId
        }

        $disk = Get-Disk `
            @diskIdParameter `
            -ErrorAction SilentlyContinue
    }

    return $disk
} # end function Get-DiskByIdentifier

<#
    .SYNOPSIS
    Tests if any of the access paths from a partition are assigned
    to a local path.

    .PARAMETER AccessPath
    Specifies the access paths that are assigned to the partition.
#>
function Test-AccessPathAssignedToLocal
{
    [CmdletBinding()]
    [OutputType([System.Boolean])]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String[]]
        $AccessPath
    )

    $accessPathAssigned = $false

    foreach ($path in $AccessPath)
    {
        if ($path -match '[a-zA-Z]:\\')
        {
            $accessPathAssigned = $true
            break
        }
    }

    return $accessPathAssigned
} # end function Test-AccessPathLocal

Export-ModuleMember -Function `
    Assert-DriveLetterValid, `
    Assert-AccessPathValid, `
    Get-DiskByIdentifier,
    Test-AccessPathAssignedToLocal


text:
Home Stadium
Our Owners
KBFC Mens
KBFC Womens
Young Blasters
HomeIvan Vukomanovic
Ivan Vukomanovic
Heach Coach
KBFC M Coaching Staff
Ivan comes with a broad experience of coaching in the top divisions of Belgium, Slovakia, and Cyprus. The 43-year-old Vukomanovic began his coaching career as an assistant coach at Belgian club Standard Liege in 2013-14 season before his promotion in the subsequent term. Under him, the team secured qualification in the UEFA Europa league group stages two years consecutively. During this tenure, he was instrumental in molding Belgian internationals like Mitchy Batshuayi and Laurent Cimon, amongst many others. He has since managed SK Slovan Bratislava in the Slovak Super Liga, with whom he won the Slovakia National Cup, and was last in charge of Apollon Limassol in the Cypriot First Division.
Prior to his coaching career, Ivan had a long and illustrious 15 years of career as a professional football player. A former defender who could also play in defensive midfield, Vukomanovic had playing stints with prominent French club FC Bordeaux as well as FC Koln in Germany, Royal Antwerp in Belgium, Dynamo Moscow in Russia and Red Star Belgrade in Serbia.
about KBFC
Formed on 27th May 2014, Kerala Blasters FC is one of the eleven teams that is a part of the Indian Super League (ISL) since its inception, with its Home ground at Jawaharlal Nehru Stadium, Kaloor, Kochi.
Jawaharlal Nehru International Stadium,Stadium Link Road,Kaloor, Kochi, Kerala 682017
info@kbfcofficial.com
INJURY UPDATE : Sandeep Singh
MAtch Day Preview : FCG vs KBFC
Academy Operations ManageR
Copyright 2022 © Kerala Blasters Football Club


text:
Daniel Flanzig in the Village Voice following Sundays Memorial "Ghost Bike" ride
By Dan Flanzig
On the Eve of Citibike, Remembering the City's Ghost Bikers
By Sydney Brownstone Mon., Apr. 22 2013
Ghost Bike Memorial Riders at Queens Plaza
On May 8, the city will launch its first bike share program. But Sunday's ghost bike memorial gathering was a snapshot of a city still struggling to embrace its riders and keep them safe. With her back to the frustrated congestion, Street Memorial Project spokeswoman Leah Todd read the names of cyclists killed in 2012 and 2013: Emma Blumstein, Shaquille "Swizzy" Cochrane, Terence Connor, Tchaka Cooke, David "Troy" Ellis, Henry Garcia, Mireya Gomez, Roger Hernandez, Victor Lopez, Jean Malizia, Alexander Martinez, Daniel "Danny" Martinez, Joseph Nelson, David Oliveras, Ramon Russel, Ronald "R.J." Tillman, and four unnamed cyclists.It's a bright, cool Sunday afternoon, and jammed car lines are radiating from Queens Plaza. The N, Q, and 7 trains rattle above intersections. But on the corner of Jackson Avenue and Queens Boulevard, several dozen cyclists have stopped to place flowers in the spokes of a bicycle that's been spray-painted white. The cyclists ignore the terse horn honks; the sign they install on top of the bike is a dedication to cyclists whose deaths didn't make the news.
The Street Memorial Project has been blessing and installing ghost bikes in remembrance of cyclists killed in traffic for eight years. And this year, Todd said, the number of cyclist deaths hasn't significantly changed. Though down from last year's 22 fatalities, the New York City Department of Transportation still reported 18 cyclists killed in 2012. Meanwhile, overall traffic fatalities increased by nearly 12 percent, and hit-and-runs were up by 31 percent.
But Sunday's memorial, weaving throughout all five boroughs and converging at Queens plaza, was less about demonstrating stats and more about installing small comforts for the living--those who too often feel justice for cyclists has not been served. A couple of blocks south of the Metropolitan Museum of Art on Fifth Avenue, Daniel "Danny" Martinez's family waited for the riders with balloons and flowers. Almost exactly a year ago, the 27-year-old bike messenger and father was felled under a truck.
"Today is just like it happened yesterday. We're still stuck," a family member of Martinez's, who didn't want to be identified by name because of ongoing litigation, told theVoice. "This day is a closure for me, for his child, for his siblings," the family member said.
"He was a man of business, he took care of his family, he took care of his kids, he had so much to live for. He was loved, and he loved. This is not right, what happened," Martinez's relative continued.
The NYPD told reporters that Martinez had been holding onto the back of the truck that killed him--something that Martinez family has difficulty believing. The police reported that they did not suspect criminality in Martinez's death, an oft-delivered line that has received much scrutiny from families of dead cyclists, activists, the media, and then City Council last year.
Last month, Police Commissioner Ray Kelly announced that the NYPD would be beefing up its "Collision Investigation Squad"--after changing its name from collision Investigation Squad--and investigating crashes that didn't just involve cyclists "dead or likely to die." Those changes, however, don't go far enough, says Josh Bisker, an environmental activist at the memorial ride who helped launch a "living street will" campaign last month. On streetwillsnyc.com, cyclists submit video wills asking the city to fully investigate their deaths, should they happen in traffic.
"The Street Wills Project is supposed to be a wake up call, of sorts," he said.
Still, Bisker is hopeful that the bike share could also spark more openness and empathy for cyclist victims in the future.
"People are going to think, 'Oh, one of my tribe, a New Yorker, has died, has suffered some harm,'" Bisker said. "As opposed to 'some guy on a bike.'"
Daniel Flanzig, a lawyer who has represented injured cyclists and their families for 16 years and rode in the memorial on Sunday, expressed a similar sentiment.
"When you study the other cycling cities, like Amsterdam, it was a mess before it got better," Flanzig, who has developed both an iPhone app and a website to better collision reporting, said. "But eventually, over time, it became a cycling culture and the cars learned how to deal with bikes.
"I think that's what's going to happen in New York," he added. "It won't be pretty for a while, but at least it's going to be a start."


text:
Q: Business logic in Symfony 2/3 I cant understand where shoud be business logic.
For example:
I shoud render  tag with some data from entity according to user role.
If im using yii(dont hate me) framework, in view side it will be somethig like that:

    <?php if ($model->isEngineer()): ?>
         <?= $model->getEngineerData(); ?>
    <?php elseif ($model->isAdmin()): ?>
         <?= $model->getAdminData(); ?>
    <?php else? ?>
         <?= $model->getOtherData(); ?>
    <?php endif ?>

According to best Symfony Best Practices, I shoud't have  isEngineer, getEngineerData, etc methods inside Entity Class, also I shoud't calls any method from Model's side. So I have created some twig extension, but how to send variables(Objects/properties not only stings) from .html.twig to twig extension, or how to handle business logic?

redpajama_set_name: RedPajamaStackExchange


Prills are small, round, Pearl-Like accents for all arts and crafts. Adhere with any clear drying adhesive or tape. They provide interesting effects and inclusions for paper arts, as holiday and all occasion embellishments, and for accents in snow, and for vintage-look projects.
12 - 3 gram jar of Prills: Fuzzy Navel, Lavender and Lace, Heart of Gold, Lemon Chiffon, Coral See, Minnie Pearls, Seas the Day, Lettuce Entertain You, Sage Advice, Tu-Tu Pink, Sweet Shoppe, & Gilt Trip.


The DAGGER Carbon Skim is a lethal weapon designed to make you win all the competitions.
This BLACK REVOLT board is the best carbon wakesurfer handmade.
The core of the board is made with a waterproof PVC foam, laminated under vacuum with multiple layers of polyester resin, S-glass, E-glass and carbon.
- 2.0 for intermediate riders and you can also choose the color of the AGENDA SURF Traction pads.


text:
from django.conf import settings
from django.db import models
from django.db.models.query import Q

from servee_blog.exceptions import InvalidSection
from servee_blog.settings import ALL_SECTION_NAME

class SiteManager(models.Manager):
    """
    A simple manager for maintaining the current site separately from other sites.
    """
    def get_query_set(self, *args, **kwargs):
        return super(SiteManager, self).get_query_set(*args, **kwargs).filter(site=settings.SITE_ID)

class PostManager(SiteManager):

    def published(self):
        return self.exclude(published=None)

    def current(self):
        return self.published().order_by("-published")

    def section(self, value, queryset=None):

        if queryset is None:
            queryset = self.published()

        if not value or (value == ALL_SECTION_NAME):
            print queryset
            return queryset
        else:
            print queryset
            a = queryset.filter(Q(sections__slug=ALL_SECTION_NAME) | Q(sections__slug=value))
            print a
            return a


Your search returned 5788 results.
by Ecuador Contrato Social por la Educación.
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Quito Contrato Social por la Educación 2013Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 370.9866 C7642i] (3).
by Pástor Pazmiño, Carlos [coord.] | Alvarado, Marcela [coord. ].
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Quito Miraflores 2012Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 333.329866 P9742n] (1).
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Quito, Ecuador : Ekos, 2014Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 351/E369g] (3).
Edition: Tercera EdiciónMaterial type: Book; Literary form: Not fiction ; Audience: General; Publisher: Quito Corte Nacional de Justicia 2013Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 340.09866 C827j] (3).
by Passailaigue Baquerizo, Roberto M.
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Guayaquil Universidad ECOTEC Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 378.899 P235a] (2).
by Ecuador Secretaría de Educación Superior, Ciencia, Tecnología e Innovación - SENESCYT | Ecuador Instituto Nacional de Estadística y Censos - INEC.
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Quito SENESCYT ; INEC 2014Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 303.483 S4462i] (4).
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Quito Ministerio de Relaciones Exteriores y Movilidad Humana 2014Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 325.866 M6653a] (5).
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Quito Ministerio del Ambiente 2013Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 363.7392 M6653i] (5).
by Ecuador Procuraduría General del Estado.
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Quito Procuraduría General del Estado 2014Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 363.709866 P96416c] (3).
by Drosican - Apoyo a la Comunidad Andina en el Ärea de Drogas Sintéticas.
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Lima Drosican 2009Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 362.2909866 D787e] (1).
by Gomezjurado Zevallos, Javier coord.
Material type: Book; Literary form: Not fiction ; Audience: General; Publisher: Quito Corporación Nacional de Telecomunicaciones - CNT ; Academia Nacional de Historia 2014Availability: Items available for loan: BIBLIOTECA IAEN [Call number: 384.09866 G6339h] (1).