Cleaned up TODOs from MPEG-2 code.

This commit is contained in:
Thomas Inskip 2014-04-29 11:51:28 -07:00
parent 67bdd89ba2
commit 77e9302aa9
8 changed files with 4 additions and 23 deletions

View File

@ -25,8 +25,6 @@ class H264BitReader {
// Initialize the reader to start reading at |data|, |size| being size // Initialize the reader to start reading at |data|, |size| being size
// of |data| in bytes. // of |data| in bytes.
// Return false on insufficient size of stream.. // Return false on insufficient size of stream..
// TODO(posciak,fischman): consider replacing Initialize() with
// heap-allocating and creating bit readers on demand instead.
bool Initialize(const uint8* data, off_t size); bool Initialize(const uint8* data, off_t size);
// Read |num_bits| next bits from stream and return in |*out|, first bit // Read |num_bits| next bits from stream and return in |*out|, first bit

View File

@ -111,7 +111,6 @@ struct H264PPS {
bool entropy_coding_mode_flag; bool entropy_coding_mode_flag;
bool bottom_field_pic_order_in_frame_present_flag; bool bottom_field_pic_order_in_frame_present_flag;
int num_slice_groups_minus1; int num_slice_groups_minus1;
// TODO(posciak): Slice groups not implemented, could be added at some point.
int num_ref_idx_l0_default_active_minus1; int num_ref_idx_l0_default_active_minus1;
int num_ref_idx_l1_default_active_minus1; int num_ref_idx_l1_default_active_minus1;
bool weighted_pred_flag; bool weighted_pred_flag;
@ -187,7 +186,7 @@ struct H264SliceHeader {
int first_mb_in_slice; int first_mb_in_slice;
int slice_type; int slice_type;
int pic_parameter_set_id; int pic_parameter_set_id;
int colour_plane_id; // TODO(posciak): use this! http://crbug.com/139878 int colour_plane_id;
int frame_num; int frame_num;
bool field_pic_flag; bool field_pic_flag;
bool bottom_field_flag; bool bottom_field_flag;
@ -307,7 +306,6 @@ class H264Parser {
// of the parsed structure in |*pps_id|/|*sps_id|. // of the parsed structure in |*pps_id|/|*sps_id|.
// To get a pointer to a given SPS/PPS structure, use GetSPS()/GetPPS(), // To get a pointer to a given SPS/PPS structure, use GetSPS()/GetPPS(),
// passing the returned |*sps_id|/|*pps_id| as parameter. // passing the returned |*sps_id|/|*pps_id| as parameter.
// TODO(posciak,fischman): consider replacing returning Result from Parse*()
// methods with a scoped_ptr and adding an AtEOS() function to check for EOS // methods with a scoped_ptr and adding an AtEOS() function to check for EOS
// if Parse*() return NULL. // if Parse*() return NULL.
Result ParseSPS(int* sps_id); Result ParseSPS(int* sps_id);

View File

@ -223,8 +223,6 @@ bool EsParserH264::ParseInternal() {
if (h264_parser_->ParseSliceHeader(nalu, &shdr) != H264Parser::kOk) { if (h264_parser_->ParseSliceHeader(nalu, &shdr) != H264Parser::kOk) {
// Only accept an invalid SPS/PPS at the beginning when the stream // Only accept an invalid SPS/PPS at the beginning when the stream
// does not necessarily start with an SPS/PPS/IDR. // does not necessarily start with an SPS/PPS/IDR.
// TODO(damienv): Should be able to differentiate a missing SPS/PPS
// from a slice header parsing error.
if (last_video_decoder_config_) if (last_video_decoder_config_)
return false; return false;
} else { } else {
@ -330,7 +328,7 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) {
return false; return false;
} }
// TODO(damienv): a MAP unit can be either 16 or 32 pixels. // TODO: a MAP unit can be either 16 or 32 pixels.
// although it's 16 pixels for progressive non MBAFF frames. // although it's 16 pixels for progressive non MBAFF frames.
uint16 width = (sps->pic_width_in_mbs_minus1 + 1) * 16; uint16 width = (sps->pic_width_in_mbs_minus1 + 1) * 16;
uint16 height = (sps->pic_height_in_map_units_minus1 + 1) * 16; uint16 height = (sps->pic_height_in_map_units_minus1 + 1) * 16;

View File

@ -280,9 +280,8 @@ void Mp2tMediaParser::RegisterPmt(int program_number, int pmt_pid) {
} }
void Mp2tMediaParser::RegisterPes(int pmt_pid, void Mp2tMediaParser::RegisterPes(int pmt_pid,
int pes_pid, int pes_pid,
int stream_type) { int stream_type) {
// TODO(damienv): check there is no mismatch if the entry already exists.
DVLOG(1) << "RegisterPes:" DVLOG(1) << "RegisterPes:"
<< " pes_pid=" << pes_pid << " pes_pid=" << pes_pid
<< " stream_type=" << std::hex << stream_type << std::dec; << " stream_type=" << std::hex << stream_type << std::dec;

View File

@ -19,8 +19,6 @@ int TsPacket::Sync(const uint8* buf, int size) {
for (; k < size; k++) { for (; k < size; k++) {
// Verify that we have 4 syncwords in a row when possible, // Verify that we have 4 syncwords in a row when possible,
// this should improve synchronization robustness. // this should improve synchronization robustness.
// TODO(damienv): Consider the case where there is garbage
// between TS packets.
bool is_header = true; bool is_header = true;
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
int idx = k + i * kPacketSize; int idx = k + i * kPacketSize;
@ -212,4 +210,3 @@ bool TsPacket::ParseAdaptationField(BitReader* bit_reader,
} // namespace mp2t } // namespace mp2t
} // namespace media } // namespace media

View File

@ -286,7 +286,6 @@ bool TsSectionPes::ParseInternal(const uint8* raw_pes, int raw_pes_size) {
} }
// Discard the rest of the PES packet header. // Discard the rest of the PES packet header.
// TODO(damienv): check if some info of the PES packet header are useful.
DCHECK_EQ(bit_reader.bits_available() % 8, 0); DCHECK_EQ(bit_reader.bits_available() % 8, 0);
int pes_header_remaining_size = pes_header_data_length - int pes_header_remaining_size = pes_header_data_length -
(pes_header_start_size - bit_reader.bits_available() / 8); (pes_header_start_size - bit_reader.bits_available() / 8);

View File

@ -57,10 +57,6 @@ bool TsSectionPmt::ParsePsiSection(BitReader* bit_reader) {
RCHECK(section_number == 0); RCHECK(section_number == 0);
RCHECK(last_section_number == 0); RCHECK(last_section_number == 0);
// TODO(damienv):
// Verify that there is no mismatch between the program number
// and the program number that was provided in a PAT for the current PMT.
// Read the end of the fixed length section. // Read the end of the fixed length section.
int pcr_pid; int pcr_pid;
int program_info_length; int program_info_length;
@ -71,7 +67,6 @@ bool TsSectionPmt::ParsePsiSection(BitReader* bit_reader) {
RCHECK(program_info_length < 1024); RCHECK(program_info_length < 1024);
// Read the program info descriptor. // Read the program info descriptor.
// TODO(damienv): check wether any of the descriptors could be useful.
// Defined in section 2.6 of ISO-13818. // Defined in section 2.6 of ISO-13818.
RCHECK(bit_reader->SkipBits(8 * program_info_length)); RCHECK(bit_reader->SkipBits(8 * program_info_length));
@ -97,7 +92,6 @@ bool TsSectionPmt::ParsePsiSection(BitReader* bit_reader) {
pid_map.insert(std::pair<int, int>(pid_es, stream_type)); pid_map.insert(std::pair<int, int>(pid_es, stream_type));
// Read the ES info descriptors. // Read the ES info descriptors.
// TODO(damienv): check wether any of the descriptors could be useful.
// Defined in section 2.6 of ISO-13818. // Defined in section 2.6 of ISO-13818.
RCHECK(bit_reader->SkipBits(8 * es_info_length)); RCHECK(bit_reader->SkipBits(8 * es_info_length));
} }
@ -119,4 +113,3 @@ void TsSectionPmt::ResetPsiSection() {
} // namespace mp2t } // namespace mp2t
} // namespace media } // namespace media

View File

@ -17,7 +17,6 @@ class TsSectionPmt : public TsSectionPsi {
// RegisterPesCb::Run(int pes_pid, int stream_type); // RegisterPesCb::Run(int pes_pid, int stream_type);
// Stream type is defined in // Stream type is defined in
// "Table 2-34 Stream type assignments" in H.222 // "Table 2-34 Stream type assignments" in H.222
// TODO(damienv): add the program number.
typedef base::Callback<void(int, int)> RegisterPesCb; typedef base::Callback<void(int, int)> RegisterPesCb;
explicit TsSectionPmt(const RegisterPesCb& register_pes_cb); explicit TsSectionPmt(const RegisterPesCb& register_pes_cb);