# US 8,279,922 B2 · Hybrid rate control in a digital stream transcoder

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,279,922 B2
- Document ID: US8279922B2
- Status: Granted
- Kind: B2
- Application number: 11/927,759
- Filed: 2007-10-30
- Published: 2008-12-11
- Granted: 2012-10-02
- Earliest claimed: 2002-03-27
- Inventors: Joel W. Schoenblum
- Web page: https://patentgrep.com/patent/US8279922B2

## CPC

- H04N 19/90: using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N 19/115: Selection of the code volume for a coding unit prior to coding
- H04N 19/124: Quantisation
- H04N 19/147: according to rate distortion criteria (rate-distortion as a criterion for motion estimation H04N19/567)
- H04N 19/157: Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N 19/172: the region being a picture, frame or field
- H04N 19/174: the region being a slice, e.g. a line of blocks or a group of blocks
- H04N 19/40: using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
- H04N 19/48: using compressed domain processing techniques other than decoding, e.g. modification of transform coefficients, variable length coding [VLC] data or run-length data (motion estimation in a transform domain H04N19/547; processing of decoded motion vectors H04N19/513)
- H04N 19/51: Motion estimation or motion compensation
- H04N 19/547: Motion estimation performed in a transform domain
- H04N 19/61: in combination with predictive coding
- H04N 19/91: Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A rate controller in run-level domain transcoder, which receives a stream of compressed frames carried in a bit stream, selectively determines whether to quantize and/or threshold portions of a frame carried in the stream of frames. The rate controller determines the input size of the frame and based at least in part upon at least a desired size, requantizes and/or thresholds the frame such that the output size of the frame is approximately the desired size.

## Claims

### Claim 1

An apparatus comprising:
a processor adapted to receive a quantized frame; determine the number of bits to shave from a given portion of the quantized frame (NSHAVE);
determine for the given portion an initial content size (SINT), which is defined as the number of bits representing the given portion when initial content information of the given portion of the quantized frame is compressed;
determine a reduction threshold (RT), wherein the reduction threshold is given as RT=NSHAVE/SINT;
determine whether to requantize the given portion of the quantized frame based at least in part upon the reduction threshold;
responsive to determining to requantize the given portion of the quantized frame, requantize in the run-level domain the given portion of the quantized frame; and
determine a total content size (CT) of the quantized frame, wherein the total content size (CT) is defined as the number of bits of the initial content information when the initial content information is compressed, and wherein the number of bits to shave NSHAVE)from the given portion is related to the product of the initial content size (SINT) times the quotient of number of bits to shave (NS) from the quantized frame divided by the total content size (CT) of the quantized frame.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the received quantized frame is made up of multiple blocks arranged in a sequence, and each block is represented by at least one set of run-level pairs, and the given portion of the quantized frame is represented by the at least one set of run-level pairs.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein the given portion of the quantized frame is a slice of the quantized frame, and the at least one set of run-level pairs representing a block of the slice is processed in parallel.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the processor is further adapted to:
parse the quantized frame into a plurality of N portions, wherein the given portion of the quantized frame is the k.sup.th portion of the frame to be processed; and determine an accumulated reduction error (E), wherein the accumulated reduction error is defined as the sum of the difference between a desired bit reduction and an actual bit reduction for each already processed portion of the quantized frame, wherein the desired bit reduction for each previously processed portion is defined as the number of bits to shave (NSHAVE) from the previously processed portion, and wherein the actual bit reduction for each previously processed portion is defined as the difference between a final compressed content size of the previously processed portion minus an initial compressed content size of the previously processed portion, and wherein the number of bits to shave (NSHAVE) from the given portion is given by the equation NSHAVE=(SINT×NS/CT)+E/(N+1−k).

### Claim 5 (depends on 4)

The apparatus of claim 4, wherein the processor is further adapted to:
determine a final content size (SFNL) of the given portion of the quantized frame, which is defined as the number of bits representing the given portion when the final content information of the given portion of the quantized frame is compressed; and determine an instantaneous reduction error (e), wherein the instantaneous reduction error is defined as the sum of the final content size (SFNL) plus the number of bits to shave (NSHAVE) from the given portion minus the initial content size (SINT), such that e=SFNL+NSHAVE−SINT.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the processor is further adapted to determine a target number (NTHERESH) of levels to set to zero by thresholding levels of the given portion, wherein the quantized frame is made up of multiple blocks arranged in a sequence, and each block is represented by at least one set of run-level pairs, and the given portion of the quantized frame includes the at least one set of run-level pairs.

### Claim 7 (depends on 6)

The apparatus of claim 6, wherein the target number (NTHRESH) of levels is related to the product of the number of levels in the given portion of the quantized frame times the quotient of the reduction threshold (RT) divided by the initial content size (SINT).

### Claim 8 (depends on 6)

The apparatus of claim 6, wherein the given portion of the quantized frame includes multiple sets of run-level pairs, and wherein the processor is further adapted to:
associate a scan position with each level in the given portion; determine a number of levels (CNT) beneath a threshold function having a predetermined width and height profile, wherein a particular level is beneath the threshold function responsive to the scan position of the particular level being greater than a specific scan position and responsive to a magnitude of the particular level being less than a particular height;
responsive to the number of levels (CNT) beneath the threshold function being within a predetermined range of the target number (NTHRESH), set the magnitude of the levels beneath the threshold function to zero; and responsive to the number of levels (CNT) beneath the threshold function being outside of the predetermined range of the target number (NTHRESH), adjust the threshold function by changing the height profile of the threshold function.

### Claim 9 (depends on 8)

The apparatus of claim 8, wherein the threshold function extends over a first range of scan positions and the processor adjusts the threshold function by shifting the relative location of the threshold function such that the threshold function extends over a second range of scan positions.

### Claim 10 (depends on 8)

The apparatus of claim 8, wherein the threshold function extends over a first range of scan positions and to adjust the threshold function the processor is adapted to:
partition the levels of the given portion into a first group and a second group of levels;
associate a second threshold function with the second group of levels, wherein the second threshold function extends over the second range of scan positions; (a) determine the number of levels (CNT1) beneath a first threshold function, wherein a first particular level is beneath the first threshold function responsive to the scan position of the first particular level being with the first range of scan positions and responsive to a magnitude of the first particular level being less than a first specific height; (b) determine the number of levels (CNT2) beneath the second threshold function, wherein a second particular level is beneath the second threshold function responsive to the scan position of the second particular level associated with the second range of scan positions and responsive to a magnitude of the second particular level being less than a second specific height; (c) responsive to the sum of CNT1 and CNT2 being within the predetermined range of the target number (NTHRESH), set the magnitude of the levels beneath the first and second threshold functions to zero; and (d) responsive to the sum of CNT1 and CNT2 being outside of the predetermined range of the target number (NTHRESH), transfer a predetermined number of levels from the first group to the second group, wherein the processor includes logic, which, responsive to the sum of CNT1 and CNT2 being outside of the predetermined range of the target number (NTHRESH), is adapted to repeat (a), (b), (c), and (d) until the sum of CNT1 and CNT2 is within the predetermined range of the target number (NTHRESH).
