# US 6,441,754 B1 · Apparatus and methods for transcoder-based adaptive quantization

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

- Number: US 6,441,754 B1
- Document ID: US6441754B1
- Status: Granted
- Kind: B1
- Application number: 09/642,925
- Filed: 2000-08-17
- Granted: 2002-08-27
- Earliest claimed: 1999-08-17
- Assignees: General Instrument Corporation
- Inventors: Limin Wang; Ajay Luthra; Paul Moroney
- Web page: https://patentgrep.com/patent/US6441754B1

## CPC

- H04N 19/162: User input
- H04N 5/76: Television signal recording
- H04N 9/7921: {for more than one processing mode}
- 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/51: Motion estimation or motion compensation
- H04N 19/90: using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N 21/4147: PVR [Personal Video Recorder] (H04N5/76 takes precedence {; arrangements for broadcast with accumulation-type receivers H04H20/40})
- H04N 21/4334: {Recording operations (recording of a television signal H04N5/76; arrangements for recording or accumulating broadcast information or broadcast-related information H04H60/27)}
- H04N 21/4351: {involving reassembling additional data, e.g. rebuilding an executable program from recovered modules}
- H04N 21/440254: {by altering signal-to-noise parameters, e.g. requantization}
- H04N 21/4622: {Retrieving content or additional data from different sources, e.g. from a broadcast channel and the Internet (web site content organization and management for information retrieval from the Internet G06F16/958; transmission by internet of broadcast information H04H60/82; stock exchange data over packet-switching network H04L12/1804; push services including data channel over packet-switching network H04L12/1859)}
- H04N 21/8545: for generating interactive applications
- H04N 5/781: on disks or drums
- H04N 5/782: on tape
- H04N 9/8042: {involving data reduction}
- H04N 21/426: Internal components of the client {; Characteristics thereof} (H04N5/44 takes precedence)
- H04N 21/47: End-user applications
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

The present invention provides a transcoding architecture and a consumer set-top box with storage capability that is based on the transcoding architecture and capable of operating efficiently in an all-digital environment. In a preferred embodiment, a digital-VIDEO DEVICE employs an MPEG-2 compliant transcoder that includes a simplified cascaded decoder and encoder, and is capable of performing determinable bitrate re-encoding without conducting motion estimation. During recording, the decoder receives and processes a compressed source bitstream, producing a decoded bitstream that includes reconstructed video and preserved motion vectors. The encoder “re-encodes” the decoded bitstream using the preserved motion vectors and performs any applicable bitrate modifications. The re-encoded bitstream is then stored.

## Claims

### Claim 1

A method for determining an optimal re-encode quantization parameter, comprising:
receiving a decoded quantization parameter, Q1, of a bitstream portion;
receiving a re-encode quantization parameter, Q2, of the bitstream portion;
comparing Q1 and Q2; and
selecting Q2 as the optimal re-encode quantization parameter if Q2 is greater than Q1, and otherwise selecting Q1 as the optimal re-encode quantization parameter.

### Claim 2

A method for forming a re-encoded bitstream portion, the method comprising:
(a) receiving a compressed bitstream portion having a first quantization parameter, Q1;
(b) initiating decoding of said compressed bitstream portion to produce said first quantization parameter, Q1;
(c) receiving a second quantization parameter, Q2;
(d) determining that Q2 is less than Q1;
(e) determining that a signal derived from Q1 is substantially equal to Q2 when the quantization error signal is below a predetermined threshold;
(f) copying said compressed bitstream portion to produce a re-encoded bitstream portion; and
(g) reconstructing said bitstream portion to form a reconstructed bitstream portion.

### Claim 3 (depends on 2)

The method of claim 2, wherein said bitstream portion is selected from a group consisting of macroblocks, slices and frames.

### Claim 4 (depends on 2)

The method of claim 2, wherein said step (e) of determining comprises comparing an inverse quantization output to a quantization input.

### Claim 5 (depends on 2)

The method of claim 2, wherein said step (e) of determining comprises determining that a first total number of bits, T1, of an inverse quantization output is equal to a second total number of bits, T2, of a quantization input.

### Claim 6 (depends on 5)

The method of claim 5, further including
copying a zero quantization error bitstream portion into a frame buffer.

### Claim 7 (depends on 2)

The method of claim 2, wherein said step (e) of determining comprises determining that a first total number of bits, T1, of an inverse quantization output is within a small percentage of a second total number of bits, T2, of a quantization input.

### Claim 8 (depends on 2)

The method of claim 2, further including:
storing a zero quantization error of the said bitstream portion into a frame buffer.

### Claim 9 (depends on 2)

A re-encoded bitstream portion formed according to the method of claim 2.

### Claim 10 (depends on 2)

The method of claim 2, wherein the received bitstream portion is obtained from a storage device.

### Claim 11

A computer readable storage medium storing program code for causing a processing system to perform the steps of:
receiving a decoded quantization parameter, Q1, of a bitstream portion;
receiving a re-encode quantization parameter, Q2, of the bitstream portion;
comparing Q1 and Q2; and
selecting Q2 as the optimal re-encode quantization parameter if Q2 is greater than Q1, and otherwise selecting Q1 as the optimal re-encode quantization parameter.

### Claim 12

A transcoder comprising:
a decoder for producing a coding parameter of a received bitstream portion; and
an encoder coupled to said decoder for producing a re-encode parameter corresponding to said received bitstream portion, comparing said re-encode parameter to said coding parameter and copying said received bitstream portion to a re-encode bitstream according to a predetermined determined correspondence between said parameters.

### Claim 13 (depends on 12)

A transcoder according to claim 12, wherein said coding parameter is a quantization parameter of said received bitstream portion and said re-encode parameter is a re-encode quantization parameter.

### Claim 14

A transcoder comprising:
means for receiving a decoded quantization parameter, Q1, of a bitstream portion;
means for receiving a re-encode quantization parameter, Q2, of the bitstream portion:
means for comparing Q1 and Q2 and
means for selecting Q2 as the optimal re-encode quantization parameter if Q2 is greater than Q1, and otherwise selecting Q1 as the optimal re-encode quantization parameter.

### Claim 15

A method for forming a re-encoded bitstream portion, comprising:
(a) receiving a compressed bitstream portion having a first quantization parameter, Q1;
(b) initiating decoding of said compressed bitstream portion to produce said first quantization parameter, Q1, and an inverse quantization output;
(c) initiating re-encoding of said decoded bitstream portion to form a second quantization parameter, Q2, and a quantization input;
(d) determining that Q2 is less than Q1;
(e) determining that said bitstream portion corresponds to a B-picture;
(f) copying said compressed bitstream portion to produce the re-encoded bitstream portion; and
(g) reconstructing said bitstream portion to form a reconstructed bitstream portion and storing said reconstructed bitstream portion in a frame buffer.

### Claim 16 (depends on 15)

The method of claim 15, wherein said step (g) is replaced by storing a zero quantization error bitstream portion into said frame buffer.

### Claim 17

A method for disposing of spare bits resulting from transcoding, comprising:
receiving a decoded quantization parameter, Q1, of a bitstream portion;
receiving a re-encode quantization parameter, Q2, of the bitstream portion;
determining that Q1 is greater than Q2;
selecting Q1 as an replacement re-encode quantization parameter; and
passing spare bits resulting from said replacement to another bitstream portion.

### Claim 18

A method for re-encoding a first bitstream to a second bitstream, the method comprising:
receiving a decoded quantization parameter, Q1, of a first bitstream portion;
receiving a re-encode quantization parameter, Q2, of the first bitstream portion;
comparing Q1 and Q2;
selecting Q2 as the optimal re-encode quantization parameter if Q2 is greater than Q1, and otherwise selecting Q1 as the optimal re-encode quantization parameter; and
using the selected re-encode quantization parameter to produce a second bitstream at a different bitrate from the first bitstream.

### Claim 19

A method for re-encoding an MPEG-compliant bitstream having macroblocks and I, P and B pictures, wherein the method uses hardware including a decoder and an encoder, wherein the bitstream is initially encoded with a first quantization parameter, Q1, wherein it is desired to re-encode the bitstream at a second quatization parameter, Q2, the method comprising:
selecting a macroblock in the bitstream;
determining whether one of the following three conditions is true regarding the selected macroblock
(a) that the selected macroblock is coded in intra-frame mode in an I, P or B picture using complete or partial re-encode transcoding;
(b) that the selected macroblock is coded in inter-frame mode in a P or B picture with a same prediction macroblock at both the decoder and encoder, and that cascade-based transcoding is used;
(c) that the selected macroblock is coded in inter-frame mode in a P or B picture with a zero corresponding quantization error compensation derived from a discrete-cosine transformation calculation, and simplified transcoding is used
then, if one of the conditions in the determining step is true, performing the following steps:
selecting Q1 over Q2 for the selected macroblock;
copying compressed bits from the selected macroblock directly into a re-encoded bitstream;
if cascaded-based transcoding is used then storing at least a portion of the selected macroblock for later access by the decoder or encoder;
else if simplified transcoding is used and the selected macroblock has zero quantization error then copying the selected macroblock into the current frame buffer.

### Claim 20

A method for re-encoding an MPEG-compliant bitstream having macroblocks and I, P and B pictures, wherein the method uses hardware including a decoder and an encoder, wherein the bitstream is initially encoded with a first quantization parameter, Q1, wherein it is desired to re-encode the bitstream at a second quatization parameter, Q2, the method comprising:
selecting a macroblock in the bitstream;
first determining whether a target number of bits assigned for a macroblock during transcoding is not less than a source number of bits used for the same macroblock in a source precompressed bitstream and, if so, proceeding to the second determining step, below;
second determining whether one of the following three conditions is true regarding the selected macroblock
(a) that the selected macroblock is coded in intra-frame mode in an I, P or B picture using cascaded-based or simplified transcoding;
(b) that the selected macroblock is coded in inter-frame mode in a P or B picture with a same prediction macroblock at both the decoder and encoder, and that cascade-based transcoding is used;
(c) that the selected macroblock is coded in inter-frame mode in a P or B picture with a zero corresponding quantization error compensation derived from a discrete-cosine transformation calculation, and simplified transcoding is used;
then, if one of the conditions in the second determining step is true, performing the following steps:
copying compressed bits from the selected macroblock directly into a re-encoded bitstream;
if cascaded-based transcoding is used then storing at least a portion of the selected macroblock for later access by the decoder or encoder;
else if simplified transcoding is used and the selected macroblock has zero quantization error then copying the selected macroblock into the current frame buffer.

### Claim 21 (depends on 20)

The method of claim 20, wherein the first determining step is deemed true even if the target number of bits falls below the source number of bits by a predetermined threshold.

### Claim 22 (depends on 21)

The method of claim 21, wherein the first determining step is deemed true even if the target number of bits falls below the source number of bits for a slice by a predetermined threshold.

### Claim 23 (depends on 22)

The method of claim 22, wherein the first determining step is deemed true even if the target number of bits falls below the source number of bits for a frame by a predetermined threshold.

### Claim 24 (depends on 20)

The method of claim 20, further comprising
reprocessing data at the encoder to prevent drifting.

### Claim 25 (depends on 20)

The method of claim 20, further comprising
identifying leftover bits resulting in encoding a first macroblock using Q1; and
using the leftover bits in the processing of a second macroblock.
