In this photo illustration a woman listens to an Apple iPod Nano on October 2, 2006 in London, England.

Apple went on the offensive Wednesday with its own witnesses in the class-action antitrust trial in federal court in Oakland, California.

The jury will start to deliberate as early as next week whether Apple violated antitrust laws by blocking songs sold by rival digital music providers from working on iPods.

On Wednesday, Apple brought its first witness: John Kelly, a former University of California at Santa Barbara computer science professor, who has his own technology consulting firm.

Kelly was very well-versed in the innards of the Apple iTunes software iterations, and spoke directly to the jury about how Apple had to innovate its software code to keep up with music pirates and sophisticated hackers.

Read More Antitrust case against Apple on its last legs

Apple's lawyers are arguing that the updates to iTunes software eight years ago were designed to improve intellectual property protection from rampant piracy.

But the plaintiffs allege Apple discouraged competition, and they are seeking damages that could reach $1 billion.