Lines Matching defs:bitstream2

406 /*                                      BitstreamEncVideo *bitstream2   )   */
408 /* Purpose : Append the intermediate bitstream (bitstream2) to the end of */
416 PV_STATUS BitstreamAppendEnc(BitstreamEncVideo *bitstream1, BitstreamEncVideo *bitstream2)
431 status = BitstreamSavePartial(bitstream2, &fraction);
439 return BitstreamAppendPacket(bitstream1, bitstream2);
445 /* we read one byte from bitstream2 and use BitstreamPutBits to do the job */
446 if (bitstream1->byteCount + bitstream2->byteCount + offset > bitstream1->bufferSize)
448 if (PV_SUCCESS != BitstreamUseOverrunBuffer(bitstream1, bitstream2->byteCount + offset))
450 bitstream1->byteCount += (bitstream2->byteCount + offset);
456 ptrBS2 = bitstream2->bitstreamBuffer;
461 numbyte2 = bitstream2->byteCount; /* number of byte to copy from bs2 */
478 status = BitstreamPutBits(bitstream1, (WORD_SIZE << 3) - bitstream2->bitLeft, bitstream2->word);
485 /* BitstreamEncVideo *bitstream2 ) */
487 /* Purpose : Append the intermediate bitstream (bitstream2) to the end of */
493 PV_STATUS BitstreamAppendPacket(BitstreamEncVideo *bitstream1, BitstreamEncVideo *bitstream2)
498 if (bitstream1->byteCount + bitstream2->byteCount > bitstream1->bufferSize)
500 if (PV_SUCCESS != BitstreamUseOverrunBuffer(bitstream1, bitstream2->byteCount))
502 bitstream1->byteCount += bitstream2->byteCount; /* legacy, to keep track of total bytes */
508 ptrBS2 = bitstream2->bitstreamBuffer;
510 numbyte2 = bitstream2->byteCount;
513 /*copy all the bytes in bitstream2*/
516 bitstream1->word = bitstream2->word; /* bitstream1->bitLeft is the same */
517 bitstream1->bitLeft = bitstream2->bitLeft;
524 /* BitstreamEncVideo *bitstream2 ) */
526 /* Purpose : Append the intermediate bitstream (bitstream2) to the end of */
532 PV_STATUS BitstreamAppendPacketNoOffset(BitstreamEncVideo *bitstream1, BitstreamEncVideo *bitstream2)
539 numbyte2 = bitstream2->byteCount;
541 if (bitstream1->byteCount + bitstream2->byteCount > bitstream1->bufferSize)
548 ptrBS2 = bitstream2->bitstreamBuffer;
552 /*copy all the bytes in bitstream2*/
557 if (status == PV_END_OF_BUF) /* re-position bitstream2 */
559 byteleft = bitstream2->byteCount - numbyte2;
563 bitstream2->byteCount = byteleft;
564 /* bitstream2->word and bitstream->bitLeft are unchanged.
649 /*copy all the bytes in bitstream2*/
673 /* BitstreamEncVideo *bitstream2 ) */
675 /* Purpose : Prepend the intermediate bitstream (bitstream2) to the beginning of */
681 PV_STATUS BitstreamPrependPacket(BitstreamEncVideo *bitstream1, BitstreamEncVideo *bitstream2)
686 BitstreamSavePartial(bitstream2, &fraction); /* make sure only fraction of byte left */
689 if (bitstream1->byteCount + bitstream2->byteCount >= bitstream1->bufferSize)
691 bitstream1->byteCount += bitstream2->byteCount;
696 if (movebyte < bitstream2->byteCount)
697 movebyte = bitstream2->byteCount;
706 /* copy bitstream2 to the beginning of bitstream1 */
707 M4VENC_MEMCPY(pSrc, bitstream2->bitstreamBuffer, bitstream2->byteCount + 1);
711 pDst = bitstream1->bitstreamBuffer + bitstream2->byteCount;
713 bitused = (WORD_SIZE << 3) - bitstream2->bitLeft;
716 byte = (bitstream2->word) << leftover;
726 bitstream1->byteCount += bitstream2->byteCount;
727 //bitstream1->bitCount += bitstream2->bitCount;
728 bitused = (WORD_SIZE << 4) - (bitstream1->bitLeft + bitstream2->bitLeft);
738 bitstream2->byteCount = bitstream2->word = 0;
739 bitstream2->bitLeft = (WORD_SIZE << 3);