Skip to content
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

[FEAT] Add bitstream module in lib_ccxr #1649

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mrswastik-robot
Copy link

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.

This PR migrates the bitstream functionality from C to Rust while maintaining backward compatibility by creating a new Rust implementation in lib_ccxr/src/common/bitstream.rs and connecting it to the existing C code through FFI bindings.

@@ -25,6 +24,9 @@ struct bitstream
// increased by the calling function, or not.
unsigned char *_i_pos;
int _i_bpos;
#ifndef DISABLE_RUST
void *rust_bs; // Pointer to Rust's Bitstream struct
Copy link
Member

Choose a reason for hiding this comment

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

Could we construct / deconstruct the struct when passing to rust instead of storing a different pointer?

There are other files, where you can see the to_ctype()

Copy link
Author

Choose a reason for hiding this comment

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

yaa surely, this should be a better approach rather than having to maintain two structures. I will try to fix it in my next commit

Copy link
Author

Choose a reason for hiding this comment

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

@prateekmedia , I have made changes in the bitstream.rs file , can you please review it now

Copy link
Member

Choose a reason for hiding this comment

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

will check this.

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.

2 participants