Spanification of jpeg_parser and related files [chromium/src : main]

0 views
Skip to first unread message

Sergio Solano (Gerrit)

unread,
Dec 5, 2025, 5:12:17 PM (2 days ago) Dec 5
to AyeAye, media-cro...@chromium.org, fuzzin...@chromium.org, feature-me...@chromium.org, vaapi-...@chromium.org, chromeos-gfx-...@google.com

Sergio Solano abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: abandon
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8196ff2e6f4e4a9d69bd9b327c6cacf0b498e631
Gerrit-Change-Number: 7233928
Gerrit-PatchSet: 2
Gerrit-Owner: Sergio Solano <sergio...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Sergio Solano (Gerrit)

unread,
Dec 5, 2025, 6:52:34 PM (2 days ago) Dec 5
to AyeAye, Colin Blundell, Dale Curtis, Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, fuzzin...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org
Attention needed from Colin Blundell, Dale Curtis and Stephen Nusko

Sergio Solano voted and added 9 comments

Votes added by Sergio Solano

Auto-Submit+1

9 comments

Patchset-level comments
File-level comment, Patchset 2:
Dale Curtis . resolved

Should this have been removed as part of https://crbug.com/450466845 ?

Stephen Nusko

Do you know who we should ask on that front? Is it Colin?

Colin Blundell

I had thought that it was still used via `VaapiMjpegDecodeAccelerator` when examining it as part of that workstream. However, looking more closely it looks like that might just be a [dead include](https://chromium-review.googlesource.com/c/chromium/src/+/7228707). If that CL passes trybots I'll do a followup one removing the files.

Colin Blundell

Ah no, my earlier finding was correct: it's used [here](https://source.chromium.org/chromium/chromium/src/+/main:media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.cc;l=139?q=vaapi_mjpeg_&ss=chromium), and that class is itself used by //components/chromeos_camera.

Sergio Solano

Acknowledged

File media/gpu/vaapi/vaapi_jpeg_decoder.cc
Line 36, Patchset 2: auto pic_param_components = base::span(pic_param->components);
auto frame_header_components = base::span(frame_header.components);
Stephen Nusko . resolved

should we `.first(frame_header.num_components)`?

Obviously this is fine since it is getting the size compile time and doing the bounds checks based on that, but might be a bit clearer.

Sergio Solano

Done

Line 59, Patchset 2: auto load_quantiser_table_span = base::span(iq_matrix->load_quantiser_table);
Stephen Nusko . resolved

I don't know if you need the span?

Stephen Nusko

sorry what I meant by this is the `_span` in the variable name. Obviously need the span to remove the UNSAFE_TODO.

Sergio Solano

Done

Line 69, Patchset 2: dest_span.copy_from(src_span);
Stephen Nusko . resolved

nit: copy_from_nonoverlapping

Why? They are clearly different tables so nonoverlapping, this is more performant.

Also please take a look at other locations.

Sergio Solano

Done

Line 108, Patchset 2: const auto& dc_src_table = dc_table[i];
const auto& ac_src_table = ac_table[i];
Stephen Nusko . resolved

I don't think these temporaries make the code read better? Perhaps just leave them as dc_table[i]?

Sergio Solano

Done

Line 120, Patchset 2: .first(num_dc_values)
.copy_from(base::span(dc_src_table.code_value).first(num_dc_values));
Stephen Nusko . resolved

`copy_prefix_from` would save you one of these `.first`

Sergio Solano

Done

File media/parsers/jpeg_parser.h
Line 85, Patchset 2: uint8_t code_value[162];
Stephen Nusko . resolved

nit: switch this one while we are here just to be consistent in the same type?

Sergio Solano

Done

File media/parsers/jpeg_parser.cc
Line 268, Patchset 2: auto code_length_span = base::span(table->code_length);
Stephen Nusko . resolved

No need for the temporary code_length_span variable, just inline it into the for loop.

Sergio Solano

Done

Line 564, Patchset 2: ptrdiff_t span_size = eoi_begin_ptr - base::as_chars(result->data).data();
Stephen Nusko . resolved

nit: variable name

perhaps

start_of_eoi_data?

Sergio Solano

what about `scan_data_size`?

Open in Gerrit

Related details

Attention is currently required from:
  • Colin Blundell
  • Dale Curtis
  • Stephen Nusko
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iea6219e18571ec93001cedd0ccd6d3925bbfd21b
Gerrit-Change-Number: 7229449
Gerrit-PatchSet: 4
Gerrit-Owner: Sergio Solano <sergio...@google.com>
Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
Gerrit-Attention: Colin Blundell <blun...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Comment-Date: Fri, 05 Dec 2025 23:52:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
Comment-In-Reply-To: Colin Blundell <blun...@chromium.org>
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages