Skip to content

[FEAT][Rust] Added Encoder Module #1710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

steel-bucket
Copy link
Contributor

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

In this PR, I have migrated a large part of ccx_encoders_common.c and the library ccx_encoders_g608.c alongside it's helper functions. I have also fixed some issues(wrong functions) in the encoding module which were caught during regression testing. After this PR all the writing that is done on txt files is done by Rust.

0xcd => (0xe28c9d, 3), // Top right corner
0xce => (0xe28c9e, 3), // Bottom left corner
0xcf => (0xe28c9f, 3), // Bottom right corner
_ => (b'?' as u32, 1), // I'll do it eventually, I promise
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this comment be resolved by adding the remaining ones?

Copy link
Contributor Author

@steel-bucket steel-bucket Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not actually my comment, it is there in the C code, and it's also there in the Encoding module from last year.
I could add more chars if I had a table, a paper or a reference.
This source seems to have some, but a lot of them are already made. If you can confirm that this source is the one, I will implement it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have very less context around this.

@cfsmp3 @canihavesomecoffee any suggestions for resolving this comment or to keep it like this for now?

@prateekmedia
Copy link
Member

@steel-bucket some tests are not passing.

@steel-bucket
Copy link
Contributor Author

steel-bucket commented Aug 2, 2025

@prateekmedia I think that's a bug, those tests are not passing in main either I assume. It's the exact same output in the latest PR 1721(not mine). I could make an empty PR to confirm it.

@hrideshmg
Copy link
Contributor

Yeah its a bug, its caused by some very minute timing differences in the SRT files. I'm currently looking into it.

@prateekmedia prateekmedia changed the title [Rust] Added Encoder Module [FEAT][Rust] Added Encoder Module Aug 4, 2025
Copy link
Member

@prateekmedia prateekmedia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Will merge after regressions run.

@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit b63a29c...:
Report Name Tests Passed
Broken 13/13
CEA-708 13/14
DVB 7/7
DVD 0/3
DVR-MS 2/2
General 22/27
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 85/86
Teletext 21/21
WTV 13/13
XDS 33/34

NOTE: The following tests have been failing on the master branch as well as the PR:

  • ccextractor --service 1 --out=txt f17524b53f..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 5ae2007a79..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 1e44efd810..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 add511677c..., Last passed:

    Never

  • ccextractor --autoprogram --out=srt --latin1 e9b9008fdf..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 27e46255f0..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 1974a299f0..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 132d7df7e9..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 99e5eaafdc..., Last passed:

    Never

  • ccextractor --in=ps e9b9008fdf..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 --ucla --xds 0069dffd21..., Last passed:

    Never

Congratulations: Merging this PR would fix the following tests:


All tests passing on the master branch were passed completely.

Check the result page for more info.

@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit b63a29c...:
Report Name Tests Passed
Broken 13/13
CEA-708 13/14
DVB 4/7
DVD 0/3
DVR-MS 2/2
General 22/27
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 85/86
Teletext 21/21
WTV 10/13
XDS 33/34

Your PR breaks these cases:

NOTE: The following tests have been failing on the master branch as well as the PR:

  • ccextractor --service 1 --out=txt f17524b53f..., Last passed:

    Never

  • ccextractor --stdout --quiet --no-fontcolor 79a51f3500..., Last passed:

    Never

  • ccextractor --stdout --quiet --no-fontcolor 767b546f96..., Last passed:

    Never

  • ccextractor --autoprogram --out=srt --latin1 --quant 0 85271be4d2..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 5ae2007a79..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 1e44efd810..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 add511677c..., Last passed:

    Never

  • ccextractor --autoprogram --out=srt --latin1 e9b9008fdf..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 27e46255f0..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 1974a299f0..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 132d7df7e9..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 99e5eaafdc..., Last passed:

    Never

  • ccextractor --in=ps e9b9008fdf..., Last passed:

    Never

  • ccextractor --out=srt --latin1 f23a544ba8..., Last passed:

    Never

  • ccextractor --out=srt --latin1 df3b4d62d3..., Last passed:

    Never

  • ccextractor --autoprogram --out=ttxt --latin1 --ucla --xds 0069dffd21..., Last passed:

    Never

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --out=sami --latin1 --autoprogram 5b4e0a6034..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 f1422b8bfe..., Last passed: Never
  • ccextractor --datapid 5603 --autoprogram --out=srt --latin1 --teletext 85c7fc1ad7..., Last passed: Never
  • ccextractor --out=spupng c83f765c66..., Last passed: Never
  • ccextractor --unicode c83f765c66..., Last passed: Never
  • ccextractor --in=es dc7169d7c4..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 c0d2fba8c0..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 006fdc391a..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 e92a1d4d2a..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 7e4ebf7fd7..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 9256a60e4b..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 27d7a43dd6..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 297a44921a..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 efbe129086..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 eae0077731..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 e2e2b501e0..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 c6407fb294..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 --datets dcada745de..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --tpage 398 5d5838bde9..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --teletext --tpage 398 3b276ad8bf..., Last passed: Never

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Check the result page for more info.

@prateekmedia prateekmedia merged commit afde4d6 into CCExtractor:master Aug 6, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants